Commit 03f6fdcf authored by Urvang Joshi's avatar Urvang Joshi
Browse files

Fix warnings reported by -Wshadow: Part1b: scan_order struct and variable

- Change struct name to all caps SCAN_ORDER to be locally consistent.
- Rename struct pointers to 'scan_order' instead of hard to read short
  names 'so' and 'sc'.

Cherry-picked from aomedia/master: 30abc082

Change-Id: Ib9f0eefe28fa97d23d642b77d7dc8e5f8613177d
parent fdb60962
...@@ -3799,7 +3799,7 @@ DECLARE_ALIGNED(16, static const int16_t, av1_qtr_iscan_32x32[1024]) = { ...@@ -3799,7 +3799,7 @@ DECLARE_ALIGNED(16, static const int16_t, av1_qtr_iscan_32x32[1024]) = {
}; };
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
const scan_order av1_default_scan_orders[TX_SIZES] = { const SCAN_ORDER av1_default_scan_orders[TX_SIZES] = {
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors }, { default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
{ default_scan_8x8, av1_default_iscan_8x8, default_scan_8x8_neighbors }, { default_scan_8x8, av1_default_iscan_8x8, default_scan_8x8_neighbors },
{ default_scan_16x16, av1_default_iscan_16x16, default_scan_16x16_neighbors }, { default_scan_16x16, av1_default_iscan_16x16, default_scan_16x16_neighbors },
...@@ -3807,7 +3807,7 @@ const scan_order av1_default_scan_orders[TX_SIZES] = { ...@@ -3807,7 +3807,7 @@ const scan_order av1_default_scan_orders[TX_SIZES] = {
}; };
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES] = { const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
{ {
// TX_4X4 // TX_4X4
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors }, { default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
...@@ -3894,7 +3894,7 @@ const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES] = { ...@@ -3894,7 +3894,7 @@ const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
} }
}; };
const scan_order av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = { const SCAN_ORDER av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = {
{ {
// TX_4X4 // TX_4X4
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors }, { default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
...@@ -4135,7 +4135,7 @@ const scan_order av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = { ...@@ -4135,7 +4135,7 @@ const scan_order av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = {
#else // CONFIG_EXT_TX #else // CONFIG_EXT_TX
const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES] = { const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
{ // TX_4X4 { // TX_4X4
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors }, { default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
{ row_scan_4x4, av1_row_iscan_4x4, row_scan_4x4_neighbors }, { row_scan_4x4, av1_row_iscan_4x4, row_scan_4x4_neighbors },
......
...@@ -28,10 +28,10 @@ typedef struct { ...@@ -28,10 +28,10 @@ typedef struct {
const int16_t *scan; const int16_t *scan;
const int16_t *iscan; const int16_t *iscan;
const int16_t *neighbors; const int16_t *neighbors;
} scan_order; } SCAN_ORDER;
extern const scan_order av1_default_scan_orders[TX_SIZES]; extern const SCAN_ORDER av1_default_scan_orders[TX_SIZES];
extern const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES]; extern const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES];
static INLINE int get_coef_context(const int16_t *neighbors, static INLINE int get_coef_context(const int16_t *neighbors,
const uint8_t *token_cache, int c) { const uint8_t *token_cache, int c) {
...@@ -40,21 +40,21 @@ static INLINE int get_coef_context(const int16_t *neighbors, ...@@ -40,21 +40,21 @@ static INLINE int get_coef_context(const int16_t *neighbors,
1; 1;
} }
static INLINE const scan_order *get_intra_scan(TX_SIZE tx_size, static INLINE const SCAN_ORDER *get_intra_scan(TX_SIZE tx_size,
TX_TYPE tx_type) { TX_TYPE tx_type) {
return &av1_intra_scan_orders[tx_size][tx_type]; return &av1_intra_scan_orders[tx_size][tx_type];
} }
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
extern const scan_order av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES]; extern const SCAN_ORDER av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES];
static INLINE const scan_order *get_inter_scan(TX_SIZE tx_size, static INLINE const SCAN_ORDER *get_inter_scan(TX_SIZE tx_size,
TX_TYPE tx_type) { TX_TYPE tx_type) {
return &av1_inter_scan_orders[tx_size][tx_type]; return &av1_inter_scan_orders[tx_size][tx_type];
} }
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
static INLINE const scan_order *get_scan(TX_SIZE tx_size, TX_TYPE tx_type, static INLINE const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type,
int is_inter) { int is_inter) {
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
return is_inter ? &av1_inter_scan_orders[tx_size][tx_type] return is_inter ? &av1_inter_scan_orders[tx_size][tx_type]
......
...@@ -295,9 +295,9 @@ static void predict_and_reconstruct_intra_block(MACROBLOCKD *const xd, ...@@ -295,9 +295,9 @@ static void predict_and_reconstruct_intra_block(MACROBLOCKD *const xd,
if (!mbmi->skip) { if (!mbmi->skip) {
TX_TYPE tx_type = get_tx_type(plane_type, xd, block_idx, tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block_idx, tx_size);
const scan_order *sc = get_scan(tx_size, tx_type, 0); const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type, 0);
const int eob = av1_decode_block_tokens(xd, plane, sc, col, row, tx_size, const int eob = av1_decode_block_tokens(
tx_type, r, mbmi->segment_id); xd, plane, scan_order, col, row, tx_size, tx_type, r, mbmi->segment_id);
inverse_transform_block(xd, plane, tx_type, tx_size, dst, pd->dst.stride, inverse_transform_block(xd, plane, tx_type, tx_size, dst, pd->dst.stride,
eob); eob);
} }
...@@ -329,7 +329,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, aom_reader *r, ...@@ -329,7 +329,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, aom_reader *r,
if (tx_size == plane_tx_size) { if (tx_size == plane_tx_size) {
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV; PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, plane_tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block, plane_tx_size);
const scan_order *sc = get_scan(plane_tx_size, tx_type, 1); const SCAN_ORDER *sc = get_scan(plane_tx_size, tx_type, 1);
const int eob = const int eob =
av1_decode_block_tokens(xd, plane, sc, blk_col, blk_row, plane_tx_size, av1_decode_block_tokens(xd, plane, sc, blk_col, blk_row, plane_tx_size,
tx_type, r, mbmi->segment_id); tx_type, r, mbmi->segment_id);
...@@ -372,9 +372,9 @@ static int reconstruct_inter_block(MACROBLOCKD *const xd, ...@@ -372,9 +372,9 @@ static int reconstruct_inter_block(MACROBLOCKD *const xd,
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV; PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
int block_idx = (row << 1) + col; int block_idx = (row << 1) + col;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block_idx, tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block_idx, tx_size);
const scan_order *sc = get_scan(tx_size, tx_type, 1); const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type, 1);
const int eob = av1_decode_block_tokens(xd, plane, sc, col, row, tx_size, const int eob = av1_decode_block_tokens(xd, plane, scan_order, col, row,
tx_type, r, segment_id); tx_size, tx_type, r, segment_id);
inverse_transform_block(xd, plane, tx_type, tx_size, inverse_transform_block(xd, plane, tx_type, tx_size,
&pd->dst.buf[4 * row * pd->dst.stride + 4 * col], &pd->dst.buf[4 * row * pd->dst.stride + 4 * col],
......
...@@ -364,7 +364,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, ...@@ -364,7 +364,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
#endif // CONFIG_PALETTE #endif // CONFIG_PALETTE
int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane, int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane,
const scan_order *sc, int x, int y, TX_SIZE tx_size, const SCAN_ORDER *sc, int x, int y, TX_SIZE tx_size,
TX_TYPE tx_type, TX_TYPE tx_type,
#if CONFIG_ANS #if CONFIG_ANS
struct AnsDecoder *const r, struct AnsDecoder *const r,
......
...@@ -27,7 +27,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r); ...@@ -27,7 +27,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r);
#endif // CONFIG_PALETTE #endif // CONFIG_PALETTE
int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane, int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane,
const scan_order *sc, int x, int y, TX_SIZE tx_size, const SCAN_ORDER *sc, int x, int y, TX_SIZE tx_size,
TX_TYPE tx_type, TX_TYPE tx_type,
#if CONFIG_ANS #if CONFIG_ANS
struct AnsDecoder *const r, struct AnsDecoder *const r,
......
...@@ -85,10 +85,10 @@ int av1_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size, ...@@ -85,10 +85,10 @@ int av1_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
const int16_t *const dequant_ptr = pd->dequant; const int16_t *const dequant_ptr = pd->dequant;
const uint8_t *const band_translate = get_band_translate(tx_size); const uint8_t *const band_translate = get_band_translate(tx_size);
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const scan_order *const so = const SCAN_ORDER *const scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi)); get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
const int16_t *const scan = so->scan; const int16_t *const scan = scan_order->scan;
const int16_t *const nb = so->neighbors; const int16_t *const nb = scan_order->neighbors;
#if CONFIG_AOM_QM #if CONFIG_AOM_QM
int seg_id = xd->mi[0]->mbmi.segment_id; int seg_id = xd->mi[0]->mbmi.segment_id;
const qm_val_t *iqmatrix = pd->seg_iqmatrix[seg_id][!ref][tx_size]; const qm_val_t *iqmatrix = pd->seg_iqmatrix[seg_id][!ref][tx_size];
...@@ -447,7 +447,7 @@ void av1_xform_quant(MACROBLOCK *x, int plane, int block, int blk_row, ...@@ -447,7 +447,7 @@ void av1_xform_quant(MACROBLOCK *x, int plane, int block, int blk_row,
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV; PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const int is_inter = is_inter_block(&xd->mi[0]->mbmi); const int is_inter = is_inter_block(&xd->mi[0]->mbmi);
const scan_order *const scan_order = get_scan(tx_size, tx_type, is_inter); const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type, is_inter);
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block); tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
...@@ -520,7 +520,7 @@ void av1_xform_quant_nuq(MACROBLOCK *x, int plane, int block, int blk_row, ...@@ -520,7 +520,7 @@ void av1_xform_quant_nuq(MACROBLOCK *x, int plane, int block, int blk_row,
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV; PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const int is_inter = is_inter_block(&xd->mi[0]->mbmi); const int is_inter = is_inter_block(&xd->mi[0]->mbmi);
const scan_order *const scan_order = get_scan(tx_size, tx_type, is_inter); const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type, is_inter);
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block); tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
...@@ -593,7 +593,7 @@ void av1_xform_quant_fp_nuq(MACROBLOCK *x, int plane, int block, int blk_row, ...@@ -593,7 +593,7 @@ void av1_xform_quant_fp_nuq(MACROBLOCK *x, int plane, int block, int blk_row,
const int is_inter = is_inter_block(&xd->mi[0]->mbmi); const int is_inter = is_inter_block(&xd->mi[0]->mbmi);
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV; PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const scan_order *const scan_order = get_scan(tx_size, tx_type, is_inter); const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type, is_inter);
int dq = get_dq_profile_from_ctx(xd->qindex[xd->mi[0]->mbmi.segment_id], ctx, int dq = get_dq_profile_from_ctx(xd->qindex[xd->mi[0]->mbmi.segment_id], ctx,
is_inter, plane_type); is_inter, plane_type);
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block); tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
......
...@@ -344,7 +344,7 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, ...@@ -344,7 +344,7 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr, const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam) { const SCAN_ORDER *sc, const QUANT_PARAM *qparam) {
// obsolete skip_block // obsolete skip_block
const int skip_block = 0; const int skip_block = 0;
...@@ -362,7 +362,7 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, ...@@ -362,7 +362,7 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
void av1_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, void av1_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr, const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, tran_low_t *dqcoeff_ptr, const MACROBLOCKD_PLANE *pd, tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr, const scan_order *sc, uint16_t *eob_ptr, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) { const QUANT_PARAM *qparam) {
// obsolete skip_block // obsolete skip_block
const int skip_block = 0; const int skip_block = 0;
...@@ -382,7 +382,7 @@ void av1_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, ...@@ -382,7 +382,7 @@ void av1_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr, const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam) { const SCAN_ORDER *sc, const QUANT_PARAM *qparam) {
// obsolete skip_block // obsolete skip_block
const int skip_block = 0; const int skip_block = 0;
(void)sc; (void)sc;
...@@ -402,7 +402,7 @@ void av1_highbd_quantize_fp_facade(const tran_low_t *coeff_ptr, ...@@ -402,7 +402,7 @@ void av1_highbd_quantize_fp_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) { const QUANT_PARAM *qparam) {
// obsolete skip_block // obsolete skip_block
const int skip_block = 0; const int skip_block = 0;
...@@ -418,7 +418,7 @@ void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr, ...@@ -418,7 +418,7 @@ void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) { const QUANT_PARAM *qparam) {
// obsolete skip_block // obsolete skip_block
const int skip_block = 0; const int skip_block = 0;
...@@ -434,7 +434,7 @@ void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr, ...@@ -434,7 +434,7 @@ void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) { const QUANT_PARAM *qparam) {
// obsolete skip_block // obsolete skip_block
const int skip_block = 0; const int skip_block = 0;
......
...@@ -28,7 +28,7 @@ typedef void (*AV1_QUANT_FACADE)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, ...@@ -28,7 +28,7 @@ typedef void (*AV1_QUANT_FACADE)(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
tran_low_t *qcoeff_ptr, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam); const QUANT_PARAM *qparam);
typedef struct { typedef struct {
...@@ -80,19 +80,19 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, ...@@ -80,19 +80,19 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr, const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam); const SCAN_ORDER *sc, const QUANT_PARAM *qparam);
void av1_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, void av1_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr, const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, tran_low_t *dqcoeff_ptr, const MACROBLOCKD_PLANE *pd, tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr, const scan_order *sc, uint16_t *eob_ptr, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam); const QUANT_PARAM *qparam);
void av1_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs, void av1_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr, const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam); const SCAN_ORDER *sc, const QUANT_PARAM *qparam);
#if CONFIG_NEW_QUANT #if CONFIG_NEW_QUANT
void quantize_dc_nuq(const tran_low_t *coeff_ptr, intptr_t n_coeffs, void quantize_dc_nuq(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
...@@ -128,7 +128,7 @@ void av1_highbd_quantize_fp_facade(const tran_low_t *coeff_ptr, ...@@ -128,7 +128,7 @@ void av1_highbd_quantize_fp_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam); const QUANT_PARAM *qparam);
void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr, void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr,
...@@ -136,7 +136,7 @@ void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr, ...@@ -136,7 +136,7 @@ void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam); const QUANT_PARAM *qparam);
void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr, void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr,
...@@ -144,7 +144,7 @@ void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr, ...@@ -144,7 +144,7 @@ void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam); const QUANT_PARAM *qparam);
void av1_highbd_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs, void av1_highbd_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs,
......
...@@ -135,7 +135,7 @@ struct rdcost_block_args { ...@@ -135,7 +135,7 @@ struct rdcost_block_args {
int64_t best_rd; int64_t best_rd;
int exit_early; int exit_early;
int use_fast_coef_costing; int use_fast_coef_costing;
const scan_order *so; const SCAN_ORDER *scan_order;
uint8_t skippable; uint8_t skippable;
}; };
...@@ -1070,7 +1070,7 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane, int block, ...@@ -1070,7 +1070,7 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane, int block,
static int rate_block(int plane, int block, int coeff_ctx, TX_SIZE tx_size, static int rate_block(int plane, int block, int coeff_ctx, TX_SIZE tx_size,
struct rdcost_block_args *args) { struct rdcost_block_args *args) {
return av1_cost_coeffs(args->x, plane, block, coeff_ctx, tx_size, return av1_cost_coeffs(args->x, plane, block, coeff_ctx, tx_size,
args->so->scan, args->so->neighbors, args->scan_order->scan, args->scan_order->neighbors,
args->use_fast_coef_costing); args->use_fast_coef_costing);
} }
...@@ -1232,7 +1232,8 @@ static void txfm_rd_in_plane(MACROBLOCK *x, const AV1_COMP *cpi, int *rate, ...@@ -1232,7 +1232,8 @@ static void txfm_rd_in_plane(MACROBLOCK *x, const AV1_COMP *cpi, int *rate,
av1_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left); av1_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
tx_type = get_tx_type(pd->plane_type, xd, 0, tx_size); tx_type = get_tx_type(pd->plane_type, xd, 0, tx_size);
args.so = get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi)); args.scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
av1_foreach_transformed_block_in_plane(xd, bsize, plane, block_rd_txfm, av1_foreach_transformed_block_in_plane(xd, bsize, plane, block_rd_txfm,
&args); &args);
...@@ -1275,7 +1276,8 @@ void av1_txfm_rd_in_plane_supertx(MACROBLOCK *x, const AV1_COMP *cpi, int *rate, ...@@ -1275,7 +1276,8 @@ void av1_txfm_rd_in_plane_supertx(MACROBLOCK *x, const AV1_COMP *cpi, int *rate,
av1_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left); av1_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
tx_type = get_tx_type(pd->plane_type, xd, 0, tx_size); tx_type = get_tx_type(pd->plane_type, xd, 0, tx_size);
args.so = get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi)); args.scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
block_rd_txfm(plane, 0, 0, 0, get_plane_block_size(bsize, pd), tx_size, block_rd_txfm(plane, 0, 0, 0, get_plane_block_size(bsize, pd), tx_size,
&args); &args);
...@@ -1946,7 +1948,7 @@ static int64_t rd_pick_intra4x4block( ...@@ -1946,7 +1948,7 @@ static int64_t rd_pick_intra4x4block(
dst_stride, xd->bd); dst_stride, xd->bd);
if (xd->lossless[xd->mi[0]->mbmi.segment_id]) { if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4); TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0); const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx = const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy)); combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT #if CONFIG_NEW_QUANT
...@@ -1956,9 +1958,9 @@ static int64_t rd_pick_intra4x4block( ...@@ -1956,9 +1958,9 @@ static int64_t rd_pick_intra4x4block(
av1_xform_quant(x, 0, block, row + idy, col + idx, BLOCK_8X8, av1_xform_quant(x, 0, block, row + idy, col + idx, BLOCK_8X8,
TX_4X4, AV1_XFORM_QUANT_FP); TX_4X4, AV1_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT #endif // CONFIG_NEW_QUANT
ratey += ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan, scan_order->scan, scan_order->neighbors,
so->neighbors, cpi->sf.use_fast_coef_costing); cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0); *(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0); *(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0); can_skip &= (p->eobs[block] == 0);
...@@ -1971,7 +1973,7 @@ static int64_t rd_pick_intra4x4block( ...@@ -1971,7 +1973,7 @@ static int64_t rd_pick_intra4x4block(
int64_t dist; int64_t dist;
unsigned int tmp; unsigned int tmp;
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4); TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0); const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx = const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy)); combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT #if CONFIG_NEW_QUANT
...@@ -1982,9 +1984,9 @@ static int64_t rd_pick_intra4x4block( ...@@ -1982,9 +1984,9 @@ static int64_t rd_pick_intra4x4block(
TX_4X4, AV1_XFORM_QUANT_FP); TX_4X4, AV1_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT #endif // CONFIG_NEW_QUANT
av1_optimize_b(x, 0, block, TX_4X4, coeff_ctx); av1_optimize_b(x, 0, block, TX_4X4, coeff_ctx);
ratey += ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan, scan_order->scan, scan_order->neighbors,
so->neighbors, cpi->sf.use_fast_coef_costing); cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0); *(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0); *(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0); can_skip &= (p->eobs[block] == 0);
...@@ -2066,7 +2068,7 @@ static int64_t rd_pick_intra4x4block( ...@@ -2066,7 +2068,7 @@ static int64_t rd_pick_intra4x4block(
if (xd->lossless[xd->mi[0]->mbmi.segment_id]) { if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4); TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0); const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx = const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy)); combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT #if CONFIG_NEW_QUANT
...@@ -2076,9 +2078,9 @@ static int64_t rd_pick_intra4x4block( ...@@ -2076,9 +2078,9 @@ static int64_t rd_pick_intra4x4block(
av1_xform_quant(x, 0, block, row + idy, col + idx, BLOCK_8X8, TX_4X4, av1_xform_quant(x, 0, block, row + idy, col + idx, BLOCK_8X8, TX_4X4,
AV1_XFORM_QUANT_B); AV1_XFORM_QUANT_B);
#endif // CONFIG_NEW_QUANT #endif // CONFIG_NEW_QUANT
ratey += ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan, scan_order->scan, scan_order->neighbors,
so->neighbors, cpi->sf.use_fast_coef_costing); cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0); *(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0); *(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0); can_skip &= (p->eobs[block] == 0);
...@@ -2090,7 +2092,7 @@ static int64_t rd_pick_intra4x4block( ...@@ -2090,7 +2092,7 @@ static int64_t rd_pick_intra4x4block(
int64_t dist; int64_t dist;
unsigned int tmp; unsigned int tmp;
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4); TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0); const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx = const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy)); combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT #if CONFIG_NEW_QUANT
...@@ -2101,9 +2103,9 @@ static int64_t rd_pick_intra4x4block( ...@@ -2101,9 +2103,9 @@ static int64_t rd_pick_intra4x4block(
AV1_XFORM_QUANT_FP); AV1_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT #endif // CONFIG_NEW_QUANT
av1_optimize_b(x, 0, block, TX_4X4, coeff_ctx); av1_optimize_b(x, 0, block, TX_4X4, coeff_ctx);
ratey += ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan, scan_order->scan, scan_order->neighbors,
so->neighbors, cpi->sf.use_fast_coef_costing); cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0); *(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0); *(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0); can_skip &= (p->eobs[block] == 0);
...@@ -2880,7 +2882,7 @@ void av1_tx_block_rd_b(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size, ...@@ -2880,7 +2882,7 @@ void av1_tx_block_rd_b(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size,
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV; PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const scan_order *const scan_order = const SCAN_ORDER *const scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi)); get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));