Commit 23c511e7 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan Committed by Frédéric BARBIER

Remove ADAPT_SCAN experiment

This experiment has been abandonned for AV1.

Change-Id: Ib3bb07d62f2025ce50dc9bc1b3f9fc22488519a7
parent b1bf64d5
......@@ -32,10 +32,7 @@ typedef struct txfm_param {
// bd==8 implies !is_hbd, but that's not certain right now.
int is_hbd;
TxSetType tx_set_type;
// for inverse transforms only
#if CONFIG_ADAPT_SCAN
const int16_t *eob_threshold;
#endif
// for inverse transforms only
int eob;
} TxfmParam;
......
......@@ -514,10 +514,6 @@ typedef struct RefBuffer {
struct scale_factors sf;
} RefBuffer;
#if CONFIG_ADAPT_SCAN
typedef int16_t EobThresholdMD[TX_TYPES][EOB_THRESHOLD_NUM];
#endif
#if CONFIG_LOOP_RESTORATION
typedef struct {
DECLARE_ALIGNED(16, InterpKernel, vfilter);
......@@ -695,9 +691,6 @@ typedef struct macroblockd {
int prev_delta_lf[FRAME_LF_COUNT];
int curr_delta_lf[FRAME_LF_COUNT];
#endif // CONFIG_LOOPFILTER_LEVEL
#endif
#if CONFIG_ADAPT_SCAN
const EobThresholdMD *eob_threshold_md;
#endif
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]);
......
......@@ -1749,10 +1749,6 @@ static const int intra_mode_context[INTRA_MODES] = {
};
#endif
#if CONFIG_ADAPT_SCAN
#define EOB_THRESHOLD_NUM 2
#endif
#if CONFIG_JNT_COMP
// Note: this is also used in unit tests. So whenever one changes the table,
// the unit tests need to be changed accordingly.
......
......@@ -358,14 +358,6 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
#define COEF_COUNT_SAT_AFTER_KEY 24
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128
#if CONFIG_ADAPT_SCAN
#define ADAPT_SCAN_PROB_PRECISION 10
// 1/8 update rate
#define ADAPT_SCAN_UPDATE_LOG_RATE 3
#define ADAPT_SCAN_UPDATE_RATE \
(1 << (ADAPT_SCAN_PROB_PRECISION - ADAPT_SCAN_UPDATE_LOG_RATE))
#endif
static INLINE aom_prob av1_merge_probs(aom_prob pre_prob,
const unsigned int ct[2],
unsigned int count_sat,
......
......@@ -3074,9 +3074,6 @@ void av1_setup_past_independence(AV1_COMMON *cm) {
av1_init_mv_probs(cm);
#if CONFIG_LV_MAP
av1_init_lv_map(cm);
#endif
#if CONFIG_ADAPT_SCAN
av1_init_scan_order(cm);
#endif
av1_convolve_init(cm);
cm->fc->initialized = 1;
......
......@@ -72,83 +72,9 @@ struct seg_counts {
unsigned int pred[PREDICTION_PROBS][2];
};
#if CONFIG_ADAPT_SCAN
typedef struct NON_ZERO_COUNT {
unsigned int non_zero_count_4X4[TX_TYPES][16];
unsigned int non_zero_count_8X8[TX_TYPES][64];
unsigned int non_zero_count_16X16[TX_TYPES][256];
unsigned int non_zero_count_32X32[TX_TYPES][1024];
unsigned int non_zero_count_4x8[TX_TYPES][32];
unsigned int non_zero_count_8x4[TX_TYPES][32];
unsigned int non_zero_count_8x16[TX_TYPES][128];
unsigned int non_zero_count_16x8[TX_TYPES][128];
unsigned int non_zero_count_16x32[TX_TYPES][512];
unsigned int non_zero_count_32x16[TX_TYPES][512];
unsigned int txb_count[TX_SIZES_ALL][TX_TYPES];
} NON_ZERO_COUNT;
#endif
typedef struct frame_contexts {
coeff_cdf_model coef_tail_cdfs[TX_SIZES][PLANE_TYPES];
coeff_cdf_model coef_head_cdfs[TX_SIZES][PLANE_TYPES];
#if CONFIG_ADAPT_SCAN
struct NON_ZERO_COUNT non_zero_count;
// TODO(angiebird): try aom_prob
uint32_t non_zero_prob_4X4[TX_TYPES][16];
uint32_t non_zero_prob_8X8[TX_TYPES][64];
uint32_t non_zero_prob_16X16[TX_TYPES][256];
uint32_t non_zero_prob_32X32[TX_TYPES][1024];
uint32_t non_zero_prob_4X8[TX_TYPES][32];
uint32_t non_zero_prob_8X4[TX_TYPES][32];
uint32_t non_zero_prob_16X8[TX_TYPES][128];
uint32_t non_zero_prob_8X16[TX_TYPES][128];
uint32_t non_zero_prob_32X16[TX_TYPES][512];
uint32_t non_zero_prob_16X32[TX_TYPES][512];
DECLARE_ALIGNED(16, int16_t, scan_4X4[TX_TYPES][16]);
DECLARE_ALIGNED(16, int16_t, scan_8X8[TX_TYPES][64]);
DECLARE_ALIGNED(16, int16_t, scan_16X16[TX_TYPES][256]);
DECLARE_ALIGNED(16, int16_t, scan_32X32[TX_TYPES][1024]);
DECLARE_ALIGNED(16, int16_t, scan_4X8[TX_TYPES][32]);
DECLARE_ALIGNED(16, int16_t, scan_8X4[TX_TYPES][32]);
DECLARE_ALIGNED(16, int16_t, scan_8X16[TX_TYPES][128]);
DECLARE_ALIGNED(16, int16_t, scan_16X8[TX_TYPES][128]);
DECLARE_ALIGNED(16, int16_t, scan_16X32[TX_TYPES][512]);
DECLARE_ALIGNED(16, int16_t, scan_32X16[TX_TYPES][512]);
DECLARE_ALIGNED(16, int16_t, iscan_4X4[TX_TYPES][16]);
DECLARE_ALIGNED(16, int16_t, iscan_8X8[TX_TYPES][64]);
DECLARE_ALIGNED(16, int16_t, iscan_16X16[TX_TYPES][256]);
DECLARE_ALIGNED(16, int16_t, iscan_32X32[TX_TYPES][1024]);
DECLARE_ALIGNED(16, int16_t, iscan_4X8[TX_TYPES][32]);
DECLARE_ALIGNED(16, int16_t, iscan_8X4[TX_TYPES][32]);
DECLARE_ALIGNED(16, int16_t, iscan_8X16[TX_TYPES][128]);
DECLARE_ALIGNED(16, int16_t, iscan_16X8[TX_TYPES][128]);
DECLARE_ALIGNED(16, int16_t, iscan_16X32[TX_TYPES][512]);
DECLARE_ALIGNED(16, int16_t, iscan_32X16[TX_TYPES][512]);
int16_t nb_4X4[TX_TYPES][(16 + 1) * 2];
int16_t nb_8X8[TX_TYPES][(64 + 1) * 2];
int16_t nb_16X16[TX_TYPES][(256 + 1) * 2];
int16_t nb_32X32[TX_TYPES][(1024 + 1) * 2];
int16_t nb_4X8[TX_TYPES][(32 + 1) * 2];
int16_t nb_8X4[TX_TYPES][(32 + 1) * 2];
int16_t nb_8X16[TX_TYPES][(128 + 1) * 2];
int16_t nb_16X8[TX_TYPES][(128 + 1) * 2];
int16_t nb_16X32[TX_TYPES][(512 + 1) * 2];
int16_t nb_32X16[TX_TYPES][(512 + 1) * 2];
SCAN_ORDER sc[TX_SIZES_ALL][TX_TYPES];
int16_t eob_threshold[TX_SIZES_ALL][TX_TYPES][EOB_THRESHOLD_NUM];
#endif // CONFIG_ADAPT_SCAN
#if CONFIG_LV_MAP
aom_prob txb_skip[TX_SIZES][TXB_SKIP_CONTEXTS];
......
......@@ -1808,18 +1808,14 @@ void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
#if !CONFIG_DAALA_TX8
static void idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
const TxfmParam *txfm_param) {
// If dc is 1, then input[0] is the reconstructed value, do not need
// dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1.
// The calculation can be simplified if there are not many non-zero dct
// coefficients. Use eobs to decide what to do.
// TODO(yunqingwang): "eobs = 1" case is also handled in av1_short_idct8x8_c.
// Combine that with code here.
#if CONFIG_ADAPT_SCAN
const int16_t half = txfm_param->eob_threshold[0];
#else
// If dc is 1, then input[0] is the reconstructed value, do not need
// dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1.
// The calculation can be simplified if there are not many non-zero dct
// coefficients. Use eobs to decide what to do.
// TODO(yunqingwang): "eobs = 1" case is also handled in av1_short_idct8x8_c.
// Combine that with code here.
const int16_t half = 12;
#endif
const int eob = txfm_param->eob;
if (eob == 1)
......@@ -1835,15 +1831,10 @@ static void idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
#if !CONFIG_DAALA_TX16
static void idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride,
const TxfmParam *txfm_param) {
// The calculation can be simplified if there are not many non-zero dct
// coefficients. Use eobs to separate different cases.
#if CONFIG_ADAPT_SCAN
const int16_t half = txfm_param->eob_threshold[0];
const int16_t quarter = txfm_param->eob_threshold[1];
#else
// The calculation can be simplified if there are not many non-zero dct
// coefficients. Use eobs to separate different cases.
const int16_t half = 38;
const int16_t quarter = 10;
#endif
const int eob = txfm_param->eob;
if (eob == 1) /* DC only DCT coefficient. */
......@@ -1860,13 +1851,8 @@ static void idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride,
#if !CONFIG_DAALA_TX32
static void idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride,
const TxfmParam *txfm_param) {
#if CONFIG_ADAPT_SCAN
const int16_t half = txfm_param->eob_threshold[0];
const int16_t quarter = txfm_param->eob_threshold[1];
#else
const int16_t half = 135;
const int16_t quarter = 34;
#endif
const int eob = txfm_param->eob;
if (eob == 1)
......@@ -2556,10 +2542,6 @@ static void init_txfm_param(const MACROBLOCKD *xd, int plane, TX_SIZE tx_size,
txfm_param->tx_set_type =
get_ext_tx_set_type(txfm_param->tx_size, plane_bsize,
is_inter_block(&xd->mi[0]->mbmi), reduced_tx_set);
#if CONFIG_ADAPT_SCAN
txfm_param->eob_threshold =
(const int16_t *)&xd->eob_threshold_md[tx_size][tx_type][0];
#endif
}
typedef void (*InvTxfmFunc)(const tran_low_t *dqcoeff, uint8_t *dst, int stride,
......
......@@ -566,9 +566,6 @@ typedef struct AV1Common {
#if CONFIG_LV_MAP
LV_MAP_CTX_TABLE coeff_ctx_table;
#endif
#if CONFIG_ADAPT_SCAN
int use_adapt_scan;
#endif
#if CONFIG_MFMV
TPL_MV_REF *tpl_mvs;
// TODO(jingning): This can be combined with sign_bias later.
......
This diff is collapsed.
......@@ -29,54 +29,6 @@ extern const SCAN_ORDER av1_default_scan_orders[TX_SIZES];
extern const SCAN_ORDER av1_intra_scan_orders[TX_SIZES_ALL][TX_TYPES];
extern const SCAN_ORDER av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES];
#if CONFIG_ADAPT_SCAN
#define USE_2X2_PROB 0
#define CACHE_SCAN_PROB 1
#define REDUCED_SET 1
#define SUB_REGION_COUNT 1
#define SUB_FRAME_COUNT 0
#define SIG_REGION 0
#define UNI_RECT 1
#define USE_TOPOLOGICAL_SORT 0
#define USE_LIMIT_SCAN_DISTANCE 0
void av1_update_scan_count_facade(const AV1_COMMON *const cm, MACROBLOCKD *xd,
int mi_row, TX_SIZE tx_size, TX_TYPE tx_type,
const tran_low_t *dqcoeffs, int max_scan);
// embed r + c and coeff_idx info with nonzero probabilities. When sorting the
// nonzero probabilities, if there is a tie, the coefficient with smaller r + c
// will be scanned first
void av1_augment_prob(TX_SIZE tx_size, TX_TYPE tx_type, uint32_t *prob);
#if USE_TOPOLOGICAL_SORT
// apply quick sort on nonzero probabilities to obtain a sort order
void av1_update_sort_order(TX_SIZE tx_size, TX_TYPE tx_type,
const uint32_t *non_zero_prob, int16_t *sort_order);
// apply topological sort on the nonzero probabilities sorting order to
// guarantee each to-be-scanned coefficient's upper and left coefficient will be
// scanned before the to-be-scanned coefficient.
void av1_update_scan_order(TX_SIZE tx_size, int16_t *sort_order, int16_t *scan,
int16_t *iscan);
#else // USE_TOPOLOGICAL_SORT
void av1_update_scan_order(TX_SIZE tx_size, TX_TYPE tx_type,
uint32_t *non_zero_prob, int16_t *scan,
int16_t *iscan);
#endif // USE_TOPOLOGICAL_SORT
// For each coeff_idx in scan[], update its above and left neighbors in
// neighbors[] accordingly.
void av1_update_neighbors(TX_SIZE tx_size, const int16_t *scan,
const int16_t *iscan, int16_t *neighbors);
void av1_init_scan_order(AV1_COMMON *cm);
void av1_adapt_scan_order(AV1_COMMON *cm, FRAME_CONTEXT *ec_ctxs[],
int num_tiles);
#if USE_2X2_PROB
void av1_down_sample_scan_count(uint32_t *non_zero_count_ds,
const uint32_t *non_zero_count,
TX_SIZE tx_size);
#endif // USE_2X2_PROB
#endif // CONFIG_ADAPT_SCAN
void av1_deliver_eob_threshold(const AV1_COMMON *cm, MACROBLOCKD *xd);
static INLINE int get_coef_context(const int16_t *neighbors,
......@@ -97,15 +49,6 @@ static INLINE int do_adapt_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
(void)tx_size;
if (tx_size_2d[tx_size] >= 1024 && tx_type != DCT_DCT) return 0;
if (tx_size > TX_32X16) return 0;
#if CONFIG_ADAPT_SCAN
#if REDUCED_SET
const int txw = tx_size_wide[tx_size];
const int txh = tx_size_high[tx_size];
if (txw == 16 && txh == 16) return tx_type == DCT_DCT;
if (txw >= 16 || txh >= 16) return tx_type <= ADST_ADST;
#endif
#endif
return tx_type < IDTX;
}
......@@ -113,17 +56,8 @@ static INLINE const SCAN_ORDER *get_scan(const AV1_COMMON *cm, TX_SIZE tx_size,
TX_TYPE tx_type,
const MB_MODE_INFO *mbmi) {
const int is_inter = is_inter_block(mbmi);
#if CONFIG_ADAPT_SCAN
(void)mbmi;
(void)is_inter;
if (!do_adapt_scan(tx_size, tx_type))
return get_default_scan(tx_size, tx_type, is_inter);
else
return &cm->fc->sc[tx_size][tx_type];
#else // CONFIG_ADAPT_SCAN
(void)cm;
return get_default_scan(tx_size, tx_type, is_inter);
#endif // CONFIG_ADAPT_SCAN
}
#ifdef __cplusplus
......
......@@ -3062,18 +3062,6 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
cm->reduced_tx_set_used = aom_rb_read_bit(rb);
#if CONFIG_ADAPT_SCAN
#if CONFIG_EXT_TILE
if (cm->large_scale_tile)
cm->use_adapt_scan = 0;
else
#endif // CONFIG_EXT_TILE
cm->use_adapt_scan = aom_rb_read_bit(rb);
// TODO(angiebird): call av1_init_scan_order only when use_adapt_scan
// switches from 1 to 0
if (cm->use_adapt_scan == 0) av1_init_scan_order(cm);
#endif // CONFIG_ADAPT_SCAN
#if !CONFIG_TEMPMV_SIGNALING
// NOTE(zoeliu): As cm->prev_frame can take neither a frame of
// show_exisiting_frame=1, nor can it take a frame not used as
......@@ -3273,9 +3261,6 @@ size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
RefBuffer *last_fb_ref_buf = &cm->frame_refs[LAST_FRAME - LAST_FRAME];
#endif
#if CONFIG_ADAPT_SCAN
av1_deliver_eob_threshold(cm, xd);
#endif
#if CONFIG_BITSTREAM_DEBUG
bitstream_queue_set_frame_read(cm->current_video_frame * 2 + cm->show_frame);
#endif
......@@ -3561,9 +3546,6 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data,
num_bwd_ctxs);
av1_average_tile_loopfilter_cdfs(pbi->common.fc, tile_ctxs, cdf_ptrs,
num_bwd_ctxs);
#if CONFIG_ADAPT_SCAN
av1_adapt_scan_order(cm, tile_ctxs, num_bwd_ctxs);
#endif // CONFIG_ADAPT_SCAN
if (!frame_is_intra_only(cm)) {
av1_adapt_inter_frame_probs(cm);
......
......@@ -409,15 +409,6 @@ uint8_t av1_read_coeffs_txb_facade(const AV1_COMMON *const cm,
pd->left_context + row, &txb_ctx);
uint8_t cul_level = av1_read_coeffs_txb(cm, xd, r, row, col, plane, &txb_ctx,
tx_size, max_scan_line, eob);
#if CONFIG_ADAPT_SCAN
PLANE_TYPE plane_type = get_plane_type(plane);
TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, tx_size);
const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
if (xd->counts && *eob > 0)
av1_update_scan_count_facade(cm, xd, mi_row, tx_size, tx_type, pd->dqcoeff,
*eob);
#endif
av1_set_contexts(xd, pd, plane, tx_size, cul_level, col, row);
return cul_level;
}
......@@ -311,14 +311,6 @@ int av1_decode_block_tokens(AV1_COMMON *cm, MACROBLOCKD *const xd, int plane,
#endif // CONFIG_NEW_QUANT
ctx, sc->scan, sc->neighbors, max_scan_line, r);
av1_set_contexts(xd, pd, plane, tx_size, eob > 0, x, y);
#if CONFIG_ADAPT_SCAN
const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
if (xd->counts)
av1_update_scan_count_facade(cm, xd, mi_row, tx_size, tx_type, pd->dqcoeff,
eob);
#else
(void)cm;
#endif
return eob;
}
......@@ -3896,15 +3896,6 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
aom_wb_write_bit(wb, cm->reduced_tx_set_used);
#if CONFIG_ADAPT_SCAN
#if CONFIG_EXT_TILE
if (cm->large_scale_tile)
assert(cm->use_adapt_scan == 0);
else
#endif // CONFIG_EXT_TILE
aom_wb_write_bit(wb, cm->use_adapt_scan);
#endif
if (!frame_is_intra_only(cm)) write_global_motion(cpi, wb);
write_tile_info(cm, wb);
......
......@@ -3697,10 +3697,6 @@ static void encode_frame_internal(AV1_COMP *cpi) {
int i;
const int last_fb_buf_idx = get_ref_frame_buf_idx(cpi, LAST_FRAME);
#if CONFIG_ADAPT_SCAN
av1_deliver_eob_threshold(cm, xd);
#endif
x->min_partition_size = AOMMIN(x->min_partition_size, cm->sb_size);
x->max_partition_size = AOMMIN(x->max_partition_size, cm->sb_size);
#if CONFIG_DIST_8X8
......@@ -4094,17 +4090,6 @@ void av1_encode_frame(AV1_COMP *cpi) {
// Indicates whether or not to use a default reduced set for ext-tx
// rather than the potential full set of 16 transforms
cm->reduced_tx_set_used = 0;
#if CONFIG_ADAPT_SCAN
#if CONFIG_EXT_TILE
if (cm->large_scale_tile)
cm->use_adapt_scan = 0;
else
#endif // CONFIG_EXT_TILE
cm->use_adapt_scan = 1;
// TODO(angiebird): call av1_init_scan_order only when use_adapt_scan
// switches from 1 to 0
if (cm->use_adapt_scan == 0) av1_init_scan_order(cm);
#endif
#if CONFIG_FRAME_MARKER
if (cm->show_frame == 0) {
......
......@@ -6371,9 +6371,6 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
num_bwd_ctxs);
av1_average_tile_loopfilter_cdfs(cpi->common.fc, tile_ctxs, cdf_ptrs,
num_bwd_ctxs);
#if CONFIG_ADAPT_SCAN
av1_adapt_scan_order(cm, tile_ctxs, num_bwd_ctxs);
#endif // CONFIG_ADAPT_SCAN
}
if (!frame_is_intra_only(cm)) {
......
......@@ -523,11 +523,6 @@ void av1_write_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
abs(tcoeff[pos]) - COEFF_BASE_RANGE - 1 - NUM_BASE_LEVELS);
}
}
#if CONFIG_ADAPT_SCAN
const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
av1_update_scan_count_facade(cm, xd, mi_row, tx_size, tx_type, tcoeff, eob);
#endif
}
typedef struct encode_txb_args {
......@@ -2306,16 +2301,6 @@ void av1_update_and_record_txb_context(int plane, int block, int blk_row,
int cul_level = av1_get_txb_entropy_context(tcoeff, scan_order, eob);
av1_set_contexts(xd, pd, plane, tx_size, cul_level, blk_col, blk_row);
#if CONFIG_ADAPT_SCAN
// Since dqcoeff is not available here, we pass qcoeff into
// av1_update_scan_count_facade(). The update behavior should be the same
// because av1_update_scan_count_facade() only cares if coefficients are zero
// or not.
const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
av1_update_scan_count_facade((AV1_COMMON *)cm, xd, mi_row, tx_size, tx_type,
qcoeff, eob);
#endif
}
void av1_update_txb_context(const AV1_COMP *cpi, ThreadData *td,
......
......@@ -587,10 +587,6 @@ void av1_first_pass(AV1_COMP *cpi, const struct lookahead_entry *source) {
av1_init_mv_probs(cm);
#if CONFIG_LV_MAP
av1_init_lv_map(cm);
#endif
#if CONFIG_ADAPT_SCAN
av1_init_scan_order(cm);
av1_deliver_eob_threshold(cm, xd);
#endif
av1_convolve_init(cm);
av1_initialize_rd_consts(cpi);
......
......@@ -468,16 +468,6 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
*tp = t;
#if CONFIG_ADAPT_SCAN
// Since dqcoeff is not available here, we pass qcoeff into
// av1_update_scan_count_facade(). The update behavior should be the same
// because av1_update_scan_count_facade() only cares if coefficients are zero
// or not.
const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
av1_update_scan_count_facade((AV1_COMMON *)cm, xd, mi_row, tx_size, tx_type,
qcoeff, c);
#endif
av1_set_contexts(xd, pd, plane, tx_size, c > 0, blk_col, blk_row);
}
......
......@@ -106,7 +106,6 @@ set(CONFIG_SPATIAL_RESAMPLING 1 CACHE NUMBER "Spatial resampling.")
set(CONFIG_SYMBOLRATE 0 CACHE NUMBER "Enables symbol rate accounting.")
# AV1 experiment flags.
set(CONFIG_ADAPT_SCAN 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_ADD_4BYTES_OBUSIZE 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_AMVR 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_AOM_QM 1 CACHE NUMBER "AV1 experiment flag.")
......
......@@ -14,12 +14,6 @@ set(AOM_BUILD_CMAKE_AOM_EXPERIMENT_DEPS_CMAKE_ 1)
# Adjusts CONFIG_* CMake variables to address conflicts between active AV1
# experiments.
macro (fix_experiment_configs)
if (CONFIG_ADAPT_SCAN)
if (NOT CONFIG_LV_MAP)
change_config_and_warn(CONFIG_LV_MAP 1 CONFIG_ADAPT_SCAN)
endif()
endif()
if (CONFIG_AMVR)
if (NOT CONFIG_HASH_ME)
change_config_and_warn(CONFIG_HASH_ME 1 CONFIG_AMVR)
......
......@@ -282,7 +282,6 @@ EXPERIMENT_LIST="
daala_tx_dst32
frame_size
ext_delta_q
adapt_scan
parallel_deblocking
deblock_13tap
loopfiltering_across_tiles
......
......@@ -93,9 +93,7 @@ typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmFunc, InvTxfmFunc, TX_SIZE, int>
PartialInvTxfmParam;
#if !CONFIG_ADAPT_SCAN
const int kMaxNumCoeffs = 1024;
#endif
class AV1PartialIDctTest
: public ::testing::TestWithParam<PartialInvTxfmParam> {
public:
......@@ -118,7 +116,6 @@ class AV1PartialIDctTest
InvTxfmFunc partial_itxfm_;
};
#if !CONFIG_ADAPT_SCAN
static MB_MODE_INFO get_mbmi() {
MB_MODE_INFO mbmi;
mbmi.ref_frame[0] = LAST_FRAME;
......@@ -248,7 +245,6 @@ TEST_P(AV1PartialIDctTest, ResultsMatch) {
EXPECT_EQ(0, max_error)
<< "Error: partial inverse transform produces different results";
}
#endif
using std::tr1::make_tuple;
INSTANTIATE_TEST_CASE_P(
......
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#include "av1/common/common_data.h"
#include "av1/common/scan.h"
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
namespace {
TEST(ScanTest, av1_augment_prob) {
const TX_SIZE tx_size = TX_4X4;
const TX_TYPE tx_type = DCT_DCT;
const int tx1d_size = tx_size_wide[tx_size];
uint32_t prob[16] = { 8, 8, 7, 7, 8, 8, 4, 2, 3, 3, 2, 2, 2, 2, 2, 2 };
const uint32_t ref_prob[16] = {
8, 8, 7, 7, 8, 8, 4, 2, 3, 3, 2, 2, 2, 2, 2, 2
};
av1_augment_prob(tx_size, tx_type, prob);
for (int r = 0; r < tx1d_size; ++r) {
for (int c = 0; c < tx1d_size; ++c) {
const uint32_t idx = r * tx1d_size + c;
EXPECT_EQ(ref_prob[idx], prob[idx] >> 16);
}
}
const SCAN_ORDER *sc = get_default_scan(tx_size, tx_type, 0);
const uint32_t mask = (1 << 16) - 1;
for (int r = 0; r < tx1d_size; ++r) {
for (int c = 0; c < tx1d_size; ++c) {
const uint32_t ref_idx = r * tx1d_size + c;
const uint32_t scan_idx = mask ^ (prob[r * tx1d_size + c] & mask);
const uint32_t idx = sc->scan[scan_idx];
EXPECT_EQ(ref_idx, idx);
}
}
}
#if USE_TOPOLOGICAL_SORT
TEST(ScanTest, av1_update_sort_order) {
const TX_SIZE tx_size = TX_4X4;
const TX_TYPE tx_type = DCT_DCT;
const uint32_t prob[16] = { 15, 14, 11, 10, 13, 12, 9, 5,
8, 7, 4, 2, 6, 3, 1, 0 };
const int16_t ref_sort_order[16] = { 0, 1, 4, 5, 2, 3, 6, 8,
9, 12, 7, 10, 13, 11, 14, 15 };
int16_t sort_order[16];
av1_update_sort_order(tx_size, tx_type, prob, sort_order);
for (int i = 0; i < 16; ++i) EXPECT_EQ(ref_sort_order[i], sort_order[i]);
}
#endif
#if USE_TOPOLOGICAL_SORT
TEST(ScanTest, av1_update_scan_order) {
TX_SIZE tx_size = TX_4X4;
const TX_TYPE tx_type = DCT_DCT;
const uint32_t prob[16] = { 10, 12, 14, 9, 11, 13, 15, 5,
8, 7, 4, 2, 6, 3, 1, 0 };
int16_t sort_order[16];
int16_t scan[16];
int16_t iscan[16];
const int16_t ref_iscan[16] = { 0, 1, 2, 6, 3, 4, 5, 10,
7, 8, 11, 13, 9, 12, 14, 15 };
av1_update_sort_order(tx_size, tx_type, prob, sort_order);
av1_update_scan_order(tx_size, sort_order, scan, iscan);
for (int i = 0; i < 16; ++i) {
EXPECT_EQ(ref_iscan[i], iscan[i]);
EXPECT_EQ(i, scan[ref_iscan[i]]);
}
}
#endif
TEST(ScanTest, av1_update_neighbors) {
TX_SIZE tx_size = TX_4X4;
// raster order
const int16_t scan[16] = { 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15 };
int16_t nb[(16 + 1) * 2];
const int16_t ref_nb[(16 + 1) * 2] = { 0, 0, 0, 0, 1, 1, 2, 2, 0,
1, 1, 4, 2, 5, 3, 6, 4, 5,
5, 8, 6, 9, 7, 10, 8, 9, 9,
12, 10, 13, 11, 14, 0, 0 };
// raster order's scan and iscan are the same
av1_update_neighbors(tx_size, scan, scan, nb);
for (int i = 0; i < (16 + 1) * 2; ++i) {
EXPECT_EQ(ref_nb[i], nb[i]);
}
}
#if USE_2X2_PROB
TEST(ScanTest, av1_down_sample_scan_count) {
const uint32_t non_zero_count[256] = {
13, 12, 11, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 9, 10, 8, 0, 0,