1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/vvc/dsp: update the interface of pred_residual_joint for joint cbcr residual functionality

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
This commit is contained in:
Wu Jianhua
2025-05-14 21:40:23 +08:00
committed by Nuo Mi
parent d00a249dbf
commit 8bdad76c00
3 changed files with 6 additions and 9 deletions

View File

@ -123,7 +123,7 @@ typedef struct VVCIntraDSPContext {
typedef struct VVCItxDSPContext { typedef struct VVCItxDSPContext {
void (*add_residual)(uint8_t *dst, const int *res, int width, int height, ptrdiff_t stride); void (*add_residual)(uint8_t *dst, const int *res, int width, int height, ptrdiff_t stride);
void (*add_residual_joint)(uint8_t *dst, const int *res, int width, int height, ptrdiff_t stride, int c_sign, int shift); void (*add_residual_joint)(uint8_t *dst, const int *res, int width, int height, ptrdiff_t stride, int c_sign, int shift);
void (*pred_residual_joint)(int *buf, int width, int height, int c_sign, int shift); void (*pred_residual_joint)(int *dst, const int *src, int width, int height, int c_sign, int shift);
void (*itx[VVC_N_TX_TYPE][VVC_N_TX_SIZE])(int *coeffs, ptrdiff_t step, size_t nz); void (*itx[VVC_N_TX_TYPE][VVC_N_TX_SIZE])(int *coeffs, ptrdiff_t step, size_t nz);
void (*transform_bdpcm)(int *coeffs, int width, int height, int vertical, int log2_transform_range); void (*transform_bdpcm)(int *coeffs, int width, int height, int vertical, int log2_transform_range);

View File

@ -62,15 +62,12 @@ static void FUNC(add_residual_joint)(uint8_t *_dst, const int *res,
} }
} }
static void FUNC(pred_residual_joint)(int *buf, const int w, const int h, static void FUNC(pred_residual_joint)(int *dst, const int *src, const int w, const int h,
const int c_sign, const int shift) const int c_sign, const int shift)
{ {
for (int y = 0; y < h; y++) { const int size = w * h;
for (int x = 0; x < w; x++) { for (int i = 0; i < size; i++)
*buf = ((*buf) * c_sign) >> shift; dst[i] = (src[i] * c_sign) >> shift;
buf++;
}
}
} }
static void FUNC(transform_bdpcm)(int *coeffs, const int width, const int height, static void FUNC(transform_bdpcm)(int *coeffs, const int width, const int height,

View File

@ -178,7 +178,7 @@ static void add_residual_for_joint_coding_chroma(VVCLocalContext *lc,
uint8_t *dst = &fc->frame->data[c_idx][(tb->y0 >> vs) * stride + uint8_t *dst = &fc->frame->data[c_idx][(tb->y0 >> vs) * stride +
((tb->x0 >> hs) << fc->ps.sps->pixel_shift)]; ((tb->x0 >> hs) << fc->ps.sps->pixel_shift)];
if (chroma_scale) { if (chroma_scale) {
fc->vvcdsp.itx.pred_residual_joint(tb->coeffs, tb->tb_width, tb->tb_height, c_sign, shift); fc->vvcdsp.itx.pred_residual_joint(tb->coeffs, tb->coeffs, tb->tb_width, tb->tb_height, c_sign, shift);
fc->vvcdsp.intra.lmcs_scale_chroma(lc, tb->coeffs, tb->coeffs, tb->tb_width, tb->tb_height, cu->x0, cu->y0); fc->vvcdsp.intra.lmcs_scale_chroma(lc, tb->coeffs, tb->coeffs, tb->tb_width, tb->tb_height, cu->x0, cu->y0);
fc->vvcdsp.itx.add_residual(dst, tb->coeffs, tb->tb_width, tb->tb_height, stride); fc->vvcdsp.itx.add_residual(dst, tb->coeffs, tb->tb_width, tb->tb_height, stride);
} else { } else {