diff --git a/av1/common/idct.c b/av1/common/idct.c index 64aec4b09cc7d20af8e27c657b9f753e9108f2c3..8b6b875b2dfacfcd467349fad8dd4f60d4950bc9 100644 --- a/av1/common/idct.c +++ b/av1/common/idct.c @@ -2785,6 +2785,25 @@ void av1_inverse_transform_block(MACROBLOCKD *xd, const tran_low_t *dqcoeff, const TX_TYPE tx_type, const TX_SIZE tx_size, uint8_t *dst, int stride, int eob) { if (!eob) return; +#if CONFIG_PVQ + const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size]; + const int txb_width = block_size_wide[tx_bsize]; + const int txb_height = block_size_high[tx_bsize]; + int r, c; +#if CONFIG_AOM_HIGHBITDEPTH + if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { + uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst); + for (r = 0; r < txb_height; r++) + for (c = 0; c < txb_width; c++) + CONVERT_TO_SHORTPTR(dst)[r * stride + c] = 0; + } else { +#endif // CONFIG_AOM_HIGHBITDEPTH + for (r = 0; r < txb_height; r++) + for (c = 0; c < txb_width; c++) dst[r * stride + c] = 0; +#if CONFIG_AOM_HIGHBITDEPTH + } +#endif // CONFIG_AOM_HIGHBITDEPTH +#endif // CONFIG_PVQ INV_TXFM_PARAM inv_txfm_param; inv_txfm_param.tx_type = tx_type; inv_txfm_param.tx_size = tx_size; diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 16ee7fd504235f50f1506ff2c59927c4bdd9da2a..7006eadc66b03e75343013eeeb999928f89cd728 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -496,22 +496,6 @@ static int av1_pvq_decode_helper2(AV1_COMMON *cm, MACROBLOCKD *const xd, eob = av1_pvq_decode_helper(xd, pvq_ref_coeff, dqcoeff, quant, plane, tx_size, tx_type, xdec, ac_dc_coded); -// Since av1 does not have separate inverse transform -// but also contains adding to predicted image, -// pass blank dummy image to av1_inv_txfm_add_*x*(), i.e. set dst as zeros -#if CONFIG_AOM_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - for (j = 0; j < tx_blk_size; j++) - for (i = 0; i < tx_blk_size; i++) - CONVERT_TO_SHORTPTR(dst)[j * pd->dst.stride + i] = 0; - } else { -#endif - for (j = 0; j < tx_blk_size; j++) - for (i = 0; i < tx_blk_size; i++) dst[j * pd->dst.stride + i] = 0; -#if CONFIG_AOM_HIGHBITDEPTH - } -#endif - inverse_transform_block(xd, plane, tx_type, tx_size, dst, pd->dst.stride, max_scan_line, eob); } diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c index 405943ab5168869f1536564a333851db14bf7bf2..ceeac845b5d6bd893998e6cc380420f978a57647 100644 --- a/av1/encoder/encodemb.c +++ b/av1/encoder/encodemb.c @@ -1105,10 +1105,6 @@ void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col, const int dst_stride = pd->dst.stride; uint8_t *dst = &pd->dst.buf[(blk_row * dst_stride + blk_col) << tx_size_wide_log2[0]]; -#if CONFIG_PVQ - int tx_blk_size; - int i, j; -#endif av1_predict_intra_block_facade(xd, plane, block_raster_idx, blk_col, blk_row, tx_size); @@ -1133,27 +1129,7 @@ void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col, if (!x->pvq_skip[plane]) *(args->skip) = 0; if (x->pvq_skip[plane]) return; - - // transform block size in pixels - tx_blk_size = tx_size_wide[tx_size]; - -// Since av1 does not have separate function which does inverse transform -// but av1_inv_txfm_add_*x*() also does addition of predicted image to -// inverse transformed image, -// pass blank dummy image to av1_inv_txfm_add_*x*(), i.e. set dst as zeros -#if CONFIG_AOM_HIGHBITDEPTH - if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - for (j = 0; j < tx_blk_size; j++) - for (i = 0; i < tx_blk_size; i++) - CONVERT_TO_SHORTPTR(dst)[j * dst_stride + i] = 0; - } else { -#endif // CONFIG_AOM_HIGHBITDEPTH - for (j = 0; j < tx_blk_size; j++) - for (i = 0; i < tx_blk_size; i++) dst[j * dst_stride + i] = 0; -#if CONFIG_AOM_HIGHBITDEPTH - } -#endif // CONFIG_AOM_HIGHBITDEPTH -#endif // #if CONFIG_PVQ +#endif // CONFIG_PVQ av1_inverse_transform_block(xd, dqcoeff, tx_type, tx_size, dst, dst_stride, *eob); #if !CONFIG_PVQ diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index f0881c88a5834df3c69bdd3a0efe8599297a419c..0659ec63aa3a459dfd46f3951019a838afbe73b4 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c @@ -1419,8 +1419,10 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane, *out_sse = this_sse >> shift; } else { const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size]; +#if !CONFIG_PVQ || CONFIG_DAALA_DIST const int bsw = block_size_wide[tx_bsize]; const int bsh = block_size_high[tx_bsize]; +#endif const int src_stride = x->plane[plane].src.stride; const int dst_stride = xd->plane[plane].dst.stride; // Scale the transform block index to pixel unit. @@ -1460,6 +1462,7 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane, DECLARE_ALIGNED(16, uint8_t, recon[MAX_TX_SQUARE]); #endif // CONFIG_AOM_HIGHBITDEPTH +#if !CONFIG_PVQ #if CONFIG_AOM_HIGHBITDEPTH if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { aom_highbd_convolve_copy(dst, dst_stride, recon, MAX_TX_SIZE, NULL, 0, @@ -1467,16 +1470,10 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane, } else #endif // CONFIG_AOM_HIGHBITDEPTH { -#if !CONFIG_PVQ aom_convolve_copy(dst, dst_stride, recon, MAX_TX_SIZE, NULL, 0, NULL, 0, bsw, bsh); -#else - int i, j; - - for (j = 0; j < bsh; j++) - for (i = 0; i < bsw; i++) recon[j * MAX_TX_SIZE + i] = 0; -#endif // !CONFIG_PVQ } +#endif // !CONFIG_PVQ const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block);