FFmpeg
vvc_mc.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023-2024 Nuo Mi
3  * Copyright (c) 2023-2024 Wu Jianhua
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 
24 #include "checkasm.h"
25 #include "libavcodec/vvc/ctu.h"
26 #include "libavcodec/vvc/data.h"
27 #include "libavcodec/vvc/dsp.h"
28 
29 #include "libavutil/common.h"
30 #include "libavutil/intreadwrite.h"
31 #include "libavutil/mem_internal.h"
32 
33 static const uint32_t pixel_mask[] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff, 0x3fff3fff, 0xffffffff };
34 static const int sizes[] = { 2, 4, 8, 16, 32, 64, 128 };
35 
36 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
37 #define PIXEL_STRIDE (MAX_CTU_SIZE * 2)
38 #define EXTRA_BEFORE 3
39 #define EXTRA_AFTER 4
40 #define SRC_EXTRA (EXTRA_BEFORE + EXTRA_AFTER) * 2
41 #define SRC_BUF_SIZE (PIXEL_STRIDE + SRC_EXTRA) * (PIXEL_STRIDE + SRC_EXTRA)
42 #define DST_BUF_SIZE (MAX_CTU_SIZE * MAX_CTU_SIZE * 2)
43 #define SRC_OFFSET ((PIXEL_STRIDE + EXTRA_BEFORE * 2) * EXTRA_BEFORE)
44 
45 #define randomize_buffers(buf0, buf1, size, mask) \
46  do { \
47  int k; \
48  for (k = 0; k < size; k += 4 / sizeof(*buf0)) { \
49  uint32_t r = rnd() & mask; \
50  AV_WN32A(buf0 + k, r); \
51  AV_WN32A(buf1 + k, r); \
52  } \
53  } while (0)
54 
55 #define randomize_pixels(buf0, buf1, size) \
56  do { \
57  uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
58  randomize_buffers(buf0, buf1, size, mask); \
59  } while (0)
60 
61 #define randomize_avg_src(buf0, buf1, size) \
62  do { \
63  uint32_t mask = 0x3fff3fff; \
64  randomize_buffers(buf0, buf1, size, mask); \
65  } while (0)
66 
67 #define randomize_prof_src(buf0, buf1, size) \
68  do { \
69  const int shift = 14 - bit_depth; \
70  const int mask16 = 0x3fff >> shift << shift; \
71  uint32_t mask = (mask16 << 16) | mask16; \
72  randomize_buffers(buf0, buf1, size, mask); \
73  } while (0)
74 
75 static void check_put_vvc_luma(void)
76 {
77  LOCAL_ALIGNED_32(int16_t, dst0, [DST_BUF_SIZE / 2]);
78  LOCAL_ALIGNED_32(int16_t, dst1, [DST_BUF_SIZE / 2]);
79  LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]);
80  LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]);
82 
83  declare_func(void, int16_t *dst, const uint8_t *src, const ptrdiff_t src_stride,
84  const int height, const int8_t *hf, const int8_t *vf, const int width);
85 
86  for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
89  for (int i = 0; i < 2; i++) {
90  for (int j = 0; j < 2; j++) {
91  for (int h = 4; h <= MAX_CTU_SIZE; h *= 2) {
92  for (int w = 4; w <= MAX_CTU_SIZE; w *= 2) {
93  const int idx = av_log2(w) - 1;
94  const int mx = rnd() % 16;
95  const int my = rnd() % 16;
96  const int8_t *hf = ff_vvc_inter_luma_filters[rnd() % 3][mx];
97  const int8_t *vf = ff_vvc_inter_luma_filters[rnd() % 3][my];
98  const char *type;
99  switch ((j << 1) | i) {
100  case 0: type = "put_luma_pixels"; break; // 0 0
101  case 1: type = "put_luma_h"; break; // 0 1
102  case 2: type = "put_luma_v"; break; // 1 0
103  case 3: type = "put_luma_hv"; break; // 1 1
104  }
105  if (check_func(c.inter.put[LUMA][idx][j][i], "%s_%d_%dx%d", type, bit_depth, w, h)) {
106  memset(dst0, 0, DST_BUF_SIZE);
107  memset(dst1, 0, DST_BUF_SIZE);
108  call_ref(dst0, src0 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w);
109  call_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w);
110  if (memcmp(dst0, dst1, DST_BUF_SIZE))
111  fail();
112  if (w == h)
113  bench_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w);
114  }
115  }
116  }
117  }
118  }
119  }
120  report("put_luma");
121 }
122 
123 static void check_put_vvc_luma_uni(void)
124 {
125  LOCAL_ALIGNED_32(uint8_t, dst0, [DST_BUF_SIZE]);
126  LOCAL_ALIGNED_32(uint8_t, dst1, [DST_BUF_SIZE]);
127  LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]);
128  LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]);
129 
131  declare_func(void, uint8_t *dst, ptrdiff_t dststride,
132  const uint8_t *src, ptrdiff_t srcstride, int height,
133  const int8_t *hf, const int8_t *vf, int width);
134 
135  for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
138  for (int i = 0; i < 2; i++) {
139  for (int j = 0; j < 2; j++) {
140  for (int h = 4; h <= MAX_CTU_SIZE; h *= 2) {
141  for (int w = 4; w <= MAX_CTU_SIZE; w *= 2) {
142  const int idx = av_log2(w) - 1;
143  const int mx = rnd() % VVC_INTER_LUMA_FACTS;
144  const int my = rnd() % VVC_INTER_LUMA_FACTS;
147  const char *type;
148 
149  switch ((j << 1) | i) {
150  case 0: type = "put_uni_pixels"; break; // 0 0
151  case 1: type = "put_uni_h"; break; // 0 1
152  case 2: type = "put_uni_v"; break; // 1 0
153  case 3: type = "put_uni_hv"; break; // 1 1
154  }
155 
156  if (check_func(c.inter.put_uni[LUMA][idx][j][i], "%s_luma_%d_%dx%d", type, bit_depth, w, h)) {
157  memset(dst0, 0, DST_BUF_SIZE);
158  memset(dst1, 0, DST_BUF_SIZE);
161  if (memcmp(dst0, dst1, DST_BUF_SIZE))
162  fail();
163  if (w == h)
165  }
166  }
167  }
168  }
169  }
170  }
171  report("put_uni_luma");
172 }
173 
174 static void check_put_vvc_chroma(void)
175 {
176  LOCAL_ALIGNED_32(int16_t, dst0, [DST_BUF_SIZE / 2]);
177  LOCAL_ALIGNED_32(int16_t, dst1, [DST_BUF_SIZE / 2]);
178  LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]);
179  LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]);
181 
182  declare_func(void, int16_t *dst, const uint8_t *src, const ptrdiff_t src_stride,
183  const int height, const int8_t *hf, const int8_t *vf, const int width);
184 
185  for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
188  for (int i = 0; i < 2; i++) {
189  for (int j = 0; j < 2; j++) {
190  for (int h = 2; h <= MAX_CTU_SIZE; h *= 2) {
191  for (int w = 2; w <= MAX_CTU_SIZE; w *= 2) {
192  const int idx = av_log2(w) - 1;
193  const int mx = rnd() % VVC_INTER_CHROMA_FACTS;
194  const int my = rnd() % VVC_INTER_CHROMA_FACTS;
197  const char *type;
198  switch ((j << 1) | i) {
199  case 0: type = "put_chroma_pixels"; break; // 0 0
200  case 1: type = "put_chroma_h"; break; // 0 1
201  case 2: type = "put_chroma_v"; break; // 1 0
202  case 3: type = "put_chroma_hv"; break; // 1 1
203  }
204  if (check_func(c.inter.put[CHROMA][idx][j][i], "%s_%d_%dx%d", type, bit_depth, w, h)) {
205  memset(dst0, 0, DST_BUF_SIZE);
206  memset(dst1, 0, DST_BUF_SIZE);
207  call_ref(dst0, src0 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w);
208  call_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w);
209  if (memcmp(dst0, dst1, DST_BUF_SIZE))
210  fail();
211  if (w == h)
212  bench_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w);
213  }
214  }
215  }
216  }
217  }
218  }
219  report("put_chroma");
220 }
221 
222 static void check_put_vvc_chroma_uni(void)
223 {
224  LOCAL_ALIGNED_32(uint8_t, dst0, [DST_BUF_SIZE]);
225  LOCAL_ALIGNED_32(uint8_t, dst1, [DST_BUF_SIZE]);
226  LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]);
227  LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]);
228 
230  declare_func(void, uint8_t *dst, ptrdiff_t dststride,
231  const uint8_t *src, ptrdiff_t srcstride, int height,
232  const int8_t *hf, const int8_t *vf, int width);
233 
234  for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
237  for (int i = 0; i < 2; i++) {
238  for (int j = 0; j < 2; j++) {
239  for (int h = 4; h <= MAX_CTU_SIZE; h *= 2) {
240  for (int w = 4; w <= MAX_CTU_SIZE; w *= 2) {
241  const int idx = av_log2(w) - 1;
242  const int mx = rnd() % VVC_INTER_CHROMA_FACTS;
243  const int my = rnd() % VVC_INTER_CHROMA_FACTS;
246  const char *type;
247 
248  switch ((j << 1) | i) {
249  case 0: type = "put_uni_pixels"; break; // 0 0
250  case 1: type = "put_uni_h"; break; // 0 1
251  case 2: type = "put_uni_v"; break; // 1 0
252  case 3: type = "put_uni_hv"; break; // 1 1
253  }
254 
255  if (check_func(c.inter.put_uni[CHROMA][idx][j][i], "%s_chroma_%d_%dx%d", type, bit_depth, w, h)) {
256  memset(dst0, 0, DST_BUF_SIZE);
257  memset(dst1, 0, DST_BUF_SIZE);
260  if (memcmp(dst0, dst1, DST_BUF_SIZE))
261  fail();
262  if (w == h)
264  }
265  }
266  }
267  }
268  }
269  }
270  report("put_uni_chroma");
271 }
272 
273 #define AVG_SRC_BUF_SIZE (MAX_CTU_SIZE * MAX_CTU_SIZE)
274 #define AVG_DST_BUF_SIZE (MAX_PB_SIZE * MAX_PB_SIZE * 2)
275 
276 static void check_avg(void)
277 {
278  LOCAL_ALIGNED_32(int16_t, src00, [AVG_SRC_BUF_SIZE]);
279  LOCAL_ALIGNED_32(int16_t, src01, [AVG_SRC_BUF_SIZE]);
280  LOCAL_ALIGNED_32(int16_t, src10, [AVG_SRC_BUF_SIZE]);
281  LOCAL_ALIGNED_32(int16_t, src11, [AVG_SRC_BUF_SIZE]);
282  LOCAL_ALIGNED_32(uint8_t, dst0, [AVG_DST_BUF_SIZE]);
283  LOCAL_ALIGNED_32(uint8_t, dst1, [AVG_DST_BUF_SIZE]);
285 
286  for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
287  randomize_avg_src((uint8_t*)src00, (uint8_t*)src10, AVG_SRC_BUF_SIZE * sizeof(int16_t));
288  randomize_avg_src((uint8_t*)src01, (uint8_t*)src11, AVG_SRC_BUF_SIZE * sizeof(int16_t));
290  for (int h = 2; h <= MAX_CTU_SIZE; h *= 2) {
291  for (int w = 2; w <= MAX_CTU_SIZE; w *= 2) {
292  {
293  declare_func(void, uint8_t *dst, ptrdiff_t dst_stride,
294  const int16_t *src0, const int16_t *src1, int width, int height);
295  if (check_func(c.inter.avg, "avg_%d_%dx%d", bit_depth, w, h)) {
296  memset(dst0, 0, AVG_DST_BUF_SIZE);
297  memset(dst1, 0, AVG_DST_BUF_SIZE);
298  call_ref(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h);
299  call_new(dst1, MAX_CTU_SIZE * SIZEOF_PIXEL, src10, src11, w, h);
300  if (memcmp(dst0, dst1, DST_BUF_SIZE))
301  fail();
302  if (w == h)
303  bench_new(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h);
304  }
305  }
306  {
307  declare_func(void, uint8_t *dst, ptrdiff_t dst_stride,
308  const int16_t *src0, const int16_t *src1, int width, int height,
309  int denom, int w0, int w1, int o0, int o1);
310  {
311  const int denom = rnd() % 8;
312  const int w0 = rnd() % 256 - 128;
313  const int w1 = rnd() % 256 - 128;
314  const int o0 = rnd() % 256 - 128;
315  const int o1 = rnd() % 256 - 128;
316  if (check_func(c.inter.w_avg, "w_avg_%d_%dx%d", bit_depth, w, h)) {
317  memset(dst0, 0, AVG_DST_BUF_SIZE);
318  memset(dst1, 0, AVG_DST_BUF_SIZE);
319 
320  call_ref(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h, denom, w0, w1, o0, o1);
321  call_new(dst1, MAX_CTU_SIZE * SIZEOF_PIXEL, src10, src11, w, h, denom, w0, w1, o0, o1);
322  if (memcmp(dst0, dst1, DST_BUF_SIZE))
323  fail();
324  if (w == h)
325  bench_new(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h, denom, w0, w1, o0, o1);
326  }
327  }
328  }
329  }
330  }
331  }
332  report("avg");
333 }
334 
335 #define SR_RANGE 2
336 static void check_dmvr(void)
337 {
338  LOCAL_ALIGNED_32(uint16_t, dst0, [DST_BUF_SIZE]);
339  LOCAL_ALIGNED_32(uint16_t, dst1, [DST_BUF_SIZE]);
340  LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]);
341  LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]);
342  const int dst_stride = MAX_PB_SIZE * sizeof(int16_t);
343 
345  declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t src_stride, int height,
346  intptr_t mx, intptr_t my, int width);
347 
348  for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
351  for (int i = 0; i < 2; i++) {
352  for (int j = 0; j < 2; j++) {
353  for (int h = 8; h <= 16; h *= 2) {
354  for (int w = 8; w <= 16; w *= 2) {
355  const int pred_w = w + 2 * SR_RANGE;
356  const int pred_h = h + 2 * SR_RANGE;
357  const int mx = rnd() % VVC_INTER_LUMA_DMVR_FACTS;
358  const int my = rnd() % VVC_INTER_LUMA_DMVR_FACTS;
359  const char *type;
360 
361  if (w * h < 128)
362  continue;
363 
364  switch ((j << 1) | i) {
365  case 0: type = "dmvr"; break; // 0 0
366  case 1: type = "dmvr_h"; break; // 0 1
367  case 2: type = "dmvr_v"; break; // 1 0
368  case 3: type = "dmvr_hv"; break; // 1 1
369  }
370 
371  if (check_func(c.inter.dmvr[j][i], "%s_%d_%dx%d", type, bit_depth, pred_w, pred_h)) {
372  memset(dst0, 0, DST_BUF_SIZE);
373  memset(dst1, 0, DST_BUF_SIZE);
374  call_ref(dst0, src0 + SRC_OFFSET, PIXEL_STRIDE, pred_h, mx, my, pred_w);
375  call_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, pred_h, mx, my, pred_w);
376  for (int k = 0; k < pred_h; k++) {
377  if (memcmp(dst0 + k * dst_stride, dst1 + k * dst_stride, pred_w * sizeof(int16_t))) {
378  fail();
379  break;
380  }
381  }
382 
383  bench_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, pred_h, mx, my, pred_w);
384  }
385  }
386  }
387  }
388  }
389  }
390  report("dmvr");
391 }
392 
393 #define BDOF_BLOCK_SIZE 16
394 #define BDOF_SRC_SIZE (MAX_PB_SIZE* (BDOF_BLOCK_SIZE + 2))
395 #define BDOF_SRC_OFFSET (MAX_PB_SIZE + 1)
396 #define BDOF_DST_SIZE (BDOF_BLOCK_SIZE * BDOF_BLOCK_SIZE * 2)
397 static void check_bdof(void)
398 {
399  LOCAL_ALIGNED_32(uint8_t, dst0, [BDOF_DST_SIZE]);
400  LOCAL_ALIGNED_32(uint8_t, dst1, [BDOF_DST_SIZE]);
401  LOCAL_ALIGNED_32(uint16_t, src00, [BDOF_SRC_SIZE]);
402  LOCAL_ALIGNED_32(uint16_t, src01, [BDOF_SRC_SIZE]);
403  LOCAL_ALIGNED_32(uint16_t, src10, [BDOF_SRC_SIZE]);
404  LOCAL_ALIGNED_32(uint16_t, src11, [BDOF_SRC_SIZE]);
405 
407  declare_func(void, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *src0, const int16_t *src1, int block_w, int block_h);
408 
409  for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) {
410  const int dst_stride = BDOF_BLOCK_SIZE * SIZEOF_PIXEL;
411 
413  randomize_prof_src(src00, src10, BDOF_SRC_SIZE);
414  randomize_prof_src(src01, src11, BDOF_SRC_SIZE);
415  for (int h = 8; h <= 16; h *= 2) {
416  for (int w = 8; w <= 16; w *= 2) {
417  if (w * h < 128)
418  continue;
419  if (check_func(c.inter.apply_bdof, "apply_bdof_%d_%dx%d", bit_depth, w, h)) {
420  memset(dst0, 0, BDOF_DST_SIZE);
421  memset(dst1, 0, BDOF_DST_SIZE);
422  call_ref(dst0, dst_stride, src00 + BDOF_SRC_OFFSET, src01 + BDOF_SRC_OFFSET, w, h);
423  call_new(dst1, dst_stride, src10 + BDOF_SRC_OFFSET, src11 + BDOF_SRC_OFFSET, w, h);
424  if (memcmp(dst0, dst1, BDOF_DST_SIZE))
425  fail();
426  bench_new(dst0, dst_stride, src00 + BDOF_SRC_OFFSET, src01 + BDOF_SRC_OFFSET, w, h);
427  }
428  }
429  }
430  }
431  report("apply_bdof");
432 }
433 
434 static void check_vvc_sad(void)
435 {
436  const int bit_depth = 10;
438  LOCAL_ALIGNED_32(uint16_t, src0, [MAX_CTU_SIZE * MAX_CTU_SIZE * 4]);
439  LOCAL_ALIGNED_32(uint16_t, src1, [MAX_CTU_SIZE * MAX_CTU_SIZE * 4]);
440  declare_func(int, const int16_t *src0, const int16_t *src1, int dx, int dy, int block_w, int block_h);
441 
444  for (int h = 8; h <= 16; h *= 2) {
445  for (int w = 8; w <= 16; w *= 2) {
446  for(int offy = 0; offy <= 4; offy++) {
447  for(int offx = 0; offx <= 4; offx++) {
448  if (w * h < 128)
449  continue;
450 
451  if (check_func(c.inter.sad, "sad_%dx%d", w, h)) {
452  int result0;
453  int result1;
454 
455  result0 = call_ref(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h);
456  result1 = call_new(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h);
457 
458  if (result1 != result0)
459  fail();
460  if(offx == 0 && offy == 0)
461  bench_new(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h);
462  }
463  }
464  }
465  }
466  }
467 
468  report("sad");
469 }
470 
472 {
473  check_dmvr();
474  check_bdof();
475  check_vvc_sad();
480  check_avg();
481 }
check_bdof
static void check_bdof(void)
Definition: vvc_mc.c:397
DST_BUF_SIZE
#define DST_BUF_SIZE
Definition: vvc_mc.c:42
ff_vvc_inter_chroma_filters
const int8_t ff_vvc_inter_chroma_filters[VVC_INTER_CHROMA_FILTER_TYPES][VVC_INTER_CHROMA_FACTS][VVC_INTER_CHROMA_TAPS]
Definition: data.c:1877
LUMA
#define LUMA
Definition: filter.c:31
mem_internal.h
src1
const pixel * src1
Definition: h264pred_template.c:421
randomize_prof_src
#define randomize_prof_src(buf0, buf1, size)
Definition: vvc_mc.c:67
SIZEOF_PIXEL
#define SIZEOF_PIXEL
Definition: vvc_mc.c:36
check_vvc_sad
static void check_vvc_sad(void)
Definition: vvc_mc.c:434
data.h
BDOF_BLOCK_SIZE
#define BDOF_BLOCK_SIZE
Definition: vvc_mc.c:393
w
uint8_t w
Definition: llviddspenc.c:38
check_put_vvc_chroma_uni
static void check_put_vvc_chroma_uni(void)
Definition: vvc_mc.c:222
check_func
#define check_func(func,...)
Definition: checkasm.h:179
BDOF_SRC_OFFSET
#define BDOF_SRC_OFFSET
Definition: vvc_mc.c:395
call_ref
#define call_ref(...)
Definition: checkasm.h:194
bit_depth
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
Definition: af_astats.c:246
check_put_vvc_luma_uni
static void check_put_vvc_luma_uni(void)
Definition: vvc_mc.c:123
mx
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition: dsp.h:53
fail
#define fail()
Definition: checkasm.h:188
checkasm.h
PIXEL_STRIDE
#define PIXEL_STRIDE
Definition: vvc_mc.c:37
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
rnd
#define rnd()
Definition: checkasm.h:172
dsp.h
intreadwrite.h
VVC_INTER_CHROMA_FACTS
#define VVC_INTER_CHROMA_FACTS
Definition: data.h:53
AVG_DST_BUF_SIZE
#define AVG_DST_BUF_SIZE
Definition: vvc_mc.c:274
check_avg
static void check_avg(void)
Definition: vvc_mc.c:276
VVC_INTER_LUMA_DMVR_FACTS
#define VVC_INTER_LUMA_DMVR_FACTS
Definition: data.h:55
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
BDOF_DST_SIZE
#define BDOF_DST_SIZE
Definition: vvc_mc.c:396
call_new
#define call_new(...)
Definition: checkasm.h:297
LOCAL_ALIGNED_32
#define LOCAL_ALIGNED_32(t, v,...)
Definition: mem_internal.h:156
pred_h
static void FUNC() pred_h(uint8_t *_src, const uint8_t *_left, const int w, const int h, const ptrdiff_t stride)
Definition: intra_template.c:877
MAX_CTU_SIZE
#define MAX_CTU_SIZE
Definition: ctu.h:33
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
ff_vvc_inter_luma_filters
const int8_t ff_vvc_inter_luma_filters[VVC_INTER_LUMA_FILTER_TYPES][VVC_INTER_LUMA_FACTS][VVC_INTER_LUMA_TAPS]
Definition: data.c:1735
pixel_mask
static const uint32_t pixel_mask[]
Definition: vvc_mc.c:33
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
VVC_INTER_LUMA_FILTER_TYPES
#define VVC_INTER_LUMA_FILTER_TYPES
Definition: data.h:48
ff_vvc_dsp_init
void ff_vvc_dsp_init(VVCDSPContext *vvcdsp, int bit_depth)
Definition: dsp.c:77
randomize_avg_src
#define randomize_avg_src(buf0, buf1, size)
Definition: vvc_mc.c:61
VVC_INTER_LUMA_FACTS
#define VVC_INTER_LUMA_FACTS
Definition: data.h:51
sizes
static const int sizes[]
Definition: vvc_mc.c:34
report
#define report
Definition: checkasm.h:191
bench_new
#define bench_new(...)
Definition: checkasm.h:368
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
check_put_vvc_luma
static void check_put_vvc_luma(void)
Definition: vvc_mc.c:75
common.h
hf
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t * hf
Definition: dsp.h:249
SRC_OFFSET
#define SRC_OFFSET
Definition: vvc_mc.c:43
VVC_INTER_CHROMA_FILTER_TYPES
#define VVC_INTER_CHROMA_FILTER_TYPES
Definition: data.h:49
MAX_PB_SIZE
#define MAX_PB_SIZE
Definition: dsp.h:32
check_put_vvc_chroma
static void check_put_vvc_chroma(void)
Definition: vvc_mc.c:174
CHROMA
@ CHROMA
Definition: vf_waveform.c:49
check_dmvr
static void check_dmvr(void)
Definition: vvc_mc.c:336
randomize_pixels
#define randomize_pixels(buf0, buf1, size)
Definition: vvc_mc.c:55
SR_RANGE
#define SR_RANGE
Definition: vvc_mc.c:335
src0
const pixel *const src0
Definition: h264pred_template.c:420
BDOF_SRC_SIZE
#define BDOF_SRC_SIZE
Definition: vvc_mc.c:394
declare_func
#define declare_func(ret,...)
Definition: checkasm.h:183
checkasm_check_vvc_mc
void checkasm_check_vvc_mc(void)
Definition: vvc_mc.c:471
h
h
Definition: vp9dsp_template.c:2070
ctu.h
width
#define width
Definition: dsp.h:85
vf
uint8_t ptrdiff_t const uint8_t ptrdiff_t int const int8_t const int8_t * vf
Definition: dsp.h:249
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26
AVG_SRC_BUF_SIZE
#define AVG_SRC_BUF_SIZE
Definition: vvc_mc.c:273
src
#define src
Definition: vp8dsp.c:248
VVCDSPContext
Definition: dsp.h:169
SRC_BUF_SIZE
#define SRC_BUF_SIZE
Definition: vvc_mc.c:41