FFmpeg
hevc_pel.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Henrik Gramner
3  * Copyright (c) 2021 Josh Dekker
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #include <string.h>
23 #include "checkasm.h"
24 #include "libavcodec/hevc/dsp.h"
25 #include "libavutil/common.h"
26 #include "libavutil/internal.h"
27 #include "libavutil/intreadwrite.h"
28 
29 static const uint32_t pixel_mask[] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff, 0x07ff07ff, 0x0fff0fff };
30 static const uint32_t pixel_mask16[] = { 0x00ff00ff, 0x01ff01ff, 0x03ff03ff, 0x07ff07ff, 0x0fff0fff };
31 static const int sizes[] = { -1, 4, 6, 8, 12, 16, 24, 32, 48, 64 };
32 static const int weights[] = { 0, 128, 255, -1 };
33 static const int denoms[] = {0, 7, 12, -1 };
34 static const int offsets[] = {0, 255, -1 };
35 
36 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
37 #define BUF_SIZE (2 * MAX_PB_SIZE * (2 * 4 + MAX_PB_SIZE))
38 
39 #define randomize_buffers() \
40  do { \
41  uint32_t mask = pixel_mask[bit_depth - 8]; \
42  int k; \
43  for (k = 0; k < BUF_SIZE + SRC_EXTRA; k += 4) { \
44  uint32_t r = rnd() & mask; \
45  AV_WN32A(buf0 + k, r); \
46  AV_WN32A(buf1 + k, r); \
47  if (k >= BUF_SIZE) \
48  continue; \
49  r = rnd(); \
50  AV_WN32A(dst0 + k, r); \
51  AV_WN32A(dst1 + k, r); \
52  } \
53  } while (0)
54 
55 #define randomize_buffers_ref() \
56  randomize_buffers(); \
57  do { \
58  uint32_t mask = pixel_mask16[bit_depth - 8]; \
59  int k; \
60  for (k = 0; k < BUF_SIZE; k += 2) { \
61  uint32_t r = rnd() & mask; \
62  AV_WN32A(ref0 + k, r); \
63  AV_WN32A(ref1 + k, r); \
64  } \
65  } while (0)
66 
67 #define src0 (buf0 + 2 * 4 * MAX_PB_SIZE) /* hevc qpel functions read data from negative src pointer offsets */
68 #define src1 (buf1 + 2 * 4 * MAX_PB_SIZE)
69 
70 /* FIXME: Does the need for SRC_EXTRA for these tests indicate a bug? */
71 #define SRC_EXTRA 8
72 
73 static void checkasm_check_hevc_qpel(void)
74 {
75  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
76  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
77  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
78  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
79 
81  int size, bit_depth, i, j;
82  declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
83  int height, intptr_t mx, intptr_t my, int width);
84 
85  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
87 
88  for (i = 0; i < 2; i++) {
89  for (j = 0; j < 2; j++) {
90  for (size = 1; size < 10; size++) {
91  const char *type;
92  switch ((j << 1) | i) {
93  case 0: type = "pel_pixels"; break; // 0 0
94  case 1: type = "qpel_h"; break; // 0 1
95  case 2: type = "qpel_v"; break; // 1 0
96  case 3: type = "qpel_hv"; break; // 1 1
97  }
98 
99  if (check_func(h.put_hevc_qpel[size][j][i],
100  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
101  int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
103  call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
104  call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
105  checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
106  dstw1, MAX_PB_SIZE * sizeof(int16_t),
107  size[sizes], size[sizes], "dst");
108  bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
109  }
110  }
111  }
112  }
113  }
114  report("qpel");
115 }
116 
118 {
119  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
120  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
121  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
122  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
123 
125  int size, bit_depth, i, j;
126  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
127  int height, intptr_t mx, intptr_t my, int width);
128 
129  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
131 
132  for (i = 0; i < 2; i++) {
133  for (j = 0; j < 2; j++) {
134  for (size = 1; size < 10; size++) {
135  const char *type;
136  switch ((j << 1) | i) {
137  case 0: type = "pel_uni_pixels"; break; // 0 0
138  case 1: type = "qpel_uni_h"; break; // 0 1
139  case 2: type = "qpel_uni_v"; break; // 1 0
140  case 3: type = "qpel_uni_hv"; break; // 1 1
141  }
142 
143  if (check_func(h.put_hevc_qpel_uni[size][j][i],
144  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
146  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
148  sizes[size], i, j, sizes[size]);
149  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
151  sizes[size], i, j, sizes[size]);
153  dst1, sizes[size] * SIZEOF_PIXEL,
154  size[sizes], size[sizes], "dst");
155  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
157  sizes[size], i, j, sizes[size]);
158  }
159  }
160  }
161  }
162  }
163  report("qpel_uni");
164 }
165 
167 {
168  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
169  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
170  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
171  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
172 
174  int size, bit_depth, i, j;
175  const int *denom, *wx, *ox;
176  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
177  int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
178 
179  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
181 
182  for (i = 0; i < 2; i++) {
183  for (j = 0; j < 2; j++) {
184  for (size = 1; size < 10; size++) {
185  const char *type;
186  switch ((j << 1) | i) {
187  case 0: type = "pel_uni_w_pixels"; break; // 0 0
188  case 1: type = "qpel_uni_w_h"; break; // 0 1
189  case 2: type = "qpel_uni_w_v"; break; // 1 0
190  case 3: type = "qpel_uni_w_hv"; break; // 1 1
191  }
192 
193  if (check_func(h.put_hevc_qpel_uni_w[size][j][i],
194  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
195  for (denom = denoms; *denom >= 0; denom++) {
196  for (wx = weights; *wx >= 0; wx++) {
197  for (ox = offsets; *ox >= 0; ox++) {
199  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
201  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
202  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
204  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
206  dst1, sizes[size] * SIZEOF_PIXEL,
207  size[sizes], size[sizes], "dst");
208  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
210  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
211  }
212  }
213  }
214  }
215  }
216  }
217  }
218  }
219  report("qpel_uni_w");
220 }
221 
223 {
224  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
225  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
226  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
227  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
228  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
229  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
230 
232  int size, bit_depth, i, j;
233  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
234  const int16_t *src2,
235  int height, intptr_t mx, intptr_t my, int width);
236 
237  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
239 
240  for (i = 0; i < 2; i++) {
241  for (j = 0; j < 2; j++) {
242  for (size = 1; size < 10; size++) {
243  const char *type;
244  switch ((j << 1) | i) {
245  case 0: type = "pel_bi_pixels"; break; // 0 0
246  case 1: type = "qpel_bi_h"; break; // 0 1
247  case 2: type = "qpel_bi_v"; break; // 1 0
248  case 3: type = "qpel_bi_hv"; break; // 1 1
249  }
250 
251  if (check_func(h.put_hevc_qpel_bi[size][j][i],
252  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
254  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
256  ref0, sizes[size], i, j, sizes[size]);
257  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
259  ref1, sizes[size], i, j, sizes[size]);
261  dst1, sizes[size] * SIZEOF_PIXEL,
262  size[sizes], size[sizes], "dst");
263  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
265  ref1, sizes[size], i, j, sizes[size]);
266  }
267  }
268  }
269  }
270  }
271  report("qpel_bi");
272 }
273 
275 {
276  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
277  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
278  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
279  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
280  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
281  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
282 
284  int size, bit_depth, i, j;
285  const int *denom, *wx, *ox;
286  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
287  const int16_t *src2,
288  int height, int denom, int wx0, int wx1,
289  int ox0, int ox1, intptr_t mx, intptr_t my, int width);
290 
291  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
293 
294  for (i = 0; i < 2; i++) {
295  for (j = 0; j < 2; j++) {
296  for (size = 1; size < 10; size++) {
297  const char *type;
298  switch ((j << 1) | i) {
299  case 0: type = "pel_bi_w_pixels"; break; // 0 0
300  case 1: type = "qpel_bi_w_h"; break; // 0 1
301  case 2: type = "qpel_bi_w_v"; break; // 1 0
302  case 3: type = "qpel_bi_w_hv"; break; // 1 1
303  }
304 
305  if (check_func(h.put_hevc_qpel_bi_w[size][j][i],
306  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
307  for (denom = denoms; *denom >= 0; denom++) {
308  for (wx = weights; *wx >= 0; wx++) {
309  for (ox = offsets; *ox >= 0; ox++) {
311  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
313  ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
314  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
316  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
318  dst1, sizes[size] * SIZEOF_PIXEL,
319  size[sizes], size[sizes], "dst");
320  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
322  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
323  }
324  }
325  }
326  }
327  }
328  }
329  }
330  }
331  report("qpel_bi_w");
332 }
333 
334 #undef SRC_EXTRA
335 #define SRC_EXTRA 0
336 
337 static void checkasm_check_hevc_epel(void)
338 {
339  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
340  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
341  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
342  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
343 
345  int size, bit_depth, i, j;
346  declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
347  int height, intptr_t mx, intptr_t my, int width);
348 
349  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
351 
352  for (i = 0; i < 2; i++) {
353  for (j = 0; j < 2; j++) {
354  for (size = 1; size < 10; size++) {
355  const char *type;
356  switch ((j << 1) | i) {
357  case 0: type = "pel_pixels"; break; // 0 0
358  case 1: type = "epel_h"; break; // 0 1
359  case 2: type = "epel_v"; break; // 1 0
360  case 3: type = "epel_hv"; break; // 1 1
361  }
362 
363  if (check_func(h.put_hevc_epel[size][j][i],
364  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
365  int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
367  call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
368  call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
369  checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
370  dstw1, MAX_PB_SIZE * sizeof(int16_t),
371  size[sizes], size[sizes], "dst");
372  bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
373  }
374  }
375  }
376  }
377  }
378  report("epel");
379 }
380 
382 {
383  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
384  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
385  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
386  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
387 
389  int size, bit_depth, i, j;
390  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
391  int height, intptr_t mx, intptr_t my, int width);
392 
393  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
395 
396  for (i = 0; i < 2; i++) {
397  for (j = 0; j < 2; j++) {
398  for (size = 1; size < 10; size++) {
399  const char *type;
400  switch ((j << 1) | i) {
401  case 0: type = "pel_uni_pixels"; break; // 0 0
402  case 1: type = "epel_uni_h"; break; // 0 1
403  case 2: type = "epel_uni_v"; break; // 1 0
404  case 3: type = "epel_uni_hv"; break; // 1 1
405  }
406 
407  if (check_func(h.put_hevc_epel_uni[size][j][i],
408  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
410  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
412  sizes[size], i, j, sizes[size]);
413  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
415  sizes[size], i, j, sizes[size]);
417  dst1, sizes[size] * SIZEOF_PIXEL,
418  size[sizes], size[sizes], "dst");
419  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
421  sizes[size], i, j, sizes[size]);
422  }
423  }
424  }
425  }
426  }
427  report("epel_uni");
428 }
429 
431 {
432  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
433  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
434  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
435  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
436 
438  int size, bit_depth, i, j;
439  const int *denom, *wx, *ox;
440  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
441  int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
442 
443  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
445 
446  for (i = 0; i < 2; i++) {
447  for (j = 0; j < 2; j++) {
448  for (size = 1; size < 10; size++) {
449  const char *type;
450  switch ((j << 1) | i) {
451  case 0: type = "pel_uni_w_pixels"; break; // 0 0
452  case 1: type = "epel_uni_w_h"; break; // 0 1
453  case 2: type = "epel_uni_w_v"; break; // 1 0
454  case 3: type = "epel_uni_w_hv"; break; // 1 1
455  }
456 
457  if (check_func(h.put_hevc_epel_uni_w[size][j][i],
458  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
459  for (denom = denoms; *denom >= 0; denom++) {
460  for (wx = weights; *wx >= 0; wx++) {
461  for (ox = offsets; *ox >= 0; ox++) {
463  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
465  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
466  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
468  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
470  dst1, sizes[size] * SIZEOF_PIXEL,
471  size[sizes], size[sizes], "dst");
472  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
474  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
475  }
476  }
477  }
478  }
479  }
480  }
481  }
482  }
483  report("epel_uni_w");
484 }
485 
487 {
488  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
489  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
490  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
491  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
492  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
493  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
494 
496  int size, bit_depth, i, j;
497  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
498  const int16_t *src2,
499  int height, intptr_t mx, intptr_t my, int width);
500 
501  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
503 
504  for (i = 0; i < 2; i++) {
505  for (j = 0; j < 2; j++) {
506  for (size = 1; size < 10; size++) {
507  const char *type;
508  switch ((j << 1) | i) {
509  case 0: type = "pel_bi_pixels"; break; // 0 0
510  case 1: type = "epel_bi_h"; break; // 0 1
511  case 2: type = "epel_bi_v"; break; // 1 0
512  case 3: type = "epel_bi_hv"; break; // 1 1
513  }
514 
515  if (check_func(h.put_hevc_epel_bi[size][j][i],
516  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
518  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
520  ref0, sizes[size], i, j, sizes[size]);
521  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
523  ref1, sizes[size], i, j, sizes[size]);
525  dst1, sizes[size] * SIZEOF_PIXEL,
526  size[sizes], size[sizes], "dst");
527  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
529  ref1, sizes[size], i, j, sizes[size]);
530  }
531  }
532  }
533  }
534  }
535  report("epel_bi");
536 }
537 
539 {
540  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
541  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
542  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
543  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
544  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
545  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
546 
548  int size, bit_depth, i, j;
549  const int *denom, *wx, *ox;
550  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
551  const int16_t *src2,
552  int height, int denom, int wx0, int wx1,
553  int ox0, int ox1, intptr_t mx, intptr_t my, int width);
554 
555  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
557 
558  for (i = 0; i < 2; i++) {
559  for (j = 0; j < 2; j++) {
560  for (size = 1; size < 10; size++) {
561  const char *type;
562  switch ((j << 1) | i) {
563  case 0: type = "pel_bi_w_pixels"; break; // 0 0
564  case 1: type = "epel_bi_w_h"; break; // 0 1
565  case 2: type = "epel_bi_w_v"; break; // 1 0
566  case 3: type = "epel_bi_w_hv"; break; // 1 1
567  }
568 
569  if (check_func(h.put_hevc_epel_bi_w[size][j][i],
570  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
571  for (denom = denoms; *denom >= 0; denom++) {
572  for (wx = weights; *wx >= 0; wx++) {
573  for (ox = offsets; *ox >= 0; ox++) {
575  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
577  ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
578  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
580  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
582  dst1, sizes[size] * SIZEOF_PIXEL,
583  size[sizes], size[sizes], "dst");
584  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
586  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
587  }
588  }
589  }
590  }
591  }
592  }
593  }
594  }
595  report("epel_bi_w");
596 }
597 
599 {
610 }
ff_hevc_dsp_init
void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
Definition: dsp.c:128
checkasm_check_hevc_qpel_bi
static void checkasm_check_hevc_qpel_bi(void)
Definition: hevc_pel.c:222
checkasm_check_hevc_epel_bi_w
static void checkasm_check_hevc_epel_bi_w(void)
Definition: hevc_pel.c:538
checkasm_check_hevc_epel_uni
static void checkasm_check_hevc_epel_uni(void)
Definition: hevc_pel.c:381
src0
#define src0
Definition: hevc_pel.c:67
pixel_mask16
static const uint32_t pixel_mask16[]
Definition: hevc_pel.c:30
check_func
#define check_func(func,...)
Definition: checkasm.h:184
checkasm_check_hevc_epel
static void checkasm_check_hevc_epel(void)
Definition: hevc_pel.c:337
call_ref
#define call_ref(...)
Definition: checkasm.h:199
bit_depth
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
Definition: af_astats.c:246
mx
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition: dsp.h:53
checkasm.h
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
checkasm_check_hevc_qpel
static void checkasm_check_hevc_qpel(void)
Definition: hevc_pel.c:73
SRC_EXTRA
#define SRC_EXTRA
Definition: hevc_pel.c:335
checkasm_check_hevc_pel
void checkasm_check_hevc_pel(void)
Definition: hevc_pel.c:598
intreadwrite.h
offsets
static const int offsets[]
Definition: hevc_pel.c:34
SIZEOF_PIXEL
#define SIZEOF_PIXEL
Definition: hevc_pel.c:36
my
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
Definition: dsp.h:53
srcstride
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t const uint8_t ptrdiff_t srcstride
Definition: dsp.h:84
checkasm_check_hevc_qpel_uni_w
static void checkasm_check_hevc_qpel_uni_w(void)
Definition: hevc_pel.c:166
call_new
#define call_new(...)
Definition: checkasm.h:302
LOCAL_ALIGNED_32
#define LOCAL_ALIGNED_32(t, v,...)
Definition: mem_internal.h:132
dsp.h
height
#define height
Definition: dsp.h:85
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
size
int size
Definition: twinvq_data.h:10344
HEVCDSPContext
Definition: dsp.h:47
report
#define report
Definition: checkasm.h:196
checkasm_check_pixel
#define checkasm_check_pixel(buf1, stride1, buf2, stride2,...)
Definition: checkasm.h:398
bench_new
#define bench_new(...)
Definition: checkasm.h:373
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
internal.h
src2
const pixel * src2
Definition: h264pred_template.c:421
weights
static const int weights[]
Definition: hevc_pel.c:32
common.h
checkasm_check_hevc_epel_bi
static void checkasm_check_hevc_epel_bi(void)
Definition: hevc_pel.c:486
checkasm_check_hevc_qpel_uni
static void checkasm_check_hevc_qpel_uni(void)
Definition: hevc_pel.c:117
MAX_PB_SIZE
#define MAX_PB_SIZE
Definition: dsp.h:32
randomize_buffers_ref
#define randomize_buffers_ref()
Definition: hevc_pel.c:55
pixel_mask
static const uint32_t pixel_mask[]
Definition: hevc_pel.c:29
denoms
static const int denoms[]
Definition: hevc_pel.c:33
declare_func
#define declare_func(ret,...)
Definition: checkasm.h:188
BUF_SIZE
#define BUF_SIZE
Definition: hevc_pel.c:37
sizes
static const int sizes[]
Definition: hevc_pel.c:31
checkasm_check_hevc_qpel_bi_w
static void checkasm_check_hevc_qpel_bi_w(void)
Definition: hevc_pel.c:274
src1
#define src1
Definition: hevc_pel.c:68
h
h
Definition: vp9dsp_template.c:2070
checkasm_check
#define checkasm_check(prefix,...)
Definition: checkasm.h:393
width
#define width
Definition: dsp.h:85
checkasm_check_hevc_epel_uni_w
static void checkasm_check_hevc_epel_uni_w(void)
Definition: hevc_pel.c:430
src
#define src
Definition: vp8dsp.c:248
randomize_buffers
#define randomize_buffers()
Definition: hevc_pel.c:39