1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

proresdsp: add idct_put_bayer

This commit adds a 12-bit DCT function to directly write to Bayer
images. Will be used in the following commit.
This commit is contained in:
Lynne
2025-07-17 13:19:55 +09:00
parent b2928971e8
commit 5674879db5
2 changed files with 18 additions and 0 deletions

View File

@@ -99,6 +99,15 @@ static inline void put_pixel(uint16_t *dst, ptrdiff_t linesize, const int16_t *i
}
}
static inline void put_pixel_bayer_12(uint16_t *dst, ptrdiff_t linesize,
const int16_t *in)
{
for (int y = 0; y < 8; y++, dst += linesize) {
for (int x = 0; x < 8; x++)
dst[x*2] = CLIP_12(in[(y << 3) + x]) << 4;
}
}
static void put_pixels_10(uint16_t *dst, ptrdiff_t linesize, const int16_t *in)
{
put_pixel(dst, linesize, in, 10);
@@ -121,6 +130,13 @@ static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *blo
put_pixels_12(out, linesize >> 1, block);
}
static void prores_idct_put_bayer_12_c(uint16_t *out, ptrdiff_t linesize,
int16_t *block, const int16_t *qmat)
{
prores_idct_12(block, qmat);
put_pixel_bayer_12(out, linesize << 1, block);
}
av_cold void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)
{
if (bits_per_raw_sample == 10) {
@@ -129,6 +145,7 @@ av_cold void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)
} else {
av_assert1(bits_per_raw_sample == 12);
dsp->idct_put = prores_idct_put_12_c;
dsp->idct_put_bayer = prores_idct_put_bayer_12_c;
dsp->idct_permutation_type = FF_IDCT_PERM_NONE;
}

View File

@@ -30,6 +30,7 @@ typedef struct ProresDSPContext {
int idct_permutation_type;
uint8_t idct_permutation[64];
void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
void (*idct_put_bayer)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
} ProresDSPContext;
void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample);