Commit 15a18e3d authored by Luc Trudeau's avatar Luc Trudeau Committed by Fred BARBIER

[CleanUp] Remove block from av1_mode_context_analyzer

av1_mode_context_analyzer is always called with block == -1.

Change-Id: Ibc9e7e87ea95f3651f7505b82674a6fd795ae985
parent 80668233
......@@ -361,20 +361,8 @@ static INLINE void av1_set_ref_frame(MV_REFERENCE_FRAME *rf,
}
static INLINE int16_t av1_mode_context_analyzer(
const int16_t *const mode_context, const MV_REFERENCE_FRAME *const rf,
BLOCK_SIZE bsize, int block) {
int16_t mode_ctx = 0;
int8_t ref_frame_type = av1_ref_frame_type(rf);
if (block >= 0) {
mode_ctx = mode_context[rf[0]] & 0x00ff;
(void)block;
(void)bsize;
return mode_ctx;
}
return mode_context[ref_frame_type];
const int16_t *const mode_context, const MV_REFERENCE_FRAME *const rf) {
return mode_context[av1_ref_frame_type(rf)];
}
static INLINE uint8_t av1_drl_ctx(const CANDIDATE_MV *ref_mv_stack,
......
......@@ -1926,8 +1926,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
if (is_compound)
mode_ctx = compound_inter_mode_ctx[mbmi->ref_frame[0]];
else
mode_ctx =
av1_mode_context_analyzer(inter_mode_ctx, mbmi->ref_frame, bsize, -1);
mode_ctx = av1_mode_context_analyzer(inter_mode_ctx, mbmi->ref_frame);
mbmi->ref_mv_idx = 0;
#if CONFIG_SEGMENT_GLOBALMV
......
......@@ -1437,8 +1437,8 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
if (is_compound)
mode_ctx = mbmi_ext->compound_mode_context[mbmi->ref_frame[0]];
else
mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
mbmi->ref_frame, bsize, -1);
mode_ctx =
av1_mode_context_analyzer(mbmi_ext->mode_context, mbmi->ref_frame);
// If segment skip is not enabled code the mode.
if (!segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
......@@ -1811,7 +1811,7 @@ static void enc_dump_logs(AV1_COMP *cpi, int mi_row, int mi_col) {
const int16_t mode_ctx =
is_comp_ref ? mbmi_ext->compound_mode_context[mbmi->ref_frame[0]]
: av1_mode_context_analyzer(mbmi_ext->mode_context,
mbmi->ref_frame, bsize, -1);
mbmi->ref_frame);
const int16_t newmv_ctx = mode_ctx & NEWMV_CTX_MASK;
int16_t zeromv_ctx = -1;
......
......@@ -1106,8 +1106,8 @@ static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data,
update_cdf(fc->inter_compound_mode_cdf[mode_ctx],
INTER_COMPOUND_OFFSET(mode), INTER_COMPOUND_MODES);
} else {
mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
mbmi->ref_frame, bsize, -1);
mode_ctx =
av1_mode_context_analyzer(mbmi_ext->mode_context, mbmi->ref_frame);
update_inter_mode_stats(counts, mode, mode_ctx);
}
......
......@@ -5760,8 +5760,8 @@ static int check_best_zero_mv(
const int16_t mode_context[TOTAL_REFS_PER_FRAME],
const int16_t compound_mode_context[TOTAL_REFS_PER_FRAME],
int_mv frame_mv[MB_MODE_COUNT][TOTAL_REFS_PER_FRAME], int this_mode,
const MV_REFERENCE_FRAME ref_frames[2], const BLOCK_SIZE bsize, int block,
int mi_row, int mi_col) {
const MV_REFERENCE_FRAME ref_frames[2], const BLOCK_SIZE bsize, int mi_row,
int mi_col) {
int_mv zeromv[2] = { {.as_int = 0 } };
int comp_pred_mode = ref_frames[1] > INTRA_FRAME;
(void)mi_row;
......@@ -5787,8 +5787,7 @@ static int check_best_zero_mv(
frame_mv[this_mode][ref_frames[0]].as_int == zeromv[0].as_int &&
(ref_frames[1] <= INTRA_FRAME ||
frame_mv[this_mode][ref_frames[1]].as_int == zeromv[1].as_int)) {
int16_t rfc =
av1_mode_context_analyzer(mode_context, ref_frames, bsize, block);
int16_t rfc = av1_mode_context_analyzer(mode_context, ref_frames);
int c1 = cost_mv_ref(x, NEARMV, rfc);
int c2 = cost_mv_ref(x, NEARESTMV, rfc);
int c3 = cost_mv_ref(x, GLOBALMV, rfc);
......@@ -8144,8 +8143,8 @@ static int64_t handle_inter_mode(
if (is_comp_pred)
mode_ctx = mbmi_ext->compound_mode_context[refs[0]];
else
mode_ctx = av1_mode_context_analyzer(mbmi_ext->mode_context,
mbmi->ref_frame, bsize, -1);
mode_ctx =
av1_mode_context_analyzer(mbmi_ext->mode_context, mbmi->ref_frame);
#if CONFIG_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
......@@ -9705,7 +9704,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
const MV_REFERENCE_FRAME ref_frames[2] = { ref_frame, second_ref_frame };
if (!check_best_zero_mv(cpi, x, mbmi_ext->mode_context,
mbmi_ext->compound_mode_context, frame_mv,
this_mode, ref_frames, bsize, -1, mi_row, mi_col))
this_mode, ref_frames, bsize, mi_row, mi_col))
continue;
}
......
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