Commit b4fc74da authored by Jingning Han's avatar Jingning Han

Take out drl index control from opt-ref-mv

Removing the drl dependency on the candidate list length appears
to incur more than 0.3% compression performance loss. Hence remove
this option from opt-ref-mv to allow better latency vs compression
performance trade off.

Change-Id: I6edaeb2d437996082b7bdd6cda7351426c5584b9
parent e9644bee
......@@ -770,9 +770,6 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const int nearest_match = ref_match_count;
const int nearest_refmv_count = *refmv_count;
#if CONFIG_OPT_REF_MV
ref_mv_stack[0].weight = 0;
#endif
for (int idx = 0; idx < nearest_refmv_count; ++idx)
ref_mv_stack[idx].weight += REF_CAT_LEVEL;
......
......@@ -352,13 +352,6 @@ static INLINE int16_t av1_mode_context_analyzer(
static INLINE uint8_t av1_drl_ctx(const CANDIDATE_MV *ref_mv_stack,
int ref_idx) {
#if CONFIG_OPT_REF_MV
if (ref_mv_stack[0].weight >= REF_CAT_LEVEL)
return 0;
else
return 2;
#endif
if (ref_mv_stack[ref_idx].weight >= REF_CAT_LEVEL &&
ref_mv_stack[ref_idx + 1].weight >= REF_CAT_LEVEL)
return 0;
......
......@@ -255,7 +255,7 @@ static void read_drl_idx(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
mbmi->ref_mv_idx = 0;
if (mbmi->mode == NEWMV || mbmi->mode == NEW_NEWMV) {
for (int idx = 0; idx < 2; ++idx) {
if (xd->ref_mv_count[ref_frame_type] > idx + 1 || CONFIG_OPT_REF_MV) {
if (xd->ref_mv_count[ref_frame_type] > idx + 1) {
uint8_t drl_ctx = av1_drl_ctx(xd->ref_mv_stack[ref_frame_type], idx);
int drl_idx = aom_read_symbol(r, ec_ctx->drl_cdf[drl_ctx], 2, ACCT_STR);
mbmi->ref_mv_idx = idx + drl_idx;
......@@ -269,7 +269,7 @@ static void read_drl_idx(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
// TODO(jingning): Unify the two syntax decoding loops after the NEARESTMV
// mode is factored in.
for (int idx = 1; idx < 3; ++idx) {
if (xd->ref_mv_count[ref_frame_type] > idx + 1 || CONFIG_OPT_REF_MV) {
if (xd->ref_mv_count[ref_frame_type] > idx + 1) {
uint8_t drl_ctx = av1_drl_ctx(xd->ref_mv_stack[ref_frame_type], idx);
int drl_idx = aom_read_symbol(r, ec_ctx->drl_cdf[drl_ctx], 2, ACCT_STR);
mbmi->ref_mv_idx = idx + drl_idx - 1;
......
......@@ -148,8 +148,7 @@ static void write_drl_idx(FRAME_CONTEXT *ec_ctx, const MB_MODE_INFO *mbmi,
if (new_mv) {
int idx;
for (idx = 0; idx < 2; ++idx) {
if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1 ||
CONFIG_OPT_REF_MV) {
if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
uint8_t drl_ctx =
av1_drl_ctx(mbmi_ext->ref_mv_stack[ref_frame_type], idx);
......@@ -165,8 +164,7 @@ static void write_drl_idx(FRAME_CONTEXT *ec_ctx, const MB_MODE_INFO *mbmi,
int idx;
// TODO(jingning): Temporary solution to compensate the NEARESTMV offset.
for (idx = 1; idx < 3; ++idx) {
if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1 ||
CONFIG_OPT_REF_MV) {
if (mbmi_ext->ref_mv_count[ref_frame_type] > idx + 1) {
uint8_t drl_ctx =
av1_drl_ctx(mbmi_ext->ref_mv_stack[ref_frame_type], idx);
aom_write_symbol(w, mbmi->ref_mv_idx != (idx - 1),
......
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