}
-static void resize_key_frame(VP8_COMP *cpi)
+static int resize_key_frame(VP8_COMP *cpi)
{
#if CONFIG_SPATIAL_RESAMPLING
VP8_COMMON *cm = &cpi->common;
cm->Height = new_height;
vp8_alloc_compressor_data(cpi);
scale_and_extend_source(cpi->un_scaled_source, cpi);
+ return 1;
}
}
#endif
+ return 0;
}
if (cm->frame_type == KEY_FRAME)
{
- resize_key_frame(cpi);
+ if(resize_key_frame(cpi))
+ {
+ /* If the frame size has changed, need to reset Q, quantizer,
+ * and background refresh.
+ */
+ Q = vp8_regulate_q(cpi, cpi->this_frame_target);
+ if (cpi->cyclic_refresh_mode_enabled && (cpi->current_layer==0))
+ cyclic_background_refresh(cpi, Q, 0);
+ vp8_set_quantizer(cpi, Q);
+ }
+
vp8_setup_key_frame(cpi);
}