Commit 6171ae77 authored by Jingning Han's avatar Jingning Han

Unify tokenize_b_arg struct

Use a single struct for tokenization and level map coding.

Change-Id: Id685992b7db5964ee204c4b0b90379df50c56546
parent 52d2b405
......@@ -373,12 +373,6 @@ int av1_cost_coeffs_txb(const AV1_COMP *const cpi, MACROBLOCK *x, int plane,
return cost;
}
typedef struct TxbParams {
const AV1_COMP *cpi;
ThreadData *td;
int rate;
} TxbParams;
int av1_get_txb_entropy_context(const tran_low_t *qcoeff,
const SCAN_ORDER *scan_order, int eob) {
const int16_t *scan = scan_order->scan;
......@@ -397,7 +391,7 @@ int av1_get_txb_entropy_context(const tran_low_t *qcoeff,
static void update_txb_context(int plane, int block, int blk_row, int blk_col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *arg) {
TxbParams *const args = arg;
struct tokenize_b_args *const args = arg;
const AV1_COMP *cpi = args->cpi;
const AV1_COMMON *cm = &cpi->common;
ThreadData *const td = args->td;
......@@ -421,7 +415,7 @@ static void update_txb_context(int plane, int block, int blk_row, int blk_col,
static void update_and_record_txb_context(int plane, int block, int blk_row,
int blk_col, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
TxbParams *const args = arg;
struct tokenize_b_args *const args = arg;
const AV1_COMP *cpi = args->cpi;
const AV1_COMMON *cm = &cpi->common;
ThreadData *const td = args->td;
......@@ -568,7 +562,7 @@ void av1_update_txb_context(const AV1_COMP *cpi, ThreadData *td,
const int ctx = av1_get_skip_context(xd);
const int skip_inc =
!segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP);
struct TxbParams arg = { cpi, td, 0 };
struct tokenize_b_args arg = { cpi, td, NULL, 0 };
(void)rate;
(void)mi_row;
(void)mi_col;
......
......@@ -268,13 +268,6 @@ const struct av1_token av1_coef_encodings[ENTROPY_TOKENS] = {
};
#endif // !CONFIG_EC_MULTISYMBOL
struct tokenize_b_args {
const AV1_COMP *cpi;
ThreadData *td;
TOKENEXTRA **tp;
int this_rate;
};
#if !CONFIG_PVQ || CONFIG_VAR_TX
static void cost_coeffs_b(int plane, int block, int blk_row, int blk_col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) {
......
......@@ -58,6 +58,13 @@ int av1_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
struct AV1_COMP;
struct ThreadData;
struct tokenize_b_args {
const struct AV1_COMP *cpi;
struct ThreadData *td;
TOKENEXTRA **tp;
int this_rate;
};
typedef enum {
OUTPUT_ENABLED = 0,
DRY_RUN_NORMAL,
......
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