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 checkasm_check_pixel(buf1, stride1, buf2, stride2, ...) \
40  ((bit_depth > 8) ? \
41  checkasm_check(uint16_t, (const uint16_t*)buf1, stride1, \
42  (const uint16_t*)buf2, stride2, \
43  __VA_ARGS__) : \
44  checkasm_check(uint8_t, (const uint8_t*) buf1, stride1, \
45  (const uint8_t*) buf2, stride2, \
46  __VA_ARGS__))
47 
48 #define randomize_buffers() \
49  do { \
50  uint32_t mask = pixel_mask[bit_depth - 8]; \
51  int k; \
52  for (k = 0; k < BUF_SIZE + SRC_EXTRA; k += 4) { \
53  uint32_t r = rnd() & mask; \
54  AV_WN32A(buf0 + k, r); \
55  AV_WN32A(buf1 + k, r); \
56  if (k >= BUF_SIZE) \
57  continue; \
58  r = rnd(); \
59  AV_WN32A(dst0 + k, r); \
60  AV_WN32A(dst1 + k, r); \
61  } \
62  } while (0)
63 
64 #define randomize_buffers_ref() \
65  randomize_buffers(); \
66  do { \
67  uint32_t mask = pixel_mask16[bit_depth - 8]; \
68  int k; \
69  for (k = 0; k < BUF_SIZE; k += 2) { \
70  uint32_t r = rnd() & mask; \
71  AV_WN32A(ref0 + k, r); \
72  AV_WN32A(ref1 + k, r); \
73  } \
74  } while (0)
75 
76 #define src0 (buf0 + 2 * 4 * MAX_PB_SIZE) /* hevc qpel functions read data from negative src pointer offsets */
77 #define src1 (buf1 + 2 * 4 * MAX_PB_SIZE)
78 
79 /* FIXME: Does the need for SRC_EXTRA for these tests indicate a bug? */
80 #define SRC_EXTRA 8
81 
82 static void checkasm_check_hevc_qpel(void)
83 {
84  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
85  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
86  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
87  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
88 
90  int size, bit_depth, i, j;
91  declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
92  int height, intptr_t mx, intptr_t my, int width);
93 
94  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
96 
97  for (i = 0; i < 2; i++) {
98  for (j = 0; j < 2; j++) {
99  for (size = 1; size < 10; size++) {
100  const char *type;
101  switch ((j << 1) | i) {
102  case 0: type = "pel_pixels"; break; // 0 0
103  case 1: type = "qpel_h"; break; // 0 1
104  case 2: type = "qpel_v"; break; // 1 0
105  case 3: type = "qpel_hv"; break; // 1 1
106  }
107 
108  if (check_func(h.put_hevc_qpel[size][j][i],
109  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
110  int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
112  call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
113  call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
114  checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
115  dstw1, MAX_PB_SIZE * sizeof(int16_t),
116  size[sizes], size[sizes], "dst");
117  bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
118  }
119  }
120  }
121  }
122  }
123  report("qpel");
124 }
125 
127 {
128  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
129  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
130  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
131  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
132 
134  int size, bit_depth, i, j;
135  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
136  int height, intptr_t mx, intptr_t my, int width);
137 
138  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
140 
141  for (i = 0; i < 2; i++) {
142  for (j = 0; j < 2; j++) {
143  for (size = 1; size < 10; size++) {
144  const char *type;
145  switch ((j << 1) | i) {
146  case 0: type = "pel_uni_pixels"; break; // 0 0
147  case 1: type = "qpel_uni_h"; break; // 0 1
148  case 2: type = "qpel_uni_v"; break; // 1 0
149  case 3: type = "qpel_uni_hv"; break; // 1 1
150  }
151 
152  if (check_func(h.put_hevc_qpel_uni[size][j][i],
153  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
155  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
157  sizes[size], i, j, sizes[size]);
158  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
160  sizes[size], i, j, sizes[size]);
162  dst1, sizes[size] * SIZEOF_PIXEL,
163  size[sizes], size[sizes], "dst");
164  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
166  sizes[size], i, j, sizes[size]);
167  }
168  }
169  }
170  }
171  }
172  report("qpel_uni");
173 }
174 
176 {
177  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
178  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
179  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
180  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
181 
183  int size, bit_depth, i, j;
184  const int *denom, *wx, *ox;
185  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
186  int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
187 
188  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
190 
191  for (i = 0; i < 2; i++) {
192  for (j = 0; j < 2; j++) {
193  for (size = 1; size < 10; size++) {
194  const char *type;
195  switch ((j << 1) | i) {
196  case 0: type = "pel_uni_w_pixels"; break; // 0 0
197  case 1: type = "qpel_uni_w_h"; break; // 0 1
198  case 2: type = "qpel_uni_w_v"; break; // 1 0
199  case 3: type = "qpel_uni_w_hv"; break; // 1 1
200  }
201 
202  if (check_func(h.put_hevc_qpel_uni_w[size][j][i],
203  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
204  for (denom = denoms; *denom >= 0; denom++) {
205  for (wx = weights; *wx >= 0; wx++) {
206  for (ox = offsets; *ox >= 0; ox++) {
208  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
210  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
211  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
213  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
215  dst1, sizes[size] * SIZEOF_PIXEL,
216  size[sizes], size[sizes], "dst");
217  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
219  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
220  }
221  }
222  }
223  }
224  }
225  }
226  }
227  }
228  report("qpel_uni_w");
229 }
230 
232 {
233  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
234  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
235  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
236  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
237  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
238  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
239 
241  int size, bit_depth, i, j;
242  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
243  const int16_t *src2,
244  int height, intptr_t mx, intptr_t my, int width);
245 
246  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
248 
249  for (i = 0; i < 2; i++) {
250  for (j = 0; j < 2; j++) {
251  for (size = 1; size < 10; size++) {
252  const char *type;
253  switch ((j << 1) | i) {
254  case 0: type = "pel_bi_pixels"; break; // 0 0
255  case 1: type = "qpel_bi_h"; break; // 0 1
256  case 2: type = "qpel_bi_v"; break; // 1 0
257  case 3: type = "qpel_bi_hv"; break; // 1 1
258  }
259 
260  if (check_func(h.put_hevc_qpel_bi[size][j][i],
261  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
263  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
265  ref0, sizes[size], i, j, sizes[size]);
266  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
268  ref1, sizes[size], i, j, sizes[size]);
270  dst1, sizes[size] * SIZEOF_PIXEL,
271  size[sizes], size[sizes], "dst");
272  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
274  ref1, sizes[size], i, j, sizes[size]);
275  }
276  }
277  }
278  }
279  }
280  report("qpel_bi");
281 }
282 
284 {
285  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
286  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
287  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
288  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
289  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
290  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
291 
293  int size, bit_depth, i, j;
294  const int *denom, *wx, *ox;
295  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
296  const int16_t *src2,
297  int height, int denom, int wx0, int wx1,
298  int ox0, int ox1, intptr_t mx, intptr_t my, int width);
299 
300  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
302 
303  for (i = 0; i < 2; i++) {
304  for (j = 0; j < 2; j++) {
305  for (size = 1; size < 10; size++) {
306  const char *type;
307  switch ((j << 1) | i) {
308  case 0: type = "pel_bi_w_pixels"; break; // 0 0
309  case 1: type = "qpel_bi_w_h"; break; // 0 1
310  case 2: type = "qpel_bi_w_v"; break; // 1 0
311  case 3: type = "qpel_bi_w_hv"; break; // 1 1
312  }
313 
314  if (check_func(h.put_hevc_qpel_bi_w[size][j][i],
315  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
316  for (denom = denoms; *denom >= 0; denom++) {
317  for (wx = weights; *wx >= 0; wx++) {
318  for (ox = offsets; *ox >= 0; ox++) {
320  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
322  ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
323  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
325  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
327  dst1, sizes[size] * SIZEOF_PIXEL,
328  size[sizes], size[sizes], "dst");
329  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
331  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
332  }
333  }
334  }
335  }
336  }
337  }
338  }
339  }
340  report("qpel_bi_w");
341 }
342 
343 #undef SRC_EXTRA
344 #define SRC_EXTRA 0
345 
346 static void checkasm_check_hevc_epel(void)
347 {
348  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
349  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
350  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
351  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
352 
354  int size, bit_depth, i, j;
355  declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
356  int height, intptr_t mx, intptr_t my, int width);
357 
358  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
360 
361  for (i = 0; i < 2; i++) {
362  for (j = 0; j < 2; j++) {
363  for (size = 1; size < 10; size++) {
364  const char *type;
365  switch ((j << 1) | i) {
366  case 0: type = "pel_pixels"; break; // 0 0
367  case 1: type = "epel_h"; break; // 0 1
368  case 2: type = "epel_v"; break; // 1 0
369  case 3: type = "epel_hv"; break; // 1 1
370  }
371 
372  if (check_func(h.put_hevc_epel[size][j][i],
373  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
374  int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
376  call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
377  call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
378  checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
379  dstw1, MAX_PB_SIZE * sizeof(int16_t),
380  size[sizes], size[sizes], "dst");
381  bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
382  }
383  }
384  }
385  }
386  }
387  report("epel");
388 }
389 
391 {
392  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
393  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
394  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
395  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
396 
398  int size, bit_depth, i, j;
399  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
400  int height, intptr_t mx, intptr_t my, int width);
401 
402  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
404 
405  for (i = 0; i < 2; i++) {
406  for (j = 0; j < 2; j++) {
407  for (size = 1; size < 10; size++) {
408  const char *type;
409  switch ((j << 1) | i) {
410  case 0: type = "pel_uni_pixels"; break; // 0 0
411  case 1: type = "epel_uni_h"; break; // 0 1
412  case 2: type = "epel_uni_v"; break; // 1 0
413  case 3: type = "epel_uni_hv"; break; // 1 1
414  }
415 
416  if (check_func(h.put_hevc_epel_uni[size][j][i],
417  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
419  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
421  sizes[size], i, j, sizes[size]);
422  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
424  sizes[size], i, j, sizes[size]);
426  dst1, sizes[size] * SIZEOF_PIXEL,
427  size[sizes], size[sizes], "dst");
428  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
430  sizes[size], i, j, sizes[size]);
431  }
432  }
433  }
434  }
435  }
436  report("epel_uni");
437 }
438 
440 {
441  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
442  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
443  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
444  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
445 
447  int size, bit_depth, i, j;
448  const int *denom, *wx, *ox;
449  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
450  int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
451 
452  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
454 
455  for (i = 0; i < 2; i++) {
456  for (j = 0; j < 2; j++) {
457  for (size = 1; size < 10; size++) {
458  const char *type;
459  switch ((j << 1) | i) {
460  case 0: type = "pel_uni_w_pixels"; break; // 0 0
461  case 1: type = "epel_uni_w_h"; break; // 0 1
462  case 2: type = "epel_uni_w_v"; break; // 1 0
463  case 3: type = "epel_uni_w_hv"; break; // 1 1
464  }
465 
466  if (check_func(h.put_hevc_epel_uni_w[size][j][i],
467  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
468  for (denom = denoms; *denom >= 0; denom++) {
469  for (wx = weights; *wx >= 0; wx++) {
470  for (ox = offsets; *ox >= 0; ox++) {
472  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
474  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
475  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
477  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
479  dst1, sizes[size] * SIZEOF_PIXEL,
480  size[sizes], size[sizes], "dst");
481  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
483  sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
484  }
485  }
486  }
487  }
488  }
489  }
490  }
491  }
492  report("epel_uni_w");
493 }
494 
496 {
497  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
498  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
499  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
500  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
501  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
502  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
503 
505  int size, bit_depth, i, j;
506  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
507  const int16_t *src2,
508  int height, intptr_t mx, intptr_t my, int width);
509 
510  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
512 
513  for (i = 0; i < 2; i++) {
514  for (j = 0; j < 2; j++) {
515  for (size = 1; size < 10; size++) {
516  const char *type;
517  switch ((j << 1) | i) {
518  case 0: type = "pel_bi_pixels"; break; // 0 0
519  case 1: type = "epel_bi_h"; break; // 0 1
520  case 2: type = "epel_bi_v"; break; // 1 0
521  case 3: type = "epel_bi_hv"; break; // 1 1
522  }
523 
524  if (check_func(h.put_hevc_epel_bi[size][j][i],
525  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
527  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
529  ref0, sizes[size], i, j, sizes[size]);
530  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
532  ref1, sizes[size], i, j, sizes[size]);
534  dst1, sizes[size] * SIZEOF_PIXEL,
535  size[sizes], size[sizes], "dst");
536  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
538  ref1, sizes[size], i, j, sizes[size]);
539  }
540  }
541  }
542  }
543  }
544  report("epel_bi");
545 }
546 
548 {
549  LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
550  LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
551  LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
552  LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
553  LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
554  LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
555 
557  int size, bit_depth, i, j;
558  const int *denom, *wx, *ox;
559  declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
560  const int16_t *src2,
561  int height, int denom, int wx0, int wx1,
562  int ox0, int ox1, intptr_t mx, intptr_t my, int width);
563 
564  for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
566 
567  for (i = 0; i < 2; i++) {
568  for (j = 0; j < 2; j++) {
569  for (size = 1; size < 10; size++) {
570  const char *type;
571  switch ((j << 1) | i) {
572  case 0: type = "pel_bi_w_pixels"; break; // 0 0
573  case 1: type = "epel_bi_w_h"; break; // 0 1
574  case 2: type = "epel_bi_w_v"; break; // 1 0
575  case 3: type = "epel_bi_w_hv"; break; // 1 1
576  }
577 
578  if (check_func(h.put_hevc_epel_bi_w[size][j][i],
579  "put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
580  for (denom = denoms; *denom >= 0; denom++) {
581  for (wx = weights; *wx >= 0; wx++) {
582  for (ox = offsets; *ox >= 0; ox++) {
584  call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
586  ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
587  call_new(dst1, sizes[size] * SIZEOF_PIXEL,
589  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
591  dst1, sizes[size] * SIZEOF_PIXEL,
592  size[sizes], size[sizes], "dst");
593  bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
595  ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
596  }
597  }
598  }
599  }
600  }
601  }
602  }
603  }
604  report("epel_bi_w");
605 }
606 
608 {
619 }
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:231
checkasm_check_hevc_epel_bi_w
static void checkasm_check_hevc_epel_bi_w(void)
Definition: hevc_pel.c:547
checkasm_check_hevc_epel_uni
static void checkasm_check_hevc_epel_uni(void)
Definition: hevc_pel.c:390
src0
#define src0
Definition: hevc_pel.c:76
pixel_mask16
static const uint32_t pixel_mask16[]
Definition: hevc_pel.c:30
check_func
#define check_func(func,...)
Definition: checkasm.h:180
checkasm_check_hevc_epel
static void checkasm_check_hevc_epel(void)
Definition: hevc_pel.c:346
call_ref
#define call_ref(...)
Definition: checkasm.h:195
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_check_pixel
#define checkasm_check_pixel(buf1, stride1, buf2, stride2,...)
Definition: hevc_pel.c:39
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:82
SRC_EXTRA
#define SRC_EXTRA
Definition: hevc_pel.c:344
checkasm_check_hevc_pel
void checkasm_check_hevc_pel(void)
Definition: hevc_pel.c:607
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:175
call_new
#define call_new(...)
Definition: checkasm.h:298
LOCAL_ALIGNED_32
#define LOCAL_ALIGNED_32(t, v,...)
Definition: mem_internal.h:130
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:192
bench_new
#define bench_new(...)
Definition: checkasm.h:369
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
internal.h
src2
const pixel * src2
Definition: h264pred_template.c:422
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:495
checkasm_check_hevc_qpel_uni
static void checkasm_check_hevc_qpel_uni(void)
Definition: hevc_pel.c:126
MAX_PB_SIZE
#define MAX_PB_SIZE
Definition: dsp.h:32
randomize_buffers_ref
#define randomize_buffers_ref()
Definition: hevc_pel.c:64
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:184
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:283
src1
#define src1
Definition: hevc_pel.c:77
h
h
Definition: vp9dsp_template.c:2070
checkasm_check
#define checkasm_check(prefix,...)
Definition: checkasm.h:389
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:439
src
#define src
Definition: vp8dsp.c:248
randomize_buffers
#define randomize_buffers()
Definition: hevc_pel.c:48