diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index f091afbc9..a76eb0906 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c @@ -1497,8 +1497,13 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane, #endif // CONFIG_DAALA_DIST } else { #if CONFIG_AOM_HIGHBITDEPTH + uint8_t *recon; DECLARE_ALIGNED(16, uint16_t, recon16[MAX_TX_SQUARE]); - uint8_t *recon = CONVERT_TO_BYTEPTR(recon16); + + if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) + recon = CONVERT_TO_BYTEPTR(recon16); + else + recon = (uint8_t *)recon16; #else DECLARE_ALIGNED(16, uint8_t, recon[MAX_TX_SQUARE]); #endif // CONFIG_AOM_HIGHBITDEPTH