Move enc-only/dec-only vars out of AV1_COMMON
Moved to AV1_COMP (cpi):
- last_frame_type
- min_qmlevel
- max_qmlevel
- use_quant_b_adapt
- num_tg
Moved to AV1Decoder (pbi):
- context_update_tile_id
- skip_loop_filter
- skip_film_grain
- is_annex_b
- valid_for_referencing
BUG=aomedia:2610
Change-Id: I8324f4b5b02804317e81d2be2c22f6e99dbe9ec7
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 456be60..0d044dc 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -2419,12 +2419,12 @@
read_tile_info_max_tile(cm, rb);
- cm->context_update_tile_id = 0;
+ pbi->context_update_tile_id = 0;
if (cm->tile_rows * cm->tile_cols > 1) {
// tile to use for cdf update
- cm->context_update_tile_id =
+ pbi->context_update_tile_id =
aom_rb_read_literal(rb, cm->log2_tile_rows + cm->log2_tile_cols);
- if (cm->context_update_tile_id >= cm->tile_rows * cm->tile_cols) {
+ if (pbi->context_update_tile_id >= cm->tile_rows * cm->tile_cols) {
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Invalid context_update_tile_id");
}
@@ -4573,12 +4573,13 @@
// If the refresh_frame_flags bitmask is set, update reference frame id values
// and mark frames as valid for reference.
-static AOM_INLINE void update_ref_frame_id(AV1_COMMON *const cm, int frame_id) {
+static AOM_INLINE void update_ref_frame_id(AV1Decoder *const pbi) {
+ AV1_COMMON *const cm = &pbi->common;
int refresh_frame_flags = cm->current_frame.refresh_frame_flags;
for (int i = 0; i < REF_FRAMES; i++) {
if ((refresh_frame_flags >> i) & 1) {
- cm->ref_frame_id[i] = frame_id;
- cm->valid_for_referencing[i] = 1;
+ cm->ref_frame_id[i] = cm->current_frame_id;
+ pbi->valid_for_referencing[i] = 1;
}
}
}
@@ -4605,7 +4606,7 @@
// Note that the displayed frame must be valid for referencing in order to
// have been selected.
cm->current_frame_id = cm->ref_frame_id[existing_frame_idx];
- update_ref_frame_id(cm, cm->current_frame_id);
+ update_ref_frame_id(pbi);
cm->refresh_frame_context = REFRESH_FRAME_CONTEXT_DISABLED;
}
@@ -4646,8 +4647,6 @@
"No sequence header");
}
- cm->last_frame_type = current_frame->frame_type;
-
if (seq_params->reduced_still_picture_hdr) {
cm->show_existing_frame = 0;
cm->show_frame = 1;
@@ -4686,7 +4685,7 @@
/* Compare display_frame_id with ref_frame_id and check valid for
* referencing */
if (display_frame_id != cm->ref_frame_id[existing_frame_idx] ||
- cm->valid_for_referencing[existing_frame_idx] == 0)
+ pbi->valid_for_referencing[existing_frame_idx] == 0)
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Reference buffer frame ID mismatch");
}
@@ -4772,7 +4771,7 @@
if (current_frame->frame_type == KEY_FRAME && cm->show_frame) {
/* All frames need to be marked as not valid for referencing */
for (int i = 0; i < REF_FRAMES; i++) {
- cm->valid_for_referencing[i] = 0;
+ pbi->valid_for_referencing[i] = 0;
}
}
cm->disable_cdf_update = aom_rb_read_bit(rb);
@@ -4829,12 +4828,12 @@
if (cm->current_frame_id - (1 << diff_len) > 0) {
if (cm->ref_frame_id[i] > cm->current_frame_id ||
cm->ref_frame_id[i] < cm->current_frame_id - (1 << diff_len))
- cm->valid_for_referencing[i] = 0;
+ pbi->valid_for_referencing[i] = 0;
} else {
if (cm->ref_frame_id[i] > cm->current_frame_id &&
cm->ref_frame_id[i] < (1 << frame_id_length) +
cm->current_frame_id - (1 << diff_len))
- cm->valid_for_referencing[i] = 0;
+ pbi->valid_for_referencing[i] = 0;
}
}
}
@@ -4926,7 +4925,7 @@
// If no corresponding buffer exists, allocate a new buffer with all
// pixels set to neutral grey.
// TODO(https://crbug.com/aomedia/2420): The spec seems to say we
- // just need to set cm->valid_for_referencing[ref_idx] to 0.
+ // just need to set pbi->valid_for_referencing[ref_idx] to 0.
int buf_idx = get_free_fb(cm);
if (buf_idx == INVALID_IDX) {
aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
@@ -5022,7 +5021,7 @@
ref = cm->remapped_ref_idx[i];
}
// Check valid for referencing
- if (cm->valid_for_referencing[ref] == 0)
+ if (pbi->valid_for_referencing[ref] == 0)
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Reference frame not valid for referencing");
@@ -5094,7 +5093,7 @@
cm->cur_frame->frame_type = current_frame->frame_type;
- update_ref_frame_id(cm, cm->current_frame_id);
+ update_ref_frame_id(pbi);
const int might_bwd_adapt =
!(seq_params->reduced_still_picture_hdr) && !(cm->disable_cdf_update);
@@ -5432,7 +5431,7 @@
cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
cm->rst_info[2].frame_restoration_type != RESTORE_NONE;
const int do_cdef =
- !cm->skip_loop_filter && !cm->coded_lossless &&
+ !pbi->skip_loop_filter && !cm->coded_lossless &&
(cm->cdef_info.cdef_bits || cm->cdef_info.cdef_strengths[0] ||
cm->cdef_info.cdef_uv_strengths[0]);
const int do_superres = av1_superres_scaled(cm);
@@ -5484,8 +5483,8 @@
if (!xd->corrupted) {
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
- assert(cm->context_update_tile_id < pbi->allocated_tiles);
- *cm->fc = pbi->tile_data[cm->context_update_tile_id].tctx;
+ assert(pbi->context_update_tile_id < pbi->allocated_tiles);
+ *cm->fc = pbi->tile_data[pbi->context_update_tile_id].tctx;
av1_reset_cdf_symbol_counters(cm->fc);
}
} else {