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

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

Issue 394353005: 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_svc_layercontext.c ('k') | source/libvpx/vp9/encoder/vp9_tokenize.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_temporal_filter.c
===================================================================
--- source/libvpx/vp9/encoder/vp9_temporal_filter.c (revision 284462)
+++ source/libvpx/vp9/encoder/vp9_temporal_filter.c (working copy)
@@ -432,12 +432,6 @@
frames_to_blur_forward = ((frames_to_blur - 1) / 2);
start_frame = distance + frames_to_blur_forward;
- // Setup scaling factors. Scaling on each of the arnr frames not supported.
- vp9_setup_scale_factors_for_frame(&sf,
- get_frame_new_buffer(cm)->y_crop_width,
- get_frame_new_buffer(cm)->y_crop_height,
- cm->width, cm->height);
-
// Setup frame pointers, NULL indicates frame not included in filter.
vp9_zero(cpi->frames);
for (frame = 0; frame < frames_to_blur; ++frame) {
@@ -447,6 +441,41 @@
cpi->frames[frames_to_blur - 1 - frame] = &buf->img;
}
+ // Setup scaling factors. Scaling on each of the arnr frames is not supported
+ if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
+ // In spatial svc the scaling factors might be less then 1/2. So we will use
+ // non-normative scaling.
+ int frame_used = 0;
+ vp9_setup_scale_factors_for_frame(&sf,
+ get_frame_new_buffer(cm)->y_crop_width,
+ get_frame_new_buffer(cm)->y_crop_height,
+ get_frame_new_buffer(cm)->y_crop_width,
+ get_frame_new_buffer(cm)->y_crop_height);
+
+ for (frame = 0; frame < frames_to_blur; ++frame) {
+ if (cm->mi_cols * MI_SIZE != cpi->frames[frame]->y_width ||
+ cm->mi_rows * MI_SIZE != cpi->frames[frame]->y_height) {
+ if (vp9_realloc_frame_buffer(&cpi->svc.scaled_frames[frame_used],
+ cm->width, cm->height,
+ cm->subsampling_x, cm->subsampling_y,
+ VP9_ENC_BORDER_IN_PIXELS, NULL, NULL,
+ NULL))
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
+ "Failed to reallocate alt_ref_buffer");
+
+ cpi->frames[frame] =
+ vp9_scale_if_required(cm, cpi->frames[frame],
+ &cpi->svc.scaled_frames[frame_used]);
+ ++frame_used;
+ }
+ }
+ } else {
+ vp9_setup_scale_factors_for_frame(&sf,
+ get_frame_new_buffer(cm)->y_crop_width,
+ get_frame_new_buffer(cm)->y_crop_height,
+ cm->width, cm->height);
+ }
+
temporal_filter_iterate_c(cpi, frames_to_blur, frames_to_blur_backward,
strength, &sf);
}
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_svc_layercontext.c ('k') | source/libvpx/vp9/encoder/vp9_tokenize.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698