Commit 84442629 authored by Zoe Liu's avatar Zoe Liu
Browse files

Simplify redundant code related to prev_frame mvs

For the setup of prev_frame and use_prev_frame_mvs, the removed
code has a copy that already exists inside read_uncompressed_header().

Change-Id: Ic814bc1f1781320e13f9ac3e183f21e2cab589d8
parent 404d92e7
......@@ -3239,9 +3239,6 @@ size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
const uint8_t **p_data_end) {
AV1_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
RefBuffer *last_fb_ref_buf = &cm->frame_refs[LAST_FRAME - LAST_FRAME];
bitstream_queue_set_frame_read(cm->current_video_frame * 2 + cm->show_frame);
......@@ -3313,43 +3310,6 @@ size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
// NOTE(zoeliu): As cm->prev_frame can take neither a frame of
// show_exisiting_frame=1, nor can it take a frame not used as
// a reference, it is probable that by the time it is being
// referred to, the frame buffer it originally points to may
// already get expired and have been reassigned to the current
// newly coded frame. Hence, we need to check whether this is
// the case, and if yes, we have 2 choices:
// (1) Simply disable the use of previous frame mvs; or
// (2) Have cm->prev_frame point to one reference frame buffer,
// e.g. LAST_FRAME.
if (!dec_is_ref_frame_buf(pbi, cm->prev_frame)) {
// Reassign the LAST_FRAME buffer to cm->prev_frame.
cm->prev_frame = last_fb_ref_buf->idx != INVALID_IDX
? &cm->buffer_pool->frame_bufs[last_fb_ref_buf->idx]
if (cm->use_prev_frame_mvs && !frame_can_use_prev_frame_mvs(cm)) {
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Frame wrongly requests previous frame MVs");
cm->use_prev_frame_mvs = !cm->error_resilient_mode && cm->prev_frame &&
cm->width == cm->last_width &&
cm->height == cm->last_height &&
cm->width == cm->prev_frame->buf.y_crop_width &&
cm->height == cm->prev_frame->buf.y_crop_height &&
!cm->last_intra_only && cm->last_show_frame &&
(cm->last_frame_type != KEY_FRAME);
cm->current_frame_seg_map = cm->cur_frame->seg_map;
if (cm->current_frame_seg_map)
Supports Markdown
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