Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
e111cba8
Commit
e111cba8
authored
Feb 20, 2018
by
Frederic Barbier
Committed by
Frédéric BARBIER
Feb 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove NEW_QUANT experiment
This experiment has been abandonned for AV1. Change-Id: I924d172f7ce85b2422bace44684329fcbf71cb5e
parent
b57fee02
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
21 additions
and
2176 deletions
+21
-2176
av1/common/blockd.h
av1/common/blockd.h
+0
-11
av1/common/enums.h
av1/common/enums.h
+0
-11
av1/common/onyxc_int.h
av1/common/onyxc_int.h
+0
-20
av1/common/quant_common.c
av1/common/quant_common.c
+0
-249
av1/common/quant_common.h
av1/common/quant_common.h
+0
-85
av1/decoder/decodeframe.c
av1/decoder/decodeframe.c
+0
-20
av1/decoder/decodetxb.c
av1/decoder/decodetxb.c
+2
-42
av1/decoder/decodetxb.h
av1/decoder/decodetxb.h
+0
-7
av1/decoder/detokenize.c
av1/decoder/detokenize.c
+0
-41
av1/encoder/av1_quantize.c
av1/encoder/av1_quantize.c
+8
-1456
av1/encoder/av1_quantize.h
av1/encoder/av1_quantize.h
+0
-57
av1/encoder/bitstream.c
av1/encoder/bitstream.c
+0
-10
av1/encoder/block.h
av1/encoder/block.h
+0
-4
av1/encoder/encodeframe.c
av1/encoder/encodeframe.c
+0
-7
av1/encoder/encodemb.c
av1/encoder/encodemb.c
+0
-40
av1/encoder/encodetxb.c
av1/encoder/encodetxb.c
+11
-102
av1/encoder/encodetxb.h
av1/encoder/encodetxb.h
+0
-7
build/cmake/aom_config_defaults.cmake
build/cmake/aom_config_defaults.cmake
+0
-1
test/test.cmake
test/test.cmake
+0
-6
No files found.
av1/common/blockd.h
View file @
e111cba8
...
...
@@ -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
...
...
av1/common/enums.h
View file @
e111cba8
...
...
@@ -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
...
...
av1/common/onyxc_int.h
View file @
e111cba8
...
...
@@ -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
}
}
...
...
av1/common/quant_common.c
View file @
e111cba8
...
...
@@ -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,
...
...
av1/common/quant_common.h
View file @
e111cba8
...
...
@@ -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
...
...
av1/decoder/decodeframe.c
View file @
e111cba8
...
...
@@ -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
);
}
...
...
av1/decoder/decodetxb.c
View file @
e111cba8
...
...
@@ -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
;
}
av1/decoder/decodetxb.h
View file @
e111cba8
...
...
@@ -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
);
...
...
av1/decoder/detokenize.c
View file @
e111cba8
...
...
@@ -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
],