]> granicus.if.org Git - libvpx/commitdiff
Fix a spatial svc bug related to scaling
authorDebargha Mukherjee <debargha@google.com>
Tue, 1 Dec 2015 18:40:10 +0000 (10:40 -0800)
committerDebargha Mukherjee <debargha@google.com>
Tue, 1 Dec 2015 18:40:59 +0000 (10:40 -0800)
Fixes bug introduced in
https://chromium-review.googlesource.com/#/c/299482/5

Change-Id: If542c1a917380465dd9bc4ce5e32b0adbb20e340

vp9/encoder/vp9_encoder.c

index a57cf87252f4306a1cae1cf9bfa515e0f941ce8f..72fa8283561d6d29c11334812197fded753b8591 100644 (file)
@@ -3682,12 +3682,16 @@ YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm,
   if (cm->mi_cols * MI_SIZE != unscaled->y_width ||
       cm->mi_rows * MI_SIZE != unscaled->y_height) {
 #if CONFIG_VP9_HIGHBITDEPTH
-    if (use_normative_scaler)
+    if (use_normative_scaler &&
+        unscaled->y_width <= (scaled->y_width << 1) &&
+        unscaled->y_height <= (scaled->y_height << 1))
       scale_and_extend_frame(unscaled, scaled, (int)cm->bit_depth);
     else
       scale_and_extend_frame_nonnormative(unscaled, scaled, (int)cm->bit_depth);
 #else
-    if (use_normative_scaler)
+    if (use_normative_scaler &&
+        unscaled->y_width <= (scaled->y_width << 1) &&
+        unscaled->y_height <= (scaled->y_height << 1))
       scale_and_extend_frame(unscaled, scaled);
     else
       scale_and_extend_frame_nonnormative(unscaled, scaled);