FFmpeg
Loading...
Searching...
No Matches
h264dsp.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Martin Storsjo
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#include <string.h>
22#include "checkasm.h"
23#include "libavcodec/h264dsp.h"
24#include "libavcodec/h264data.h"
25#include "libavcodec/h264idct.h"
27#include "libavutil/common.h"
30
31static const uint32_t pixel_mask[5] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff, 0x0fff0fff, 0x3fff3fff };
32static const uint32_t pixel_mask_lf[3] = { 0xff0fff0f, 0x01ff000f, 0x03ff000f };
33
34#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
35#define SIZEOF_COEF (2 * ((bit_depth + 7) / 8))
36#define PIXEL_STRIDE 16
37
38#define randomize_buffers(idx) \
39 do { \
40 int x, y; \
41 uint32_t mask = pixel_mask[(idx)]; \
42 for (y = 0; y < sz; y++) { \
43 for (x = 0; x < PIXEL_STRIDE; x += 4) { \
44 AV_WN32A(src + y * PIXEL_STRIDE + x, rnd() & mask); \
45 AV_WN32A(dst + y * PIXEL_STRIDE + x, rnd() & mask); \
46 } \
47 for (x = 0; x < sz; x++) { \
48 if (bit_depth == 8) { \
49 coef[y * sz + x] = src[y * PIXEL_STRIDE + x] - \
50 dst[y * PIXEL_STRIDE + x]; \
51 } else { \
52 ((int32_t *)coef)[y * sz + x] = \
53 ((uint16_t *)src)[y * (PIXEL_STRIDE/2) + x] - \
54 ((uint16_t *)dst)[y * (PIXEL_STRIDE/2) + x]; \
55 } \
56 } \
57 } \
58 } while (0)
59
60#define dct4x4_impl(size, dctcoef) \
61static void dct4x4_##size(dctcoef *coef) \
62{ \
63 int i, y, x; \
64 dctcoef tmp[16]; \
65 for (i = 0; i < 4; i++) { \
66 const int z0 = coef[i*4 + 0] + coef[i*4 + 3]; \
67 const int z1 = coef[i*4 + 1] + coef[i*4 + 2]; \
68 const int z2 = coef[i*4 + 0] - coef[i*4 + 3]; \
69 const int z3 = coef[i*4 + 1] - coef[i*4 + 2]; \
70 tmp[i + 4*0] = z0 + z1; \
71 tmp[i + 4*1] = 2*z2 + z3; \
72 tmp[i + 4*2] = z0 - z1; \
73 tmp[i + 4*3] = z2 - 2*z3; \
74 } \
75 for (i = 0; i < 4; i++) { \
76 const int z0 = tmp[i*4 + 0] + tmp[i*4 + 3]; \
77 const int z1 = tmp[i*4 + 1] + tmp[i*4 + 2]; \
78 const int z2 = tmp[i*4 + 0] - tmp[i*4 + 3]; \
79 const int z3 = tmp[i*4 + 1] - tmp[i*4 + 2]; \
80 coef[i*4 + 0] = z0 + z1; \
81 coef[i*4 + 1] = 2*z2 + z3; \
82 coef[i*4 + 2] = z0 - z1; \
83 coef[i*4 + 3] = z2 - 2*z3; \
84 } \
85 for (y = 0; y < 4; y++) { \
86 for (x = 0; x < 4; x++) { \
87 const int64_t scale[] = { 13107 * 10, 8066 * 13, 5243 * 16 }; \
88 const int idx = (y & 1) + (x & 1); \
89 coef[y*4 + x] = (coef[y*4 + x] * scale[idx] + (1 << 14)) >> 15; \
90 } \
91 } \
92}
93
94#define DCT8_1D(src, srcstride, dst, dststride) do { \
95 const int a0 = (src)[srcstride * 0] + (src)[srcstride * 7]; \
96 const int a1 = (src)[srcstride * 0] - (src)[srcstride * 7]; \
97 const int a2 = (src)[srcstride * 1] + (src)[srcstride * 6]; \
98 const int a3 = (src)[srcstride * 1] - (src)[srcstride * 6]; \
99 const int a4 = (src)[srcstride * 2] + (src)[srcstride * 5]; \
100 const int a5 = (src)[srcstride * 2] - (src)[srcstride * 5]; \
101 const int a6 = (src)[srcstride * 3] + (src)[srcstride * 4]; \
102 const int a7 = (src)[srcstride * 3] - (src)[srcstride * 4]; \
103 const int b0 = a0 + a6; \
104 const int b1 = a2 + a4; \
105 const int b2 = a0 - a6; \
106 const int b3 = a2 - a4; \
107 const int b4 = a3 + a5 + (a1 + (a1 >> 1)); \
108 const int b5 = a1 - a7 - (a5 + (a5 >> 1)); \
109 const int b6 = a1 + a7 - (a3 + (a3 >> 1)); \
110 const int b7 = a3 - a5 + (a7 + (a7 >> 1)); \
111 (dst)[dststride * 0] = b0 + b1; \
112 (dst)[dststride * 1] = b4 + (b7 >> 2); \
113 (dst)[dststride * 2] = b2 + (b3 >> 1); \
114 (dst)[dststride * 3] = b5 + (b6 >> 2); \
115 (dst)[dststride * 4] = b0 - b1; \
116 (dst)[dststride * 5] = b6 - (b5 >> 2); \
117 (dst)[dststride * 6] = (b2 >> 1) - b3; \
118 (dst)[dststride * 7] = (b4 >> 2) - b7; \
119} while (0)
120
121#define dct8x8_impl(size, dctcoef) \
122static void dct8x8_##size(dctcoef *coef) \
123{ \
124 int i, x, y; \
125 dctcoef tmp[64]; \
126 for (i = 0; i < 8; i++) \
127 DCT8_1D(coef + i, 8, tmp + i, 8); \
128 \
129 for (i = 0; i < 8; i++) \
130 DCT8_1D(tmp + 8*i, 1, coef + i, 8); \
131 \
132 for (y = 0; y < 8; y++) { \
133 for (x = 0; x < 8; x++) { \
134 static const int scale[] = { \
135 13107 * 20, 11428 * 18, 20972 * 32, \
136 12222 * 19, 16777 * 25, 15481 * 24, \
137 }; \
138 static const int idxmap[] = { \
139 0, 3, 4, 3, \
140 3, 1, 5, 1, \
141 4, 5, 2, 5, \
142 3, 1, 5, 1, \
143 }; \
144 const int idx = idxmap[(y & 3) * 4 + (x & 3)]; \
145 coef[y*8 + x] = ((int64_t)coef[y*8 + x] * \
146 scale[idx] + (1 << 17)) >> 18; \
147 } \
148 } \
149}
150
151dct4x4_impl(16, int16_t)
153
154dct8x8_impl(16, int16_t)
156
157static void dct4x4(int16_t *coef, int bit_depth)
158{
159 if (bit_depth == 8)
160 dct4x4_16(coef);
161 else
162 dct4x4_32((int32_t *) coef);
163}
164
165static void dct8x8(int16_t *coef, int bit_depth)
166{
167 if (bit_depth == 8) {
168 dct8x8_16(coef);
169 } else {
170 dct8x8_32((int32_t *) coef);
171 }
172}
173
174
175static void check_idct(void)
176{
177 static const int depths[5] = { 8, 9, 10, 12, 14 };
178 LOCAL_ALIGNED_16(uint8_t, src, [8 * 8 * 2]);
179 LOCAL_ALIGNED_16(uint8_t, dst, [8 * 8 * 2]);
180 LOCAL_ALIGNED_16(uint8_t, dst0, [8 * 8 * 2]);
181 LOCAL_ALIGNED_16(uint8_t, dst1_base, [8 * 8 * 2 + 32]);
182 LOCAL_ALIGNED_16(int16_t, coef, [8 * 8 * 2]);
183 LOCAL_ALIGNED_16(int16_t, subcoef0, [8 * 8 * 2]);
184 LOCAL_ALIGNED_16(int16_t, subcoef1, [8 * 8 * 2]);
186 int bit_depth, sz, align, dc, i;
187 declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, int16_t *block, ptrdiff_t stride);
188
189 for (i = 0; i < FF_ARRAY_ELEMS(depths); i++) {
190 bit_depth = depths[i];
192
193 for (dc = 0; dc <= 2; dc++) {
194 for (sz = 4; sz <= 8; sz += 4) {
195 void (*idct)(uint8_t *, int16_t *, ptrdiff_t) = NULL;
196 const char fmts[3][28] = {
197 "idct%d_add_%dbpp", "idct%d_dc_add_%dbpp",
198 "add_pixels%d_%dbpp",
199 };
200
202
203 if (sz == 4)
204 dct4x4(coef, bit_depth);
205 else
206 dct8x8(coef, bit_depth);
207
208 switch ((sz << 2) | dc) {
209 case (4 << 2) | 0: idct = h.idct_add; break;
210 case (4 << 2) | 1: idct = h.idct_dc_add; break;
211 case (4 << 2) | 2: idct = h.add_pixels4_clear; break;
212 case (8 << 2) | 0: idct = h.idct8_add; break;
213 case (8 << 2) | 1: idct = h.idct8_dc_add; break;
214 case (8 << 2) | 2: idct = h.add_pixels8_clear; break;
215 }
216
217 if (check_func(idct, fmts[dc], sz, bit_depth)) {
218 for (align = 0; align < 16; align += sz * SIZEOF_PIXEL) {
219 uint8_t *dst1 = dst1_base + align;
220 if (dc) {
221 memset(subcoef0, 0, sz * sz * SIZEOF_COEF);
222 memcpy(subcoef0, coef, SIZEOF_COEF);
223 } else {
224 memcpy(subcoef0, coef, sz * sz * SIZEOF_COEF);
225 }
226 memcpy(dst0, dst, sz * PIXEL_STRIDE);
227 memcpy(dst1, dst, sz * PIXEL_STRIDE);
228 memcpy(subcoef1, subcoef0, sz * sz * SIZEOF_COEF);
229 call_ref(dst0, subcoef0, PIXEL_STRIDE);
230 call_new(dst1, subcoef1, PIXEL_STRIDE);
231 if (memcmp(dst0, dst1, sz * PIXEL_STRIDE) ||
232 memcmp(subcoef0, subcoef1, sz * sz * SIZEOF_COEF))
233 fail();
234 bench_new(dst1, subcoef1, sz * SIZEOF_PIXEL);
235 }
236 }
237 }
238 }
239 }
240}
241
242static void check_idct_multiple(void)
243{
244 LOCAL_ALIGNED_16(uint8_t, dst_full, [16 * 16 * 2]);
245 LOCAL_ALIGNED_16(int16_t, coef_full, [16 * 16 * 2]);
246 LOCAL_ALIGNED_16(uint8_t, dst0, [16 * 16 * 2]);
247 LOCAL_ALIGNED_16(uint8_t, dst1, [16 * 16 * 2]);
248 LOCAL_ALIGNED_16(int16_t, coef0, [16 * 16 * 2]);
249 LOCAL_ALIGNED_16(int16_t, coef1, [16 * 16 * 2]);
250 LOCAL_ALIGNED_16(uint8_t, nnzc, [15 * 8]);
252 int bit_depth, i, y, func;
253 declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, const int *block_offset, int16_t *block, ptrdiff_t stride, const uint8_t nnzc[15*8]);
254
255 for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
257 for (func = 0; func < 3; func++) {
258 void (*idct)(uint8_t *, const int *, int16_t *, ptrdiff_t, const uint8_t[]) = NULL;
259 const char *name;
260 int sz = 4, intra = 0;
261 int block_offset[16] = { 0 };
262 switch (func) {
263 case 0:
264 idct = h.idct_add16;
265 name = "idct_add16";
266 break;
267 case 1:
268 idct = h.idct_add16intra;
269 name = "idct_add16intra";
270 intra = 1;
271 break;
272 case 2:
273 idct = h.idct8_add4;
274 name = "idct8_add4";
275 sz = 8;
276 break;
277 }
278 memset(nnzc, 0, 15 * 8);
279 memset(coef_full, 0, 16 * 16 * SIZEOF_COEF);
280 for (i = 0; i < 16 * 16; i += sz * sz) {
281 uint8_t src[8 * 8 * 2];
282 uint8_t dst[8 * 8 * 2];
283 int16_t coef[8 * 8 * 2];
284 int index = i / sz;
285 int block_y = (index / 16) * sz;
286 int block_x = index % 16;
287 int offset = (block_y * 16 + block_x) * SIZEOF_PIXEL;
288 int nnz = rnd() % 3;
289
291 if (sz == 4)
292 dct4x4(coef, bit_depth);
293 else
294 dct8x8(coef, bit_depth);
295
296 for (y = 0; y < sz; y++)
297 memcpy(&dst_full[offset + y * 16 * SIZEOF_PIXEL],
298 &dst[PIXEL_STRIDE * y], sz * SIZEOF_PIXEL);
299
300 if (nnz > 1)
301 nnz = sz * sz;
302 memcpy(&coef_full[i * SIZEOF_COEF/sizeof(coef[0])],
303 coef, nnz * SIZEOF_COEF);
304
305 if (intra && nnz == 1)
306 nnz = 0;
307
308 nnzc[scan8[i / 16]] = nnz;
309 block_offset[i / 16] = offset;
310 }
311
312 if (check_func(idct, "%s_%dbpp", name, bit_depth)) {
313 memcpy(coef0, coef_full, 16 * 16 * SIZEOF_COEF);
314 memcpy(coef1, coef_full, 16 * 16 * SIZEOF_COEF);
315 memcpy(dst0, dst_full, 16 * 16 * SIZEOF_PIXEL);
316 memcpy(dst1, dst_full, 16 * 16 * SIZEOF_PIXEL);
317 call_ref(dst0, block_offset, coef0, 16 * SIZEOF_PIXEL, nnzc);
318 call_new(dst1, block_offset, coef1, 16 * SIZEOF_PIXEL, nnzc);
319 if (memcmp(dst0, dst1, 16 * 16 * SIZEOF_PIXEL) ||
320 memcmp(coef0, coef1, 16 * 16 * SIZEOF_COEF))
321 fail();
322 bench_new(dst1, block_offset, coef1, 16 * SIZEOF_PIXEL, nnzc);
323 }
324 }
325 }
326}
327
328static void check_idct_dequant(void)
329{
330 static const int depths[5] = { 8, 9, 10, 12, 14 };
331 LOCAL_ALIGNED_16(int16_t, src16, [16]);
332 LOCAL_ALIGNED_16(int32_t, src32, [16]);
333 LOCAL_ALIGNED_16(int16_t, dst0_16, [16 * 16]);
334 LOCAL_ALIGNED_16(int16_t, dst1_16, [16 * 16]);
335 LOCAL_ALIGNED_16(int32_t, dst0_32, [16 * 16]);
336 LOCAL_ALIGNED_16(int32_t, dst1_32, [16 * 16]);
338 int bit_depth, i, qmul;
339 declare_func(void, int16_t *output, int16_t *input, int qmul);
340
341 qmul = rnd() % 4096;
342
343 for (i = 0; i < FF_ARRAY_ELEMS(depths); i++) {
344 bit_depth = depths[i];
346
347 void *src, *dst_ref, *dst_new;
348 if (bit_depth == 8) {
349 src = src16;
350 dst_ref = dst0_16;
351 dst_new = dst1_16;
352 for (int j = 0; j < 16; j++)
353 src16[j] = (rnd() % 512) - 256;
354 } else {
355 src = src32;
356 dst_ref = dst0_32;
357 dst_new = dst1_32;
358 for (int j = 0; j < 16; j++)
359 src32[j] = (rnd() % (1 << (bit_depth + 1))) - (1 << bit_depth);
360 }
361 memset(dst_ref, 0, 16 * 16 * SIZEOF_COEF);
362 memset(dst_new, 0, 16 * 16 * SIZEOF_COEF);
363
364 if (check_func(h.luma_dc_dequant_idct, "luma_dc_dequant_idct_%d", bit_depth)) {
365
366 call_ref(dst_ref, src, qmul);
367 call_new(dst_new, src, qmul);
368 checkasm_check_dctcoef(dst0, 16*SIZEOF_COEF, dst1, 16*SIZEOF_COEF, 16, 16, "dst");
369 bench_new(dst_new, src, qmul);
370 }
371 }
372}
373
374
375static void check_loop_filter(void)
376{
377 enum {
378 N = 35,
379 };
380 LOCAL_ALIGNED_16(uint8_t, dst, [32 * 16 * 2]);
381 LOCAL_ALIGNED_16(uint8_t, dst0, [32 * 16 * 2]);
382 LOCAL_ALIGNED_16(uint8_t, dst1, [32 * 16 * 2]);
384 int bit_depth;
385 int alphas[N], betas[N];
386 int8_t tc0[N][4];
387
388 declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *pix, ptrdiff_t stride,
389 int alpha, int beta, int8_t *tc0);
390
391 for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
392 uint32_t mask = pixel_mask_lf[bit_depth - 8];
394 for (int i = N, a = 255, c = 250; --i >= 0;) {
395 alphas[i] = a << (bit_depth - 8);
396 betas[i] = (i + 2) / 2 << (bit_depth - 8);
397 tc0[i][0] = tc0[i][3] = (c + 6) / 10;
398 tc0[i][1] = (c + 7) / 15;
399 tc0[i][2] = (c + 9) / 20;
400 a = a*9/10;
401 c = c*9/10;
402 }
403
404#define CHECK_LOOP_FILTER(name, align, idc) \
405 do { \
406 if (check_func(h.name, #name #idc "_%dbpp", bit_depth)) { \
407 for (int j = 0; j < N; ++j) { \
408 intptr_t off = 8 * 32 + (j & 15) * 4 * !align; \
409 for (int i = 0; i < 1024; i += 4) { \
410 AV_WN32A(dst + i, rnd() & mask); \
411 } \
412 memcpy(dst0, dst, 32 * 16 * 2); \
413 memcpy(dst1, dst, 32 * 16 * 2); \
414 \
415 call_ref(dst0 + off, 32, alphas[j], betas[j], tc0[j]); \
416 call_new(dst1 + off, 32, alphas[j], betas[j], tc0[j]); \
417 if (memcmp(dst0, dst1, 32 * 16 * SIZEOF_PIXEL)) { \
418 fprintf(stderr, #name #idc ": j:%d, alpha:%d beta:%d " \
419 "tc0:{%d,%d,%d,%d}\n", j, alphas[j], betas[j], \
420 tc0[j][0], tc0[j][1], tc0[j][2], tc0[j][3]); \
421 fail(); \
422 } \
423 bench_new(dst1 + off, 32, alphas[j], betas[j], tc0[j]);\
424 } \
425 } \
426 } while (0)
427
428 CHECK_LOOP_FILTER(v_loop_filter_luma, 1,);
429 CHECK_LOOP_FILTER(h_loop_filter_luma, 0,);
430 CHECK_LOOP_FILTER(h_loop_filter_luma_mbaff, 0,);
431 CHECK_LOOP_FILTER(v_loop_filter_chroma, 1,);
432 CHECK_LOOP_FILTER(h_loop_filter_chroma, 0,);
433 CHECK_LOOP_FILTER(h_loop_filter_chroma_mbaff, 0,);
434
436 CHECK_LOOP_FILTER(h_loop_filter_chroma, 0, 422);
437 CHECK_LOOP_FILTER(h_loop_filter_chroma_mbaff, 0, 422);
438#undef CHECK_LOOP_FILTER
439 }
440}
441
442static void check_loop_filter_intra(void)
443{
444 enum {
445 N = 35,
446 };
447 LOCAL_ALIGNED_16(uint8_t, dst, [32 * 16 * 2]);
448 LOCAL_ALIGNED_16(uint8_t, dst0, [32 * 16 * 2]);
449 LOCAL_ALIGNED_16(uint8_t, dst1, [32 * 16 * 2]);
451 int bit_depth;
452 int alphas[N], betas[N];
453
454 declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *pix, ptrdiff_t stride,
455 int alpha, int beta);
456
457 for (bit_depth = 8; bit_depth <= 10; bit_depth++) {
458 uint32_t mask = pixel_mask_lf[bit_depth - 8];
460 for (int i = N, a = 255; --i >= 0;) {
461 alphas[i] = a << (bit_depth - 8);
462 betas[i] = (i + 2) / 2 << (bit_depth - 8);
463 a = a*9/10;
464 }
465
466#define CHECK_LOOP_FILTER(name, align, idc) \
467 do { \
468 if (check_func(h.name, #name #idc "_%dbpp", bit_depth)) { \
469 for (int j = 0; j < N; ++j) { \
470 intptr_t off = 8 * 32 + (j & 15) * 4 * !align; \
471 for (int i = 0; i < 1024; i += 4) { \
472 AV_WN32A(dst + i, rnd() & mask); \
473 } \
474 memcpy(dst0, dst, 32 * 16 * 2); \
475 memcpy(dst1, dst, 32 * 16 * 2); \
476 \
477 call_ref(dst0 + off, 32, alphas[j], betas[j]); \
478 call_new(dst1 + off, 32, alphas[j], betas[j]); \
479 if (memcmp(dst0, dst1, 32 * 16 * SIZEOF_PIXEL)) { \
480 fprintf(stderr, #name #idc ": j:%d, alpha:%d beta:%d\n", \
481 j, alphas[j], betas[j]); \
482 fail(); \
483 } \
484 bench_new(dst1 + off, 32, alphas[j], betas[j]); \
485 } \
486 } \
487 } while (0)
488
489 CHECK_LOOP_FILTER(v_loop_filter_luma_intra, 1,);
490 CHECK_LOOP_FILTER(h_loop_filter_luma_intra, 0,);
491 CHECK_LOOP_FILTER(h_loop_filter_luma_mbaff_intra, 0,);
492 CHECK_LOOP_FILTER(v_loop_filter_chroma_intra, 1,);
493 CHECK_LOOP_FILTER(h_loop_filter_chroma_intra, 0,);
494 CHECK_LOOP_FILTER(h_loop_filter_chroma_mbaff_intra, 0,);
495
497 CHECK_LOOP_FILTER(h_loop_filter_chroma_intra, 0, 422);
498 CHECK_LOOP_FILTER(h_loop_filter_chroma_mbaff_intra, 0, 422);
499#undef CHECK_LOOP_FILTER
500 }
501}
502
504{
505 check_idct();
508 report("idct");
509
511 report("loop_filter");
512
514 report("loop_filter_intra");
515}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
Definition af_astats.c:246
#define N
Definition af_mcompand.c:54
int32_t
static const uint8_t *BS_FUNC align(BSCTX *bc)
Skip bits to a byte boundary.
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define rnd
Definition checkasm.h:136
#define checkasm_check_dctcoef(buf1, stride1, buf2, stride2,...)
Definition checkasm.h:177
common internal and external API header
#define NULL
Definition coverity.c:32
static int16_t block[64]
Definition dct.c:125
#define declare_func
Definition test.h:489
#define fail
Definition test.h:479
#define bench_new
Definition test.h:487
#define check_func
Definition test.h:481
#define call_new
Definition test.h:486
#define call_ref
Definition test.h:485
#define report
Definition test.h:480
#define declare_func_emms
Definition test.h:490
int index
Definition gxfenc.c:90
H.264 decoder/parser shared code.
static const uint8_t scan8[16 *3+3]
Definition h264_parse.h:40
H.264 DSP functions.
int a
static const int16_t alpha[]
Definition ilbcdata.h:55
unsigned offset
Definition libaomenc.c:763
static void idct(int16_t block[64])
Definition 4xm.c:167
av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
Definition h264dsp.c:66
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition jacosubdec.c:66
#define AV_CPU_FLAG_MMX
standard MMX
Definition cpu.h:32
static const uint16_t mask[17]
Definition lzw.c:38
#define LOCAL_ALIGNED_16(t, v,...)
enum AVPixelFormat pix
Definition ohcodec.c:55
const char * name
Definition qsvenc.c:142
#define FF_ARRAY_ELEMS(a)
Context for storing H.264 DSP functions.
Definition h264dsp.h:42
#define stride
#define SIZEOF_PIXEL
Definition h264chroma.c:28
void checkasm_check_h264dsp(void)
Definition h264dsp.c:503
static void check_loop_filter(void)
Definition h264dsp.c:375
static const uint32_t pixel_mask[5]
Definition h264dsp.c:31
#define PIXEL_STRIDE
Definition h264dsp.c:36
static void check_idct_multiple(void)
Definition h264dsp.c:242
static void check_loop_filter_intra(void)
Definition h264dsp.c:442
static void check_idct_dequant(void)
Definition h264dsp.c:328
static const uint32_t pixel_mask_lf[3]
Definition h264dsp.c:32
static void check_idct(void)
Definition h264dsp.c:175
#define CHECK_LOOP_FILTER(name, align, idc)
static void dct8x8(int16_t *coef, int bit_depth)
Definition h264dsp.c:165
#define dct4x4_impl(size, dctcoef)
Definition h264dsp.c:60
#define dct8x8_impl(size, dctcoef)
Definition h264dsp.c:121
#define randomize_buffers(idx)
Definition h264dsp.c:38
#define SIZEOF_COEF
Definition h264dsp.c:35
#define src
Definition vp8dsp.c:248
static void dct4x4(int16_t *coef)
Definition vp8dsp.c:47
static double c[64]