Commit cad5ebce authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove experimental flag of LV_MAP

This experiment has been adopted, we can simplify the code
by dropping the associated preprocessor conditionals.

Change-Id: Ic3438799335c6cd05f170302f49bd47e1f705c24
parent 248b9563
...@@ -352,30 +352,28 @@ if (CONFIG_INTERNAL_STATS) ...@@ -352,30 +352,28 @@ if (CONFIG_INTERNAL_STATS)
"${AOM_ROOT}/av1/encoder/blockiness.c") "${AOM_ROOT}/av1/encoder/blockiness.c")
endif () endif ()
if (CONFIG_LV_MAP) set(AOM_AV1_COMMON_SOURCES
set(AOM_AV1_COMMON_SOURCES ${AOM_AV1_COMMON_SOURCES}
${AOM_AV1_COMMON_SOURCES} "${AOM_ROOT}/av1/common/txb_common.c"
"${AOM_ROOT}/av1/common/txb_common.c" "${AOM_ROOT}/av1/common/txb_common.h")
"${AOM_ROOT}/av1/common/txb_common.h")
set(AOM_AV1_COMMON_INTRIN_SSE2 set(AOM_AV1_COMMON_INTRIN_SSE2
${AOM_AV1_COMMON_INTRIN_SSE2} ${AOM_AV1_COMMON_INTRIN_SSE2}
"${AOM_ROOT}/av1/common/x86/txb_sse2.c") "${AOM_ROOT}/av1/common/x86/txb_sse2.c")
set(AOM_AV1_DECODER_SOURCES set(AOM_AV1_DECODER_SOURCES
${AOM_AV1_DECODER_SOURCES} ${AOM_AV1_DECODER_SOURCES}
"${AOM_ROOT}/av1/decoder/decodetxb.c" "${AOM_ROOT}/av1/decoder/decodetxb.c"
"${AOM_ROOT}/av1/decoder/decodetxb.h") "${AOM_ROOT}/av1/decoder/decodetxb.h")
set(AOM_AV1_ENCODER_SOURCES set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES} ${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/encodetxb.c" "${AOM_ROOT}/av1/encoder/encodetxb.c"
"${AOM_ROOT}/av1/encoder/encodetxb.h") "${AOM_ROOT}/av1/encoder/encodetxb.h")
set(AOM_AV1_ENCODER_INTRIN_SSE2 set(AOM_AV1_ENCODER_INTRIN_SSE2
${AOM_AV1_ENCODER_INTRIN_SSE2} ${AOM_AV1_ENCODER_INTRIN_SSE2}
"${AOM_ROOT}/av1/encoder/x86/encodetxb_sse2.c") "${AOM_ROOT}/av1/encoder/x86/encodetxb_sse2.c")
endif ()
if (CONFIG_CFL) if (CONFIG_CFL)
set(AOM_AV1_COMMON_SOURCES set(AOM_AV1_COMMON_SOURCES
......
...@@ -81,7 +81,7 @@ specialize qw/av1_highbd_convolve_vert sse4_1/; ...@@ -81,7 +81,7 @@ specialize qw/av1_highbd_convolve_vert sse4_1/;
# #
# txb # txb
# #
if (aom_config("CONFIG_LV_MAP") eq "yes") { {
add_proto qw/void av1_get_br_level_counts/, "const uint8_t *const levels, const int width, const int height, uint8_t *const level_counts"; add_proto qw/void av1_get_br_level_counts/, "const uint8_t *const levels, const int width, const int height, uint8_t *const level_counts";
specialize qw/av1_get_br_level_counts sse2/; specialize qw/av1_get_br_level_counts sse2/;
} }
...@@ -414,7 +414,7 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { ...@@ -414,7 +414,7 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
# End av1_high encoder functions # End av1_high encoder functions
# txb # txb
if (aom_config("CONFIG_LV_MAP") eq "yes") { {
add_proto qw/void av1_get_nz_map_contexts/, "const uint8_t *const levels, const int16_t *const scan, const uint16_t eob, const TX_SIZE tx_size, const TX_TYPE tx_type, int8_t *const coeff_contexts"; add_proto qw/void av1_get_nz_map_contexts/, "const uint8_t *const levels, const int16_t *const scan, const uint16_t eob, const TX_SIZE tx_size, const TX_TYPE tx_type, int8_t *const coeff_contexts";
specialize qw/av1_get_nz_map_contexts sse2/; specialize qw/av1_get_nz_map_contexts sse2/;
} }
......
...@@ -81,7 +81,6 @@ void av1_foreach_transformed_block_in_plane( ...@@ -81,7 +81,6 @@ void av1_foreach_transformed_block_in_plane(
} }
} }
#if CONFIG_LV_MAP
void av1_foreach_transformed_block(const MACROBLOCKD *const xd, void av1_foreach_transformed_block(const MACROBLOCKD *const xd,
BLOCK_SIZE bsize, int mi_row, int mi_col, BLOCK_SIZE bsize, int mi_row, int mi_col,
foreach_transformed_block_visitor visit, foreach_transformed_block_visitor visit,
...@@ -94,7 +93,6 @@ void av1_foreach_transformed_block(const MACROBLOCKD *const xd, ...@@ -94,7 +93,6 @@ void av1_foreach_transformed_block(const MACROBLOCKD *const xd,
av1_foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg); av1_foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg);
} }
} }
#endif
void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
int plane, TX_SIZE tx_size, int has_eob, int aoff, int plane, TX_SIZE tx_size, int has_eob, int aoff,
......
...@@ -1025,12 +1025,10 @@ void av1_foreach_transformed_block_in_plane( ...@@ -1025,12 +1025,10 @@ void av1_foreach_transformed_block_in_plane(
const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane, const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane,
foreach_transformed_block_visitor visit, void *arg); foreach_transformed_block_visitor visit, void *arg);
#if CONFIG_LV_MAP
void av1_foreach_transformed_block(const MACROBLOCKD *const xd, void av1_foreach_transformed_block(const MACROBLOCKD *const xd,
BLOCK_SIZE bsize, int mi_row, int mi_col, BLOCK_SIZE bsize, int mi_row, int mi_col,
foreach_transformed_block_visitor visit, foreach_transformed_block_visitor visit,
void *arg, const int num_planes); void *arg, const int num_planes);
#endif
void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
int plane, TX_SIZE tx_size, int has_eob, int aoff, int plane, TX_SIZE tx_size, int has_eob, int aoff,
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
#include "av1/common/onyxc_int.h" #include "av1/common/onyxc_int.h"
#include "av1/common/scan.h" #include "av1/common/scan.h"
#include "av1/common/token_cdfs.h" #include "av1/common/token_cdfs.h"
#if CONFIG_LV_MAP
#include "av1/common/txb_common.h" #include "av1/common/txb_common.h"
#endif
/* Extra bits coded from LSB to MSB */ /* Extra bits coded from LSB to MSB */
const aom_cdf_prob av1_cat1_cdf0[CDF_SIZE(2)] = { AOM_CDF2(20352) }; const aom_cdf_prob av1_cat1_cdf0[CDF_SIZE(2)] = { AOM_CDF2(20352) };
...@@ -563,7 +561,6 @@ static int get_q_ctx(int q) { ...@@ -563,7 +561,6 @@ static int get_q_ctx(int q) {
#endif // CONFIG_Q_ADAPT_PROBS #endif // CONFIG_Q_ADAPT_PROBS
void av1_default_coef_probs(AV1_COMMON *cm) { void av1_default_coef_probs(AV1_COMMON *cm) {
#if CONFIG_LV_MAP
#if CONFIG_Q_ADAPT_PROBS #if CONFIG_Q_ADAPT_PROBS
const int index = get_q_ctx(cm->base_qindex); const int index = get_q_ctx(cm->base_qindex);
av1_copy(cm->fc->txb_skip_cdf, av1_default_txb_skip_cdfs[index]); av1_copy(cm->fc->txb_skip_cdf, av1_default_txb_skip_cdfs[index]);
...@@ -595,20 +592,6 @@ void av1_default_coef_probs(AV1_COMMON *cm) { ...@@ -595,20 +592,6 @@ void av1_default_coef_probs(AV1_COMMON *cm) {
av1_copy(cm->fc->eob_flag_cdf512, av1_default_eob_multi512); av1_copy(cm->fc->eob_flag_cdf512, av1_default_eob_multi512);
av1_copy(cm->fc->eob_flag_cdf1024, av1_default_eob_multi1024); av1_copy(cm->fc->eob_flag_cdf1024, av1_default_eob_multi1024);
#endif // CONFIG_Q_ADAPT_PROBS #endif // CONFIG_Q_ADAPT_PROBS
#else
const int index = AOMMIN(TOKEN_CDF_Q_CTXS - 1, cm->base_qindex / 64);
av1_copy(cm->fc->coef_head_cdfs[TX_4X4],
(*av1_default_qctx_coef_cdfs[index])[TX_4X4]);
av1_copy(cm->fc->coef_head_cdfs[TX_8X8],
(*av1_default_qctx_coef_cdfs[index])[TX_8X8]);
av1_copy(cm->fc->coef_head_cdfs[TX_16X16],
(*av1_default_qctx_coef_cdfs[index])[TX_16X16]);
av1_copy(cm->fc->coef_head_cdfs[TX_32X32],
(*av1_default_qctx_coef_cdfs[index])[TX_32X32]);
av1_copy(cm->fc->coef_head_cdfs[TX_64X64],
(*av1_default_qctx_coef_cdfs[index])[TX_32X32]);
av1_coef_pareto_cdfs(cm->fc);
#endif // CONFIG_LV_MAP
} }
static void av1_average_cdf(aom_cdf_prob *cdf_ptr[], aom_cdf_prob *fc_cdf_ptr, static void av1_average_cdf(aom_cdf_prob *cdf_ptr[], aom_cdf_prob *fc_cdf_ptr,
...@@ -646,7 +629,6 @@ void av1_average_tile_coef_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[], ...@@ -646,7 +629,6 @@ void av1_average_tile_coef_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
aom_cdf_prob *fc_cdf_ptr; aom_cdf_prob *fc_cdf_ptr;
assert(num_tiles == 1); assert(num_tiles == 1);
#if CONFIG_LV_MAP
AVERAGE_TILE_CDFS(txb_skip_cdf) AVERAGE_TILE_CDFS(txb_skip_cdf)
AVERAGE_TILE_CDFS(eob_extra_cdf) AVERAGE_TILE_CDFS(eob_extra_cdf)
AVERAGE_TILE_CDFS(dc_sign_cdf) AVERAGE_TILE_CDFS(dc_sign_cdf)
...@@ -660,10 +642,6 @@ void av1_average_tile_coef_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[], ...@@ -660,10 +642,6 @@ void av1_average_tile_coef_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
AVERAGE_TILE_CDFS(eob_flag_cdf1024) AVERAGE_TILE_CDFS(eob_flag_cdf1024)
AVERAGE_TILE_CDFS(coeff_base_eob_cdf) AVERAGE_TILE_CDFS(coeff_base_eob_cdf)
AVERAGE_TILE_CDFS(coeff_br_cdf) AVERAGE_TILE_CDFS(coeff_br_cdf)
#else // CONFI_LV_MAP
AVERAGE_TILE_CDFS(coef_head_cdfs)
AVERAGE_TILE_CDFS(coef_tail_cdfs)
#endif
} }
void av1_average_tile_mv_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[], void av1_average_tile_mv_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
......
...@@ -56,7 +56,6 @@ extern "C" { ...@@ -56,7 +56,6 @@ extern "C" {
#define ENTROPY_NODES 11 #define ENTROPY_NODES 11
#if CONFIG_LV_MAP
#define TXB_SKIP_CONTEXTS 13 #define TXB_SKIP_CONTEXTS 13
#define EOB_COEF_CONTEXTS 22 #define EOB_COEF_CONTEXTS 22
...@@ -90,8 +89,6 @@ typedef enum TX_CLASS { ...@@ -90,8 +89,6 @@ typedef enum TX_CLASS {
TX_CLASSES = 3, TX_CLASSES = 3,
} TX_CLASS; } TX_CLASS;
#endif
DECLARE_ALIGNED(16, extern const uint8_t, av1_pt_energy_class[ENTROPY_TOKENS]); DECLARE_ALIGNED(16, extern const uint8_t, av1_pt_energy_class[ENTROPY_TOKENS]);
#define CAT1_MIN_VAL 5 #define CAT1_MIN_VAL 5
...@@ -171,9 +168,7 @@ static INLINE int av1_get_cat6_extrabits_size(TX_SIZE tx_size, ...@@ -171,9 +168,7 @@ static INLINE int av1_get_cat6_extrabits_size(TX_SIZE tx_size,
struct AV1Common; struct AV1Common;
struct frame_contexts; struct frame_contexts;
void av1_default_coef_probs(struct AV1Common *cm); void av1_default_coef_probs(struct AV1Common *cm);
#if CONFIG_LV_MAP
void av1_adapt_coef_probs(struct AV1Common *cm); void av1_adapt_coef_probs(struct AV1Common *cm);
#endif // CONFIG_LV_MAP
// This is the index in the scan order beyond which all coefficients for // This is the index in the scan order beyond which all coefficients for
// 8x8 transform and above are in the top band. // 8x8 transform and above are in the top band.
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
#include "av1/common/scan.h" #include "av1/common/scan.h"
#include "av1/common/onyxc_int.h" #include "av1/common/onyxc_int.h"
#include "av1/common/seg_common.h" #include "av1/common/seg_common.h"
#if CONFIG_LV_MAP
#include "av1/common/txb_common.h" #include "av1/common/txb_common.h"
#endif
static const aom_cdf_prob default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)] = static const aom_cdf_prob default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)] =
{ { AOM_CDF2(128 * 155) }, { AOM_CDF2(128 * 116) }, { AOM_CDF2(128 * 94) }, { { AOM_CDF2(128 * 155) }, { AOM_CDF2(128 * 116) }, { AOM_CDF2(128 * 94) },
...@@ -1380,9 +1378,7 @@ void av1_setup_past_independence(AV1_COMMON *cm) { ...@@ -1380,9 +1378,7 @@ void av1_setup_past_independence(AV1_COMMON *cm) {
av1_default_coef_probs(cm); av1_default_coef_probs(cm);
init_mode_probs(cm->fc); init_mode_probs(cm->fc);
av1_init_mv_probs(cm); av1_init_mv_probs(cm);
#if CONFIG_LV_MAP
av1_init_lv_map(cm); av1_init_lv_map(cm);
#endif
cm->fc->initialized = 1; cm->fc->initialized = 1;
av1_setup_frame_contexts(cm); av1_setup_frame_contexts(cm);
......
...@@ -76,7 +76,6 @@ typedef struct frame_contexts { ...@@ -76,7 +76,6 @@ typedef struct frame_contexts {
coeff_cdf_model coef_tail_cdfs[TX_SIZES][PLANE_TYPES]; coeff_cdf_model coef_tail_cdfs[TX_SIZES][PLANE_TYPES];
coeff_cdf_model coef_head_cdfs[TX_SIZES][PLANE_TYPES]; coeff_cdf_model coef_head_cdfs[TX_SIZES][PLANE_TYPES];
#if CONFIG_LV_MAP
aom_cdf_prob txb_skip_cdf[TX_SIZES][TXB_SKIP_CONTEXTS][CDF_SIZE(2)]; aom_cdf_prob txb_skip_cdf[TX_SIZES][TXB_SKIP_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob eob_extra_cdf[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS] aom_cdf_prob eob_extra_cdf[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS]
[CDF_SIZE(2)]; [CDF_SIZE(2)];
...@@ -94,7 +93,6 @@ typedef struct frame_contexts { ...@@ -94,7 +93,6 @@ typedef struct frame_contexts {
[CDF_SIZE(4)]; [CDF_SIZE(4)];
aom_cdf_prob coeff_br_cdf[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS] aom_cdf_prob coeff_br_cdf[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS]
[CDF_SIZE(BR_CDF_SIZE)]; [CDF_SIZE(BR_CDF_SIZE)];
#endif
aom_cdf_prob newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)]; aom_cdf_prob newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob zeromv_cdf[GLOBALMV_MODE_CONTEXTS][CDF_SIZE(2)]; aom_cdf_prob zeromv_cdf[GLOBALMV_MODE_CONTEXTS][CDF_SIZE(2)];
...@@ -226,7 +224,6 @@ typedef struct FRAME_COUNTS { ...@@ -226,7 +224,6 @@ typedef struct FRAME_COUNTS {
unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS] unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS]; [SWITCHABLE_FILTERS];
#if CONFIG_LV_MAP
#if CONFIG_ENTROPY_STATS #if CONFIG_ENTROPY_STATS
unsigned int txb_skip[TX_SIZES][TXB_SKIP_CONTEXTS][2]; unsigned int txb_skip[TX_SIZES][TXB_SKIP_CONTEXTS][2];
unsigned int eob_extra[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS][2]; unsigned int eob_extra[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS][2];
...@@ -248,7 +245,6 @@ typedef struct FRAME_COUNTS { ...@@ -248,7 +245,6 @@ typedef struct FRAME_COUNTS {
[NUM_BASE_LEVELS + 2]; [NUM_BASE_LEVELS + 2];
unsigned int coeff_base_eob_multi[TX_SIZES][PLANE_TYPES] unsigned int coeff_base_eob_multi[TX_SIZES][PLANE_TYPES]
[SIG_COEF_CONTEXTS_EOB][NUM_BASE_LEVELS + 1]; [SIG_COEF_CONTEXTS_EOB][NUM_BASE_LEVELS + 1];
#endif // CONFIG_LV_MAP
unsigned int newmv_mode[NEWMV_MODE_CONTEXTS][2]; unsigned int newmv_mode[NEWMV_MODE_CONTEXTS][2];
unsigned int zeromv_mode[GLOBALMV_MODE_CONTEXTS][2]; unsigned int zeromv_mode[GLOBALMV_MODE_CONTEXTS][2];
......
...@@ -199,14 +199,12 @@ typedef struct BufferPool { ...@@ -199,14 +199,12 @@ typedef struct BufferPool {
InternalFrameBufferList int_frame_buffers; InternalFrameBufferList int_frame_buffers;
} BufferPool; } BufferPool;
#if CONFIG_LV_MAP
typedef struct { typedef struct {
int base_ctx_table[2 /*row*/][2 /*col*/][3 /*sig_map*/] int base_ctx_table[2 /*row*/][2 /*col*/][3 /*sig_map*/]
[BASE_CONTEXT_POSITION_NUM + 1]; [BASE_CONTEXT_POSITION_NUM + 1];
} LV_MAP_CTX_TABLE; } LV_MAP_CTX_TABLE;
typedef int BASE_CTX_TABLE[2 /*col*/][3 /*sig_map*/] typedef int BASE_CTX_TABLE[2 /*col*/][3 /*sig_map*/]
[BASE_CONTEXT_POSITION_NUM + 1]; [BASE_CONTEXT_POSITION_NUM + 1];
#endif
#if CONFIG_REFERENCE_BUFFER #if CONFIG_REFERENCE_BUFFER
/* Initial version of sequence header structure */ /* Initial version of sequence header structure */
...@@ -600,9 +598,7 @@ typedef struct AV1Common { ...@@ -600,9 +598,7 @@ typedef struct AV1Common {
int refresh_mask; int refresh_mask;
int invalid_delta_frame_id_minus1; int invalid_delta_frame_id_minus1;
#endif // CONFIG_REFERENCE_BUFFER #endif // CONFIG_REFERENCE_BUFFER
#if CONFIG_LV_MAP
LV_MAP_CTX_TABLE coeff_ctx_table; LV_MAP_CTX_TABLE coeff_ctx_table;
#endif
#if CONFIG_MFMV #if CONFIG_MFMV
TPL_MV_REF *tpl_mvs; TPL_MV_REF *tpl_mvs;
int tpl_mvs_mem_size; int tpl_mvs_mem_size;
......
This diff is collapsed.
...@@ -50,13 +50,8 @@ static INLINE int get_coef_context(const int16_t *neighbors, ...@@ -50,13 +50,8 @@ static INLINE int get_coef_context(const int16_t *neighbors,
static INLINE const SCAN_ORDER *get_default_scan(TX_SIZE tx_size, static INLINE const SCAN_ORDER *get_default_scan(TX_SIZE tx_size,
TX_TYPE tx_type, TX_TYPE tx_type,
int is_inter) { int is_inter) {
#if CONFIG_LV_MAP
(void)is_inter; (void)is_inter;
return &av1_inter_scan_orders[tx_size][tx_type]; return &av1_inter_scan_orders[tx_size][tx_type];
#else
return is_inter ? &av1_inter_scan_orders[tx_size][tx_type]
: &av1_intra_scan_orders[tx_size][tx_type];
#endif
} }
static INLINE const SCAN_ORDER *get_scan(const AV1_COMMON *cm, TX_SIZE tx_size, static INLINE const SCAN_ORDER *get_scan(const AV1_COMMON *cm, TX_SIZE tx_size,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -57,9 +57,7 @@ ...@@ -57,9 +57,7 @@
#include "av1/decoder/decodeframe.h" #include "av1/decoder/decodeframe.h"
#include "av1/decoder/decodemv.h" #include "av1/decoder/decodemv.h"
#include "av1/decoder/decoder.h" #include "av1/decoder/decoder.h"
#if CONFIG_LV_MAP
#include "av1/decoder/decodetxb.h" #include "av1/decoder/decodetxb.h"
#endif
#include "av1/decoder/detokenize.h" #include "av1/decoder/detokenize.h"
#define MAX_AV1_HEADER_SIZE 80 #define MAX_AV1_HEADER_SIZE 80
...@@ -129,7 +127,6 @@ static void predict_and_reconstruct_intra_block( ...@@ -129,7 +127,6 @@ static void predict_and_reconstruct_intra_block(
struct aom_usec_timer timer; struct aom_usec_timer timer;
aom_usec_timer_start(&timer); aom_usec_timer_start(&timer);
#endif #endif
#if CONFIG_LV_MAP
int16_t max_scan_line = 0; int16_t max_scan_line = 0;
int eob; int eob;
av1_read_coeffs_txb_facade(cm, xd, r, row, col, plane, tx_size, av1_read_coeffs_txb_facade(cm, xd, r, row, col, plane, tx_size,
...@@ -137,15 +134,6 @@ static void predict_and_reconstruct_intra_block( ...@@ -137,15 +134,6 @@ static void predict_and_reconstruct_intra_block(
// tx_type will be read out in av1_read_coeffs_txb_facade // tx_type will be read out in av1_read_coeffs_txb_facade
const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, tx_size, const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, tx_size,
cm->reduced_tx_set_used); cm->reduced_tx_set_used);
#else // CONFIG_LV_MAP
const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, row, col, tx_size,
cm->reduced_tx_set_used);
const SCAN_ORDER *scan_order = get_scan(cm, tx_size, tx_type, mbmi);
int16_t max_scan_line = 0;
const int eob =
av1_decode_block_tokens(cm, xd, plane, scan_order, col, row, tx_size,
tx_type, &max_scan_line, r, mbmi->segment_id);
#endif // CONFIG_LV_MAP
#if TXCOEFF_TIMER #if TXCOEFF_TIMER
aom_usec_timer_mark(&timer); aom_usec_timer_mark(&timer);
...@@ -192,7 +180,6 @@ static void decode_reconstruct_tx(AV1_COMMON *cm, MACROBLOCKD *const xd, ...@@ -192,7 +180,6 @@ static void decode_reconstruct_tx(AV1_COMMON *cm, MACROBLOCKD *const xd,
struct aom_usec_timer timer; struct aom_usec_timer timer;
aom_usec_timer_start(&timer); aom_usec_timer_start(&timer);
#endif #endif
#if CONFIG_LV_MAP
int16_t max_scan_line = 0; int16_t max_scan_line = 0;
int eob; int eob;
av1_read_coeffs_txb_facade(cm, xd, r, blk_row, blk_col, plane, tx_size, av1_read_coeffs_txb_facade(cm, xd, r, blk_row, blk_col, plane, tx_size,
...@@ -200,15 +187,6 @@ static void decode_reconstruct_tx(AV1_COMMON *cm, MACROBLOCKD *const xd, ...@@ -200,15 +187,6 @@ static void decode_reconstruct_tx(AV1_COMMON *cm, MACROBLOCKD *const xd,
// tx_type will be read out in av1_read_coeffs_txb_facade // tx_type will be read out in av1_read_coeffs_txb_facade
const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col, const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col,
tx_size, cm->reduced_tx_set_used); tx_size, cm->reduced_tx_set_used);
#else // CONFIG_LV_MAP
const TX_TYPE tx_type = av1_get_tx_type(plane_type, xd, blk_row, blk_col,
tx_size, cm->reduced_tx_set_used);
const SCAN_ORDER *sc = get_scan(cm, tx_size, tx_type, mbmi);
int16_t max_scan_line = 0;
const int eob =
av1_decode_block_tokens(cm, xd, plane, sc, blk_col, blk_row, tx_size,
tx_type, &max_scan_line, r, mbmi->segment_id);
#endif // CONFIG_LV_MAP
#if TXCOEFF_TIMER #if TXCOEFF_TIMER
aom_usec_timer_mark(&timer); aom_usec_timer_mark(&timer);
......
<
...@@ -42,9 +42,7 @@ ...@@ -42,9 +42,7 @@
#include "av1/encoder/bitstream.h" #include "av1/encoder/bitstream.h"
#include "av1/encoder/cost.h" #include "av1/encoder/cost.h"
#include "av1/encoder/encodemv.h" #include "av1/encoder/encodemv.h"
#if CONFIG_LV_MAP
#include "av1/encoder/encodetxb.h" #include "av1/encoder/encodetxb.h"
#endif // CONFIG_LV_MAP
#include "av1/encoder/mcomp.h" #include "av1/encoder/mcomp.h"
#include "av1/encoder/palette.h" #include "av1/encoder/palette.h"
#include "av1/encoder/segmentation.h" #include "av1/encoder/segmentation.h"
...@@ -385,79 +383,6 @@ static void pack_map_tokens(aom_writer *w, const TOKENEXTRA **tp, int n, ...@@ -385,79 +383,6 @@ static void pack_map_tokens(aom_writer *w, const TOKENEXTRA **tp, int n,
*tp = p; *tp = p;
} }
#if !CONFIG_LV_MAP
static INLINE void write_coeff_extra(const aom_cdf_prob *const *cdf, int val,
int n, aom_writer *w) {
// Code the extra bits from LSB to MSB in groups of 4
int i = 0;
int count = 0;
while (count < n) {
const int size = AOMMIN(n - count, 4);
const int mask = (1 << size) - 1;
aom_write_cdf(w, val & mask, cdf[i++], 1 << size);
val >>= size;
count += size;
}
}
static void pack_mb_tokens(aom_writer *w, const TOKENEXTRA **tp,
const TOKENEXTRA *const stop,
aom_bit_depth_t bit_depth, const TX_SIZE tx_size,
TOKEN_STATS *token_stats) {
const TOKENEXTRA *p = *tp;
int count = 0;
const int seg_eob = av1_get_max_eob(tx_size);
while (p < stop && p->token != EOSB_TOKEN) {
const int token = p->token;
const int8_t eob_val = p->eob_val;
if (token == BLOCK_Z_TOKEN) {
aom_write_symbol(w, 0, *p->head_cdf, HEAD_TOKENS + 1);
p++;
break;
continue;
}
const av1_extra_bit *const extra_bits = &av1_extra_bits[token];
if (eob_val == LAST_EOB) {
// Just code a flag indicating whether the value is >1 or 1.
aom_write_bit(w, token != ONE_TOKEN);
} else {
int comb_symb = 2 * AOMMIN(token, TWO_TOKEN) - eob_val + p->first_val;
aom_write_symbol(w, comb_symb, *p->head_cdf, HEAD_TOKENS + p->first_val);
}
if (token > ONE_TOKEN) {
aom_write_symbol(w, token - TWO_TOKEN, *p->tail_cdf, TAIL_TOKENS);
}
if (extra_bits->base_val) {
const int bit_string = p->extra;
const int bit_string_length = extra_bits->len; // Length of extra bits to
const int is_cat6 = (extra_bits->base_val == CAT6_MIN_VAL);
// be written excluding
// the sign bit.
int skip_bits = is_cat6 ? CAT6_BIT_SIZE - av1_get_cat6_extrabits_size(
tx_size, bit_depth)
: 0;
assert(!(bit_string >> (bit_string_length - skip_bits + 1)));
if (bit_string_length > 0)
write_coeff_extra(extra_bits->cdf, bit_string >> 1,
bit_string_length - skip_bits, w);
aom_write_bit_record(w, bit_string & 1, token_stats);
}
++p;
++count;
if (eob_val == EARLY_EOB || count == seg_eob) break;
}
*tp = p;
}
#endif // !CONFIG_LV_MAP
#if CONFIG_LV_MAP
static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x,
const TOKENEXTRA **tp, const TOKENEXTRA **tp,
const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, const TOKENEXTRA *const tok_end, MACROBLOCKD *xd,
...@@ -513,56 +438,6 @@ static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x, ...@@ -513,56 +438,6 @@ static void pack_txb_tokens(aom_writer *w, AV1_COMMON *cm, MACROBLOCK *const x,
} }
} }
} }
#else // CONFIG_LV_MAP
static void pack_txb_tokens(aom_writer *w, const TOKENEXTRA **tp,
const TOKENEXTRA *const tok_end, MACROBLOCKD *xd,
MB_MODE_INFO *mbmi, int plane,
BLOCK_SIZE plane_bsize, aom_bit_depth_t bit_depth,
int block, int blk_row, int blk_col,
TX_SIZE tx_size, TOKEN_STATS *token_stats) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
const int tx_row = blk_row >> (1 - pd->subsampling_y);
const int tx_col = blk_col >> (1 - pd->subsampling_x);
const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
const TX_SIZE plane_tx_size =
plane ? av1_get_uv_tx_size(mbmi, pd->subsampling_x, pd->subsampling_y)
: mbmi->inter_tx_size[tx_row][tx_col];
if (tx_size == plane_tx_size || plane) {
TOKEN_STATS tmp_token_stats;
init_token_stats(&tmp_token_stats);
pack_mb_tokens(w, tp, tok_end, bit_depth, tx_size, &tmp_token_stats);
#if CONFIG_RD_DEBUG
token_stats->txb_coeff_cost_map[blk_row][blk_col] = tmp_token_stats.cost;
token_stats->cost += tmp_token_stats.cost;
#endif
} else {
const TX_SIZE sub_txs = sub_tx_size_map[1][tx_size];
const int bsw = tx_size_wide_unit[sub_txs];
const int bsh = tx_size_high_unit[sub_txs];
assert(bsw > 0 && bsh > 0);
for (int r = 0; r < tx_size_high_unit[tx_size]; r += bsh) {
for (int c = 0; c < tx_size_wide_unit[tx_size]; c += bsw) {
const int offsetr = blk_row + r;
const int offsetc = blk_col + c;
const int step = bsh * bsw;
if (offsetr >= max_blocks_high || offsetc >= max_blocks_wide) continue;
pack_txb_tokens(w, tp, tok_end, xd, mbmi, plane, plane_bsize, bit_depth,
block, offsetr, offsetc, sub_txs, token_stats);
block += step;
}
}
}
}
#endif // CONFIG_LV_MAP
#if CONFIG_SPATIAL_SEGMENTATION #if CONFIG_SPATIAL_SEGMENTATION
static int neg_interleave(int x, int ref, int max) { static int neg_interleave(int x, int ref, int max) {
...@@ -1875,12 +1750,9 @@ static void write_inter_txb_coeff(AV1_COMMON *const cm, MACROBLOCK *const x, ...@@ -1875,12 +1750,9 @@ static void write_inter_txb_coeff(AV1_COMMON *const cm, MACROBLOCK *const x,
blk_row += bkh) { blk_row += bkh) {
for (blk_col = col >> pd->subsampling_x; blk_col < unit_width; for (blk_col = col >> pd->subsampling_x; blk_col < unit_width;
blk_col += bkw) { blk_col += bkw) {
pack_txb_tokens(w, pack_txb_tokens(w, cm, x, tok, tok_end, xd, mbmi, plane, plane_bsize,
#if CONFIG_LV_MAP cm->bit_depth, *block, blk_row, blk_col, max_tx_size,
cm, x, token_stats);
#endif
tok, tok_end, xd, mbmi, plane, plane_bsize, cm->bit_depth,
*block, blk_row, blk_col, max_tx_size, token_stats);
*block += step; *block += step;
} }
} }
...@@ -1899,10 +1771,8 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile, ...@@ -1899,10 +1771,8 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
int plane; int plane;
int bh, bw; int bh, bw;
MACROBLOCK *const x = &cpi->td.mb; MACROBLOCK *const x = &cpi->td.mb;
#if CONFIG_LV_MAP
(void)tok; (void)tok;
(void)tok_end; (void)tok_end;
#endif
xd->mi = cm->mi_grid_visible + mi_offset; xd->mi = cm->mi_grid_visible + mi_offset;
assert(mbmi->sb_type <= cm->seq_params.sb_size || assert(mbmi->sb_type <= cm->seq_params.sb_size ||
...@@ -1934,17 +1804,10 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile, ...@@ -1934,17 +1804,10 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
&cols); &cols);
assert(*tok < tok_end); assert(*tok < tok_end);
pack_map_tokens(w, tok, palette_size_plane, rows * cols); pack_map_tokens(w, tok, palette_size_plane, rows * cols);
#if !CONFIG_LV_MAP
assert(*tok < tok_end + mbmi->skip);
#endif // !CONFIG_LV_MAP
} }
} }
if (!mbmi->skip) { if (!mbmi->skip) {
#if !CONFIG_LV_MAP
assert(*tok < tok_end);
#endif
if (!is_inter_block(mbmi)) if (!is_inter_block(mbmi))
av1_write_coeffs_mb(cm, x, mi_row, mi_col, w, mbmi->sb_type); av1_write_coeffs_mb(cm, x, mi_row, mi_col, w, mbmi->sb_type);
...@@ -1975,9 +1838,6 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile, ...@@ -1975,9 +1838,6 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
const struct macroblockd_plane *const pd = &xd->plane[plane]; const struct macroblockd_plane *const pd = &xd->plane[plane];
if (!is_chroma_reference(mi_row, mi_col, mbmi->sb_type, if (!is_chroma_reference(mi_row, mi_col, mbmi->sb_type,
pd->subsampling_x, pd->subsampling_y)) { pd->subsampling_x, pd->subsampling_y)) {
#if !CONFIG_LV_MAP
(*tok)++;
#endif // !CONFIG_LV_MAP
continue; continue;
} }
write_inter_txb_coeff(cm, x, mbmi, w, tok, tok_end, &token_stats, write_inter_txb_coeff(cm, x, mbmi, w, tok, tok_end, &token_stats,
...@@ -3071,9 +2931,6 @@ static uint32_t write_tiles(AV1_COMP *const cpi, uint8_t *const dst, ...@@ -3071,9 +2931,6 @@ static uint32_t write_tiles(AV1_COMP *const cpi, uint8_t *const dst,