Enable quality boost for internal ARFs
Also remove some unused MACRO constants
Change-Id: Id2d296922a2b9bb53437f644ee329b43837497fa
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index fce370f..163b759 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -2258,7 +2258,7 @@
// LAST3_FRAME.
refresh_mask |=
(cpi->refresh_last_frame << cpi->ref_fb_idx[LAST_REF_FRAMES - 1]);
-#if SHIFT_BWDREF_BUF
+#if USE_SYMM_MULTI_LAYER
refresh_mask |=
(cpi->new_bwdref_update_rule == 1)
? (cpi->refresh_bwd_ref_frame << cpi->ref_fb_idx[EXTREF_FRAME - 1])
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index a4dbda7..be231eb 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -3311,7 +3311,7 @@
}
}
-#if SHIFT_BWDREF_BUF
+#if USE_SYMM_MULTI_LAYER
// This function is used to shift the virtual indices of bwd reference
// frames as follows:
// BWD_REF -> ALT2_REF -> EXT_REF
@@ -3351,7 +3351,7 @@
sizeof(cpi->interp_filter_selected[ordered_bwd[i + 1] + LAST_FRAME]));
}
}
-#endif // SHIFT_BWDREF_BUF
+#endif // USE_SYMM_MULTI_LAYER
#if USE_GF16_MULTI_LAYER
static void update_reference_frames_gf16(AV1_COMP *cpi) {
@@ -3461,7 +3461,7 @@
memcpy(cpi->interp_filter_selected[LAST_FRAME],
cpi->interp_filter_selected[bwdref_to_show],
sizeof(cpi->interp_filter_selected[bwdref_to_show]));
-#if SHIFT_BWDREF_BUF
+#if USE_SYMM_MULTI_LAYER
if (cpi->new_bwdref_update_rule == 1) {
lshift_bwd_ref_frames(cpi);
// pass outdated forward reference frame (previous LAST3) to the
@@ -3470,7 +3470,7 @@
} else {
#endif
cpi->ref_fb_idx[bwdref_to_show - 1] = tmp;
-#if SHIFT_BWDREF_BUF
+#if USE_SYMM_MULTI_LAYER
}
#endif
} else { /* For non key/golden frames */
@@ -3497,7 +3497,7 @@
// === BWDREF_FRAME ===
if (cpi->refresh_bwd_ref_frame) {
-#if SHIFT_BWDREF_BUF
+#if USE_SYMM_MULTI_LAYER
if (cpi->new_bwdref_update_rule) {
// We shift the backward reference frame as follows:
// BWDREF -> ALTREF2 -> EXTREF
@@ -3509,11 +3509,11 @@
rshift_bwd_ref_frames(cpi);
cpi->ref_fb_idx[BWDREF_FRAME - 1] = tmp;
} else {
-#endif // SHIFT_BWDREF_BUF
+#endif // USE_SYMM_MULTI_LAYER
ref_cnt_fb(pool->frame_bufs,
&cm->ref_frame_map[cpi->ref_fb_idx[BWDREF_FRAME - 1]],
cm->new_fb_idx);
-#if SHIFT_BWDREF_BUF
+#if USE_SYMM_MULTI_LAYER
}
#endif
memcpy(cpi->interp_filter_selected[BWDREF_FRAME],
diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c
index f70b19c..e2f5627 100644
--- a/av1/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -2323,15 +2323,11 @@
0 // arf_update_idx
},
{
-// gf_group->index == 3 (Frame 1)
-#if MATCH_OLD_BITRATE
+ // gf_group->index == 3 (Frame 1)
LAST_BIPRED_UPDATE, // update_type
-#else
- LF_UPDATE, // update_type
-#endif
- 0, // arf_src_offset
- 0, // arf_pos_in_gf
- 0 // arf_update_idx
+ 0, // arf_src_offset
+ 0, // arf_pos_in_gf
+ 0 // arf_update_idx
},
{
@@ -2758,7 +2754,7 @@
// TODO(zoeliu): To investigate whether the allocated bits on
// BIPRED_UPDATE frames need to be further adjusted.
gf_group->bit_allocation[frame_index] = target_frame_size;
-#if MATCH_OLD_BITRATE
+#if USE_SYMM_MULTI_LAYER
} else if (cpi->new_bwdref_update_rule == 1 &&
gf_group->update_type[frame_index] == INTNL_OVERLAY_UPDATE) {
int arf_pos = gf_group->arf_pos_in_gf[frame_index];
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index 5e6536f..8fa6b7b 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -930,11 +930,8 @@
ASSIGN_MINQ_TABLE(cm->bit_depth, inter_minq);
#if CUSTOMIZED_GF
- int is_intrl_arf_boost =
+ const int is_intrl_arf_boost =
gf_group->update_type[gf_group->index] == INTNL_ARF_UPDATE;
-#if MATCH_OLD_BITRATE
- if (cpi->new_bwdref_update_rule == 1) is_intrl_arf_boost = 0;
-#endif
#else
const int is_intrl_arf_boost = cpi->refresh_alt2_ref_frame;
#endif // CUSTOMIZED_GF
diff --git a/av1/encoder/ratectrl.h b/av1/encoder/ratectrl.h
index 2b93b31..f0508da 100644
--- a/av1/encoder/ratectrl.h
+++ b/av1/encoder/ratectrl.h
@@ -35,12 +35,7 @@
#endif
#if USE_SYMM_MULTI_LAYER
-#define MATCH_OLD_BITRATE 1
-#define SHIFT_BWDREF_BUF 1
#define USE_MANUAL_GF4_STRUCT 0
-#else
-#define MATCH_OLD_BITRATE 0
-#define SHIFT_BWDREF_BUF 0
#endif
#define MIN_GF_INTERVAL 4