summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorJianhui Dai <jianhui.j.dai@intel.com>2022-01-01 08:01:48 +0800
committerJianhui Dai <jianhui.j.dai@intel.com>2022-01-01 12:34:28 +0800
commit44e611482e13fdffa0acde780a20dd68ee153498 (patch)
tree3acf869619eadcdb920d576e8e05d48888ad0efe /vp9/encoder
parent6b68c81892baddb514a8e1247c50f0b35786f5aa (diff)
downloadlibvpx-44e611482e13fdffa0acde780a20dd68ee153498.tar
libvpx-44e611482e13fdffa0acde780a20dd68ee153498.tar.gz
libvpx-44e611482e13fdffa0acde780a20dd68ee153498.tar.bz2
libvpx-44e611482e13fdffa0acde780a20dd68ee153498.zip
Add vp9 ref frame to flag map function
Change-Id: I371c2346b9e0153c0f8053cab399ce14cd286c56
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_bitstream.c7
-rw-r--r--vp9/encoder/vp9_encoder.c4
-rw-r--r--vp9/encoder/vp9_encoder.h15
-rw-r--r--vp9/encoder/vp9_pickmode.c39
-rw-r--r--vp9/encoder/vp9_rdopt.c16
-rw-r--r--vp9/encoder/vp9_speed_features.c5
-rw-r--r--vp9/encoder/vp9_svc_layercontext.c18
7 files changed, 47 insertions, 57 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index 7644930c1..c5145acf0 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -1241,9 +1241,7 @@ static void write_uncompressed_header(VP9_COMP *cpi,
vpx_wb_write_literal(wb, vp9_get_refresh_mask(cpi), REF_FRAMES);
write_frame_size(cm, wb);
} else {
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
- const MV_REFERENCE_FRAME first_ref = get_first_ref_frame(cpi);
+ const int first_ref = get_first_ref_frame(cpi);
const int first_ref_map_idx = get_ref_frame_map_idx(cpi, first_ref);
MV_REFERENCE_FRAME ref_frame;
vpx_wb_write_literal(wb, vp9_get_refresh_mask(cpi), REF_FRAMES);
@@ -1251,7 +1249,8 @@ static void write_uncompressed_header(VP9_COMP *cpi,
// If a reference frame is not referenced, then set the index for that
// reference to the first one used/referenced.
for (ref_frame = LAST_FRAME; ref_frame < MAX_REF_FRAMES; ++ref_frame) {
- const int referenced = cpi->ref_frame_flags & flag_list[ref_frame];
+ const int referenced =
+ cpi->ref_frame_flags & ref_frame_to_flag(ref_frame);
const int map_idx = referenced ? get_ref_frame_map_idx(cpi, ref_frame)
: first_ref_map_idx;
assert(map_idx != INVALID_IDX);
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 8d5ec5a36..1038bd951 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -586,8 +586,6 @@ static void apply_roi_map(VP9_COMP *cpi) {
int ref_frame[8];
int internal_delta_q[MAX_SEGMENTS];
int i;
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
// TODO(jianj): Investigate why ROI not working in speed < 5 or in non
// realtime mode.
@@ -628,7 +626,7 @@ static void apply_roi_map(VP9_COMP *cpi) {
valid_ref = 0;
// If GOLDEN is selected, make sure it's set as reference.
if (ref_frame[i] == GOLDEN_FRAME &&
- !(cpi->ref_frame_flags & flag_list[ref_frame[i]])) {
+ !(cpi->ref_frame_flags & ref_frame_to_flag(ref_frame[i]))) {
valid_ref = 0;
}
// GOLDEN was updated in previous encoded frame, so GOLDEN and LAST are
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 1bca7ded7..0059e881b 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -1196,12 +1196,17 @@ static INLINE int frame_is_kf_gf_arf(const VP9_COMP *cpi) {
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref);
}
-static INLINE MV_REFERENCE_FRAME get_first_ref_frame(VP9_COMP *const cpi) {
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
- MV_REFERENCE_FRAME ref_frame = LAST_FRAME;
+static INLINE int ref_frame_to_flag(int8_t ref_frame) {
+ static const int kVp9RefFlagList[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
+ VP9_ALT_FLAG };
+ assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME);
+ return kVp9RefFlagList[ref_frame];
+}
+
+static INLINE int get_first_ref_frame(VP9_COMP *const cpi) {
+ int ref_frame = LAST_FRAME;
while (ref_frame < MAX_REF_FRAMES) {
- if (cpi->ref_frame_flags & flag_list[ref_frame]) break;
+ if (cpi->ref_frame_flags & ref_frame_to_flag(ref_frame)) break;
ref_frame++;
}
return ref_frame;
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 695fd484f..c8e167f25 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1247,7 +1247,7 @@ static INLINE void find_predictors(
VP9_COMP *cpi, MACROBLOCK *x, MV_REFERENCE_FRAME ref_frame,
int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES],
int const_motion[MAX_REF_FRAMES], int *ref_frame_skip_mask,
- const int flag_list[4], TileDataEnc *tile_data, int mi_row, int mi_col,
+ TileDataEnc *tile_data, int mi_row, int mi_col,
struct buf_2d yv12_mb[4][MAX_MB_PLANE], BLOCK_SIZE bsize,
int force_skip_low_temp_var, int comp_pred_allowed) {
VP9_COMMON *const cm = &cpi->common;
@@ -1259,7 +1259,7 @@ static INLINE void find_predictors(
frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
frame_mv[ZEROMV][ref_frame].as_int = 0;
// this needs various further optimizations. to be continued..
- if ((cpi->ref_frame_flags & flag_list[ref_frame]) && (yv12 != NULL)) {
+ if ((cpi->ref_frame_flags & ref_frame_to_flag(ref_frame)) && (yv12 != NULL)) {
int_mv *const candidates = x->mbmi_ext->ref_mvs[ref_frame];
const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf, sf);
@@ -1690,8 +1690,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES];
uint8_t mode_checked[MB_MODE_COUNT][MAX_REF_FRAMES];
struct buf_2d yv12_mb[4][MAX_MB_PLANE];
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
RD_COST this_rdc, best_rdc;
// var_y and sse_y are saved to be used in skipping checking
unsigned int var_y = UINT_MAX;
@@ -1925,14 +1923,14 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
// constrain the inter mode to only test zero motion.
if (cpi->use_svc && svc->force_zero_mode_spatial_ref &&
svc->spatial_layer_id > 0 && !gf_temporal_ref) {
- if (cpi->ref_frame_flags & flag_list[LAST_FRAME]) {
+ if (cpi->ref_frame_flags & VP9_LAST_FLAG) {
struct scale_factors *const sf = &cm->frame_refs[LAST_FRAME - 1].sf;
if (vp9_is_scaled(sf)) {
svc_force_zero_mode[LAST_FRAME - 1] = 1;
inter_layer_ref = LAST_FRAME;
}
}
- if (cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) {
+ if (cpi->ref_frame_flags & VP9_GOLD_FLAG) {
struct scale_factors *const sf = &cm->frame_refs[GOLDEN_FRAME - 1].sf;
if (vp9_is_scaled(sf)) {
svc_force_zero_mode[GOLDEN_FRAME - 1] = 1;
@@ -1957,7 +1955,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
cpi->rc.avg_frame_low_motion < 60))
usable_ref_frame = LAST_FRAME;
- if (!((cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) &&
+ if (!((cpi->ref_frame_flags & VP9_GOLD_FLAG) &&
!svc_force_zero_mode[GOLDEN_FRAME - 1] && !force_skip_low_temp_var))
use_golden_nonzeromv = 0;
@@ -1985,12 +1983,11 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
// Skip find_predictor if the reference frame is not in the
// ref_frame_flags (i.e., not used as a reference for this frame).
skip_ref_find_pred[ref_frame] =
- !(cpi->ref_frame_flags & flag_list[ref_frame]);
+ !(cpi->ref_frame_flags & ref_frame_to_flag(ref_frame));
if (!skip_ref_find_pred[ref_frame]) {
find_predictors(cpi, x, ref_frame, frame_mv, const_motion,
- &ref_frame_skip_mask, flag_list, tile_data, mi_row,
- mi_col, yv12_mb, bsize, force_skip_low_temp_var,
- comp_modes > 0);
+ &ref_frame_skip_mask, tile_data, mi_row, mi_col, yv12_mb,
+ bsize, force_skip_low_temp_var, comp_modes > 0);
}
}
@@ -2014,7 +2011,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
// than current layer: force check of GF-ZEROMV before early exit
// due to skip flag.
if (svc->spatial_layer_id > 0 && no_scaling &&
- (cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) &&
+ (cpi->ref_frame_flags & VP9_GOLD_FLAG) &&
cm->base_qindex > svc->lower_layer_qindex + 10)
force_test_gf_zeromv = 1;
@@ -2094,7 +2091,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
if (comp_pred) {
if (!cpi->allow_comp_inter_inter) continue;
// Skip compound inter modes if ARF is not available.
- if (!(cpi->ref_frame_flags & flag_list[second_ref_frame])) continue;
+ if (!(cpi->ref_frame_flags & ref_frame_to_flag(second_ref_frame)))
+ continue;
// Do not allow compound prediction if the segment level reference frame
// feature is in use as in this case there can only be one reference.
if (segfeature_active(seg, mi->segment_id, SEG_LVL_REF_FRAME)) continue;
@@ -2107,7 +2105,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
(!cpi->use_svc && sse_zeromv_normalized < thresh_skip_golden)))
continue;
- if (!(cpi->ref_frame_flags & flag_list[ref_frame])) continue;
+ if (!(cpi->ref_frame_flags & ref_frame_to_flag(ref_frame))) continue;
// For screen content. If zero_temp_sad source is computed: skip
// non-zero motion check for stationary blocks. If the superblock is
@@ -2190,7 +2188,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
if (usable_ref_frame < ALTREF_FRAME) {
if (!force_skip_low_temp_var && usable_ref_frame > LAST_FRAME) {
i = (ref_frame == LAST_FRAME) ? GOLDEN_FRAME : LAST_FRAME;
- if ((cpi->ref_frame_flags & flag_list[i]))
+ if ((cpi->ref_frame_flags & ref_frame_to_flag(i)))
if (x->pred_mv_sad[ref_frame] > (x->pred_mv_sad[i] << 1))
ref_frame_skip_mask |= (1 << ref_frame);
}
@@ -2199,9 +2197,9 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
ref_frame == ALTREF_FRAME)) {
int ref1 = (ref_frame == GOLDEN_FRAME) ? LAST_FRAME : GOLDEN_FRAME;
int ref2 = (ref_frame == ALTREF_FRAME) ? LAST_FRAME : ALTREF_FRAME;
- if (((cpi->ref_frame_flags & flag_list[ref1]) &&
+ if (((cpi->ref_frame_flags & ref_frame_to_flag(ref1)) &&
(x->pred_mv_sad[ref_frame] > (x->pred_mv_sad[ref1] << 1))) ||
- ((cpi->ref_frame_flags & flag_list[ref2]) &&
+ ((cpi->ref_frame_flags & ref_frame_to_flag(ref2)) &&
(x->pred_mv_sad[ref_frame] > (x->pred_mv_sad[ref2] << 1))))
ref_frame_skip_mask |= (1 << ref_frame);
}
@@ -2488,7 +2486,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
perform_intra_pred =
svc->temporal_layer_id == 0 ||
svc->layer_context[svc->temporal_layer_id].is_key_frame ||
- !(cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]) ||
+ !(cpi->ref_frame_flags & VP9_GOLD_FLAG) ||
(!svc->layer_context[svc->temporal_layer_id].is_key_frame &&
svc_force_zero_mode[best_pickmode.best_ref_frame - 1]);
inter_mode_thresh = (inter_mode_thresh << 1) + inter_mode_thresh;
@@ -2747,8 +2745,6 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, int mi_row,
MV_REFERENCE_FRAME best_ref_frame = NONE;
unsigned char segment_id = mi->segment_id;
struct buf_2d yv12_mb[4][MAX_MB_PLANE];
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
int64_t best_rd = INT64_MAX;
b_mode_info bsi[MAX_REF_FRAMES][4];
int ref_frame_skip_mask = 0;
@@ -2764,7 +2760,8 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, int mi_row,
int_mv dummy_mv[2];
x->pred_mv_sad[ref_frame] = INT_MAX;
- if ((cpi->ref_frame_flags & flag_list[ref_frame]) && (yv12 != NULL)) {
+ if ((cpi->ref_frame_flags & ref_frame_to_flag(ref_frame)) &&
+ (yv12 != NULL)) {
int_mv *const candidates = mbmi_ext->ref_mvs[ref_frame];
const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
vp9_setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf,
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index a1687dcf4..0171a0572 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3315,8 +3315,6 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
int_mv single_newmv[MAX_REF_FRAMES] = { { 0 } };
INTERP_FILTER single_inter_filter[MB_MODE_COUNT][MAX_REF_FRAMES];
int single_skippable[MB_MODE_COUNT][MAX_REF_FRAMES];
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
int64_t best_rd = best_rd_so_far;
int64_t best_pred_diff[REFERENCE_MODES];
int64_t best_pred_rd[REFERENCE_MODES];
@@ -3392,7 +3390,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
x->pred_mv_sad[ref_frame] = INT_MAX;
- if ((cpi->ref_frame_flags & flag_list[ref_frame]) &&
+ if ((cpi->ref_frame_flags & ref_frame_to_flag(ref_frame)) &&
!(is_rect_partition && (ctx->skip_ref_frame_mask & (1 << ref_frame)))) {
assert(get_ref_frame_buffer(cpi, ref_frame) != NULL);
setup_buffer_inter(cpi, x, ref_frame, bsize, mi_row, mi_col,
@@ -3403,7 +3401,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
}
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- if (!(cpi->ref_frame_flags & flag_list[ref_frame])) {
+ if (!(cpi->ref_frame_flags & ref_frame_to_flag(ref_frame))) {
// Skip checking missing references in both single and compound reference
// modes. Note that a mode will be skipped if both reference frames
// are masked out.
@@ -3609,7 +3607,8 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
continue;
// Skip compound inter modes if ARF is not available.
- if (!(cpi->ref_frame_flags & flag_list[second_ref_frame])) continue;
+ if (!(cpi->ref_frame_flags & ref_frame_to_flag(second_ref_frame)))
+ continue;
// Do not allow compound prediction if the segment level reference frame
// feature is in use as in this case there can only be one reference.
@@ -4140,8 +4139,6 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data,
int comp_pred, i;
int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES];
struct buf_2d yv12_mb[4][MAX_MB_PLANE];
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
int64_t best_rd = best_rd_so_far;
int64_t best_yrd = best_rd_so_far; // FIXME(rbultje) more precise
int64_t best_pred_diff[REFERENCE_MODES];
@@ -4191,7 +4188,7 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data,
rd_cost->rate = INT_MAX;
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
- if (cpi->ref_frame_flags & flag_list[ref_frame]) {
+ if (cpi->ref_frame_flags & ref_frame_to_flag(ref_frame)) {
setup_buffer_inter(cpi, x, ref_frame, bsize, mi_row, mi_col,
frame_mv[NEARESTMV], frame_mv[NEARMV], yv12_mb);
} else {
@@ -4276,7 +4273,8 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data,
cm->ref_frame_sign_bias[second_ref_frame])
continue;
- if (!(cpi->ref_frame_flags & flag_list[second_ref_frame])) continue;
+ if (!(cpi->ref_frame_flags & ref_frame_to_flag(second_ref_frame)))
+ continue;
// Do not allow compound prediction if the segment level reference frame
// feature is in use as in this case there can only be one reference.
if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) continue;
diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c
index 81695e915..7d7b2c3fb 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -495,11 +495,10 @@ static void set_rt_speed_feature_framesize_independent(
(cpi->external_resize == 1 ||
cpi->oxcf.resize_mode == RESIZE_DYNAMIC)) {
MV_REFERENCE_FRAME ref_frame;
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
- if (yv12 != NULL && (cpi->ref_frame_flags & flag_list[ref_frame])) {
+ if (yv12 != NULL &&
+ (cpi->ref_frame_flags & ref_frame_to_flag(ref_frame))) {
const struct scale_factors *const scale_fac =
&cm->frame_refs[ref_frame - 1].sf;
if (vp9_is_scaled(scale_fac)) sf->reference_masking = 0;
diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c
index f01cb17a2..30c17fd8e 100644
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -719,8 +719,6 @@ static void set_flags_and_fb_idx_bypass_via_set_ref_frame_config(
void vp9_copy_flags_ref_update_idx(VP9_COMP *const cpi) {
SVC *const svc = &cpi->svc;
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
int sl = svc->spatial_layer_id;
svc->lst_fb_idx[sl] = cpi->lst_fb_idx;
svc->gld_fb_idx[sl] = cpi->gld_fb_idx;
@@ -743,12 +741,9 @@ void vp9_copy_flags_ref_update_idx(VP9_COMP *const cpi) {
svc->update_golden[sl] = (uint8_t)cpi->refresh_golden_frame;
svc->update_altref[sl] = (uint8_t)cpi->refresh_alt_ref_frame;
- svc->reference_last[sl] =
- (uint8_t)(cpi->ref_frame_flags & flag_list[LAST_FRAME]);
- svc->reference_golden[sl] =
- (uint8_t)(cpi->ref_frame_flags & flag_list[GOLDEN_FRAME]);
- svc->reference_altref[sl] =
- (uint8_t)(cpi->ref_frame_flags & flag_list[ALTREF_FRAME]);
+ svc->reference_last[sl] = (uint8_t)(cpi->ref_frame_flags & VP9_LAST_FLAG);
+ svc->reference_golden[sl] = (uint8_t)(cpi->ref_frame_flags & VP9_GOLD_FLAG);
+ svc->reference_altref[sl] = (uint8_t)(cpi->ref_frame_flags & VP9_ALT_FLAG);
}
int vp9_one_pass_cbr_svc_start_layer(VP9_COMP *const cpi) {
@@ -1069,15 +1064,14 @@ void vp9_svc_constrain_inter_layer_pred(VP9_COMP *const cpi) {
svc->disable_inter_layer_pred == INTER_LAYER_PRED_OFF ||
svc->drop_spatial_layer[sl - 1]) {
MV_REFERENCE_FRAME ref_frame;
- static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
- VP9_ALT_FLAG };
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
- if (yv12 != NULL && (cpi->ref_frame_flags & flag_list[ref_frame])) {
+ if (yv12 != NULL &&
+ (cpi->ref_frame_flags & ref_frame_to_flag(ref_frame))) {
const struct scale_factors *const scale_fac =
&cm->frame_refs[ref_frame - 1].sf;
if (vp9_is_scaled(scale_fac)) {
- cpi->ref_frame_flags &= (~flag_list[ref_frame]);
+ cpi->ref_frame_flags &= (~ref_frame_to_flag(ref_frame));
// Point golden/altref frame buffer index to last.
if (!svc->simulcast_mode) {
if (ref_frame == GOLDEN_FRAME)