Commit fe1e58ec authored by Yunqing Wang's avatar Yunqing Wang

Not to call reset_use_upsampled_references() while encoding key frames

A crash was reported while encoding >1080p file using best mode.
(aom issue 107 and issue 108). The cause was that the speed features
were initialized using good mode in AV1. The patch(commit f330ca)
disabled the upsampled reference usage only for good mode, but not for
best mode. So, for 1st key frame, the encoder incorrectly called
reset_use_upsampled_references() that caused the segfault.

The patch(commit e4e93b) disabled the upsampled reference usage for all
encoding modes and resolved the issue. This patch fixed issue 108 and
further made sure the upsampled references would be used correctly.

BUG=aomedia:108

Change-Id: I8362cc7cd82be324fd77f0bec315aeba509903bd
parent b9b28381
......@@ -3912,7 +3912,8 @@ static void encode_without_recode_loop(AV1_COMP *cpi) {
// cpi->sf.use_upsampled_references can be different from frame to frame.
// Every time when cpi->sf.use_upsampled_references is changed from 0 to 1.
// The reference frames for this frame have to be up-sampled before encoding.
if (!use_upsampled_ref && cpi->sf.use_upsampled_references)
if (!use_upsampled_ref && cpi->sf.use_upsampled_references &&
cm->frame_type != KEY_FRAME)
reset_use_upsampled_references(cpi);
av1_set_quantizer(cm, q);
......@@ -3985,7 +3986,8 @@ static void encode_with_recode_loop(AV1_COMP *cpi, size_t *size,
// 1.
// The reference frames for this frame have to be up-sampled before
// encoding.
if (!use_upsampled_ref && cpi->sf.use_upsampled_references)
if (!use_upsampled_ref && cpi->sf.use_upsampled_references &&
cm->frame_type != KEY_FRAME)
reset_use_upsampled_references(cpi);
// TODO(agrange) Scale cpi->max_mv_magnitude if frame-size has changed.
......
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