Commit 85a8f70c authored by Wei-Ting Lin's avatar Wei-Ting Lin Committed by Wei-ting Lin

ncobmc_adapt_weight: Add bitstream syntax

Define the syntax and entropy coding templates for
NCOBMC_ADAPT_WEIGHT. The actual values of the default
probabilities and the index tree structure need to
be fine tuned.

In this experiment all mv's in a superblock are sent
first as in the ncobmc case.

Change-Id: I68d50d3d27346c2847ea449a1168c6a99fbb4d3d
parent 302d0970
......@@ -432,6 +432,13 @@ typedef struct MB_MODE_INFO {
MOTION_MODE motion_mode;
#if CONFIG_MOTION_VAR
int overlappable_neighbors[2];
#if CONFIG_NCOBMC_ADAPT_WEIGHT
// Applying different weighting kernels in ncobmc
// In current implementation, interpolation modes only defined for squared
// blocks. A rectangular block is divided into two squared blocks and each
// squared block has an interpolation mode.
NCOBMC_MODE ncobmc_mode[2];
#endif
#endif // CONFIG_MOTION_VAR
int_mv mv[2];
int_mv pred_mv[2];
......@@ -1362,6 +1369,15 @@ static INLINE MOTION_MODE motion_mode_allowed(
}
}
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
static INLINE NCOBMC_MODE ncobmc_mode_allowed(BLOCK_SIZE block) {
if (block < BLOCK_8X8 || block > BLOCK_64X64)
return NO_OVERLAP;
else
return (NCOBMC_MODE)(MAX_NCOBMC_MODES - 1);
}
#endif
static INLINE void assert_motion_mode_valid(MOTION_MODE mode,
#if CONFIG_GLOBAL_MOTION && SEPARATE_GLOBAL_MOTION
int block,
......
......@@ -1530,6 +1530,34 @@ static const int partition_supertx_context_lookup[PARTITION_TYPES] = { -1, 0, 0,
#endif // CONFIG_EXT_PARTITION_TYPES
#endif // CONFIG_SUPERTX
#if CONFIG_NCOBMC_ADAPT_WEIGHT
// NCOBMC_ADAPT_INTRPL only supports block size >= BLOCK_8X8 and <= BLOCK_64X64
static const ADAPT_OVERLAP_BLOCK adapt_overlap_block_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_2X2
ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_2X4
ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_4X2
#endif
ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_4X4
ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_4X8
ADAPT_OVERLAP_BLOCK_INVALID, // BLOCK_8X4
// the rest of the block sizes round to the largest squared block less than
// the given block size
ADAPT_OVERLAP_BLOCK_8X8, ADAPT_OVERLAP_BLOCK_8X8, ADAPT_OVERLAP_BLOCK_8X8,
ADAPT_OVERLAP_BLOCK_16X16, ADAPT_OVERLAP_BLOCK_16X16,
ADAPT_OVERLAP_BLOCK_16X16, ADAPT_OVERLAP_BLOCK_32X32,
ADAPT_OVERLAP_BLOCK_32X32, ADAPT_OVERLAP_BLOCK_32X32,
ADAPT_OVERLAP_BLOCK_64X64,
#if CONFIG_EXT_PARTITION
ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
ADAPT_OVERLAP_BLOCK_INVALID,
#endif // CONFIG_EXT_PARTITION
ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID
};
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#if CONFIG_ADAPT_SCAN
#define EOB_THRESHOLD_NUM 2
#endif
......
......@@ -1153,6 +1153,24 @@ static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
#endif // CONFIG_EXT_PARTITION
};
#if CONFIG_NCOBMC_ADAPT_WEIGHT
const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)] = {
-NO_OVERLAP, 2, -NCOBMC_MODE_1, 4,
-NCOBMC_MODE_2, 6, -NCOBMC_MODE_3, 8,
-NCOBMC_MODE_4, 10, -NCOBMC_MODE_5, 12,
-NCOBMC_MODE_6, 14, -NCOBMC_MODE_7, -NCOBMC_MODE_8
};
// TODO(weitinglin): find default prob
static const aom_prob
default_ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES - 1] = {
{ 23, 37, 37, 38, 65, 71, 81, 86 }, // 8x8
{ 28, 32, 37, 43, 51, 64, 85, 128 }, // 16X16 equal prob
{ 86, 22, 32, 25, 10, 40, 97, 65 }, // 32X32
{ 28, 32, 37, 43, 51, 64, 85, 128 } // 64X64 equal prob
};
#endif
#elif !CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
......@@ -4625,6 +4643,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
av1_copy(fc->motion_mode_prob, default_motion_mode_prob);
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
av1_copy(fc->ncobmc_mode_prob, default_ncobmc_mode_prob);
#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
av1_copy(fc->obmc_prob, default_obmc_prob);
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
......@@ -4870,6 +4891,11 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
aom_tree_merge_probs(av1_motion_mode_tree, pre_fc->motion_mode_prob[i],
counts->motion_mode[i], fc->motion_mode_prob[i]);
#if CONFIG_NCOBMC_ADAPT_WEIGHT
for (i = 0; i < ADAPT_OVERLAP_BLOCKS; ++i)
aom_tree_merge_probs(av1_ncobmc_mode_tree, pre_fc->ncobmc_mode_prob[i],
counts->ncobmc_mode[i], fc->ncobmc_mode_prob[i]);
#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
fc->obmc_prob[i] =
......
......@@ -208,6 +208,11 @@ typedef struct frame_contexts {
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
aom_prob motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1];
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
aom_prob ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES - 1];
#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
aom_prob obmc_prob[BLOCK_SIZES];
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
......@@ -388,6 +393,9 @@ typedef struct FRAME_COUNTS {
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
unsigned int motion_mode[BLOCK_SIZES][MOTION_MODES];
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
unsigned int ncobmc_mode[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES];
#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
unsigned int obmc[BLOCK_SIZES][2];
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
......@@ -531,7 +539,9 @@ extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)];
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
extern const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)];
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
extern const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)];
#endif
#if CONFIG_LOOP_RESTORATION
#define RESTORE_NONE_SGRPROJ_PROB 64
#define RESTORE_NONE_BILATERAL_PROB 16
......
......@@ -193,6 +193,22 @@ typedef enum ATTRIBUTE_PACKED {
#define MAX_NUM_TXB (1 << (MAX_SB_SIZE_LOG2 - MIN_TX_SIZE_LOG2))
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
typedef enum ATTRIBUTE_PACKED {
NO_OVERLAP,
NCOBMC_MODE_1,
NCOBMC_MODE_2,
NCOBMC_MODE_3,
NCOBMC_MODE_4,
NCOBMC_MODE_5,
NCOBMC_MODE_6,
NCOBMC_MODE_7,
NCOBMC_MODE_8,
MAX_NCOBMC_MODES
} NCOBMC_MODE;
// #define MAX_INTRPL_MODES 9
#endif
// frame transform mode
typedef enum {
ONLY_4X4 = 0, // only 4x4 transform used
......@@ -395,6 +411,17 @@ typedef enum {
MOTION_MODES
} MOTION_MODE;
#if CONFIG_NCOBMC_ADAPT_WEIGHT
typedef enum {
ADAPT_OVERLAP_BLOCK_8X8,
ADAPT_OVERLAP_BLOCK_16X16,
ADAPT_OVERLAP_BLOCK_32X32,
ADAPT_OVERLAP_BLOCK_64X64,
ADAPT_OVERLAP_BLOCKS,
ADAPT_OVERLAP_BLOCK_INVALID = 255
} ADAPT_OVERLAP_BLOCK;
#endif
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
typedef enum {
......
......@@ -2153,7 +2153,7 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
aom_merge_corrupted_flag(&xd->corrupted, reader_corrupted_flag);
}
#if CONFIG_NCOBMC && CONFIG_MOTION_VAR
#if (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT) && CONFIG_MOTION_VAR
static void detoken_and_recon_sb(AV1Decoder *const pbi, MACROBLOCKD *const xd,
int mi_row, int mi_col, aom_reader *r,
BLOCK_SIZE bsize) {
......@@ -2253,7 +2253,7 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd,
#endif
bsize);
#if !(CONFIG_MOTION_VAR && CONFIG_NCOBMC)
#if !(CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT))
#if CONFIG_SUPERTX
if (!supertx_enabled)
#endif // CONFIG_SUPERTX
......@@ -3883,7 +3883,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
#endif // CONFIG_SUPERTX
mi_row, mi_col, &td->bit_reader, cm->sb_size,
b_width_log2_lookup[cm->sb_size]);
#if CONFIG_NCOBMC && CONFIG_MOTION_VAR
#if (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT) && CONFIG_MOTION_VAR
detoken_and_recon_sb(pbi, &td->xd, mi_row, mi_col, &td->bit_reader,
cm->sb_size);
#endif
......@@ -4024,7 +4024,7 @@ static int tile_worker_hook(TileWorkerData *const tile_data,
#endif
mi_row, mi_col, &tile_data->bit_reader, cm->sb_size,
b_width_log2_lookup[cm->sb_size]);
#if CONFIG_NCOBMC && CONFIG_MOTION_VAR
#if (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT) && CONFIG_MOTION_VAR
detoken_and_recon_sb(pbi, &tile_data->xd, mi_row, mi_col,
&tile_data->bit_reader, cm->sb_size);
#endif
......@@ -5138,6 +5138,13 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
}
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
for (i = 0; i < ADAPT_OVERLAP_BLOCKS; ++i) {
for (j = 0; j < MAX_NCOBMC_MODES - 1; ++j)
av1_diff_update_prob(&r, &fc->ncobmc_mode_prob[i][j], ACCT_STR);
}
#endif
#if !CONFIG_EC_ADAPT
if (cm->interp_filter == SWITCHABLE) read_switchable_interp_probs(fc, &r);
#endif
......@@ -5227,6 +5234,10 @@ static void debug_check_frame_counts(const AV1_COMMON *const cm) {
assert(!memcmp(cm->counts.motion_mode, zero_counts.motion_mode,
sizeof(cm->counts.motion_mode)));
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
assert(!memcmp(cm->counts.ncobmc_mode, zero_counts.ncobmc_mode,
sizeof(cm->counts.ncobmc_mode)));
#endif
assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter,
sizeof(cm->counts.intra_inter)));
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
......
......@@ -330,6 +330,29 @@ static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
}
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
}
#if CONFIG_NCOBMC_ADAPT_WEIGHT
static void read_ncobmc_mode(AV1_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *mi,
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 (ncobmc_mode_allowed(mbmi->sb_type) == NO_OVERLAP ||
ao_block == ADAPT_OVERLAP_BLOCK_INVALID)
return;
ncobmc_mode[0] = aom_read_tree(r, av1_ncobmc_mode_tree,
cm->fc->ncobmc_mode_prob[ao_block], ACCT_STR);
if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[0]];
if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
ncobmc_mode[1] = aom_read_tree(
r, av1_ncobmc_mode_tree, cm->fc->ncobmc_mode_prob[ao_block], ACCT_STR);
if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[1]];
}
}
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
......@@ -2544,6 +2567,11 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER
mbmi->motion_mode = read_motion_mode(cm, xd, mi, r);
#if CONFIG_NCOBMC_ADAPT_WEIGHT
read_ncobmc_mode(cm, xd, mi, mbmi->ncobmc_mode, r);
#endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
if (is_singleref_comp_mode) assert(mbmi->motion_mode == SIMPLE_TRANSLATION);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
......
......@@ -118,6 +118,9 @@ static struct av1_token compound_type_encodings[COMPOUND_TYPES];
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static struct av1_token motion_mode_encodings[MOTION_MODES];
#if CONFIG_NCOBMC_ADAPT_WEIGHT
static struct av1_token ncobmc_mode_encodings[MAX_NCOBMC_MODES];
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_LOOP_RESTORATION
static struct av1_token switchable_restore_encodings[RESTORE_SWITCHABLE_TYPES];
......@@ -174,6 +177,9 @@ void av1_encode_token_init(void) {
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
av1_tokens_from_tree(motion_mode_encodings, av1_motion_mode_tree);
#if CONFIG_NCOBMC_ADAPT_WEIGHT
av1_tokens_from_tree(ncobmc_mode_encodings, av1_ncobmc_mode_tree);
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_LOOP_RESTORATION
av1_tokens_from_tree(switchable_restore_encodings,
......@@ -351,7 +357,7 @@ static void encode_unsigned_max(struct aom_write_bit_buffer *wb, int data,
(CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION || CONFIG_EXT_INTER)
static void prob_diff_update(const aom_tree_index *tree,
aom_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/], int n,
const unsigned int counts[/* n */], int n,
int probwt, aom_writer *w) {
int i;
unsigned int branch_ct[32][2];
......@@ -611,6 +617,25 @@ static void write_motion_mode(const AV1_COMMON *cm, const MODE_INFO *mi,
}
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
}
#if CONFIG_NCOBMC_ADAPT_WEIGHT
static void write_ncobmc_mode(const AV1_COMMON *cm, const MODE_INFO *mi,
aom_writer *w) {
const MB_MODE_INFO *mbmi = &mi->mbmi;
ADAPT_OVERLAP_BLOCK ao_block = adapt_overlap_block_lookup[mbmi->sb_type];
if (ncobmc_mode_allowed(mbmi->sb_type) == NO_OVERLAP ||
ao_block == ADAPT_OVERLAP_BLOCK_INVALID)
return;
av1_write_token(w, av1_ncobmc_mode_tree, cm->fc->ncobmc_mode_prob[ao_block],
&ncobmc_mode_encodings[mbmi->ncobmc_mode[0]]);
if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
av1_write_token(w, av1_ncobmc_mode_tree, cm->fc->ncobmc_mode_prob[ao_block],
&ncobmc_mode_encodings[mbmi->ncobmc_mode[1]]);
}
}
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_DELTA_Q
......@@ -2212,6 +2237,9 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
if (mbmi->ref_frame[1] != INTRA_FRAME)
#endif // CONFIG_EXT_INTER
write_motion_mode(cm, mi, w);
#if CONFIG_NCOBMC_ADAPT_WEIGHT
write_ncobmc_mode(cm, mi, w);
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
......@@ -2853,7 +2881,7 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
#endif // CONFIG_COEF_INTERLEAVE
}
#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
#if CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
static void write_tokens_sb(AV1_COMP *cpi, const TileInfo *const tile,
aom_writer *w, const TOKENEXTRA **tok,
const TOKENEXTRA *const tok_end, int mi_row,
......@@ -2939,7 +2967,7 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
supertx_enabled,
#endif
mi_row, mi_col);
#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
#if CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
(void)tok;
(void)tok_end;
#else
......@@ -3270,7 +3298,7 @@ static void write_modes(AV1_COMP *const cpi, const TileInfo *const tile,
for (mi_col = mi_col_start; mi_col < mi_col_end; mi_col += cm->mib_size) {
write_modes_sb_wrapper(cpi, tile, w, tok, tok_end, 0, mi_row, mi_col,
cm->sb_size);
#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
#if CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
write_tokens_sb(cpi, tile, w, tok, tok_end, mi_row, mi_col, cm->sb_size);
#endif
}
......@@ -5103,6 +5131,13 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i)
prob_diff_update(av1_motion_mode_tree, fc->motion_mode_prob[i],
counts->motion_mode[i], MOTION_MODES, probwt, header_bc);
#if CONFIG_NCOBMC_ADAPT_WEIGHT
for (i = ADAPT_OVERLAP_BLOCK_8X8; i < ADAPT_OVERLAP_BLOCKS; ++i) {
prob_diff_update(av1_ncobmc_mode_tree, fc->ncobmc_mode_prob[i],
counts->ncobmc_mode[i], MAX_NCOBMC_MODES, probwt,
header_bc);
}
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if !CONFIG_EC_ADAPT
if (cm->interp_filter == SWITCHABLE)
......
......@@ -1158,7 +1158,7 @@ static void update_supertx_param_sb(const AV1_COMP *const cpi, ThreadData *td,
}
#endif // CONFIG_SUPERTX
#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
#if CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
static void set_mode_info_b(const AV1_COMP *const cpi,
const TileInfo *const tile, ThreadData *td,
int mi_row, int mi_col, BLOCK_SIZE bsize,
......@@ -1723,6 +1723,18 @@ static void update_stats(const AV1_COMMON *const cm, ThreadData *td, int mi_row,
if (motion_allowed > SIMPLE_TRANSLATION)
counts->motion_mode[mbmi->sb_type][mbmi->motion_mode]++;
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
if (ncobmc_mode_allowed(mbmi->sb_type) > NO_OVERLAP) {
ADAPT_OVERLAP_BLOCK ao_block =
adapt_overlap_block_lookup[mbmi->sb_type];
++counts->ncobmc_mode[ao_block][mbmi->ncobmc_mode[0]];
if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
++counts->ncobmc_mode[ao_block][mbmi->ncobmc_mode[1]];
}
}
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
......
......@@ -7755,6 +7755,7 @@ static int64_t motion_mode_rd(
int mi_col, HandleInterModeArgs *const args, const int64_t ref_best_rd,
const int *refs, int rate_mv,
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
// only used when WARPED_MOTION is on?
int_mv *const single_newmv,
#if CONFIG_EXT_INTER
int rate2_bmc_nocoeff, MB_MODE_INFO *best_bmc_mbmi, int rate_mv_bmc,
......@@ -8217,6 +8218,11 @@ static int64_t handle_inter_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
int skip_txfm_sb = 0;
int64_t skip_sse_sb = INT64_MAX;
int16_t mode_ctx;
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
// dummy fillers
mbmi->ncobmc_mode[0] = NO_OVERLAP;
mbmi->ncobmc_mode[1] = NO_OVERLAP;
#endif
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
......
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