Commit 6e5ade98 authored by David Barker's avatar David Barker Committed by Debargha Mukherjee

Fix render size with !CONFIG_FRAME_SUPERRES

If CONFIG_FRAME_SUPERRES is disabled, and we don't explicitly signal
a render size for a frame, then the render size would be set to the
crop size of the *previous* frame (or 0 for the first frame in a video).

Return to using the VP9 behaviour in this case (albeit coded slightly
differently to help support superres) - ie, use the crop size of the
current frame if an explicit render size is not provided.

We do this by moving the calls to resize_context_buffers() (which sets
up cm->width and cm->height) before the calls to setup_render_size
(which might use those values). Because resize_context_buffers() does not
read any data, the bitstream format should not be affected, aside from
the intended bugfix.

BUG=aomedia:1044

Change-Id: I4fc71b9aea36cc06e10408715c205d9674f87fc2
parent 2854fe70
......@@ -1473,8 +1473,8 @@ static void setup_frame_size(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
#if CONFIG_FRAME_SUPERRES
setup_superres(cm, rb, &width, &height);
#endif // CONFIG_FRAME_SUPERRES
setup_render_size(cm, rb);
resize_context_buffers(cm, width, height);
setup_render_size(cm, rb);
lock_buffer_pool(pool);
if (aom_realloc_frame_buffer(
......@@ -1540,6 +1540,7 @@ static void setup_frame_size_with_refs(AV1_COMMON *cm,
#if CONFIG_FRAME_SUPERRES
setup_superres(cm, rb, &width, &height);
#endif // CONFIG_FRAME_SUPERRES
resize_context_buffers(cm, width, height);
found = 1;
break;
}
......@@ -1556,6 +1557,7 @@ static void setup_frame_size_with_refs(AV1_COMMON *cm,
#if CONFIG_FRAME_SUPERRES
setup_superres(cm, rb, &width, &height);
#endif // CONFIG_FRAME_SUPERRES
resize_context_buffers(cm, width, height);
setup_render_size(cm, rb);
}
......@@ -1584,8 +1586,6 @@ static void setup_frame_size_with_refs(AV1_COMMON *cm,
"Referenced frame has incompatible color format");
}
resize_context_buffers(cm, width, height);
lock_buffer_pool(pool);
if (aom_realloc_frame_buffer(
get_frame_new_buffer(cm), cm->width, cm->height, cm->subsampling_x,
......
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