Commit 7daf0422 authored by Wei-Ting Lin's avatar Wei-Ting Lin Committed by Wei-ting Lin

ncobmc-adapt-weight: remove bitstream for training

Change-Id: I08340afd1bc667b97d96e5540cf5c126bcfaaab4
parent 914d53a1
......@@ -872,7 +872,6 @@ static const aom_cdf_prob
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
};
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#elif !CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
......
......@@ -300,7 +300,7 @@ static void read_drl_idx(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
MODE_INFO *mi, aom_reader *r) {
MB_MODE_INFO *mbmi = &mi->mbmi;
#if CONFIG_NEW_MULTISYMBOL
#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
(void)cm;
#endif
......@@ -352,18 +352,12 @@ static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_NCOBMC_ADAPT_WEIGHT
static void read_ncobmc_mode(MACROBLOCKD *xd, MODE_INFO *mi,
#ifndef TRAINING_WEIGHTS
NCOBMC_MODE ncobmc_mode[2],
#else
NCOBMC_MODE ncobmc_mode[][4],
#endif
aom_reader *r) {
NCOBMC_MODE ncobmc_mode[2], aom_reader *r) {
MB_MODE_INFO *mbmi = &mi->mbmi;
FRAME_COUNTS *counts = xd->counts;
ADAPT_OVERLAP_BLOCK ao_block = adapt_overlap_block_lookup[mbmi->sb_type];
if (mbmi->motion_mode != NCOBMC_ADAPT_WEIGHT) return;
#ifndef TRAINING_WEIGHTS
ncobmc_mode[0] = aom_read_symbol(r, xd->tile_ctx->ncobmc_mode_cdf[ao_block],
MAX_NCOBMC_MODES, ACCT_STR);
if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[0]];
......@@ -373,24 +367,8 @@ static void read_ncobmc_mode(MACROBLOCKD *xd, MODE_INFO *mi,
MAX_NCOBMC_MODES, ACCT_STR);
if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[1]];
}
#else
int i;
for (i = 0; i < 4; ++i) {
ncobmc_mode[0][i] = aom_read_symbol(
r, xd->tile_ctx->ncobmc_mode_cdf[ao_block], MAX_NCOBMC_MODES, ACCT_STR);
if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[0][i]];
}
if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
for (i = 0; i < 4; ++i) {
ncobmc_mode[1][i] =
aom_read_symbol(r, xd->tile_ctx->ncobmc_mode_cdf[ao_block],
MAX_NCOBMC_MODES, ACCT_STR);
if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[1][i]];
}
}
#endif
}
#endif
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
......
......@@ -509,6 +509,9 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_GLOBAL_MOTION
0, cm->global_motion,
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_WARPED_MOTION
xd,
#endif
mi);
#else
MOTION_MODE last_motion_mode_allowed = motion_mode_allowed(
......@@ -547,25 +550,12 @@ static void write_ncobmc_mode(MACROBLOCKD *xd, const MODE_INFO *mi,
ADAPT_OVERLAP_BLOCK ao_block = adapt_overlap_block_lookup[mbmi->sb_type];
if (mbmi->motion_mode != NCOBMC_ADAPT_WEIGHT) return;
#ifndef TRAINING_WEIGHTS
aom_write_symbol(w, mbmi->ncobmc_mode[0],
xd->tile_ctx->ncobmc_mode_cdf[ao_block], MAX_NCOBMC_MODES);
if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
aom_write_symbol(w, mbmi->ncobmc_mode[1],
xd->tile_ctx->ncobmc_mode_cdf[ao_block], MAX_NCOBMC_MODES);
}
#else
int block;
for (block = 0; block < 4; ++block)
aom_write_symbol(w, mbmi->ncobmc_mode[0][block],
xd->tile_ctx->ncobmc_mode_cdf[ao_block], MAX_NCOBMC_MODES);
if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
for (block = 0; block < 4; ++block)
aom_write_symbol(w, mbmi->ncobmc_mode[1][block],
xd->tile_ctx->ncobmc_mode_cdf[ao_block],
MAX_NCOBMC_MODES);
}
#endif
}
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
......
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