Convert PVQ skip variable to enum
Creates the PVQ_SKIP_TYPE enum to encapsulate the different types of
skipping that can be signaled by PVQ (i.e. skip: AC, DC or both).
There is no impact on the bitstream. However, the decoder will now emit
an internal error if the decoded skip flag is out of range. The
block_skip variable is also renamed to ac_dc_coded as it stores the same
information.
Change-Id: Ib2aadaf99dc1736ea392ae5ed8948c3cdc12da9b
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 982d75e..fac99f9 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -611,19 +611,20 @@
// PVQ for inter mode block
if (!x->skip_block) {
- int ac_dc_coded = av1_pvq_encode_helper(&x->daala_enc,
- coeff, // target original vector
- ref_coeff, // reference vector
- dqcoeff, // de-quantized vector
- eob, // End of Block marker
- pd->dequant, // aom's quantizers
- plane, // image plane
- tx_size, // block size in log_2 - 2
- tx_type,
- &x->rate, // rate measured
- x->pvq_speed,
- pvq_info); // PVQ info for a block
- skip = ac_dc_coded == 0;
+ PVQ_SKIP_TYPE ac_dc_coded =
+ av1_pvq_encode_helper(&x->daala_enc,
+ coeff, // target original vector
+ ref_coeff, // reference vector
+ dqcoeff, // de-quantized vector
+ eob, // End of Block marker
+ pd->dequant, // aom's quantizers
+ plane, // image plane
+ tx_size, // block size in log_2 - 2
+ tx_type,
+ &x->rate, // rate measured
+ x->pvq_speed,
+ pvq_info); // PVQ info for a block
+ skip = ac_dc_coded == PVQ_SKIP;
}
x->pvq_skip[plane] = skip;
@@ -1122,13 +1123,12 @@
}
#if CONFIG_PVQ
-int av1_pvq_encode_helper(daala_enc_ctx *daala_enc, tran_low_t *const coeff,
- tran_low_t *ref_coeff, tran_low_t *const dqcoeff,
- uint16_t *eob, const int16_t *quant, int plane,
- int tx_size, TX_TYPE tx_type, int *rate, int speed,
- PVQ_INFO *pvq_info) {
+PVQ_SKIP_TYPE av1_pvq_encode_helper(
+ daala_enc_ctx *daala_enc, tran_low_t *const coeff, tran_low_t *ref_coeff,
+ tran_low_t *const dqcoeff, uint16_t *eob, const int16_t *quant, int plane,
+ int tx_size, TX_TYPE tx_type, int *rate, int speed, PVQ_INFO *pvq_info) {
const int tx_blk_size = tx_size_wide[tx_size];
- int ac_dc_coded;
+ PVQ_SKIP_TYPE ac_dc_coded;
int quant_shift = get_tx_scale(tx_size);
int pvq_dc_quant;
int use_activity_masking = daala_enc->use_activity_masking;