Commit e17ebe92 authored by Jingning Han's avatar Jingning Han
Browse files

Separate ref frame mvs control from prev_frame_mvs

The control of using reference frame motion vector is a separate
factor from the existence of previous frame motion vectors. This
commit decouples these two, such that the encoder can control the
use of reference motion vector. When it is used, one can further
identify if the previous frame exists or not, then to decide if
need to force use_prev_frame_mvs to be zero.

This solves the issue where the previous frame mvs is set to be
0 and it accidentally shuts off the access to all other existing
referece frames mvs in the mfmv system. It brings back the coding
performance gains to normal.

Change-Id: I2531f73e55582a9bb5b3e0ff47e361a199ec8082
parent c4b67641
......@@ -720,7 +720,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
ref_mv_stack[idx].weight += REF_CAT_LEVEL;
if (cm->use_prev_frame_mvs) {
if (cm->use_ref_frame_mvs) {
int blk_row, blk_col;
int coll_blk_count = 0;
int voffset = AOMMAX(mi_size_high[BLOCK_8X8], xd->n8_h);
......@@ -350,6 +350,8 @@ typedef struct AV1Common {
// Whether to use previous frame's motion vectors for prediction.
int use_prev_frame_mvs;
int use_ref_frame_mvs;
// Persistent mb segment id map used in prediction.
int seg_map_idx;
int prev_seg_map_idx;
......@@ -3094,9 +3094,12 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
cm->interp_filter = read_frame_interp_filter(rb);
if (frame_might_use_prev_frame_mvs(cm))
cm->use_prev_frame_mvs = aom_rb_read_bit(rb);
cm->use_ref_frame_mvs = aom_rb_read_bit(rb);
cm->use_prev_frame_mvs = 0;
cm->use_ref_frame_mvs = 0;
cm->use_prev_frame_mvs =
cm->use_ref_frame_mvs && frame_can_use_prev_frame_mvs(cm);
for (i = 0; i < INTER_REFS_PER_FRAME; ++i) {
RefBuffer *const ref_buf = &cm->frame_refs[i];
......@@ -3939,9 +3939,8 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
fix_interp_filter(cm, cpi->td.counts);
write_frame_interp_filter(cm->interp_filter, wb);
if (frame_might_use_prev_frame_mvs(cm)) {
aom_wb_write_bit(wb, cm->use_prev_frame_mvs);
if (frame_might_use_prev_frame_mvs(cm))
aom_wb_write_bit(wb, cm->use_ref_frame_mvs);
......@@ -5223,8 +5223,9 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
// frame type has been decided outside of this function call
cm->cur_frame->intra_only = cm->frame_type == KEY_FRAME || cm->intra_only;
cm->use_prev_frame_mvs =
cm->use_ref_frame_mvs =
!cpi->oxcf.disable_tempmv && !cm->cur_frame->intra_only;
cm->use_prev_frame_mvs = cm->use_ref_frame_mvs;
// Reset the frame packet stamp index.
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