Commit 930c51c3 authored by Fangwen Fu's avatar Fangwen Fu Committed by Yaowu Xu

Sync enc/dec for tempmv_signaling

* Change ref parameter to use LAST FRAME instead of
 previous frame, which makes it consistent in
 enc/dec for tempmv_signaling.

BUG=aomedia:511

Change-Id: I02f1101623b7b3b09cd4d3f2977e9503b95818ec
parent bad82f1f
......@@ -4134,11 +4134,17 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
#if CONFIG_PALETTE
cm->allow_screen_content_tools = aom_rb_read_bit(rb);
#endif // CONFIG_PALETTE
#if CONFIG_TEMPMV_SIGNALING
cm->use_prev_frame_mvs = 0;
#endif
} else {
cm->intra_only = cm->show_frame ? 0 : aom_rb_read_bit(rb);
#if CONFIG_PALETTE
if (cm->intra_only) cm->allow_screen_content_tools = aom_rb_read_bit(rb);
#endif // CONFIG_PALETTE
#if CONFIG_TEMPMV_SIGNALING
if (cm->intra_only || cm->error_resilient_mode) cm->use_prev_frame_mvs = 0;
#endif
if (cm->error_resilient_mode) {
cm->reset_frame_context = RESET_FRAME_CONTEXT_ALL;
} else {
......@@ -4952,13 +4958,17 @@ void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
cm->setup_mi(cm);
#if CONFIG_TEMPMV_SIGNALING
if (cm->use_prev_frame_mvs) {
RefBuffer *last_fb_ref_buf = &cm->frame_refs[LAST_FRAME - LAST_FRAME];
cm->prev_frame = &cm->buffer_pool->frame_bufs[last_fb_ref_buf->idx];
assert(!cm->error_resilient_mode &&
cm->width == last_fb_ref_buf->buf->y_width &&
cm->height == last_fb_ref_buf->buf->y_height &&
!cm->prev_frame->intra_only);
RefBuffer *last_ref_buf = &cm->frame_refs[LAST_FRAME - LAST_FRAME];
if (last_ref_buf->idx != INVALID_IDX) {
cm->prev_frame = &cm->buffer_pool->frame_bufs[last_ref_buf->idx];
if (cm->use_prev_frame_mvs) {
assert(!cm->error_resilient_mode &&
cm->width == last_ref_buf->buf->y_width &&
cm->height == last_ref_buf->buf->y_height &&
!cm->prev_frame->intra_only);
}
} else {
assert(cm->use_prev_frame_mvs == 0);
}
#else
cm->use_prev_frame_mvs =
......
......@@ -5328,6 +5328,8 @@ static void encode_frame_internal(AV1_COMP *cpi) {
cm->width == cm->prev_frame->buf.y_width &&
cm->height == cm->prev_frame->buf.y_height &&
!cm->intra_only && !cm->prev_frame->intra_only;
} else {
cm->use_prev_frame_mvs = 0;
}
#else
cm->use_prev_frame_mvs =
......
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