Commit e111cba8 authored by Frederic Barbier's avatar Frederic Barbier Committed by Frédéric BARBIER

Remove NEW_QUANT experiment

This experiment has been abandonned for AV1.

Change-Id: I924d172f7ce85b2422bace44684329fcbf71cb5e
parent b57fee02
......@@ -31,11 +31,7 @@
extern "C" {
#endif
#if CONFIG_NEW_QUANT
#define USE_B_QUANT_NO_TRELLIS 0
#else
#define USE_B_QUANT_NO_TRELLIS 1
#endif // CONFIG_NEW_QUANT
#define MAX_MB_PLANE 3
......@@ -288,10 +284,6 @@ typedef struct MB_MODE_INFO {
#if CONFIG_EXT_PARTITION_TYPES
PARTITION_TYPE partition;
#endif
#if CONFIG_NEW_QUANT
int dq_off_index;
int send_dq_bit;
#endif // CONFIG_NEW_QUANT
/* deringing gain *per-superblock* */
int8_t cdef_strength;
int current_q_index;
......@@ -463,9 +455,6 @@ typedef struct macroblockd_plane {
// dequantization process. They have the same coefficient
// shift/scale as TX.
int16_t seg_dequant_QTX[MAX_SEGMENTS][2];
#if CONFIG_NEW_QUANT
dequant_val_type_nuq seg_dequant_nuq_QTX[MAX_SEGMENTS][QUANT_PROFILES][2];
#endif
uint8_t *color_index_map;
// block size in pixels
......
......@@ -658,17 +658,6 @@ typedef enum ATTRIBUTE_PACKED {
#define SUPERRES_SCALE_DENOMINATOR_MIN (SCALE_NUMERATOR + 1)
#endif // CONFIG_HORZONLY_FRAME_SUPERRES
#if CONFIG_NEW_QUANT
typedef enum ATTRIBUTE_PACKED {
DQ_MULT, // Dequant is just multiplication
DQ_MULT_OFFSET1, // Dequant is multiplication and offset1
DQ_MULT_OFFSET2, // Dequant is multiplication and offset2
DQ_MULT_OFFSET3, // Dequant is multiplication and offset3
DQ_TYPES
} DqType;
#define DQ_TYPE_BITS 2
#endif // CONFIG_NEW_QUANT
#ifdef __cplusplus
} // extern "C"
#endif
......
......@@ -386,11 +386,6 @@ typedef struct AV1Common {
int min_qmlevel;
int max_qmlevel;
#endif
#if CONFIG_NEW_QUANT
dequant_val_type_nuq y_dequant_nuq_QTX[MAX_SEGMENTS][QUANT_PROFILES][2];
dequant_val_type_nuq u_dequant_nuq_QTX[MAX_SEGMENTS][QUANT_PROFILES][2];
dequant_val_type_nuq v_dequant_nuq_QTX[MAX_SEGMENTS][QUANT_PROFILES][2];
#endif
/* We allocate a MODE_INFO struct for each macroblock, together with
an extra row on top and column on the left to simplify prediction. */
......@@ -610,9 +605,6 @@ typedef struct AV1Common {
// TODO(jingning): This can be combined with sign_bias later.
int8_t ref_frame_side[TOTAL_REFS_PER_FRAME];
#endif
#if CONFIG_NEW_QUANT
DqType dq_type;
#endif // CONFIG_NEW_QUANT
#if CONFIG_FRAME_REFS_SIGNALING
int frame_refs_short_signaling;
......@@ -800,10 +792,6 @@ static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
memcpy(xd->plane[i].seg_iqmatrix, cm->y_iqmatrix, sizeof(cm->y_iqmatrix));
#endif
#if CONFIG_NEW_QUANT
memcpy(xd->plane[i].seg_dequant_nuq_QTX, cm->y_dequant_nuq_QTX,
sizeof(cm->y_dequant_nuq_QTX));
#endif
} else {
if (i == AOM_PLANE_U) {
memcpy(xd->plane[i].seg_dequant_QTX, cm->u_dequant_QTX,
......@@ -811,10 +799,6 @@ static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_AOM_QM
memcpy(xd->plane[i].seg_iqmatrix, cm->u_iqmatrix,
sizeof(cm->u_iqmatrix));
#endif
#if CONFIG_NEW_QUANT
memcpy(xd->plane[i].seg_dequant_nuq_QTX, cm->u_dequant_nuq_QTX,
sizeof(cm->u_dequant_nuq_QTX));
#endif
} else {
memcpy(xd->plane[i].seg_dequant_QTX, cm->v_dequant_QTX,
......@@ -822,10 +806,6 @@ static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_AOM_QM
memcpy(xd->plane[i].seg_iqmatrix, cm->v_iqmatrix,
sizeof(cm->v_iqmatrix));
#endif
#if CONFIG_NEW_QUANT
memcpy(xd->plane[i].seg_dequant_nuq_QTX, cm->v_dequant_nuq_QTX,
sizeof(cm->v_dequant_nuq_QTX));
#endif
}
}
......
......@@ -16,255 +16,6 @@
#include "av1/common/seg_common.h"
#include "av1/common/blockd.h"
#if CONFIG_NEW_QUANT
// Zero-bin widths expressed as a fraction over 128 of the quant stepsize.
// So a value x indicates the bin is actually factor x/128 of the
// nominal quantization step. The width is only
// for one side of zero, so the actual width is twice that.
// These are needed only on the encoder side.
static const uint8_t x0_nuq[X0_PROFILES][2] = {
{
// lossless
64, 64, // dc, ac
},
// optimize = 1
{
// Y/intra, optimize 1, low quality
64, 64, // dc, ac
},
{
// Y/intra, optimize 1, high quality
64, 64, // dc, ac
},
{
// UV/intra, optimize 1, low quality
64, 64, // dc, ac
},
{
// UV/intra, optimize 1, high quality
64, 64, // dc, ac
},
{
// Y/inter, optimize 1, low quality
64, 64, // dc, ac
},
{
// Y/inter, optimize 1, high quality
64, 64, // dc, ac
},
{
// UV/inter, optimize 1, low quality
64, 64, // dc, ac
},
{
// UV/inter, optimize 1, high quality
64, 64, // dc, ac
},
// optimize = 0
{
// Y/intra, optimize 0, low quality
80, 80, // dc, ac
},
{
// Y/intra, optimize 0, high quality
82, 82, // dc, ac
},
{
// UV/intra, optimize 0, low quality
80, 80, // dc, ac
},
{
// UV/intra, optimize 0, high quality
82, 82, // dc, ac
},
{
// Y/inter, optimize 0, low quality
80, 80, // dc, ac
},
{
// Y/inter, optimize 0, high quality
82, 82, // dc, ac
},
{
// UV/inter, optimize 0, low quality
80, 80, // dc, ac
},
{
// UV/inter, optimize 0, high quality
82, 82, // dc, ac
},
};
// Offset tables needed on the decoder side
static const int8_t doff_nuq[QUANT_PROFILES][2] = {
{
// lossless
0, 0, // dc, ac
},
// dq_type = 1
{
// Y/intra, dq_type 1, low quality
-4, -6, // dc, ac
},
{
// Y/intra, dq_type 1, high quality
-2, -3, // dc, ac
},
{
// UV/intra, dq_type 1, low quality
-4, -6, // dc, ac
},
{
// UV/intra, dq_type 1, high quality
-2, -3, // dc, ac
},
{
// Y/inter, dq_type 1, low quality
-4, -6, // dc, ac
},
{
// Y/inter, dq_type 1, high quality
-3, -4, // dc, ac
},
{
// UV/inter, dq_type 1, low quality
-4, -6, // dc, ac
},
{
// UV/inter, dq_type 1, high quality
-3, -4, // dc, ac
},
// dq_type = 2
{
// Y/intra, dq_type 2, low quality
0, -2, // dc, ac
},
{
// Y/intra, dq_type 2, high quality
5, 3, // dc, ac
},
{
// UV/intra, dq_type 2, low quality
-1, -3, // dc, ac
},
{
// UV/intra, dq_type 2, high quality
4, 2, // dc, ac
},
{
// Y/inter, dq_type 2, low quality
-2, -4, // dc, ac
},
{
// Y/inter, dq_type 2, high quality
2, 1, // dc, ac
},
{
// UV/inter, dq_type 2, low quality
-3, -5, // dc, ac
},
{
// UV/inter, dq_type 2, high quality
1, 0, // dc, ac
},
// dq_type = 3
{
// Y/intra, dq_type 3, low quality
4, 2, // dc, ac
},
{
// Y/intra, dq_type 3, high quality
12, 10, // dc, ac
},
{
// UV/intra, dq_type 3, low quality
2, 0, // dc, ac
},
{
// UV/intra, dq_type 3, high quality
10, 8, // dc, ac
},
{
// Y/inter, dq_type 3, low quality
0, -2, // dc, ac
},
{
// Y/inter, dq_type 3, high quality
8, 6, // dc, ac
},
{
// UV/inter, dq_type 3, low quality
-2, -4, // dc, ac
},
{
// UV/inter, dq_type 3, high quality
6, 4, // dc, ac
},
};
// Encoder only
static INLINE uint8_t get_nuq_zbin(int is_ac_coeff, int x0_profile) {
return x0_nuq[x0_profile][is_ac_coeff];
}
// Encoder only
void av1_get_cuml_bins_nuq(int q, int is_ac_coeff, tran_low_t *zbin_width,
int x0_profile) {
const uint8_t zbin = get_nuq_zbin(is_ac_coeff, x0_profile);
zbin_width[0] = ROUND_POWER_OF_TWO(zbin * q, 7);
}
static INLINE int8_t quant_to_doff_fixed(int is_ac_coeff, int q_profile) {
return doff_nuq[q_profile][is_ac_coeff];
}
void av1_get_dequant_val_nuq(int q, int is_ac_coeff, tran_low_t *dq,
int q_profile) {
// Get the dequantization offset that will be applied to all non-zero bins.
const tran_low_t doff = quant_to_doff_fixed(is_ac_coeff, q_profile);
dq[0] = ROUND_POWER_OF_TWO_SIGNED(doff * q, 7);
dq[1] = ROUND_POWER_OF_TWO_SIGNED(doff * q, 8);
dq[2] = ROUND_POWER_OF_TWO_SIGNED(doff * q, 9);
}
tran_low_t av1_dequant_abscoeff_nuq(int v, int q,
#if CONFIG_AOM_QM
int q_profile, int is_ac_coeff,
#else
const tran_low_t *dq,
#endif // CONFIG_AOM_QM
int shift) {
if (v == 0) return 0;
#if CONFIG_AOM_QM
const uint8_t doff = quant_to_doff_fixed(is_ac_coeff, q_profile);
return ((q * v) >> shift) + ROUND_POWER_OF_TWO_SIGNED(doff * q, 7 + shift);
#else
return ((q * v) >> shift) + dq[shift];
#endif
}
tran_low_t av1_dequant_coeff_nuq(int v, int q,
#if CONFIG_AOM_QM
int q_profile, int is_ac_coeff,
#else
const tran_low_t *dq,
#endif // CONFIG_AOM_QM
int shift) {
#if CONFIG_AOM_QM
tran_low_t dqmag =
av1_dequant_abscoeff_nuq(abs(v), q, q_profile, is_ac_coeff, shift);
#else
tran_low_t dqmag = av1_dequant_abscoeff_nuq(abs(v), q, dq, shift);
#endif // CONFIG_AOM_QM
return (v < 0 ? -dqmag : dqmag);
}
#endif // CONFIG_NEW_QUANT
static const int16_t dc_qlookup_Q3[QINDEX_RANGE] = {
4, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18,
19, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30,
......
......@@ -63,91 +63,6 @@ const qm_val_t *av1_qmatrix(struct AV1Common *cm, int qindex, int comp,
TX_SIZE tx_size);
#endif // CONFIG_AOM_QM
#if CONFIG_NEW_QUANT
#define QUANT_PROFILES ((DQ_TYPES - 1) * 8 + 1)
#define QUANT_RANGES 2
#define NUQ_KNOTS 1
// Encoder only
#define X0_PROFILES (2 * 8 + 1)
// dequant_val_type_nuq needs space for the 3 possible shift values
// for different tx sizes
typedef tran_low_t dequant_val_type_nuq[NUQ_KNOTS * 3];
typedef tran_low_t cuml_bins_type_nuq[NUQ_KNOTS];
void av1_get_dequant_val_nuq(int q, int is_ac_coeff, tran_low_t *dq,
int dq_off_index);
void av1_get_cuml_bins_nuq(int q, int is_ac_coeff, tran_low_t *cuml_bins,
int q_profile);
tran_low_t av1_dequant_abscoeff_nuq(int v, int q,
#if CONFIG_AOM_QM
int q_profile, int is_ac_coeff,
#else
const tran_low_t *dq,
#endif // CONFIG_AOM_QM
int shift);
tran_low_t av1_dequant_coeff_nuq(int v, int q,
#if CONFIG_AOM_QM
int q_profile, int is_ac_coeff,
#else
const tran_low_t *dq,
#endif // CONFIG_AOM_QM
int shift);
static INLINE int qindex_to_qrange(int qindex) {
return (qindex < 140 ? 1 : 0);
}
static INLINE int get_dq_profile(DqType dqtype, int qindex, int is_inter,
PLANE_TYPE plane_type) {
// intra/inter, Y/UV, ctx, qrange
static const int
dq_profile_lookup[DQ_TYPES][REF_TYPES][PLANE_TYPES][QUANT_RANGES] = {
{
{ { 0, 0 }, { 0, 0 } }, // intra: Y, UV
{ { 0, 0 }, { 0, 0 } }, // inter: Y, UV
},
{
{ { 1, 2 }, { 3, 4 } }, // intra: Y, UV
{ { 5, 6 }, { 7, 8 } }, // inter: Y, UV
},
{
{ { 9, 10 }, { 11, 12 } }, // intra: Y, UV
{ { 13, 14 }, { 15, 16 } }, // inter: Y, UV
},
{
{ { 17, 18 }, { 19, 20 } }, // intra: Y, UV
{ { 21, 22 }, { 23, 24 } }, // inter: Y, UV
},
};
if (!qindex) return 0; // lossless
if (!dqtype) return 0; // DQ_MULT
return dq_profile_lookup[dqtype][is_inter][plane_type]
[qindex_to_qrange(qindex)];
}
// Encoder only
static INLINE int get_x0_profile(int optimize, int qindex, int is_inter,
PLANE_TYPE plane_type) {
// intra/inter, Y/UV, ctx, qrange
static const int x0_profile_lookup[2][REF_TYPES][PLANE_TYPES][QUANT_RANGES] =
{
{
{ { 1, 2 }, { 3, 4 } }, // intra: Y, UV
{ { 5, 6 }, { 7, 8 } }, // inter: Y, UV
},
{
{ { 9, 10 }, { 11, 12 } }, // intra: Y, UV
{ { 13, 14 }, { 15, 16 } }, // inter: Y, UV
},
};
if (!qindex) return 0; // lossless
return x0_profile_lookup[!optimize][is_inter][plane_type]
[qindex_to_qrange(qindex)];
}
#endif // CONFIG_NEW_QUANT
#ifdef __cplusplus
} // extern "C"
#endif
......
......@@ -1150,19 +1150,6 @@ static void setup_segmentation_dequant(AV1_COMMON *const cm) {
cm->v_iqmatrix[i][j] = av1_iqmatrix(cm, qmlevel, AOM_PLANE_V, j);
}
#endif // CONFIG_AOM_QM
#if CONFIG_NEW_QUANT
for (int dq = 0; dq < QUANT_PROFILES; dq++) {
// DC and AC coefs
for (int b = 0; b < 2; ++b) {
av1_get_dequant_val_nuq(cm->y_dequant_QTX[i][b != 0], b,
cm->y_dequant_nuq_QTX[i][dq][b], dq);
av1_get_dequant_val_nuq(cm->u_dequant_QTX[i][b != 0], b,
cm->u_dequant_nuq_QTX[i][dq][b], dq);
av1_get_dequant_val_nuq(cm->v_dequant_QTX[i][b != 0], b,
cm->v_dequant_nuq_QTX[i][dq][b], dq);
}
}
#endif // CONFIG_NEW_QUANT
}
}
......@@ -3343,13 +3330,6 @@ static int read_uncompressed_header(AV1Decoder *pbi,
}
cm->all_lossless = all_lossless(cm, xd);
setup_segmentation_dequant(cm);
#if CONFIG_NEW_QUANT
if (!cm->all_lossless) {
cm->dq_type = aom_rb_read_literal(rb, DQ_TYPE_BITS);
} else {
cm->dq_type = DQ_MULT;
}
#endif // CONFIG_NEW_QUANT
if (!cm->all_lossless) {
setup_cdef(cm, rb);
}
......
......@@ -50,7 +50,6 @@ static INLINE int rec_eob_pos(const int eob_token, const int extra) {
return eob;
}
#if !CONFIG_NEW_QUANT
static INLINE int get_dqv(const int16_t *dequant, int coeff_idx,
const qm_val_t *iqmatrix) {
int dqv = dequant[!!coeff_idx];
......@@ -63,18 +62,10 @@ static INLINE int get_dqv(const int16_t *dequant, int coeff_idx,
#endif
return dqv;
}
#endif
uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
aom_reader *const r, const int blk_row,
const int blk_col, const int plane,
#if CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
int dq_profile,
#else
dequant_val_type_nuq *dq_val,
#endif // CONFIG_AOM_QM
#endif // CONFIG_NEW_QUANT
const TXB_CTX *const txb_ctx, const TX_SIZE tx_size,
int16_t *const max_scan_line, int *const eob) {
FRAME_CONTEXT *const ec_ctx = xd->tile_ctx;
......@@ -89,13 +80,6 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
const int16_t *const dequant = pd->seg_dequant_QTX[mbmi->segment_id];
tran_low_t *const tcoeffs = pd->dqcoeff;
const int shift = av1_get_tx_scale(tx_size);
#if CONFIG_NEW_QUANT
#if !CONFIG_AOM_QM
const tran_low_t *dqv_val = &dq_val[0][0];
#endif // !CONFIG_AOM_QM
const int nq_shift = shift;
#endif // CONFIG_NEW_QUANT && !CONFIG_AOM_QM
const int bwl = get_txb_bwl(tx_size);
const int width = get_txb_wide(tx_size);
const int height = get_txb_high(tx_size);
......@@ -273,19 +257,8 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
}
cul_level += level;
tran_low_t dq_coeff;
#if CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
dq_coeff = av1_dequant_abscoeff_nuq(level, dequant[!!c], dq_profile, !!c,
nq_shift);
#else
dqv_val = &dq_val[pos != 0][0];
dq_coeff =
av1_dequant_abscoeff_nuq(level, dequant[!!c], dqv_val, nq_shift);
#endif // CONFIG_AOM_QM
#else
dq_coeff = level * get_dqv(dequant, scan[c], iqmatrix);
dq_coeff = dq_coeff >> shift;
#endif // CONFIG_NEW_QUANT
if (sign) {
dq_coeff = -dq_coeff;
}
......@@ -312,25 +285,12 @@ uint8_t av1_read_coeffs_txb_facade(const AV1_COMMON *const cm,
const BLOCK_SIZE bsize = mbmi->sb_type;
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#if CONFIG_NEW_QUANT
const int seg_id = mbmi->segment_id;
const int ref = is_inter_block(mbmi);
int dq = get_dq_profile(cm->dq_type, xd->qindex[seg_id], ref, pd->plane_type);
#endif // CONFIG_NEW_QUANT
TXB_CTX txb_ctx;
get_txb_ctx(plane_bsize, tx_size, plane, pd->above_context + col,
pd->left_context + row, &txb_ctx);
uint8_t cul_level =
av1_read_coeffs_txb(cm, xd, r, row, col, plane,
#if CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
dq,
#else
pd->seg_dequant_nuq_QTX[seg_id][dq],
#endif // CONFIG_AOM_QM
#endif // CONFIG_NEW_QUANT
&txb_ctx, tx_size, max_scan_line, eob);
uint8_t cul_level = av1_read_coeffs_txb(cm, xd, r, row, col, plane, &txb_ctx,
tx_size, max_scan_line, eob);
av1_set_contexts(xd, pd, plane, tx_size, cul_level, col, row);
return cul_level;
}
......@@ -21,13 +21,6 @@
uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
aom_reader *const r, const int blk_row,
const int blk_col, const int plane,
#if CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
int dq_profile,
#else
dequant_val_type_nuq *dq_val,
#endif // CONFIG_AOM_QM
#endif // CONFIG_NEW_QUANT
const TXB_CTX *const txb_ctx, const TX_SIZE tx_size,
int16_t *const max_scan_line, int *const eob);
......
......@@ -60,13 +60,6 @@ static int token_to_value(aom_reader *const r, int token, TX_SIZE tx_size,
static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
TX_SIZE tx_size, TX_TYPE tx_type, const int16_t *dq,
#if CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
int dq_profile,
#else
dequant_val_type_nuq *dq_val,
#endif // CONFIG_AOM_QM
#endif // CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
qm_val_t *iqm[TX_SIZES_ALL],
#endif // CONFIG_AOM_QM
......@@ -91,16 +84,9 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
const uint8_t *band_translate = get_band_translate(tx_size);
int v, token;
int32_t dqv = dq[0];
#if CONFIG_NEW_QUANT && !CONFIG_AOM_QM
const tran_low_t *dqv_val = &dq_val[0][0];
#endif // CONFIG_NEW_QUANT && !CONFIG_AOM_QM
int dq_shift = av1_get_tx_scale(tx_size);
#if CONFIG_NEW_QUANT
int nq_shift = dq_shift;
#endif // CONFIG_NEW_QUANT
band = *band_translate++;
int more_data = 1;
......@@ -109,10 +95,6 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
int last_pos = (c + 1 == max_eob);
int first_pos = (c == 0);
#if CONFIG_NEW_QUANT && !CONFIG_AOM_QM
dqv_val = &dq_val[band != 0][0];
#endif // CONFIG_NEW_QUANT && !CONFIG_AOM_QM
comb_token = last_pos ? 2 * aom_read_bit(r, ACCT_STR) + 2
: aom_read_symbol(r, coef_head_cdfs[band][ctx],
HEAD_TOKENS + first_pos, ACCT_STR) +
......@@ -144,9 +126,6 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
if (token > ONE_TOKEN)
token +=
aom_read_symbol(r, coef_tail_cdfs[band][ctx], TAIL_TOKENS, ACCT_STR);
#if CONFIG_NEW_QUANT && !CONFIG_AOM_QM
dqv_val = &dq_val[band != 0][0];
#endif // CONFIG_NEW_QUANT && !CONFIG_AOM_QM
*max_scan_line = AOMMAX(*max_scan_line, scan[c]);
token_cache[scan[c]] = av1_pt_energy_class[token];
......@@ -158,15 +137,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
dqv = ((iqmatrix[scan[c]] * (int)dqv) + (1 << (AOM_QM_BITS - 1))) >>
AOM_QM_BITS;
#endif
#if CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
v = av1_dequant_abscoeff_nuq(val, dqv, dq_profile, band != 0, nq_shift);
#else
v = av1_dequant_abscoeff_nuq(val, dqv, dqv_val, nq_shift);
#endif // CONFIG_AOM_QM
#else
v = (int)(((int64_t)val * dqv) >> dq_shift);
#endif
v = (int)check_range(aom_read_bit(r, ACCT_STR) ? -v : v, xd->bd);
......@@ -270,24 +241,12 @@ int av1_decode_block_tokens(AV1_COMMON *cm, MACROBLOCKD *const xd, int plane,
const int16_t *const dequant = pd->seg_dequant_QTX[seg_id];
const int ctx =
get_entropy_context(tx_size, pd->above_context + x, pd->left_context + y);
#if CONFIG_NEW_QUANT
const int ref = is_inter_block(&xd->mi[0]->mbmi);
int dq = get_dq_profile(cm->dq_type, xd->qindex[seg_id], ref, pd->plane_type);
#endif // CONFIG_NEW_QUANT
const int eob =
decode_coefs(xd, pd->plane_type, pd->dqcoeff, tx_size, tx_type, dequant,
#if CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
dq, pd->seg_iqmatrix[seg_id],
#else
pd->seg_dequant_nuq_QTX[seg_id][dq],
#endif // CONFIG_AOM_QM
#else
#if CONFIG_AOM_QM
pd->seg_iqmatrix[seg_id],
#endif // CONFIG_AOM_QM
#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);
(void)cm;
......
This diff is collapsed.
......@@ -24,10 +24,6 @@ extern "C" {
typedef struct QUANT_PARAM {
int log_scale;
TX_SIZE tx_size;
#if CONFIG_NEW_QUANT
int dq;
int x0;
#endif // CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
const qm_val_t *qmatrix;
const qm_val_t *iqmatrix;
......@@ -45,14 +41,6 @@ typedef void (*AV1_QUANT_FACADE)(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
// av1_quantize.c.
// All of its fields use the same coefficient shift/scaling at TX.
typedef struct {
#if CONFIG_NEW_QUANT
DECLARE_ALIGNED(16, tran_low_t,
y_cuml_bins_nuq[QUANT_PROFILES][QINDEX_RANGE][2][NUQ_KNOTS]);
DECLARE_ALIGNED(16, tran_low_t,
u_cuml_bins_nuq[QUANT_PROFILES][QINDEX_RANGE][2][NUQ_KNOTS]);
DECLARE_ALIGNED(16, tran_low_t,
v_cuml_bins_nuq[QUANT_PROFILES][QINDEX_RANGE][2][NUQ_KNOTS]);
#endif // CONFIG_NEW_QUANT
// 0: dc 1: ac 2-8: ac repeated to SIMD width
DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]);
......@@ -92,14 +80,6 @@ typedef struct {
DECLARE_ALIGNED(16, int16_t, y_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width
DECLARE_ALIGNED(16, int16_t, u_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width
DECLARE_ALIGNED(16, int16_t, v_dequant_Q3[QINDEX_RANGE][8]); // 8: SIMD width
#if CONFIG_NEW_QUANT && !CONFIG_AOM_QM
DECLARE_ALIGNED(16, dequant_val_type_nuq,
y_dequant_val_nuq_QTX[QUANT_PROFILES][QINDEX_RANGE][2]);
DECLARE_ALIGNED(16, dequant_val_type_nuq,
u_dequant_val_nuq_QTX[QUANT_PROFILES][QINDEX_RANGE][2]);
DECLARE_ALIGNED(16, dequant_val_type_nuq,
v_dequant_val_nuq_QTX[QUANT_PROFILES][QINDEX_RANGE][2]);
#endif // CONFIG_NEW_QUANT && !CONFIG_AOM_QM
} Dequants;
struct AV1_COMP;
......@@ -141,26 +121,6 @@ void av1_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const SCAN_ORDER *sc, const QUANT_PARAM *qparam);
#if CONFIG_NEW_QUANT
void av1_quantize_fp_nuq_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p,
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
void av1_quantize_b_nuq_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p,
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
void av1_quantize_dc_nuq_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p,
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
#endif // CONFIG_NEW_QUANT
void av1_highbd_quantize_fp_facade(const tran_low_t *coeff_ptr,