Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: source/libvpx/vp9/encoder/vp9_encoder.c

Issue 415333002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_encoder.h ('k') | source/libvpx/vp9/encoder/vp9_extend.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_encoder.c
===================================================================
--- source/libvpx/vp9/encoder/vp9_encoder.c (revision 285372)
+++ source/libvpx/vp9/encoder/vp9_encoder.c (working copy)
@@ -1418,17 +1418,6 @@
src += s->uv_stride;
} while (--h);
-#if CONFIG_ALPHA
- if (s->alpha_buffer) {
- src = s->alpha_buffer;
- h = s->alpha_height;
- do {
- fwrite(src, s->alpha_width, 1, yuv_rec_file);
- src += s->alpha_stride;
- } while (--h);
- }
-#endif
-
fflush(yuv_rec_file);
}
#endif
@@ -1437,22 +1426,18 @@
YV12_BUFFER_CONFIG *dst) {
// TODO(dkovalev): replace YV12_BUFFER_CONFIG with vpx_image_t
int i;
- const uint8_t *const srcs[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
- src->alpha_buffer};
- const int src_strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
- src->alpha_stride};
- const int src_widths[4] = {src->y_crop_width, src->uv_crop_width,
- src->uv_crop_width, src->y_crop_width};
- const int src_heights[4] = {src->y_crop_height, src->uv_crop_height,
- src->uv_crop_height, src->y_crop_height};
- uint8_t *const dsts[4] = {dst->y_buffer, dst->u_buffer, dst->v_buffer,
- dst->alpha_buffer};
- const int dst_strides[4] = {dst->y_stride, dst->uv_stride, dst->uv_stride,
- dst->alpha_stride};
- const int dst_widths[4] = {dst->y_crop_width, dst->uv_crop_width,
- dst->uv_crop_width, dst->y_crop_width};
- const int dst_heights[4] = {dst->y_crop_height, dst->uv_crop_height,
- dst->uv_crop_height, dst->y_crop_height};
+ const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
+ const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
+ const int src_widths[3] = {src->y_crop_width, src->uv_crop_width,
+ src->uv_crop_width };
+ const int src_heights[3] = {src->y_crop_height, src->uv_crop_height,
+ src->uv_crop_height};
+ uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer};
+ const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
+ const int dst_widths[3] = {dst->y_crop_width, dst->uv_crop_width,
+ dst->uv_crop_width};
+ const int dst_heights[3] = {dst->y_crop_height, dst->uv_crop_height,
+ dst->uv_crop_height};
for (i = 0; i < MAX_MB_PLANE; ++i)
vp9_resize_plane(srcs[i], src_heights[i], src_widths[i], src_strides[i],
@@ -1467,14 +1452,10 @@
const int src_h = src->y_crop_height;
const int dst_w = dst->y_crop_width;
const int dst_h = dst->y_crop_height;
- const uint8_t *const srcs[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
- src->alpha_buffer};
- const int src_strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
- src->alpha_stride};
- uint8_t *const dsts[4] = {dst->y_buffer, dst->u_buffer, dst->v_buffer,
- dst->alpha_buffer};
- const int dst_strides[4] = {dst->y_stride, dst->uv_stride, dst->uv_stride,
- dst->alpha_stride};
+ const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
+ const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
+ uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer};
+ const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
const InterpKernel *const kernel = vp9_get_interp_kernel(EIGHTTAP);
int x, y, i;
@@ -2245,15 +2226,6 @@
set_speed_features(cpi);
-#if CONFIG_DENOISING
-#ifdef OUTPUT_YUV_DENOISED
- if (cpi->oxcf.noise_sensitivity > 0) {
- vp9_write_yuv_frame_420(&cpi->denoiser.running_avg_y[INTRA_FRAME],
- yuv_denoised_file);
- }
-#endif
-#endif
-
// Decide q and q bounds.
q = vp9_rc_pick_q_and_bounds(cpi, &bottom_index, &top_index);
@@ -2269,6 +2241,16 @@
encode_with_recode_loop(cpi, size, dest, q, bottom_index, top_index);
}
+#if CONFIG_DENOISING
+#ifdef OUTPUT_YUV_DENOISED
+ if (cpi->oxcf.noise_sensitivity > 0) {
+ vp9_write_yuv_frame_420(&cpi->denoiser.running_avg_y[INTRA_FRAME],
+ yuv_denoised_file);
+ }
+#endif
+#endif
+
+
// Special case code to reduce pulsing when key frames are forced at a
// fixed interval. Note the reconstruction error if it is the frame before
// the force key frame
@@ -2441,15 +2423,13 @@
int res = 0;
const int subsampling_x = sd->uv_width < sd->y_width;
const int subsampling_y = sd->uv_height < sd->y_height;
- const int is_spatial_svc = cpi->use_svc &&
- (cpi->svc.number_temporal_layers == 1);
check_initial_width(cpi, subsampling_x, subsampling_y);
vpx_usec_timer_start(&timer);
-#ifdef CONFIG_SPATIAL_SVC
- if (is_spatial_svc)
+#if CONFIG_SPATIAL_SVC
+ if (cpi->use_svc && cpi->svc.number_temporal_layers == 1)
res = vp9_svc_lookahead_push(cpi, cpi->lookahead, sd, time_stamp, end_time,
frame_flags);
else
@@ -2580,7 +2560,9 @@
return -1;
if (is_spatial_svc && cpi->pass == 2) {
+#if CONFIG_SPATIAL_SVC
vp9_svc_lookahead_peek(cpi, cpi->lookahead, 0, 1);
+#endif
vp9_restore_layer_context(cpi);
}
@@ -2603,7 +2585,7 @@
if (arf_src_index) {
assert(arf_src_index <= rc->frames_to_key);
-#ifdef CONFIG_SPATIAL_SVC
+#if CONFIG_SPATIAL_SVC
if (is_spatial_svc)
cpi->source = vp9_svc_lookahead_peek(cpi, cpi->lookahead,
arf_src_index, 0);
@@ -2613,7 +2595,7 @@
if (cpi->source != NULL) {
cpi->alt_ref_source = cpi->source;
-#ifdef CONFIG_SPATIAL_SVC
+#if CONFIG_SPATIAL_SVC
if (is_spatial_svc && cpi->svc.spatial_layer_id > 0) {
int i;
// Reference a hidden frame from a lower layer
@@ -2648,7 +2630,7 @@
if (!cpi->source) {
// Get last frame source.
if (cm->current_video_frame > 0) {
-#ifdef CONFIG_SPATIAL_SVC
+#if CONFIG_SPATIAL_SVC
if (is_spatial_svc)
cpi->last_source = vp9_svc_lookahead_peek(cpi, cpi->lookahead, -1, 0);
else
@@ -2659,7 +2641,7 @@
}
// Read in the source frame.
-#ifdef CONFIG_SPATIAL_SVC
+#if CONFIG_SPATIAL_SVC
if (is_spatial_svc)
cpi->source = vp9_svc_lookahead_pop(cpi, cpi->lookahead, flush);
else
@@ -2703,6 +2685,9 @@
cpi->last_end_time_stamp_seen = cpi->source->ts_start;
}
+ // Clear down mmx registers
+ vp9_clear_system_state();
+
// adjust frame rates based on timestamps given
if (cm->show_frame) {
adjust_frame_rate(cpi);
@@ -2717,9 +2702,6 @@
// start with a 0 size frame
*size = 0;
- // Clear down mmx registers
- vp9_clear_system_state();
-
/* find a free buffer for the new frame, releasing the reference previously
* held.
*/
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_encoder.h ('k') | source/libvpx/vp9/encoder/vp9_extend.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698