Commit 0cf54d40 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove abandonned SUPERTX experiment

Change-Id: I9d3f0380865790d8adcb85f03305b193bc1949d7
parent 365e644a
This diff is collapsed.
......@@ -360,10 +360,6 @@ typedef struct MB_MODE_INFO {
#endif
int8_t skip;
int8_t segment_id;
#if CONFIG_SUPERTX
// Minimum of all segment IDs under the current supertx block.
int8_t segment_id_supertx;
#endif // CONFIG_SUPERTX
int8_t seg_id_predicted; // valid only when temporal_update is enabled
#if CONFIG_MRC_TX
......@@ -759,9 +755,6 @@ typedef struct macroblockd {
TXFM_CONTEXT left_txfm_context_buffer[2 * MAX_MIB_SIZE];
TX_SIZE max_tx_size;
#if CONFIG_SUPERTX
TX_SIZE supertx_size;
#endif
#endif
#if CONFIG_LOOP_RESTORATION
......@@ -877,14 +870,6 @@ static const TX_TYPE intra_mode_to_tx_type_context[INTRA_MODES] = {
ADST_ADST, // PAETH
};
#if CONFIG_SUPERTX
static INLINE int supertx_enabled(const MB_MODE_INFO *mbmi) {
TX_SIZE max_tx_size = txsize_sqr_map[mbmi->tx_size];
return tx_size_wide[max_tx_size] >
AOMMIN(block_size_wide[mbmi->sb_type], block_size_high[mbmi->sb_type]);
}
#endif // CONFIG_SUPERTX
#define USE_TXTYPE_SEARCH_FOR_SUB8X8_IN_CB4X4 1
#if CONFIG_RECT_TX
......@@ -1387,12 +1372,6 @@ static INLINE TX_SIZE av1_get_uv_tx_size(const MB_MODE_INFO *mbmi,
assert(mbmi->tx_size > TX_2X2);
#endif // CONFIG_CHROMA_2X2
#if CONFIG_SUPERTX
if (supertx_enabled(mbmi))
return uvsupertx_size_lookup[txsize_sqr_map[mbmi->tx_size]]
[pd->subsampling_x][pd->subsampling_y];
#endif // CONFIG_SUPERTX
const TX_SIZE uv_txsize =
uv_txsize_lookup[mbmi->sb_type][mbmi->tx_size][pd->subsampling_x]
[pd->subsampling_y];
......
......@@ -2119,33 +2119,6 @@ static const int intra_mode_context[INTRA_MODES] = {
};
#endif
#if CONFIG_SUPERTX
static const TX_SIZE uvsupertx_size_lookup[TX_SIZES][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
#if CONFIG_CHROMA_2X2
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_16X16, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_32X32, TX_16X16 }, { TX_16X16, TX_16X16 } },
#if CONFIG_TX64X64
{ { TX_64X64, TX_32X32 }, { TX_32X32, TX_32X32 } },
#endif // CONFIG_TX64X64
};
#if CONFIG_EXT_PARTITION_TYPES
static const int partition_supertx_context_lookup[EXT_PARTITION_TYPES] = {
-1, 0, 0, 1, 0, 0, 0, 0, 0, 0
};
#else
static const int partition_supertx_context_lookup[PARTITION_TYPES] = { -1, 0, 0,
1 };
#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] = {
......
......@@ -2654,25 +2654,6 @@ static const aom_cdf_prob
};
#endif // CONFIG_FILTER_INTRA
#if CONFIG_SUPERTX
static const aom_prob
default_supertx_prob[PARTITION_SUPERTX_CONTEXTS][TX_SIZES] = {
#if CONFIG_CHROMA_2X2
#if CONFIG_TX64X64
{ 1, 1, 160, 160, 170, 180 }, { 1, 1, 200, 200, 210, 220 },
#else
{ 1, 1, 160, 160, 170 }, { 1, 1, 200, 200, 210 },
#endif // CONFIG_TX64X64
#else
#if CONFIG_TX64X64
{ 1, 160, 160, 170, 180 }, { 1, 200, 200, 210, 220 },
#else
{ 1, 160, 160, 170 }, { 1, 200, 200, 210 },
#endif // CONFIG_TX64X64
#endif // CONFIG_CHROMA_2X2
};
#endif // CONFIG_SUPERTX
// FIXME(someone) need real defaults here
static const aom_prob default_segment_tree_probs[SEG_TREE_PROBS] = {
128, 128, 128, 128, 128, 128, 128
......@@ -6565,9 +6546,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->interintra_mode_prob, default_interintra_mode_prob);
av1_copy(fc->interintra_mode_cdf, default_interintra_mode_cdf);
#endif // CONFIG_INTERINTRA
#if CONFIG_SUPERTX
av1_copy(fc->supertx_prob, default_supertx_prob);
#endif // CONFIG_SUPERTX
av1_copy(fc->seg.tree_probs, default_segment_tree_probs);
av1_copy(fc->seg.pred_probs, default_segment_pred_probs);
#if CONFIG_NEW_MULTISYMBOL
......@@ -6704,15 +6682,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_SUPERTX
for (i = 0; i < PARTITION_SUPERTX_CONTEXTS; ++i) {
for (j = TX_8X8; j < TX_SIZES; ++j) {
fc->supertx_prob[i][j] = av1_mode_mv_merge_probs(
pre_fc->supertx_prob[i][j], counts->supertx[i][j]);
}
}
#endif // CONFIG_SUPERTX
for (i = 0; i < INTER_MODE_CONTEXTS; i++)
aom_tree_merge_probs(
av1_inter_compound_mode_tree, pre_fc->inter_compound_mode_probs[i],
......
......@@ -326,9 +326,6 @@ typedef struct frame_contexts {
aom_cdf_prob intrabc_cdf[CDF_SIZE(2)];
#endif
int initialized;
#if CONFIG_SUPERTX
aom_prob supertx_prob[PARTITION_SUPERTX_CONTEXTS][TX_SIZES];
#endif // CONFIG_SUPERTX
struct segmentation_probs seg;
#if CONFIG_FILTER_INTRA
aom_prob filter_intra_probs[PLANE_TYPES];
......@@ -541,10 +538,6 @@ typedef struct FRAME_COUNTS {
unsigned int inter_ext_tx[EXT_TX_SIZES][TX_TYPES];
#endif // CONFIG_EXT_TX
#endif // CONFIG_ENTROPY_STATS
#if CONFIG_SUPERTX
unsigned int supertx[PARTITION_SUPERTX_CONTEXTS][TX_SIZES][2];
unsigned int supertx_size[TX_SIZES];
#endif // CONFIG_SUPERTX
struct seg_counts seg;
#if CONFIG_FILTER_INTRA
unsigned int filter_intra[PLANE_TYPES][2];
......
......@@ -712,11 +712,6 @@ typedef enum {
#define MODE_CTX_REF_FRAMES (TOTAL_REFS_PER_FRAME + COMP_REFS)
#if CONFIG_SUPERTX
#define PARTITION_SUPERTX_CONTEXTS 2
#define MAX_SUPERTX_BLOCK_SIZE BLOCK_32X32
#endif // CONFIG_SUPERTX
#if CONFIG_LOOP_RESTORATION
typedef enum {
RESTORE_NONE,
......
......@@ -914,20 +914,6 @@ static INLINE int is_chroma_reference(int mi_row, int mi_col, BLOCK_SIZE bsize,
#endif
}
#if CONFIG_SUPERTX
static INLINE int need_handle_chroma_sub8x8(BLOCK_SIZE bsize, int subsampling_x,
int subsampling_y) {
const int bw = mi_size_wide[bsize];
const int bh = mi_size_high[bsize];
if (bsize >= BLOCK_8X8 ||
((!(bh & 0x01) || !subsampling_y) && (!(bw & 0x01) || !subsampling_x)))
return 0;
else
return 1;
}
#endif
static INLINE BLOCK_SIZE scale_chroma_bsize(BLOCK_SIZE bsize, int subsampling_x,
int subsampling_y) {
BLOCK_SIZE bs = bsize;
......
This diff is collapsed.
......@@ -286,9 +286,6 @@ void av1_make_masked_inter_predictor(
const int subpel_x, const int subpel_y, const struct scale_factors *sf,
int w, int h, ConvolveParams *conv_params, InterpFilters interp_filters,
int xs, int ys,
#if CONFIG_SUPERTX
int wedge_offset_x, int wedge_offset_y,
#endif // CONFIG_SUPERTX
#if CONFIG_GLOBAL_MOTION || CONFIG_WARPED_MOTION || CONFIG_COMPOUND_SEGMENT
int plane,
#endif
......@@ -375,25 +372,6 @@ void av1_build_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col, BUFFER_SET *ctx,
BLOCK_SIZE bsize);
#if CONFIG_SUPERTX
void av1_build_inter_predictor_sb_sub8x8_extend(const AV1_COMMON *cm,
MACROBLOCKD *xd, int mi_row_ori,
int mi_col_ori, int mi_row,
int mi_col, int plane,
BLOCK_SIZE bsize, int block);
void av1_build_inter_predictor_sb_extend(const AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row_ori, int mi_col_ori,
int mi_row, int mi_col, int plane,
BLOCK_SIZE bsize);
struct macroblockd_plane;
void av1_build_masked_inter_predictor_complex(
MACROBLOCKD *xd, uint8_t *dst, int dst_stride, const uint8_t *pre,
int pre_stride, int mi_row, int mi_col, int mi_row_ori, int mi_col_ori,
BLOCK_SIZE bsize, BLOCK_SIZE top_bsize, PARTITION_TYPE partition,
int plane);
#endif // CONFIG_SUPERTX
void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, const MV *src_mv,
const struct scale_factors *sf, int w, int h,
......@@ -631,13 +609,12 @@ void av1_combine_interintra(MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane,
void av1_build_inter_predictors_for_planes_single_buf(
MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane_from, int plane_to, int mi_row,
int mi_col, int ref, uint8_t *ext_dst[3], int ext_dst_stride[3]);
void av1_build_wedge_inter_predictor_from_buf(
MACROBLOCKD *xd, BLOCK_SIZE bsize, int plane_from, int plane_to,
#if CONFIG_SUPERTX
int wedge_offset_x, int wedge_offset_y,
#endif // CONFIG_SUPERTX
uint8_t *ext_dst0[3], int ext_dst_stride0[3], uint8_t *ext_dst1[3],
int ext_dst_stride1[3]);
void av1_build_wedge_inter_predictor_from_buf(MACROBLOCKD *xd, BLOCK_SIZE bsize,
int plane_from, int plane_to,
uint8_t *ext_dst0[3],
int ext_dst_stride0[3],
uint8_t *ext_dst1[3],
int ext_dst_stride1[3]);
#if CONFIG_NCOBMC_ADAPT_WEIGHT
#define ASSIGN_ALIGNED_PTRS(p, a, s) \
......
This diff is collapsed.
This diff is collapsed.
......@@ -21,9 +21,6 @@ extern "C" {
#endif
void av1_read_mode_info(AV1Decoder *const pbi, MACROBLOCKD *xd,
#if CONFIG_SUPERTX
int supertx_enabled,
#endif
int mi_row, int mi_col, aom_reader *r, int x_mis,
int y_mis);
......@@ -33,9 +30,6 @@ void av1_read_mode_info(AV1Decoder *const pbi, MACROBLOCKD *xd,
#endif
void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#if CONFIG_SUPERTX
int supertx_enabled,
#endif
#if CONFIG_TXK_SEL
int blk_row, int blk_col, int block, int plane,
TX_SIZE tx_size,
......
This diff is collapsed.
......@@ -36,9 +36,6 @@ static INLINE int av1_preserve_existing_gf(AV1_COMP *cpi) {
}
void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
#if CONFIG_SUPERTX
const int supertx_enabled,
#endif
#if CONFIG_TXK_SEL
int blk_row, int blk_col, int block, int plane,
TX_SIZE tx_size,
......
......@@ -130,24 +130,10 @@ static void alloc_tree_contexts(AV1_COMMON *cm, PC_TREE *tree, int num_pix) {
&tree->horizontal4[i]);
alloc_mode_context(cm, num_pix / 4, PARTITION_HORZ_4, &tree->vertical4[i]);
}
#if CONFIG_SUPERTX
alloc_mode_context(cm, num_pix, PARTITION_HORZ, &tree->horizontal_supertx);
alloc_mode_context(cm, num_pix, PARTITION_VERT, &tree->vertical_supertx);
alloc_mode_context(cm, num_pix, PARTITION_SPLIT, &tree->split_supertx);
alloc_mode_context(cm, num_pix, PARTITION_HORZ_A, &tree->horizontala_supertx);
alloc_mode_context(cm, num_pix, PARTITION_HORZ_B, &tree->horizontalb_supertx);
alloc_mode_context(cm, num_pix, PARTITION_VERT_A, &tree->verticala_supertx);
alloc_mode_context(cm, num_pix, PARTITION_VERT_B, &tree->verticalb_supertx);
#endif // CONFIG_SUPERTX
#else
alloc_mode_context(cm, num_pix, &tree->none);
alloc_mode_context(cm, num_pix / 2, &tree->horizontal[0]);
alloc_mode_context(cm, num_pix / 2, &tree->vertical[0]);
#if CONFIG_SUPERTX
alloc_mode_context(cm, num_pix, &tree->horizontal_supertx);
alloc_mode_context(cm, num_pix, &tree->vertical_supertx);
alloc_mode_context(cm, num_pix, &tree->split_supertx);
#endif
if (num_pix > 16) {
alloc_mode_context(cm, num_pix / 2, &tree->horizontal[1]);
......@@ -178,17 +164,6 @@ static void free_tree_contexts(PC_TREE *tree) {
free_mode_context(&tree->horizontal[1]);
free_mode_context(&tree->vertical[0]);
free_mode_context(&tree->vertical[1]);
#if CONFIG_SUPERTX
free_mode_context(&tree->horizontal_supertx);
free_mode_context(&tree->vertical_supertx);
free_mode_context(&tree->split_supertx);
#if CONFIG_EXT_PARTITION_TYPES
free_mode_context(&tree->horizontala_supertx);
free_mode_context(&tree->horizontalb_supertx);
free_mode_context(&tree->verticala_supertx);
free_mode_context(&tree->verticalb_supertx);
#endif // CONFIG_EXT_PARTITION_TYPES
#endif // CONFIG_SUPERTX
}
// This function sets up a tree of contexts such that at each square
......
......@@ -90,17 +90,6 @@ typedef struct PC_TREE {
struct PC_TREE *split[4];
PICK_MODE_CONTEXT *leaf_split[4];
};
#if CONFIG_SUPERTX
PICK_MODE_CONTEXT horizontal_supertx;
PICK_MODE_CONTEXT vertical_supertx;
PICK_MODE_CONTEXT split_supertx;
#if CONFIG_EXT_PARTITION_TYPES
PICK_MODE_CONTEXT horizontala_supertx;
PICK_MODE_CONTEXT horizontalb_supertx;
PICK_MODE_CONTEXT verticala_supertx;
PICK_MODE_CONTEXT verticalb_supertx;
#endif
#endif
} PC_TREE;
void av1_setup_pc_tree(struct AV1Common *cm, struct ThreadData *td);
......
This diff is collapsed.
......@@ -989,34 +989,6 @@ void av1_encode_sb(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row,
}
}
#if CONFIG_SUPERTX
void av1_encode_sb_supertx(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize) {
MACROBLOCKD *const xd = &x->e_mbd;
struct optimize_ctx ctx;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
struct encode_b_args arg = { cm, x, &ctx, &mbmi->skip, NULL, NULL, 1 };
int plane;
mbmi->skip = 1;
if (x->skip) return;
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
#if CONFIG_VAR_TX
const TX_SIZE tx_size = TX_4X4;
#else
const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
#endif
av1_subtract_plane(x, bsize, plane);
av1_get_entropy_contexts(bsize, tx_size, pd, ctx.ta[plane], ctx.tl[plane]);
arg.ta = ctx.ta[plane];
arg.tl = ctx.tl[plane];
av1_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block,
&arg);
}
}
#endif // CONFIG_SUPERTX
#if !CONFIG_PVQ
void av1_set_txb_context(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) {
......
......@@ -45,9 +45,6 @@ typedef enum AV1_XFORM_QUANT {
void av1_encode_sb(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row,
int mi_col);
#if CONFIG_SUPERTX
void av1_encode_sb_supertx(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize);
#endif // CONFIG_SUPERTX
void av1_encode_sby_pass1(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize);
void av1_xform_quant(const AV1_COMMON *cm, MACROBLOCK *x, int plane, int block,
int blk_row, int blk_col, BLOCK_SIZE plane_bsize,
......
......@@ -687,9 +687,6 @@ void av1_first_pass(AV1_COMP *cpi, const struct lookahead_entry *source) {
// Do intra 16x16 prediction.
xd->mi[0]->mbmi.segment_id = 0;
#if CONFIG_SUPERTX
xd->mi[0]->mbmi.segment_id_supertx = 0;
#endif // CONFIG_SUPERTX
xd->lossless[xd->mi[0]->mbmi.segment_id] = (qindex == 0);
xd->mi[0]->mbmi.mode = DC_PRED;
xd->mi[0]->mbmi.tx_size =
......
......@@ -1414,10 +1414,10 @@ static int cost_coeffs(const AV1_COMMON *const cm, MACROBLOCK *x, int plane,
const int cat6_bits = av1_get_cat6_extrabits_size(tx_size, 8);
#endif // CONFIG_HIGHBITDEPTH
#if !CONFIG_VAR_TX && !CONFIG_SUPERTX
#if !CONFIG_VAR_TX
// Check for consistency of tx_size with mode info
assert(tx_size == av1_get_tx_size(plane, xd));
#endif // !CONFIG_VAR_TX && !CONFIG_SUPERTX
#endif // !CONFIG_VAR_TX
(void)cm;
if (eob == 0) {
......@@ -1870,9 +1870,9 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
x->tune_metric != AOM_TUNE_PSNR;
#endif // CONFIG_DIST_8X8
#if !CONFIG_SUPERTX && !CONFIG_VAR_TX
#if !CONFIG_VAR_TX
assert(tx_size == av1_get_tx_size(plane, xd));
#endif // !CONFIG_SUPERTX
#endif // !CONFIG_VAR_TX
av1_init_rd_stats(&this_rd_stats);
......@@ -2129,46 +2129,6 @@ static void txfm_rd_in_plane(MACROBLOCK *x, const AV1_COMP *cpi,
}
}
#if CONFIG_SUPERTX
void av1_txfm_rd_in_plane_supertx(MACROBLOCK *x, const AV1_COMP *cpi, int *rate,
int64_t *distortion, int *skippable,
int64_t *sse, int64_t ref_best_rd, int plane,
BLOCK_SIZE bsize, TX_SIZE tx_size,
int use_fast_coef_casting) {
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblockd_plane *const pd = &xd->plane[plane];
struct rdcost_block_args args;
av1_zero(args);
args.cpi = cpi;
args.x = x;
args.best_rd = ref_best_rd;
args.use_fast_coef_costing = use_fast_coef_casting;
#if CONFIG_EXT_TX
assert(tx_size < TX_SIZES);
#endif // CONFIG_EXT_TX
if (plane == 0) xd->mi[0]->mbmi.tx_size = tx_size;
av1_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
block_rd_txfm(plane, 0, 0, 0, get_plane_block_size(bsize, pd), tx_size,
&args);
if (args.exit_early) {
*rate = INT_MAX;
*distortion = INT64_MAX;
*sse = INT64_MAX;
*skippable = 0;
} else {
*distortion = args.rd_stats.dist;
*rate = args.rd_stats.rate;
*sse = args.rd_stats.sse;
*skippable = !x->plane[plane].eobs[0];
}
}
#endif // CONFIG_SUPERTX
static int tx_size_cost(const AV1_COMP *const cpi, const MACROBLOCK *const x,
BLOCK_SIZE bsize, TX_SIZE tx_size) {
const AV1_COMMON *const cm = &cpi->common;
......@@ -8278,12 +8238,8 @@ static int64_t build_and_cost_compound_type(
mbmi->mv[0].as_int = cur_mv[0].as_int;
mbmi->mv[1].as_int = cur_mv[1].as_int;
*out_rate_mv = rate_mv;
av1_build_wedge_inter_predictor_from_buf(xd, bsize, 0, 0,
#if CONFIG_SUPERTX
0, 0,
#endif // CONFIG_SUPERTX
preds0, strides, preds1,
strides);
av1_build_wedge_inter_predictor_from_buf(xd, bsize, 0, 0, preds0, strides,
preds1, strides);
}
av1_subtract_plane(x, bsize, 0);
rd = estimate_yrd_for_sb(cpi, bsize, x, &rate_sum, &dist_sum,
......@@ -8293,11 +8249,8 @@ static int64_t build_and_cost_compound_type(
best_rd_cur = rd;
} else {
av1_build_wedge_inter_predictor_from_buf(xd, bsize, 0, 0,
#if CONFIG_SUPERTX
0, 0,
#endif // CONFIG_SUPERTX
preds0, strides, preds1, strides);
av1_build_wedge_inter_predictor_from_buf(xd, bsize, 0, 0, preds0, strides,
preds1, strides);
av1_subtract_plane(x, bsize, 0);
rd = estimate_yrd_for_sb(cpi, bsize, x, &rate_sum, &dist_sum,
&tmp_skip_txfm_sb, &tmp_skip_sse_sb, INT64_MAX);
......@@ -10065,11 +10018,8 @@ static void pick_filter_intra_interframe(
PALETTE_MODE_INFO *pmi_uv, int palette_ctx, int skip_mask,
unsigned int *ref_costs_single, int64_t *best_rd, int64_t *best_intra_rd,
PREDICTION_MODE *best_intra_mode, int *best_mode_index, int *best_skip2,
int *best_mode_skippable,
#if CONFIG_SUPERTX
int *returnrate_nocoef,
#endif // CONFIG_SUPERTX
int64_t *best_pred_rd, MB_MODE_INFO *best_mbmode, RD_STATS *rd_cost) {
int *best_mode_skippable, int64_t *best_pred_rd, MB_MODE_INFO *best_mbmode,
RD_STATS *rd_cost) {
const AV1_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
......@@ -10197,15 +10147,6 @@ static void pick_filter_intra_interframe(
*best_mode_index = dc_mode_index;
mbmi->mv[0].as_int = 0;
rd_cost->rate = rate2;
#if CONFIG_SUPERTX
if (x->skip)
*returnrate_nocoef = rate2;
else
*returnrate_nocoef = rate2 - rate_y - rate_uv;
*returnrate_nocoef -= av1_cost_bit(av1_get_skip_prob(cm, xd), skippable);
*returnrate_nocoef -= av1_cost_bit(av1_get_intra_inter_prob(cm, xd),
mbmi->ref_frame[0] != INTRA_FRAME);
#endif // CONFIG_SUPERTX
rd_cost->dist = distortion2;
rd_cost->rdcost = this_rd;
*best_rd = this_rd;
......@@ -10226,12 +10167,8 @@ static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x,
void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
MACROBLOCK *x, int mi_row, int mi_col,
RD_STATS *rd_cost,
#if CONFIG_SUPERTX
int *returnrate_nocoef,
#endif // CONFIG_SUPERTX
BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
int64_t best_rd_so_far) {
RD_STATS *rd_cost, BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx, int64_t best_rd_so_far) {
const AV1_COMMON *const cm = &cpi->common;
const RD_OPT *const rd_opt = &cpi->rd;
const SPEED_FEATURES *const sf = &cpi->sf;
......@@ -10388,9 +10325,6 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
}
rd_cost->rate = INT_MAX;
#if CONFIG_SUPERTX
*returnrate_nocoef = INT_MAX;
#endif // CONFIG_SUPERTX
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
x->pred_mv_sad[ref_frame] = INT_MAX;
......@@ -11455,38 +11389,6 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
}
rd_cost->rate = rate2;
#if CONFIG_SUPERTX
if (x->skip)
*returnrate_nocoef = rate2;
else
*returnrate_nocoef = rate2 - rate_y - rate_uv;
*returnrate_nocoef -= av1_cost_bit(
av1_get_skip_prob(cm, xd), disable_skip || skippable || this_skip2);
*returnrate_nocoef -= av1_cost_bit(av1_get_intra_inter_prob(cm, xd),
mbmi->ref_frame[0] != INTRA_FRAME);
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
MODE_INFO *const mi = xd->mi[0];
const MOTION_MODE motion_allowed = motion_mode_allowed(
#if CONFIG_GLOBAL_MOTION
0, xd->global_motion,
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_WARPED_MOTION
xd,
#endif
mi);
if (motion_allowed == WARPED_CAUSAL)
*returnrate_nocoef -= x->motion_mode_cost[bsize][mbmi->motion_mode];
else if (motion_allowed == OBMC_CAUSAL)
*returnrate_nocoef -= x->motion_mode_cost1[bsize][mbmi->motion_mode];
#else
*returnrate_nocoef -= x->motion_mode_cost[bsize][mbmi->motion_mode];
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#endif // CONFIG_SUPERTX
rd_cost->dist = distortion2;
rd_cost->rdcost = this_rd;
best_rd = this_rd;
......@@ -11644,9 +11546,6 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
// Only try palette mode when the best mode so far is an intra mode.
if (try_palette && !is_inter_mode(best_mbmode.mode)) {
int rate2 = 0;
#if CONFIG_SUPERTX
int best_rate_nocoef;
#endif // CONFIG_SUPERTX
int64_t distortion2 = 0, best_rd_palette = best_rd, this_rd,
best_model_rd_palette = INT64_MAX;
int skippable = 0, rate_overhead_palette = 0;
......@@ -11709,14 +11608,8 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
if (skippable) {
rate2 -= (rd_stats_y.rate + rate_uv_tokenonly[uv_tx]);
#if CONFIG_SUPERTX
best_rate_nocoef = rate2;
#endif // CONFIG_SUPERTX
rate2 += av1_cost_bit(av1_get_skip_prob(cm, xd), 1);
} else {
#if CONFIG_SUPERTX
best_rate_nocoef = rate2 - (rd_stats_y.rate + rate_uv_tokenonly[uv_tx]);
#endif // CONFIG_SUPERTX
rate2 += av1_cost_bit(av1_get_skip_prob(cm, xd), 0);
}
this_rd = RDCOST(x->rdmult, rate2, distortion2);
......@@ -11724,9 +11617,6 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
best_mode_index = 3;
mbmi->mv[0].as_int = 0;
rd_cost->rate = rate2;
#if CONFIG_SUPERTX
*returnrate_nocoef = best_rate_nocoef;
#endif // CONFIG_SUPERTX
rd_cost->dist = distortion2;
rd_cost->rdcost = this_rd;
best_rd = this_rd;
......@@ -11751,9 +11641,6 @@ PALETTE_EXIT:
#endif // CONFIG_EXT_INTRA
pmi_uv, palette_ctx, 0, ref_costs_single, &best_rd, &best_intra_rd,
&best_intra_mode, &best_mode_index, &best_skip2, &best_mode_skippable,
#if CONFIG_SUPERTX
returnrate_nocoef,
#endif // CONFIG_SUPERTX
best_pred_rd, &best_mbmode, rd_cost);
}
#endif // CONFIG_FILTER_INTRA
......
......@@ -99,12 +99,8 @@ unsigned int av1_high_get_sby_perpixel_variance(const AV1_COMP *cpi,
void av1_rd_pick_inter_mode_sb(const struct AV1_COMP *cpi,
struct TileDataEnc *tile_data,
struct macroblock *x, int mi_row, int mi_col,
struct RD_STATS *rd_cost,
#if CONFIG_SUPERTX
int *returnrate_nocoef,
#endif // CONFIG_SUPERTX
BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
int64_t best_rd_so_far);
struct RD_STATS *rd_cost, BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx, int64_t best_rd_so_far);
void av1_rd_pick_inter_mode_sb_seg_skip(
const struct AV1_COMP *cpi, struct TileDataEnc *tile_data,
......@@ -121,21 +117,6 @@ void av1_check_ncobmc_rd(const struct AV1_COMP *cpi, struct macroblock *x,
int mi_row, int mi_col);
#endif // CONFIG_MOTION_VAR && CONFIG_NCOBMC
#if CONFIG_SUPERTX
#if CONFIG_VAR_TX
void av1_tx_block_rd_b(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size,
int blk_row, int blk_col, int plane, int block,
int plane_bsize, const ENTROPY_CONTEXT *a,
const ENTROPY_CONTEXT *l, RD_STATS *rd_stats);
#endif
void av1_txfm_rd_in_plane_supertx(MACROBLOCK *x, const AV1_COMP *cpi, int *rate,
int64_t *distortion, int *skippable,
int64_t *sse, int64_t ref_best_rd, int plane,
BLOCK_SIZE bsize, TX_SIZE tx_size,
int use_fast_coef_casting);
#endif // CONFIG_SUPERTX
#ifdef __cplusplus
} // extern "C"
#endif
......
......@@ -509,11 +509,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
const int eob = p->eobs[block];
const PLANE_TYPE type = pd->plane_type;
const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
#if CONFIG_SUPERTX
const int segment_id = AOMMIN(mbmi->segment_id, mbmi->segment_id_supertx);
#else
const int segment_id = mbmi->segment_id;
#endif // CONFIG_SUEPRTX
const int16_t *scan, *nb;
const TX_TYPE tx_type =
av1_get_tx_type(type, xd, blk_row, blk_col, block, tx_size);
......@@ -881,48 +877,3 @@ void av1_tokenize_sb(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
if (rate) *rate += arg.this_rate;
}
#if CONFIG_SUPERTX
void av1_tokenize_sb_supertx(const AV1_COMP *cpi, ThreadData *td,
TOKENEXTRA **t, RUN_TYPE dry_run, int mi_row,
int mi_col, BLOCK_SIZE bsize, int *rate) {
const AV1_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &td->mb.e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
TOKENEXTRA *t_backup = *t;
const int ctx = av1_get_skip_context(xd);
const int skip_inc =
!segfeature_active(&cm->seg, mbmi->segment_id_supertx, SEG_LVL_SKIP);
struct tokenize_b_args arg = { cpi, td, t, 0 };
if (mbmi->skip) {
if (!dry_run) td->counts->skip[ctx][1] += skip_inc;
av1_reset_skip_context(xd, mi_row, mi_col, bsize);
if (dry_run) *t = t_backup;
return;
}