Commit b6a3062d authored by John Koleszar's avatar John Koleszar
Browse files

Fix incorrect comparison of frame size

The width and height stored in the reference frames are padded out to
a multiple of 16. The Width and Height variables in common are the
displayed size, which may be smaller. The incorrect comparison was
causing scaling related code to be called when it shouldn't have
been. A notable case where this happens is 1080p, since 1088 != 1080.

Change-Id: I55f743eeeeaefbf2e777e193bc9a77ff726e16b5
parent 714aa9f3
......@@ -2598,7 +2598,7 @@ static void scale_references(VP9_COMP *cpi) {
for (i = 0; i < 3; i++) {
YV12_BUFFER_CONFIG *ref = &cm->yv12_fb[cm->ref_frame_map[i]];
if (ref->y_width != cm->Width || ref->y_height != cm->Height) {
if (ref->y_width != cm->mb_cols * 16 || ref->y_height != cm->mb_rows * 16) {
int new_fb = get_free_fb(cm);
vp8_yv12_realloc_frame_buffer(&cm->yv12_fb[new_fb],
......@@ -2672,8 +2672,8 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
int64_t mcomp_filter_cost[4];
/* Scale the source buffer, if required */
if (cm->Width != cpi->un_scaled_source->y_width ||
cm->Height != cpi->un_scaled_source->y_height) {
if (cm->mb_cols * 16 != cpi->un_scaled_source->y_width ||
cm->mb_rows * 16 != cpi->un_scaled_source->y_height) {
scale_and_extend_frame(cpi->un_scaled_source, &cpi->scaled_source);
cpi->Source = &cpi->scaled_source;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment