Commit f33e01d7 authored by Peter de Rivaz's avatar Peter de Rivaz

Unconditionally use LAST_FRAME for prev_frame.

BUG=aomedia:78

Change-Id: Id85cf22302317d33b593345fd31090a6620f4101
parent 000d196b
......@@ -662,9 +662,8 @@ static INLINE int frame_might_use_prev_frame_mvs(const AV1_COMMON *cm) {
// Returns 1 if this frame really can use MVs from some previous frame.
static INLINE int frame_can_use_prev_frame_mvs(const AV1_COMMON *cm) {
return (frame_might_use_prev_frame_mvs(cm) && cm->last_show_frame &&
cm->prev_frame && !cm->prev_frame->intra_only &&
cm->width == cm->prev_frame->width &&
return (frame_might_use_prev_frame_mvs(cm) && cm->prev_frame &&
!cm->prev_frame->intra_only && cm->width == cm->prev_frame->width &&
cm->height == cm->prev_frame->height);
}
#endif
......
......@@ -2973,6 +2973,11 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
else
cm->use_ref_frame_mvs = 0;
cm->prev_frame =
cm->frame_refs[LAST_FRAME - LAST_FRAME].idx != INVALID_IDX
? &cm->buffer_pool
->frame_bufs[cm->frame_refs[LAST_FRAME - LAST_FRAME].idx]
: NULL;
cm->use_prev_frame_mvs =
cm->use_ref_frame_mvs && frame_can_use_prev_frame_mvs(cm);
#endif
......@@ -3233,6 +3238,7 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
if (cm->use_adapt_scan == 0) av1_init_scan_order(cm);
#endif // CONFIG_ADAPT_SCAN
#if !CONFIG_TEMPMV_SIGNALING
// 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
......@@ -3251,6 +3257,7 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
->frame_bufs[cm->frame_refs[LAST_FRAME - LAST_FRAME].idx]
: NULL;
}
#endif
#if CONFIG_TEMPMV_SIGNALING
if (cm->use_prev_frame_mvs && !frame_can_use_prev_frame_mvs(cm)) {
......@@ -3429,7 +3436,9 @@ size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
uint8_t clear_data[MAX_AV1_HEADER_SIZE];
size_t first_partition_size;
YV12_BUFFER_CONFIG *new_fb;
#if !CONFIG_TEMPMV_SIGNALING
RefBuffer *last_fb_ref_buf = &cm->frame_refs[LAST_FRAME - LAST_FRAME];
#endif
#if CONFIG_ADAPT_SCAN
av1_deliver_eob_threshold(cm, xd);
......@@ -3489,6 +3498,7 @@ size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
cm->setup_mi(cm);
#if !CONFIG_TEMPMV_SIGNALING
// 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
......@@ -3505,6 +3515,7 @@ size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
? &cm->buffer_pool->frame_bufs[last_fb_ref_buf->idx]
: NULL;
}
#endif
#if CONFIG_TEMPMV_SIGNALING
if (cm->use_prev_frame_mvs && !frame_can_use_prev_frame_mvs(cm)) {
......
......@@ -4170,6 +4170,11 @@ static void encode_frame_internal(AV1_COMP *cpi) {
av1_initialize_me_consts(cpi, x, cm->base_qindex);
init_encode_frame_mb_context(cpi);
#if CONFIG_TEMPMV_SIGNALING
cm->prev_frame = last_fb_buf_idx != INVALID_IDX
? &cm->buffer_pool->frame_bufs[last_fb_buf_idx]
: NULL;
#else
// 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
......@@ -4186,6 +4191,7 @@ static void encode_frame_internal(AV1_COMP *cpi) {
? &cm->buffer_pool->frame_bufs[last_fb_buf_idx]
: NULL;
}
#endif
#if CONFIG_TEMPMV_SIGNALING
cm->use_prev_frame_mvs &= frame_can_use_prev_frame_mvs(cm);
......
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