42 { 1, 0x00000000 }, { 2, 0x00000002 }, { 3, 0x00000007 }, { 5, 0x00000019 }, { 6, 0x00000030 },
43 { 6, 0x00000036 }, { 7, 0x00000063 }, { 7, 0x0000006B }, { 7, 0x0000006F }, { 8, 0x000000D4 },
44 { 8, 0x000000DC }, { 9, 0x00000189 }, { 9, 0x000001A0 }, { 9, 0x000001AB }, {10, 0x00000310 },
45 {10, 0x00000316 }, {10, 0x00000354 }, {10, 0x00000375 }, {10, 0x00000377 }, {11, 0x00000623 },
46 {11, 0x00000684 }, {11, 0x000006AB }, {11, 0x000006EC }, {12, 0x00000C44 }, {12, 0x00000C5C },
47 {12, 0x00000C5E }, {12, 0x00000D55 }, {12, 0x00000DD1 }, {12, 0x00000DD3 }, {12, 0x00000DDB },
48 {13, 0x0000188B }, {13, 0x000018BB }, {13, 0x00001AA8 }, {13, 0x00001BA0 }, {13, 0x00001BA4 },
49 {13, 0x00001BB5 }, {14, 0x00003115 }, {14, 0x00003175 }, {14, 0x0000317D }, {14, 0x00003553 },
50 {14, 0x00003768 }, {15, 0x00006228 }, {15, 0x000062E8 }, {15, 0x000062F8 }, {15, 0x00006AA4 },
51 {15, 0x00006E85 }, {15, 0x00006E87 }, {15, 0x00006ED3 }, {16, 0x0000C453 }, {16, 0x0000C5D3 },
52 {16, 0x0000C5F3 }, {16, 0x0000DD08 }, {16, 0x0000DD0C }, {16, 0x0000DDA4 }, {17, 0x000188A4 },
53 {17, 0x00018BA5 }, {17, 0x00018BE5 }, {17, 0x0001AA95 }, {17, 0x0001AA97 }, {17, 0x0001BA13 },
54 {17, 0x0001BB4A }, {17, 0x0001BB4B }, {18, 0x00031748 }, {18, 0x000317C8 }, {18, 0x00035528 },
55 {18, 0x0003552C }, {18, 0x00037424 }, {18, 0x00037434 }, {18, 0x00037436 }, {19, 0x00062294 },
56 {19, 0x00062E92 }, {19, 0x00062F92 }, {19, 0x0006AA52 }, {19, 0x0006AA5A }, {19, 0x0006E84A },
57 {19, 0x0006E86A }, {19, 0x0006E86E }, {20, 0x000C452A }, {20, 0x000C5D27 }, {20, 0x000C5F26 },
58 {20, 0x000D54A6 }, {20, 0x000D54B6 }, {20, 0x000DD096 }, {20, 0x000DD0D6 }, {20, 0x000DD0DE },
59 {21, 0x00188A56 }, {21, 0x0018BA4D }, {21, 0x0018BE4E }, {21, 0x0018BE4F }, {21, 0x001AA96E },
60 {21, 0x001BA12E }, {21, 0x001BA12F }, {21, 0x001BA1AF }, {21, 0x001BA1BF }, {22, 0x00317498 },
61 {22, 0x0035529C }, {22, 0x0035529D }, {22, 0x003552DE }, {22, 0x003552DF }, {22, 0x0037435D },
62 {22, 0x0037437D }, {23, 0x0062295D }, {23, 0x0062E933 }, {23, 0x006AA53D }, {23, 0x006AA53E },
63 {23, 0x006AA53F }, {23, 0x006E86B9 }, {23, 0x006E86F8 }, {24, 0x00C452B8 }, {24, 0x00C5D265 },
64 {24, 0x00D54A78 }, {24, 0x00D54A79 }, {24, 0x00DD0D70 }, {24, 0x00DD0D71 }, {24, 0x00DD0DF2 },
65 {24, 0x00DD0DF3 }, {26, 0x03114BA2 }, {25, 0x0188A5B1 }, {25, 0x0188A58B }, {25, 0x0188A595 },
66 {25, 0x0188A5D6 }, {25, 0x0188A5D7 }, {25, 0x0188A5A8 }, {25, 0x0188A5AE }, {25, 0x0188A5AF },
67 {25, 0x0188A5C4 }, {25, 0x0188A5C5 }, {25, 0x0188A587 }, {25, 0x0188A584 }, {25, 0x0188A585 },
68 {25, 0x0188A5C6 }, {25, 0x0188A5C7 }, {25, 0x0188A5CC }, {25, 0x0188A5CD }, {25, 0x0188A581 },
69 {25, 0x0188A582 }, {25, 0x0188A583 }, {25, 0x0188A5CE }, {25, 0x0188A5CF }, {25, 0x0188A5C2 },
70 {25, 0x0188A5C3 }, {25, 0x0188A5C1 }, {25, 0x0188A5B4 }, {25, 0x0188A5B5 }, {25, 0x0188A5E6 },
71 {25, 0x0188A5E7 }, {25, 0x0188A5E4 }, {25, 0x0188A5E5 }, {25, 0x0188A5AB }, {25, 0x0188A5E0 },
72 {25, 0x0188A5E1 }, {25, 0x0188A5E2 }, {25, 0x0188A5E3 }, {25, 0x0188A5B6 }, {25, 0x0188A5B7 },
73 {25, 0x0188A5FD }, {25, 0x0188A57E }, {25, 0x0188A57F }, {25, 0x0188A5EC }, {25, 0x0188A5ED },
74 {25, 0x0188A5FE }, {25, 0x0188A5FF }, {25, 0x0188A57D }, {25, 0x0188A59C }, {25, 0x0188A59D },
75 {25, 0x0188A5E8 }, {25, 0x0188A5E9 }, {25, 0x0188A5EA }, {25, 0x0188A5EB }, {25, 0x0188A5EF },
76 {25, 0x0188A57A }, {25, 0x0188A57B }, {25, 0x0188A578 }, {25, 0x0188A579 }, {25, 0x0188A5BA },
77 {25, 0x0188A5BB }, {25, 0x0188A5B8 }, {25, 0x0188A5B9 }, {25, 0x0188A588 }, {25, 0x0188A589 },
78 {25, 0x018BA4C8 }, {25, 0x018BA4C9 }, {25, 0x0188A5FA }, {25, 0x0188A5FB }, {25, 0x0188A5BC },
79 {25, 0x0188A5BD }, {25, 0x0188A598 }, {25, 0x0188A599 }, {25, 0x0188A5F4 }, {25, 0x0188A5F5 },
80 {25, 0x0188A59B }, {25, 0x0188A5DE }, {25, 0x0188A5DF }, {25, 0x0188A596 }, {25, 0x0188A597 },
81 {25, 0x0188A5F8 }, {25, 0x0188A5F9 }, {25, 0x0188A5F1 }, {25, 0x0188A58E }, {25, 0x0188A58F },
82 {25, 0x0188A5DC }, {25, 0x0188A5DD }, {25, 0x0188A5F2 }, {25, 0x0188A5F3 }, {25, 0x0188A58C },
83 {25, 0x0188A58D }, {25, 0x0188A5A4 }, {25, 0x0188A5F0 }, {25, 0x0188A5A5 }, {25, 0x0188A5A6 },
84 {25, 0x0188A5A7 }, {25, 0x0188A59A }, {25, 0x0188A5A2 }, {25, 0x0188A5A3 }, {25, 0x0188A58A },
85 {25, 0x0188A5B0 }, {25, 0x0188A5A0 }, {25, 0x0188A5A1 }, {25, 0x0188A5DA }, {25, 0x0188A5DB },
86 {25, 0x0188A59E }, {25, 0x0188A59F }, {25, 0x0188A5D8 }, {25, 0x0188A5EE }, {25, 0x0188A5D9 },
87 {25, 0x0188A5F6 }, {25, 0x0188A5F7 }, {25, 0x0188A57C }, {25, 0x0188A5C8 }, {25, 0x0188A5C9 },
88 {25, 0x0188A594 }, {25, 0x0188A5FC }, {25, 0x0188A5CA }, {25, 0x0188A5CB }, {25, 0x0188A5B2 },
89 {25, 0x0188A5AA }, {25, 0x0188A5B3 }, {25, 0x0188A572 }, {25, 0x0188A573 }, {25, 0x0188A5C0 },
90 {25, 0x0188A5BE }, {25, 0x0188A5BF }, {25, 0x0188A592 }, {25, 0x0188A580 }, {25, 0x0188A593 },
91 {25, 0x0188A590 }, {25, 0x0188A591 }, {25, 0x0188A586 }, {25, 0x0188A5A9 }, {25, 0x0188A5D2 },
92 {25, 0x0188A5D3 }, {25, 0x0188A5D4 }, {25, 0x0188A5D5 }, {25, 0x0188A5AC }, {25, 0x0188A5AD },
98 {1, 0x0000, 1}, {2, 0x0000, 2}, {3, 0x0000, 3}, {4, 0x0000, 4},
99 {5, 0x0000, 5}, {6, 0x0000, 6}, {7, 0x0000, 7}, {8, 0x0000, 8},
100 {9, 0x0000, 9}, {10, 0x0000, 10}, {11, 0x0000, 11},
101 {7, 0x0069, 12}, {8, 0x00D1, 20}, {9, 0x018A, 32},
102 {10, 0x0343, 60}, {11, 0x0685, 100}, {13, 0x18BF, 180}, {13, 0x1BA5, 320},
111 { 16, 16, 8, 4, 4, 2, 6, 6, 9, },
112 { 16, 16, 8, 4, 4, 2, 6, 6, 9, },
113 { 16, 16, 8, 4, 4, 2, 7, 7, 10, },
114 { 16, 16, 8, 4, 4, 2, 8, 8, 12, },
115 { 16, 16, 8, 4, 4, 2, 16, 16, 26, },
116 { 24, 24, 12, 6, 6, 3, 24, 24, 36, },
117 { 24, 24, 12, 6, 6, 3, 24, 24, 36, },
118 { 32, 32, 24, 8, 8, 6, 32, 32, 48, },
119 { 32, 32, 24, 8, 8, 6, 32, 32, 48, },
120 { 48, 48, 32, 12, 12, 8, 64, 64, 96, },
121 { 48, 48, 32, 12, 12, 8, 64, 64, 96, },
122 { 64, 64, 48, 16, 16, 12, 96, 96, 144, },
123 { 64, 64, 48, 16, 16, 12, 128, 128, 192, },
126 { 16, 16, 8, 4, 4, 2, 6, 6, 9, },
127 { 16, 16, 8, 4, 4, 2, 6, 6, 12, },
128 { 16, 16, 8, 4, 4, 2, 7, 7, 14, },
129 { 16, 16, 8, 4, 4, 2, 8, 8, 16, },
130 { 16, 16, 8, 4, 4, 2, 16, 16, 26, },
131 { 24, 24, 12, 6, 6, 3, 24, 24, 36, },
132 { 24, 24, 12, 6, 6, 3, 24, 24, 48, },
133 { 32, 32, 24, 8, 8, 6, 32, 32, 48, },
134 { 48, 48, 32, 12, 12, 8, 32, 32, 64, },
135 { 48, 48, 32, 12, 12, 8, 64, 64, 96, },
136 { 48, 48, 32, 12, 12, 8, 64, 64, 128, },
137 { 64, 64, 48, 16, 16, 12, 96, 96, 160, },
138 { 64, 64, 48, 16, 16, 12, 128, 128, 192, },
141 { 16, 16, 8, 4, 4, 2, 6, 6, 9, },
142 { 16, 16, 8, 4, 4, 2, 6, 6, 12, },
143 { 16, 16, 8, 4, 4, 2, 7, 7, 14, },
144 { 16, 16, 8, 4, 4, 2, 8, 8, 16, },
145 { 16, 16, 8, 4, 4, 2, 16, 16, 26, },
146 { 24, 24, 12, 6, 6, 3, 24, 24, 36, },
147 { 24, 24, 12, 6, 6, 3, 24, 24, 48, },
148 { 32, 32, 24, 8, 8, 6, 32, 32, 48, },
149 { 48, 48, 32, 12, 12, 8, 32, 32, 64, },
150 { 48, 48, 32, 12, 12, 8, 64, 64, 96, },
151 { 48, 48, 32, 12, 12, 8, 64, 64, 128, },
152 { 64, 64, 48, 16, 16, 12, 96, 96, 160, },
153 { 64, 64, 48, 16, 16, 12, 128, 128, 192, },
156 { 16, 16, 8, 16, 16, 8, 24, 24, 36, },
157 { 16, 16, 8, 16, 16, 8, 24, 24, 36, },
158 { 16, 16, 8, 16, 16, 8, 32, 32, 48, },
159 { 16, 16, 8, 16, 16, 8, 32, 32, 48, },
160 { 16, 16, 8, 20, 20, 10, 80, 80, 128, },
161 { 24, 24, 12, 24, 24, 12, 96, 96, 144, },
162 { 24, 24, 12, 24, 24, 12, 96, 96, 144, },
163 { 32, 32, 24, 32, 32, 24, 128, 128, 192, },
164 { 32, 32, 24, 32, 32, 24, 128, 128, 192, },
165 { 48, 48, 32, 48, 48, 32, 256, 256, 384, },
166 { 48, 48, 32, 48, 48, 32, 256, 256, 384, },
167 { 56, 56, 40, 56, 56, 40, 512, 512, 768, },
168 { 64, 64, 48, 64, 64, 48, 512, 512, 768, },
171 { 16, 16, 8, 16, 16, 8, 24, 24, 36, },
172 { 16, 16, 8, 16, 16, 8, 48, 48, 72, },
173 { 16, 16, 8, 16, 16, 8, 48, 48, 72, },
174 { 16, 16, 8, 16, 16, 8, 64, 64, 96, },
175 { 16, 16, 8, 20, 20, 10, 80, 80, 128, },
176 { 24, 24, 12, 24, 24, 12, 96, 96, 144, },
177 { 24, 24, 12, 24, 24, 12, 192, 192, 288, },
178 { 32, 32, 24, 32, 32, 24, 128, 128, 192, },
179 { 32, 32, 24, 32, 32, 24, 256, 256, 384, },
180 { 48, 48, 32, 48, 48, 32, 256, 256, 384, },
181 { 48, 48, 32, 48, 48, 32, 512, 512, 768, },
182 { 56, 56, 40, 56, 56, 40, 512, 512, 768, },
183 { 64, 64, 48, 64, 64, 48,1024,1024,1536, },
186 { 16, 16, 8, 16, 16, 8, 24, 24, 36, },
187 { 16, 16, 8, 16, 16, 8, 48, 48, 72, },
188 { 16, 16, 8, 16, 16, 8, 48, 48, 72, },
189 { 16, 16, 8, 16, 16, 8, 64, 64, 96, },
190 { 16, 16, 10, 20, 20, 10, 80, 80, 128, },
191 { 24, 24, 12, 24, 24, 12, 96, 96, 144, },
192 { 24, 24, 12, 24, 24, 12, 192, 192, 288, },
193 { 32, 32, 24, 32, 32, 24, 128, 128, 192, },
194 { 32, 32, 24, 32, 32, 24, 256, 256, 384, },
195 { 48, 48, 32, 48, 48, 32, 256, 256, 384, },
196 { 48, 48, 32, 48, 48, 32, 512, 512, 768, },
197 { 56, 56, 40, 56, 56, 40, 512, 512, 768, },
198 { 64, 64, 48, 64, 64, 48,1024,1024,1536, },
247 const int sign_mask = 256;
248 const int twos_complement = -sign_mask;
249 const int mag_mask = sign_mask - 1;
258 if (avctx->
width & 15) {
266 int w8, h8, w4, h4, w2, h2;
317 for (
int i = 0;
i < 512;
i++) {
318 int value = (
i & sign_mask) ? twos_complement + (
i & mag_mask):
i;
330 s->
cb[512].
bits = 0x3114ba3;
335 for (
int i = 1, j = 0;
i < 320 && j < 17; j++) {
348 s->
rb[320].
run = 320;
350 for (
int i = 0;
i < 256;
i++) {
351 int idx =
i + ((768LL *
i *
i *
i) / (256 * 256 * 256));
355 for (
int i = 0;
i < 1024;
i++) {
373 int16_t *low, ptrdiff_t low_stride,
374 int16_t *high, ptrdiff_t high_stride,
377 low[(0>>1) * low_stride] = av_clip_int16(input[0*in_stride] + input[1*in_stride]);
378 high[(0>>1) * high_stride] = av_clip_int16((5 * input[0*in_stride] - 11 * input[1*in_stride] +
379 4 * input[2*in_stride] + 4 * input[3*in_stride] -
380 1 * input[4*in_stride] - 1 * input[5*in_stride] + 4) >> 3);
382 for (
int i = 2;
i < len - 2;
i += 2) {
383 low[(
i>>1) * low_stride] = av_clip_int16(input[
i*in_stride] + input[(
i+1)*in_stride]);
384 high[(
i>>1) * high_stride] = av_clip_int16(((-input[(
i-2)*in_stride] - input[(
i-1)*in_stride] +
385 input[(
i+2)*in_stride] + input[(
i+3)*in_stride] + 4) >> 3) +
386 input[(
i+0)*in_stride] - input[(
i+1)*in_stride]);
389 low[((len-2)>>1) * low_stride] = av_clip_int16(input[((len-2)+0)*in_stride] + input[((len-2)+1)*in_stride]);
390 high[((len-2)>>1) * high_stride] = av_clip_int16((11* input[((len-2)+0)*in_stride] - 5 * input[((len-2)+1)*in_stride] -
391 4 * input[((len-2)-1)*in_stride] - 4 * input[((len-2)-2)*in_stride] +
392 1 * input[((len-2)-3)*in_stride] + 1 * input[((len-2)-4)*in_stride] + 4) >> 3);
398 filter(input, 1, low, 1, high, 1, width);
402 int16_t *low, ptrdiff_t low_stride,
403 int16_t *high, ptrdiff_t high_stride,
int len)
405 filter(input, in_stride, low, low_stride, high, high_stride, len);
409 int height,
unsigned quantization)
411 const int16_t
factor = (uint32_t)(1
U << 15) / quantization;
414 for (
int j = 0; j <
width; j++)
415 input[j] = av_clip_intp2(((input[j] * factor + 16384 *
FFSIGN(input[j])) / 32768), 10);
435 for (
int j = 0; j <
width; j++) {
438 if (alpha > 0 && alpha < 4080) {
445 dst[j] = av_clip_uintp2(alpha, 12);
461 const uint16_t *lut = s->
lut;
465 for (
int plane = 0; plane < s->
planes; plane++) {
469 int act_plane = plane == 1 ? 2 : plane == 2 ? 1 : plane;
470 int16_t *
input = (int16_t *)frame->
data[act_plane];
471 int16_t *low = s->
plane[plane].
l_h[6];
472 int16_t *high = s->
plane[plane].
l_h[7];
473 ptrdiff_t in_stride = frame->
linesize[act_plane] / 2;
474 int low_stride, high_stride;
478 in_stride, s->
alpha);
480 in_stride = avctx->
width;
483 for (
int i = 0;
i < height * 2;
i++) {
497 vert_filter(input, a_width, low, low_stride, high, high_stride, height * 2);
508 vert_filter(input, a_width, low, low_stride, high, high_stride, height * 2);
523 for (
int i = 0;
i < height * 2;
i++) {
524 for (
int j = 0; j < width * 2; j++)
526 input += a_width * 2;
530 for (
int i = 0;
i < height * 2;
i++) {
532 input += a_width * 2;
542 vert_filter(input, a_width, low, low_stride, high, high_stride, height * 2);
553 vert_filter(input, a_width, low, low_stride, high, high_stride, height * 2);
569 for (
int i = 0;
i < height * 2;
i++) {
570 for (
int j = 0; j < width * 2; j++)
572 input += a_width * 2;
577 for (
int i = 0;
i < height * 2;
i++) {
579 input += a_width * 2;
589 vert_filter(input, a_width, low, low_stride, high, high_stride, height * 2);
600 vert_filter(input, a_width, low, low_stride, high, high_stride, height * 2);
614 bytestream2_put_be16(pby, 9);
617 bytestream2_put_be16(pby, s->
planes);
620 bytestream2_put_be32(pby, 0);
623 bytestream2_put_be16(pby, 0);
626 bytestream2_put_be16(pby, 1);
629 bytestream2_put_be16(pby, s->
planes);
635 bytestream2_put_be16(pby, 3);
641 bytestream2_put_be16(pby, 2);
644 bytestream2_put_be16(pby, 3);
647 bytestream2_put_be16(pby, avctx->
width);
650 bytestream2_put_be16(pby, avctx->
height);
662 bytestream2_put_be16(pby, 1);
664 for (
int p = 0; p < s->
planes; p++) {
672 bytestream2_put_be16(pby, 3);
675 bytestream2_put_be16(pby, p);
679 bytestream2_put_be16(pby, 0x1a4a);
684 bytestream2_put_be16(pby, 0);
687 bytestream2_put_be16(pby, 3);
690 bytestream2_put_be16(pby, width);
693 bytestream2_put_be16(pby, height);
696 bytestream2_put_be16(pby, 0);
699 bytestream2_put_be16(pby, 1);
702 bytestream2_put_be16(pby, 16);
705 bytestream2_put_be16(pby, 0x0f0f);
708 for (
int j = 0; j <
width; j++)
709 bytestream2_put_be16(pby, data[j]);
714 bytestream2_put_be16(pby, 0x1b4b);
716 for (
int l = 0; l < 3; l++) {
717 for (
int i = 0;
i < 3;
i++) {
722 for (
int l = 0; l < 3; l++) {
729 bytestream2_put_be16(pby, 0x0d0d);
732 bytestream2_put_be16(pby, 3 + 2 * (l == 2));
735 bytestream2_put_be16(pby, 3 - l);
738 bytestream2_put_be16(pby, 3 - l);
740 bytestream2_put_be16(pby,
NumBands);
741 bytestream2_put_be16(pby, 4);
744 bytestream2_put_be16(pby, width);
747 bytestream2_put_be16(pby, height);
750 bytestream2_put_be16(pby, 0);
753 bytestream2_put_be16(pby, 0);
756 bytestream2_put_be16(pby, 1);
759 bytestream2_put_be16(pby, 1);
761 for (
int i = 0;
i < 3;
i++) {
763 int count = 0, padd = 0;
766 bytestream2_put_be16(pby, 0x0e0e);
769 bytestream2_put_be16(pby,
i + 1);
772 bytestream2_put_be16(pby, 1);
775 bytestream2_put_be16(pby, width);
778 bytestream2_put_be16(pby, height);
781 bytestream2_put_be16(pby, 1 + l * 3 +
i);
784 bytestream2_put_be16(pby, 3);
790 bytestream2_put_be16(pby, 1);
793 bytestream2_put_be16(pby, 0);
800 for (
int m = 0; m <
height; m++) {
801 for (
int j = 0; j <
stride; j++) {
809 }
else if (count > 0) {
829 bytestream2_put_byte(pby, 0);
832 bytestream2_put_be16(pby, 0);
836 bytestream2_put_be16(pby, 0x0c0c);
843 bytestream2_put_be16(pby, 0);
869 for (
int j = 0; j < 8; j++)
878 #define OFFSET(x) offsetof(CFHDEncContext, x) 879 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM 911 .priv_class = &cfhd_class,
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static const AVClass cfhd_class
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const unsigned codebook[256][2]
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void horiz_filter(int16_t *input, int16_t *low, int16_t *high, int width)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
#define LIBAVUTIL_VERSION_INT
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
static av_cold int init(AVCodecContext *avctx)
static const uint16_t quantization_per_subband[2][3][13][9]
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
const char * av_default_item_name(void *ptr)
Return the context name.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
static double cb(void *priv, double x, double y)
SubBand band[DWT_LEVELS][4]
static av_cold int end(AVCodecContext *avctx)
Multithreading support functions.
GLsizei GLboolean const GLfloat * value
static av_cold int cfhd_encode_init(AVCodecContext *avctx)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static av_cold int cfhd_encode_close(AVCodecContext *avctx)
unsigned quantization[SUBBAND_COUNT]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const AVOption options[]
static av_always_inline int bytestream2_get_bytes_left_p(PutByteContext *p)
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_PIX_FMT_GBRAP12
simple assert() macros that are a bit more flexible than ISO C assert().
const char * name
Name of the codec implementation.
static av_always_inline int bytestream2_tell_p(PutByteContext *p)
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
int flags
A combination of AV_PKT_FLAG values.
static int put_bits_count(PutBitContext *s)
static av_always_inline void bytestream2_skip_p(PutByteContext *p, unsigned int size)
int width
picture width / height.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about quality
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define FF_ARRAY_ELEMS(a)
static av_always_inline int bytestream2_seek_p(PutByteContext *p, int offset, int whence)
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static const int16_t alpha[]
main external API structure.
static av_always_inline void filter(int16_t *input, ptrdiff_t in_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len)
Describe the class of an AVClass context structure.
static const int factor[16]
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
static enum AVPixelFormat pix_fmts[]
#define AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_YUV422P10
static const uint16_t runbook[18][3]
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
GLint GLenum GLboolean GLsizei stride
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void vert_filter(int16_t *input, ptrdiff_t in_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void quantize_band(int16_t *input, int width, int a_width, int height, unsigned quantization)
static int put_runcode(PutBitContext *pb, int count, const Runbook *const rb)
int frame_number
Frame counter, set by libavcodec.
#define av_malloc_array(a, b)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
AVPixelFormat
Pixel format.
This structure stores compressed data.
static void process_alpha(const int16_t *src, int width, int height, ptrdiff_t stride, int16_t *dst)
int16_t * subband[SUBBAND_COUNT]
void * av_mallocz_array(size_t nmemb, size_t size)