History

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.

Lynne committed 1 year ago

Commit 56748791 parent b2928972 files · +18 −0Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/proresdsp.c +17 −0
  2. libavcodec/proresdsp.h +1 −0
libavcodec/proresdsp.c+17−0
@@ -99,6 +99,15 @@ static inline void put_pixel(uint16_t *dst, ptrdiff_t linesize, const int16_t *i · 98 unmodified lines
99 }99 }
100}100}
101 101
102static inline void put_pixel_bayer_12(uint16_t *dst, ptrdiff_t linesize,
103 const int16_t *in)
104{
105 for (int y = 0; y < 8; y++, dst += linesize) {
106 for (int x = 0; x < 8; x++)
107 dst[x*2] = CLIP_12(in[(y << 3) + x]) << 4;
108 }
109}
110
102static void put_pixels_10(uint16_t *dst, ptrdiff_t linesize, const int16_t *in)111static void put_pixels_10(uint16_t *dst, ptrdiff_t linesize, const int16_t *in)
103{112{
104 put_pixel(dst, linesize, in, 10);113 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 · 16 unmodified lines
121 put_pixels_12(out, linesize >> 1, block);130 put_pixels_12(out, linesize >> 1, block);
122}131}
123 132
133static void prores_idct_put_bayer_12_c(uint16_t *out, ptrdiff_t linesize,
134 int16_t *block, const int16_t *qmat)
135{
136 prores_idct_12(block, qmat);
137 put_pixel_bayer_12(out, linesize << 1, block);
138}
139
124av_cold void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)140av_cold void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)
125{141{
126 if (bits_per_raw_sample == 10) {142 if (bits_per_raw_sample == 10) {
@@ -129,6 +145,7 @@ av_cold void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample) · 2 unmodified lines
129 } else {145 } else {
130 av_assert1(bits_per_raw_sample == 12);146 av_assert1(bits_per_raw_sample == 12);
131 dsp->idct_put = prores_idct_put_12_c;147 dsp->idct_put = prores_idct_put_12_c;
148 dsp->idct_put_bayer = prores_idct_put_bayer_12_c;
132 dsp->idct_permutation_type = FF_IDCT_PERM_NONE;149 dsp->idct_permutation_type = FF_IDCT_PERM_NONE;
133 }150 }
134 151
libavcodec/proresdsp.h+1−0
@@ -30,6 +30,7 @@ typedef struct ProresDSPContext { · 29 unmodified lines
30 int idct_permutation_type;30 int idct_permutation_type;
31 uint8_t idct_permutation[64];31 uint8_t idct_permutation[64];
32 void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);32 void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
33 void (*idct_put_bayer)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
33} ProresDSPContext;34} ProresDSPContext;
34 35
35void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample);36void ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t