Commit c01dddb7 authored by Zoe Liu's avatar Zoe Liu

Remove ONE_SIDED_COMPOUND experimental flag

Always assume ONE_SIDED_COMPOUND is true as it has been adopted
officially. Further, this patch also fixes the cmake setup for
the experiment of EXT_COMP_REFS, as when EXT_COMP_REFS is on, it
shall always have ONE_SIDED_COMPOUND on (but that was not the case
without this patch).

We leave EXT_COMP_REFS for the time being, even though it is also
adopted, since by keeping this flag, it may allow its turning off to
tune the encoder speed. The experiment of EXT_COMP_REFS should be
removed eventually at the closing of the bitstream.

Change-Id: I0644318e522f5b48d5bba4e4391104a24d43cdc3
parent 81d458b2
......@@ -519,16 +519,11 @@ int av1_get_pred_context_comp_ref_p(const AV1_COMMON *cm,
const int above_in_image = xd->up_available;
const int left_in_image = xd->left_available;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
// Code seems to assume that signbias of cm->comp_bwd_ref[0] is always 1
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
const int bwd_ref_sign_idx = 1;
#else
const int bwd_ref_sign_idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
#endif // CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
const int fwd_ref_sign_idx = !bwd_ref_sign_idx;
(void)cm;
......@@ -624,16 +619,11 @@ int av1_get_pred_context_comp_ref_p1(const AV1_COMMON *cm,
const int above_in_image = xd->up_available;
const int left_in_image = xd->left_available;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
// Code seems to assume that signbias of cm->comp_bwd_ref[0] is always 1
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
const int bwd_ref_sign_idx = 1;
#else
const int bwd_ref_sign_idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
#endif // CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
const int fwd_ref_sign_idx = !bwd_ref_sign_idx;
(void)cm;
......@@ -732,15 +722,11 @@ int av1_get_pred_context_comp_ref_p2(const AV1_COMMON *cm,
const int above_in_image = xd->up_available;
const int left_in_image = xd->left_available;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
const int bwd_ref_sign_idx = 1;
#else
const int bwd_ref_sign_idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
#endif // CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
const int fwd_ref_sign_idx = !bwd_ref_sign_idx;
(void)cm;
......
......@@ -95,16 +95,7 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
struct aom_read_bit_buffer *rb);
static int is_compound_reference_allowed(const AV1_COMMON *cm) {
#if CONFIG_ONE_SIDED_COMPOUND // Normative in decoder
return !frame_is_intra_only(cm);
#else
int i;
if (frame_is_intra_only(cm)) return 0;
for (i = 1; i < INTER_REFS_PER_FRAME; ++i)
if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1]) return 1;
return 0;
#endif // CONFIG_ONE_SIDED_COMPOUND
}
static void setup_compound_reference_mode(AV1_COMMON *cm) {
......
......@@ -1505,12 +1505,7 @@ static void read_ref_frames(AV1_COMMON *const cm, MACROBLOCKD *const xd,
assert(comp_ref_type == BIDIR_COMP_REFERENCE);
#endif // CONFIG_EXT_COMP_REFS
// Normative in decoder (for low delay)
#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
const int idx = 1;
#else // !(CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS)
const int idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
#endif // CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS)
const int ctx = av1_get_pred_context_comp_ref_p(cm, xd);
const int bit = READ_REF_BIT(comp_ref_p);
......
......@@ -4177,25 +4177,14 @@ void av1_encode_frame(AV1_COMP *cpi) {
// side behavior is where the ALT ref buffer has opposite sign bias to
// the other two.
if (!frame_is_intra_only(cm)) {
#if !CONFIG_ONE_SIDED_COMPOUND
if ((cm->ref_frame_sign_bias[ALTREF_FRAME] ==
cm->ref_frame_sign_bias[GOLDEN_FRAME]) ||
(cm->ref_frame_sign_bias[ALTREF_FRAME] ==
cm->ref_frame_sign_bias[LAST_FRAME])) {
cpi->allow_comp_inter_inter = 0;
} else {
#endif // !CONFIG_ONE_SIDED_COMPOUND
cpi->allow_comp_inter_inter = 1;
cm->comp_fwd_ref[0] = LAST_FRAME;
cm->comp_fwd_ref[1] = LAST2_FRAME;
cm->comp_fwd_ref[2] = LAST3_FRAME;
cm->comp_fwd_ref[3] = GOLDEN_FRAME;
cm->comp_bwd_ref[0] = BWDREF_FRAME;
cm->comp_bwd_ref[1] = ALTREF2_FRAME;
cm->comp_bwd_ref[2] = ALTREF_FRAME;
#if !CONFIG_ONE_SIDED_COMPOUND // Normative in encoder
}
#endif // !CONFIG_ONE_SIDED_COMPOUND
cpi->allow_comp_inter_inter = 1;
cm->comp_fwd_ref[0] = LAST_FRAME;
cm->comp_fwd_ref[1] = LAST2_FRAME;
cm->comp_fwd_ref[2] = LAST3_FRAME;
cm->comp_fwd_ref[3] = GOLDEN_FRAME;
cm->comp_bwd_ref[0] = BWDREF_FRAME;
cm->comp_bwd_ref[1] = ALTREF2_FRAME;
cm->comp_bwd_ref[2] = ALTREF_FRAME;
} else {
cpi->allow_comp_inter_inter = 0;
}
......
......@@ -374,13 +374,12 @@ static void setup_frame(AV1_COMP *cpi) {
#endif // CONFIG_NO_FRAME_CONTEXT_SIGNALING
av1_zero(cpi->interp_filter_selected[0]);
}
#if CONFIG_ONE_SIDED_COMPOUND && \
!CONFIG_EXT_COMP_REFS // No change to bitstream
#if !CONFIG_EXT_COMP_REFS // No change to bitstream
if (cpi->sf.recode_loop == DISALLOW_RECODE) {
cpi->refresh_bwd_ref_frame = cpi->refresh_last_frame;
cpi->rc.is_bipred_frame = 1;
}
#endif // CONFIG_ONE_SIDED_COMPOUND && !CONFIG_EXT_COMP_REFS
#endif // !CONFIG_EXT_COMP_REFS
#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
cm->frame_refs[0].idx < 0) {
......
......@@ -9579,7 +9579,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
// This is only used in motion vector unit test.
if (cpi->oxcf.motion_vector_unit_test && ref_frame == INTRA_FRAME) continue;
#if CONFIG_ONE_SIDED_COMPOUND && !CONFIG_EXT_COMP_REFS // Changes LL bitstream
#if !CONFIG_EXT_COMP_REFS // Changes LL bitstream
if (cpi->oxcf.pass == 0) {
// Complexity-compression trade-offs
// if (ref_frame == ALTREF_FRAME) continue;
......@@ -9587,7 +9587,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
if (second_ref_frame == ALTREF_FRAME) continue;
// if (second_ref_frame == BWDREF_FRAME) continue;
}
#endif // CONFIG_ONE_SIDED_COMPOUND && !CONFIG_EXT_COMP_REFS
#endif // !CONFIG_EXT_COMP_REFS
comp_pred = second_ref_frame > INTRA_FRAME;
if (comp_pred) {
if (!cpi->allow_comp_inter_inter) continue;
......
......@@ -172,7 +172,6 @@ set(CONFIG_NEW_MULTISYMBOL 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_NEW_QUANT 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_NO_FRAME_CONTEXT_SIGNALING 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OBU 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_ONE_SIDED_COMPOUND 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OPT_REF_MV 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_PALETTE_DELTA_ENCODING 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_PALETTE_THROUGHPUT 1 CACHE NUMBER "AV1 experiment flag.")
......
......@@ -309,7 +309,6 @@ EXPERIMENT_LIST="
new_multisymbol
compound_singleref
aom_qm
one_sided_compound
ext_comp_refs
smooth_hv
lgt
......@@ -500,7 +499,6 @@ post_process_cmdline() {
soft_enable intra_edge
soft_enable mv_compress
soft_enable dual_filter
soft_enable one_sided_compound
soft_enable convolve_round
soft_enable aom_qm
soft_enable dist_8x8
......@@ -542,7 +540,6 @@ post_process_cmdline() {
enabled compound_round && soft_enable convolve_round
enabled ext_intra_mod && enable_feature intra_edge
enabled intra_edge && enable_feature ext_intra
enabled ext_comp_refs && enable_feature one_sided_compound
enabled cfl && enable_feature smooth_hv
enabled cdef_singlepass && enable_feature cdef
enabled mfmv && enable_feature frame_marker
......
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