Commit 0bdf5f5c authored by Hui Su's avatar Hui Su Committed by Sebastien Alaiwan
Browse files

Remove probability model for comp_ref and comp_bwdref

At this point, av1_adapt_inter_frame_probs() can be removed.

Change-Id: Ic8f9cc4f6b874aeec84a57fb7dbfacdb33309b51
parent a7e3bfe1
......@@ -1426,18 +1426,6 @@ static const aom_cdf_prob
{ AOM_CDF2(196 * 128) } } };
#endif // CONFIG_EXT_COMP_REFS
static const aom_prob default_comp_ref_p[REF_CONTEXTS][FWD_REFS - 1] = {
{ 28, 10, 8 },
{ 77, 27, 26 },
{ 127, 62, 56 },
{ 186, 126, 160 },
{ 236, 143, 172 }
};
static const aom_prob default_comp_bwdref_p[REF_CONTEXTS][BWD_REFS - 1] = {
{ 22, 13 }, { 140, 124 }, { 241, 239 }, { 128, 128 }, { 128, 128 }
};
static const aom_cdf_prob
default_comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)] = {
{ { AOM_CDF2(3556) }, { AOM_CDF2(1217) }, { AOM_CDF2(988) } },
......@@ -1452,8 +1440,8 @@ static const aom_cdf_prob
{ { AOM_CDF2(2762) }, { AOM_CDF2(1614) } },
{ { AOM_CDF2(17976) }, { AOM_CDF2(15912) } },
{ { AOM_CDF2(30894) }, { AOM_CDF2(30639) } },
{ { AOM_CDF2(32768) }, { AOM_CDF2(32768) } },
{ { AOM_CDF2(32768) }, { AOM_CDF2(32768) } }
{ { AOM_CDF2(16384) }, { AOM_CDF2(16384) } },
{ { AOM_CDF2(16384) }, { AOM_CDF2(16384) } }
};
static const aom_cdf_prob default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1]
......@@ -3278,7 +3266,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->comp_ref_type_cdf, default_comp_ref_type_cdf);
av1_copy(fc->uni_comp_ref_cdf, default_uni_comp_ref_cdf);
#endif // CONFIG_EXT_COMP_REFS
av1_copy(fc->comp_ref_prob, default_comp_ref_p);
av1_copy(fc->palette_y_mode_cdf, default_palette_y_mode_cdf);
av1_copy(fc->palette_uv_mode_cdf, default_palette_uv_mode_cdf);
av1_copy(fc->comp_ref_cdf, default_comp_ref_cdf);
......@@ -3307,7 +3294,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_init_txb_probs(fc);
#endif
av1_copy(fc->comp_bwdref_prob, default_comp_bwdref_p);
av1_copy(fc->comp_bwdref_cdf, default_comp_bwdref_cdf);
av1_copy(fc->single_ref_cdf, default_single_ref_cdf);
av1_copy(fc->txfm_partition_cdf, default_txfm_partition_cdf);
......@@ -3370,22 +3356,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif
}
void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
int i, j;
FRAME_CONTEXT *fc = cm->fc;
const FRAME_CONTEXT *pre_fc = cm->pre_fc;
const FRAME_COUNTS *counts = &cm->counts;
for (i = 0; i < REF_CONTEXTS; i++)
for (j = 0; j < (FWD_REFS - 1); j++)
fc->comp_ref_prob[i][j] = mode_mv_merge_probs(pre_fc->comp_ref_prob[i][j],
counts->comp_ref[i][j]);
for (i = 0; i < REF_CONTEXTS; i++)
for (j = 0; j < (BWD_REFS - 1); j++)
fc->comp_bwdref_prob[i][j] = mode_mv_merge_probs(
pre_fc->comp_bwdref_prob[i][j], counts->comp_bwdref[i][j]);
}
static void set_default_lf_deltas(struct loopfilter *lf) {
lf->mode_ref_delta_enabled = 1;
lf->mode_ref_delta_update = 1;
......
......@@ -166,7 +166,6 @@ typedef struct frame_contexts {
[CDF_SIZE(2)];
#endif // CONFIG_EXT_COMP_REFS
aom_prob comp_ref_prob[REF_CONTEXTS][FWD_REFS - 1];
aom_prob comp_bwdref_prob[REF_CONTEXTS][BWD_REFS - 1];
aom_cdf_prob comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)];
aom_cdf_prob comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)];
aom_cdf_prob txfm_partition_cdf[TXFM_PARTITION_CONTEXTS][CDF_SIZE(2)];
......@@ -322,12 +321,10 @@ typedef struct FRAME_COUNTS {
unsigned int comp_ref_type[COMP_REF_TYPE_CONTEXTS][2];
unsigned int uni_comp_ref[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1][2];
#endif // CONFIG_EXT_COMP_REFS
#endif // CONFIG_ENTROPY_STATS
#if CONFIG_ENTROPY_STATS
unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS - 1][2];
#endif // CONFIG_ENTROPY_STATS
unsigned int comp_ref[REF_CONTEXTS][FWD_REFS - 1][2];
unsigned int comp_bwdref[REF_CONTEXTS][BWD_REFS - 1][2];
#endif // CONFIG_ENTROPY_STATS
unsigned int txfm_partition[TXFM_PARTITION_CONTEXTS][2];
#if CONFIG_EXT_SKIP
unsigned int skip_mode[SKIP_MODE_CONTEXTS][2];
......@@ -439,7 +436,6 @@ static const int av1_ext_tx_inv[EXT_TX_SET_TYPES][TX_TYPES] = {
void av1_setup_frame_contexts(struct AV1Common *cm);
void av1_setup_past_independence(struct AV1Common *cm);
void av1_adapt_inter_frame_probs(struct AV1Common *cm);
static INLINE int av1_ceil_log2(int n) {
int i = 1, p = 2;
......
......@@ -240,12 +240,6 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p(const AV1_COMMON *cm,
return xd->tile_ctx->comp_ref_cdf[pred_context][0];
}
static INLINE aom_prob av1_get_pred_prob_comp_ref_p(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = av1_get_pred_context_comp_ref_p(cm, xd);
return cm->fc->comp_ref_prob[pred_context][0];
}
int av1_get_pred_context_comp_ref_p1(const AV1_COMMON *cm,
const MACROBLOCKD *xd);
......@@ -255,12 +249,6 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p1(
return xd->tile_ctx->comp_ref_cdf[pred_context][1];
}
static INLINE aom_prob av1_get_pred_prob_comp_ref_p1(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = av1_get_pred_context_comp_ref_p1(cm, xd);
return cm->fc->comp_ref_prob[pred_context][1];
}
int av1_get_pred_context_comp_ref_p2(const AV1_COMMON *cm,
const MACROBLOCKD *xd);
......@@ -270,12 +258,6 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p2(
return xd->tile_ctx->comp_ref_cdf[pred_context][2];
}
static INLINE aom_prob av1_get_pred_prob_comp_ref_p2(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = av1_get_pred_context_comp_ref_p2(cm, xd);
return cm->fc->comp_ref_prob[pred_context][2];
}
int av1_get_pred_context_comp_bwdref_p(const AV1_COMMON *cm,
const MACROBLOCKD *xd);
......@@ -285,12 +267,6 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_bwdref_p(
return xd->tile_ctx->comp_bwdref_cdf[pred_context][0];
}
static INLINE aom_prob av1_get_pred_prob_comp_bwdref_p(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = av1_get_pred_context_comp_bwdref_p(cm, xd);
return cm->fc->comp_bwdref_prob[pred_context][0];
}
int av1_get_pred_context_comp_bwdref_p1(const AV1_COMMON *cm,
const MACROBLOCKD *xd);
......@@ -300,12 +276,6 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_bwdref_p1(
return xd->tile_ctx->comp_bwdref_cdf[pred_context][1];
}
static INLINE aom_prob av1_get_pred_prob_comp_bwdref_p1(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = av1_get_pred_context_comp_bwdref_p1(cm, xd);
return cm->fc->comp_bwdref_prob[pred_context][1];
}
int av1_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
int av1_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
......
......@@ -3125,10 +3125,6 @@ static void debug_check_frame_counts(const AV1_COMMON *const cm) {
sizeof(cm->counts.motion_mode)));
assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter,
sizeof(cm->counts.intra_inter)));
assert(!memcmp(cm->counts.comp_ref, zero_counts.comp_ref,
sizeof(cm->counts.comp_ref)));
assert(!memcmp(cm->counts.comp_bwdref, zero_counts.comp_bwdref,
sizeof(cm->counts.comp_bwdref)));
assert(!memcmp(cm->counts.skip, zero_counts.skip, sizeof(cm->counts.skip)));
}
#endif // NDEBUG
......@@ -3455,7 +3451,6 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data,
num_bwd_ctxs);
if (!frame_is_intra_only(cm)) {
av1_adapt_inter_frame_probs(cm);
av1_average_tile_inter_cdfs(&pbi->common, pbi->common.fc, tile_ctxs,
cdf_ptrs, num_bwd_ctxs);
av1_average_tile_mv_cdfs(pbi->common.fc, tile_ctxs, cdf_ptrs,
......
......@@ -1305,8 +1305,6 @@ static void set_ref_frames_for_skip_mode(AV1_COMMON *const cm,
static void read_ref_frames(AV1_COMMON *const cm, MACROBLOCKD *const xd,
aom_reader *r, int segment_id,
MV_REFERENCE_FRAME ref_frame[2]) {
FRAME_COUNTS *counts = xd->counts;
if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
ref_frame[0] = (MV_REFERENCE_FRAME)get_segdata(&cm->seg, segment_id,
SEG_LVL_REF_FRAME);
......@@ -1364,32 +1362,20 @@ static void read_ref_frames(AV1_COMMON *const cm, MACROBLOCKD *const xd,
#endif // CONFIG_EXT_COMP_REFS
const int idx = 1;
const int ctx = av1_get_pred_context_comp_ref_p(cm, xd);
const int bit = READ_REF_BIT(comp_ref_p);
if (counts) ++counts->comp_ref[ctx][0][bit];
// Decode forward references.
if (!bit) {
const int ctx1 = av1_get_pred_context_comp_ref_p1(cm, xd);
const int bit1 = READ_REF_BIT(comp_ref_p1);
if (counts) ++counts->comp_ref[ctx1][1][bit1];
ref_frame[!idx] = cm->comp_fwd_ref[bit1 ? 1 : 0];
} else {
const int ctx2 = av1_get_pred_context_comp_ref_p2(cm, xd);
const int bit2 = READ_REF_BIT(comp_ref_p2);
if (counts) ++counts->comp_ref[ctx2][2][bit2];
ref_frame[!idx] = cm->comp_fwd_ref[bit2 ? 3 : 2];
}
// Decode backward references.
const int ctx_bwd = av1_get_pred_context_comp_bwdref_p(cm, xd);
const int bit_bwd = READ_REF_BIT(comp_bwdref_p);
if (counts) ++counts->comp_bwdref[ctx_bwd][0][bit_bwd];
if (!bit_bwd) {
const int ctx1_bwd = av1_get_pred_context_comp_bwdref_p1(cm, xd);
const int bit1_bwd = READ_REF_BIT(comp_bwdref_p1);
if (counts) ++counts->comp_bwdref[ctx1_bwd][1][bit1_bwd];
ref_frame[idx] = cm->comp_bwd_ref[bit1_bwd];
} else {
ref_frame[idx] = cm->comp_bwd_ref[2];
......
......@@ -291,6 +291,12 @@ struct macroblock {
int uni_comp_ref_cost[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1]
[CDF_SIZE(2)];
#endif // CONFIG_EXT_COMP_REFS
// Cost for signaling ref_frame[0] (LAST_FRAME, LAST2_FRAME, LAST3_FRAME or
// GOLDEN_FRAME) in bidir-comp mode.
int comp_ref_cost[REF_CONTEXTS][FWD_REFS - 1][2];
// Cost for signaling ref_frame[1] (ALTREF_FRAME, ALTREF2_FRAME, or
// BWDREF_FRAME) in bidir-comp mode.
int comp_bwdref_cost[REF_CONTEXTS][BWD_REFS - 1][2];
int inter_compound_mode_cost[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES];
#if CONFIG_JNT_COMP
int compound_type_cost[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1];
......
......@@ -940,21 +940,48 @@ static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data,
} else {
#endif // CONFIG_EXT_COMP_REFS
const int bit = (ref0 == GOLDEN_FRAME || ref0 == LAST3_FRAME);
if (allow_update_cdf)
update_cdf(av1_get_pred_cdf_comp_ref_p(cm, xd), bit, 2);
#if CONFIG_ENTROPY_STATS
counts->comp_ref[av1_get_pred_context_comp_ref_p(cm, xd)][0][bit]++;
#endif // CONFIG_ENTROPY_STATS
if (!bit) {
if (allow_update_cdf) {
update_cdf(av1_get_pred_cdf_comp_ref_p1(cm, xd),
ref0 == LAST2_FRAME, 2);
}
#if CONFIG_ENTROPY_STATS
counts->comp_ref[av1_get_pred_context_comp_ref_p1(cm, xd)][1]
[ref0 == LAST2_FRAME]++;
#endif // CONFIG_ENTROPY_STATS
} else {
if (allow_update_cdf) {
update_cdf(av1_get_pred_cdf_comp_ref_p2(cm, xd),
ref0 == GOLDEN_FRAME, 2);
}
#if CONFIG_ENTROPY_STATS
counts->comp_ref[av1_get_pred_context_comp_ref_p2(cm, xd)][2]
[ref0 == GOLDEN_FRAME]++;
#endif // CONFIG_ENTROPY_STATS
}
if (allow_update_cdf) {
update_cdf(av1_get_pred_cdf_comp_bwdref_p(cm, xd),
ref1 == ALTREF_FRAME, 2);
}
#if CONFIG_ENTROPY_STATS
counts->comp_bwdref[av1_get_pred_context_comp_bwdref_p(cm, xd)][0]
[ref1 == ALTREF_FRAME]++;
if (ref1 != ALTREF_FRAME)
#endif // CONFIG_ENTROPY_STATS
if (ref1 != ALTREF_FRAME) {
if (allow_update_cdf) {
update_cdf(av1_get_pred_cdf_comp_bwdref_p1(cm, xd),
ref1 == ALTREF2_FRAME, 2);
}
#if CONFIG_ENTROPY_STATS
counts->comp_bwdref[av1_get_pred_context_comp_bwdref_p1(cm, xd)]
[1][ref1 == ALTREF2_FRAME]++;
#endif // CONFIG_ENTROPY_STATS
}
#if CONFIG_EXT_COMP_REFS
}
#endif // CONFIG_EXT_COMP_REFS
......
......@@ -6262,7 +6262,6 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
if (!frame_is_intra_only(cm)) {
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
av1_adapt_inter_frame_probs(cm);
av1_average_tile_inter_cdfs(&cpi->common, cpi->common.fc, tile_ctxs,
cdf_ptrs, num_bwd_ctxs);
av1_average_tile_mv_cdfs(cpi->common.fc, tile_ctxs, cdf_ptrs,
......
......@@ -252,6 +252,20 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
}
#endif // CONFIG_EXT_COMP_REFS
for (i = 0; i < REF_CONTEXTS; ++i) {
for (j = 0; j < FWD_REFS - 1; ++j) {
av1_cost_tokens_from_cdf(x->comp_ref_cost[i][j], fc->comp_ref_cdf[i][j],
NULL);
}
}
for (i = 0; i < REF_CONTEXTS; ++i) {
for (j = 0; j < BWD_REFS - 1; ++j) {
av1_cost_tokens_from_cdf(x->comp_bwdref_cost[i][j],
fc->comp_bwdref_cdf[i][j], NULL);
}
}
for (i = 0; i < INTRA_INTER_CONTEXTS; ++i) {
av1_cost_tokens_from_cdf(x->intra_inter_cost[i], fc->intra_inter_cdf[i],
NULL);
......
......@@ -5877,11 +5877,12 @@ static void estimate_ref_frame_costs(
#endif // !CONFIG_REF_ADAPT
if (cm->reference_mode != SINGLE_REFERENCE) {
aom_prob ref_comp_p = av1_get_pred_prob_comp_ref_p(cm, xd);
aom_prob ref_comp_p1 = av1_get_pred_prob_comp_ref_p1(cm, xd);
aom_prob ref_comp_p2 = av1_get_pred_prob_comp_ref_p2(cm, xd);
aom_prob bwdref_comp_p = av1_get_pred_prob_comp_bwdref_p(cm, xd);
aom_prob bwdref_comp_p1 = av1_get_pred_prob_comp_bwdref_p1(cm, xd);
const int bwdref_comp_ctx_p = av1_get_pred_context_comp_bwdref_p(cm, xd);
const int bwdref_comp_ctx_p1 =
av1_get_pred_context_comp_bwdref_p1(cm, xd);
const int ref_comp_ctx_p = av1_get_pred_context_comp_ref_p(cm, xd);
const int ref_comp_ctx_p1 = av1_get_pred_context_comp_ref_p1(cm, xd);
const int ref_comp_ctx_p2 = av1_get_pred_context_comp_ref_p2(cm, xd);
#if CONFIG_EXT_COMP_REFS
const int comp_ref_type_ctx = av1_get_comp_reference_type_context(xd);
......@@ -5893,23 +5894,28 @@ static void estimate_ref_frame_costs(
ref_bicomp_costs[BWDREF_FRAME] = ref_bicomp_costs[ALTREF2_FRAME] = 0;
ref_bicomp_costs[ALTREF_FRAME] = 0;
ref_bicomp_costs[LAST_FRAME] += av1_cost_bit(ref_comp_p, 0);
ref_bicomp_costs[LAST2_FRAME] += av1_cost_bit(ref_comp_p, 0);
ref_bicomp_costs[LAST3_FRAME] += av1_cost_bit(ref_comp_p, 1);
ref_bicomp_costs[GOLDEN_FRAME] += av1_cost_bit(ref_comp_p, 1);
ref_bicomp_costs[LAST_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][0];
ref_bicomp_costs[LAST2_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][0];
ref_bicomp_costs[LAST3_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][1];
ref_bicomp_costs[GOLDEN_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][1];
ref_bicomp_costs[LAST_FRAME] += av1_cost_bit(ref_comp_p1, 0);
ref_bicomp_costs[LAST2_FRAME] += av1_cost_bit(ref_comp_p1, 1);
ref_bicomp_costs[LAST_FRAME] += x->comp_ref_cost[ref_comp_ctx_p1][1][0];
ref_bicomp_costs[LAST2_FRAME] += x->comp_ref_cost[ref_comp_ctx_p1][1][1];
ref_bicomp_costs[LAST3_FRAME] += av1_cost_bit(ref_comp_p2, 0);
ref_bicomp_costs[GOLDEN_FRAME] += av1_cost_bit(ref_comp_p2, 1);
ref_bicomp_costs[LAST3_FRAME] += x->comp_ref_cost[ref_comp_ctx_p2][2][0];
ref_bicomp_costs[GOLDEN_FRAME] += x->comp_ref_cost[ref_comp_ctx_p2][2][1];
ref_bicomp_costs[BWDREF_FRAME] += av1_cost_bit(bwdref_comp_p, 0);
ref_bicomp_costs[ALTREF2_FRAME] += av1_cost_bit(bwdref_comp_p, 0);
ref_bicomp_costs[ALTREF_FRAME] += av1_cost_bit(bwdref_comp_p, 1);
ref_bicomp_costs[BWDREF_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
ref_bicomp_costs[ALTREF2_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
ref_bicomp_costs[ALTREF_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p][0][1];
ref_bicomp_costs[BWDREF_FRAME] += av1_cost_bit(bwdref_comp_p1, 0);
ref_bicomp_costs[ALTREF2_FRAME] += av1_cost_bit(bwdref_comp_p1, 1);
ref_bicomp_costs[BWDREF_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p1][1][0];
ref_bicomp_costs[ALTREF2_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p1][1][1];
int ref0, ref1;
for (ref0 = LAST_FRAME; ref0 <= GOLDEN_FRAME; ++ref0) {
......@@ -5948,25 +5954,30 @@ static void estimate_ref_frame_costs(
ref_costs_comp[BWDREF_FRAME] = ref_costs_comp[ALTREF2_FRAME] =
ref_costs_comp[ALTREF_FRAME] = 0;
ref_costs_comp[LAST_FRAME] += av1_cost_bit(ref_comp_p, 0);
ref_costs_comp[LAST2_FRAME] += av1_cost_bit(ref_comp_p, 0);
ref_costs_comp[LAST3_FRAME] += av1_cost_bit(ref_comp_p, 1);
ref_costs_comp[GOLDEN_FRAME] += av1_cost_bit(ref_comp_p, 1);
ref_costs_comp[LAST_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][0];
ref_costs_comp[LAST2_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][0];
ref_costs_comp[LAST3_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][1];
ref_costs_comp[GOLDEN_FRAME] += x->comp_ref_cost[ref_comp_ctx_p][0][1];
ref_costs_comp[LAST_FRAME] += av1_cost_bit(ref_comp_p1, 0);
ref_costs_comp[LAST2_FRAME] += av1_cost_bit(ref_comp_p1, 1);
ref_costs_comp[LAST_FRAME] += x->comp_ref_cost[ref_comp_ctx_p1][1][0];
ref_costs_comp[LAST2_FRAME] += x->comp_ref_cost[ref_comp_ctx_p1][1][1];
ref_costs_comp[LAST3_FRAME] += av1_cost_bit(ref_comp_p2, 0);
ref_costs_comp[GOLDEN_FRAME] += av1_cost_bit(ref_comp_p2, 1);
ref_costs_comp[LAST3_FRAME] += x->comp_ref_cost[ref_comp_ctx_p2][2][0];
ref_costs_comp[GOLDEN_FRAME] += x->comp_ref_cost[ref_comp_ctx_p2][2][1];
// NOTE(zoeliu): BWDREF and ALTREF each add an extra cost by coding 1
// more bit.
ref_costs_comp[BWDREF_FRAME] += av1_cost_bit(bwdref_comp_p, 0);
ref_costs_comp[ALTREF2_FRAME] += av1_cost_bit(bwdref_comp_p, 0);
ref_costs_comp[ALTREF_FRAME] += av1_cost_bit(bwdref_comp_p, 1);
ref_costs_comp[BWDREF_FRAME] += av1_cost_bit(bwdref_comp_p1, 0);
ref_costs_comp[ALTREF2_FRAME] += av1_cost_bit(bwdref_comp_p1, 1);
ref_costs_comp[BWDREF_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
ref_costs_comp[ALTREF2_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
ref_costs_comp[ALTREF_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p][0][1];
ref_costs_comp[BWDREF_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p1][1][0];
ref_costs_comp[ALTREF2_FRAME] +=
x->comp_bwdref_cost[bwdref_comp_ctx_p1][1][1];
#endif // CONFIG_EXT_COMP_REFS
} else {
#if CONFIG_EXT_COMP_REFS
......
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