Commit d9b5726f authored by Thomas Davies's avatar Thomas Davies

NEW_MULTISYMBOL: adapt obmc syntax.

Change-Id: Iea00482779cd3fdc7f354d5c39684dd0752d0849
parent d1b8c2a3
......@@ -5703,9 +5703,10 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
AVERAGE_TILE_CDFS(drl_cdf)
#endif
// FIXME: cdfs not defined for motion_mode_prob, obmc_prob
// FIXME: cdfs not defined for motion_mode_prob
// FIXME: cdfs not defined for super_tx
#if CONFIG_EXT_INTER
AVERAGE_TILE_CDFS(inter_compound_mode_cdf)
......@@ -5731,6 +5732,9 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
}
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(intra_inter_cdf)
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
AVERAGE_TILE_CDFS(obmc_cdf)
#endif
#endif
}
......
......@@ -1390,6 +1390,34 @@ static const aom_prob default_obmc_prob[BLOCK_SIZES] = {
252, 252, 252,
#endif // CONFIG_EXT_PARTITION
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_obmc_cdf[BLOCK_SIZES][CDF_SIZE(2)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif
#if CONFIG_DELTA_Q
......@@ -4905,6 +4933,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
av1_copy(fc->obmc_prob, default_obmc_prob);
#if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->obmc_cdf, default_obmc_cdf);
#endif
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
......
......@@ -230,6 +230,9 @@ typedef struct frame_contexts {
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
aom_prob obmc_prob[BLOCK_SIZES];
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob obmc_cdf[BLOCK_SIZES][CDF_SIZE(2)];
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
aom_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
......
......@@ -342,7 +342,12 @@ static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return SIMPLE_TRANSLATION;
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
if (last_motion_mode_allowed == OBMC_CAUSAL) {
#if CONFIG_NEW_MULTISYMBOL
motion_mode =
aom_read_symbol(r, xd->tile_ctx->obmc_cdf[mbmi->sb_type], 2, ACCT_STR);
#else
motion_mode = aom_read(r, cm->fc->obmc_prob[mbmi->sb_type], ACCT_STR);
#endif
if (counts) ++counts->obmc[mbmi->sb_type][motion_mode];
return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
} else {
......
......@@ -609,9 +609,13 @@ static void write_is_inter(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static void write_motion_mode(const AV1_COMMON *cm, const MODE_INFO *mi,
aom_writer *w) {
static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
const MODE_INFO *mi, aom_writer *w) {
const MB_MODE_INFO *mbmi = &mi->mbmi;
#if !CONFIG_NEW_MULTISYMBOL
(void)xd;
#endif
#if CONFIG_NCOBMC_ADAPT_WEIGHT
MOTION_MODE last_motion_mode_allowed =
motion_mode_allowed_wrapper(0,
......@@ -629,8 +633,13 @@ static void write_motion_mode(const AV1_COMMON *cm, const MODE_INFO *mi,
if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return;
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
if (last_motion_mode_allowed == OBMC_CAUSAL) {
#if CONFIG_NEW_MULTISYMBOL
aom_write_symbol(w, mbmi->motion_mode == OBMC_CAUSAL,
xd->tile_ctx->obmc_cdf[mbmi->sb_type], 2);
#else
aom_write(w, mbmi->motion_mode == OBMC_CAUSAL,
cm->fc->obmc_prob[mbmi->sb_type]);
#endif
} else {
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
av1_write_token(w, av1_motion_mode_tree,
......@@ -2281,7 +2290,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
#if CONFIG_EXT_INTER
if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER
write_motion_mode(cm, mi, w);
write_motion_mode(cm, xd, mi, w);
#if CONFIG_NCOBMC_ADAPT_WEIGHT
write_ncobmc_mode(cm, mi, w);
#endif
......
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