Line | Branch | Exec | Source |
---|---|---|---|
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) { \ | ||
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 | 13 | static void check_put_vvc_luma(void) | |
68 | { | ||
69 | 13 | LOCAL_ALIGNED_32(int16_t, dst0, [DST_BUF_SIZE / 2]); | |
70 | 13 | LOCAL_ALIGNED_32(int16_t, dst1, [DST_BUF_SIZE / 2]); | |
71 | 13 | LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]); | |
72 | 13 | LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]); | |
73 | VVCDSPContext c; | ||
74 | |||
75 | 13 | declare_func(void, int16_t *dst, const uint8_t *src, const ptrdiff_t src_stride, | |
76 | const int height, const int8_t *hf, const int8_t *vf, const int width); | ||
77 | |||
78 |
2/2✓ Branch 0 taken 39 times.
✓ Branch 1 taken 13 times.
|
52 | for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
79 |
2/2✓ Branch 1 taken 710775 times.
✓ Branch 2 taken 39 times.
|
710814 | randomize_pixels(src0, src1, SRC_BUF_SIZE); |
80 | 39 | ff_vvc_dsp_init(&c, bit_depth); | |
81 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 39 times.
|
117 | for (int i = 0; i < 2; i++) { |
82 |
2/2✓ Branch 0 taken 156 times.
✓ Branch 1 taken 78 times.
|
234 | for (int j = 0; j < 2; j++) { |
83 |
2/2✓ Branch 0 taken 936 times.
✓ Branch 1 taken 156 times.
|
1092 | for (int h = 4; h <= MAX_CTU_SIZE; h *= 2) { |
84 |
2/2✓ Branch 0 taken 5616 times.
✓ Branch 1 taken 936 times.
|
6552 | for (int w = 4; w <= MAX_CTU_SIZE; w *= 2) { |
85 | 5616 | const int idx = av_log2(w) - 1; | |
86 | 5616 | const int mx = rnd() % 16; | |
87 | 5616 | const int my = rnd() % 16; | |
88 | 5616 | const int8_t *hf = ff_vvc_inter_luma_filters[rnd() % 3][mx]; | |
89 | 5616 | const int8_t *vf = ff_vvc_inter_luma_filters[rnd() % 3][my]; | |
90 | const char *type; | ||
91 |
4/5✓ Branch 0 taken 1404 times.
✓ Branch 1 taken 1404 times.
✓ Branch 2 taken 1404 times.
✓ Branch 3 taken 1404 times.
✗ Branch 4 not taken.
|
5616 | switch ((j << 1) | i) { |
92 | 1404 | case 0: type = "put_luma_pixels"; break; // 0 0 | |
93 | 1404 | case 1: type = "put_luma_h"; break; // 0 1 | |
94 | 1404 | case 2: type = "put_luma_v"; break; // 1 0 | |
95 | 1404 | case 3: type = "put_luma_hv"; break; // 1 1 | |
96 | } | ||
97 |
2/2✓ Branch 3 taken 1110 times.
✓ Branch 4 taken 4506 times.
|
5616 | if (check_func(c.inter.put[LUMA][idx][j][i], "%s_%d_%dx%d", type, bit_depth, w, h)) { |
98 | 1110 | memset(dst0, 0, DST_BUF_SIZE); | |
99 | 1110 | memset(dst1, 0, DST_BUF_SIZE); | |
100 | 1110 | call_ref(dst0, src0 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
101 | 1110 | call_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
102 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1110 times.
|
1110 | if (memcmp(dst0, dst1, DST_BUF_SIZE)) |
103 | ✗ | fail(); | |
104 |
2/2✓ Branch 0 taken 185 times.
✓ Branch 1 taken 925 times.
|
1110 | if (w == h) |
105 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 185 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
|
185 | bench_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); |
106 | } | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | 13 | report("put_luma"); | |
113 | 13 | } | |
114 | |||
115 | 13 | static void check_put_vvc_luma_uni(void) | |
116 | { | ||
117 | 13 | LOCAL_ALIGNED_32(uint8_t, dst0, [DST_BUF_SIZE]); | |
118 | 13 | LOCAL_ALIGNED_32(uint8_t, dst1, [DST_BUF_SIZE]); | |
119 | 13 | LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]); | |
120 | 13 | LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]); | |
121 | |||
122 | VVCDSPContext c; | ||
123 | 13 | declare_func(void, uint8_t *dst, ptrdiff_t dststride, | |
124 | uint8_t *src, ptrdiff_t srcstride, int height, const int8_t *hf, const int8_t *vf, int width); | ||
125 | |||
126 |
2/2✓ Branch 0 taken 39 times.
✓ Branch 1 taken 13 times.
|
52 | for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
127 | 39 | ff_vvc_dsp_init(&c, bit_depth); | |
128 |
2/2✓ Branch 1 taken 710775 times.
✓ Branch 2 taken 39 times.
|
710814 | randomize_pixels(src0, src1, SRC_BUF_SIZE); |
129 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 39 times.
|
117 | for (int i = 0; i < 2; i++) { |
130 |
2/2✓ Branch 0 taken 156 times.
✓ Branch 1 taken 78 times.
|
234 | for (int j = 0; j < 2; j++) { |
131 |
2/2✓ Branch 0 taken 936 times.
✓ Branch 1 taken 156 times.
|
1092 | for (int h = 4; h <= MAX_CTU_SIZE; h *= 2) { |
132 |
2/2✓ Branch 0 taken 5616 times.
✓ Branch 1 taken 936 times.
|
6552 | for (int w = 4; w <= MAX_CTU_SIZE; w *= 2) { |
133 | 5616 | const int idx = av_log2(w) - 1; | |
134 | 5616 | const int mx = rnd() % VVC_INTER_LUMA_FACTS; | |
135 | 5616 | const int my = rnd() % VVC_INTER_LUMA_FACTS; | |
136 | 5616 | const int8_t *hf = ff_vvc_inter_luma_filters[rnd() % VVC_INTER_FILTER_TYPES][mx]; | |
137 | 5616 | const int8_t *vf = ff_vvc_inter_luma_filters[rnd() % VVC_INTER_FILTER_TYPES][my]; | |
138 | const char *type; | ||
139 | |||
140 |
4/5✓ Branch 0 taken 1404 times.
✓ Branch 1 taken 1404 times.
✓ Branch 2 taken 1404 times.
✓ Branch 3 taken 1404 times.
✗ Branch 4 not taken.
|
5616 | switch ((j << 1) | i) { |
141 | 1404 | case 0: type = "put_uni_pixels"; break; // 0 0 | |
142 | 1404 | case 1: type = "put_uni_h"; break; // 0 1 | |
143 | 1404 | case 2: type = "put_uni_v"; break; // 1 0 | |
144 | 1404 | case 3: type = "put_uni_hv"; break; // 1 1 | |
145 | } | ||
146 | |||
147 |
2/2✓ Branch 3 taken 1110 times.
✓ Branch 4 taken 4506 times.
|
5616 | if (check_func(c.inter.put_uni[LUMA][idx][j][i], "%s_luma_%d_%dx%d", type, bit_depth, w, h)) { |
148 | 1110 | memset(dst0, 0, DST_BUF_SIZE); | |
149 | 1110 | memset(dst1, 0, DST_BUF_SIZE); | |
150 | 1110 | call_ref(dst0, PIXEL_STRIDE, src0 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
151 | 1110 | call_new(dst1, PIXEL_STRIDE, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
152 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1110 times.
|
1110 | if (memcmp(dst0, dst1, DST_BUF_SIZE)) |
153 | ✗ | fail(); | |
154 |
2/2✓ Branch 0 taken 185 times.
✓ Branch 1 taken 925 times.
|
1110 | if (w == h) |
155 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 185 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
|
185 | bench_new(dst1, PIXEL_STRIDE, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); |
156 | } | ||
157 | } | ||
158 | } | ||
159 | } | ||
160 | } | ||
161 | } | ||
162 | 13 | report("put_uni_luma"); | |
163 | 13 | } | |
164 | |||
165 | 13 | static void check_put_vvc_chroma(void) | |
166 | { | ||
167 | 13 | LOCAL_ALIGNED_32(int16_t, dst0, [DST_BUF_SIZE / 2]); | |
168 | 13 | LOCAL_ALIGNED_32(int16_t, dst1, [DST_BUF_SIZE / 2]); | |
169 | 13 | LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]); | |
170 | 13 | LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]); | |
171 | VVCDSPContext c; | ||
172 | |||
173 | 13 | declare_func(void, int16_t *dst, const uint8_t *src, const ptrdiff_t src_stride, | |
174 | const int height, const int8_t *hf, const int8_t *vf, const int width); | ||
175 | |||
176 |
2/2✓ Branch 0 taken 39 times.
✓ Branch 1 taken 13 times.
|
52 | for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
177 |
2/2✓ Branch 1 taken 710775 times.
✓ Branch 2 taken 39 times.
|
710814 | randomize_pixels(src0, src1, SRC_BUF_SIZE); |
178 | 39 | ff_vvc_dsp_init(&c, bit_depth); | |
179 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 39 times.
|
117 | for (int i = 0; i < 2; i++) { |
180 |
2/2✓ Branch 0 taken 156 times.
✓ Branch 1 taken 78 times.
|
234 | for (int j = 0; j < 2; j++) { |
181 |
2/2✓ Branch 0 taken 1092 times.
✓ Branch 1 taken 156 times.
|
1248 | for (int h = 2; h <= MAX_CTU_SIZE; h *= 2) { |
182 |
2/2✓ Branch 0 taken 7644 times.
✓ Branch 1 taken 1092 times.
|
8736 | for (int w = 2; w <= MAX_CTU_SIZE; w *= 2) { |
183 | 7644 | const int idx = av_log2(w) - 1; | |
184 | 7644 | const int mx = rnd() % VVC_INTER_CHROMA_FACTS; | |
185 | 7644 | const int my = rnd() % VVC_INTER_CHROMA_FACTS; | |
186 | 7644 | const int8_t *hf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][mx]; | |
187 | 7644 | const int8_t *vf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][my]; | |
188 | const char *type; | ||
189 |
4/5✓ Branch 0 taken 1911 times.
✓ Branch 1 taken 1911 times.
✓ Branch 2 taken 1911 times.
✓ Branch 3 taken 1911 times.
✗ Branch 4 not taken.
|
7644 | switch ((j << 1) | i) { |
190 | 1911 | case 0: type = "put_chroma_pixels"; break; // 0 0 | |
191 | 1911 | case 1: type = "put_chroma_h"; break; // 0 1 | |
192 | 1911 | case 2: type = "put_chroma_v"; break; // 1 0 | |
193 | 1911 | case 3: type = "put_chroma_hv"; break; // 1 1 | |
194 | } | ||
195 |
2/2✓ Branch 3 taken 1463 times.
✓ Branch 4 taken 6181 times.
|
7644 | if (check_func(c.inter.put[CHROMA][idx][j][i], "%s_%d_%dx%d", type, bit_depth, w, h)) { |
196 | 1463 | memset(dst0, 0, DST_BUF_SIZE); | |
197 | 1463 | memset(dst1, 0, DST_BUF_SIZE); | |
198 | 1463 | call_ref(dst0, src0 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
199 | 1463 | call_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
200 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1463 times.
|
1463 | if (memcmp(dst0, dst1, DST_BUF_SIZE)) |
201 | ✗ | fail(); | |
202 |
2/2✓ Branch 0 taken 209 times.
✓ Branch 1 taken 1254 times.
|
1463 | if (w == h) |
203 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 209 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
|
209 | bench_new(dst1, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); |
204 | } | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | } | ||
209 | } | ||
210 | 13 | report("put_chroma"); | |
211 | 13 | } | |
212 | |||
213 | 13 | static void check_put_vvc_chroma_uni(void) | |
214 | { | ||
215 | 13 | LOCAL_ALIGNED_32(uint8_t, dst0, [DST_BUF_SIZE]); | |
216 | 13 | LOCAL_ALIGNED_32(uint8_t, dst1, [DST_BUF_SIZE]); | |
217 | 13 | LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]); | |
218 | 13 | LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]); | |
219 | |||
220 | VVCDSPContext c; | ||
221 | 13 | declare_func(void, uint8_t *dst, ptrdiff_t dststride, | |
222 | uint8_t *src, ptrdiff_t srcstride, int height, const int8_t *hf, const int8_t *vf, int width); | ||
223 | |||
224 |
2/2✓ Branch 0 taken 39 times.
✓ Branch 1 taken 13 times.
|
52 | for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
225 | 39 | ff_vvc_dsp_init(&c, bit_depth); | |
226 |
2/2✓ Branch 1 taken 710775 times.
✓ Branch 2 taken 39 times.
|
710814 | randomize_pixels(src0, src1, SRC_BUF_SIZE); |
227 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 39 times.
|
117 | for (int i = 0; i < 2; i++) { |
228 |
2/2✓ Branch 0 taken 156 times.
✓ Branch 1 taken 78 times.
|
234 | for (int j = 0; j < 2; j++) { |
229 |
2/2✓ Branch 0 taken 936 times.
✓ Branch 1 taken 156 times.
|
1092 | for (int h = 4; h <= MAX_CTU_SIZE; h *= 2) { |
230 |
2/2✓ Branch 0 taken 5616 times.
✓ Branch 1 taken 936 times.
|
6552 | for (int w = 4; w <= MAX_CTU_SIZE; w *= 2) { |
231 | 5616 | const int idx = av_log2(w) - 1; | |
232 | 5616 | const int mx = rnd() % VVC_INTER_CHROMA_FACTS; | |
233 | 5616 | const int my = rnd() % VVC_INTER_CHROMA_FACTS; | |
234 | 5616 | const int8_t *hf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][mx]; | |
235 | 5616 | const int8_t *vf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][my]; | |
236 | const char *type; | ||
237 | |||
238 |
4/5✓ Branch 0 taken 1404 times.
✓ Branch 1 taken 1404 times.
✓ Branch 2 taken 1404 times.
✓ Branch 3 taken 1404 times.
✗ Branch 4 not taken.
|
5616 | switch ((j << 1) | i) { |
239 | 1404 | case 0: type = "put_uni_pixels"; break; // 0 0 | |
240 | 1404 | case 1: type = "put_uni_h"; break; // 0 1 | |
241 | 1404 | case 2: type = "put_uni_v"; break; // 1 0 | |
242 | 1404 | case 3: type = "put_uni_hv"; break; // 1 1 | |
243 | } | ||
244 | |||
245 |
2/2✓ Branch 3 taken 1110 times.
✓ Branch 4 taken 4506 times.
|
5616 | if (check_func(c.inter.put_uni[CHROMA][idx][j][i], "%s_chroma_%d_%dx%d", type, bit_depth, w, h)) { |
246 | 1110 | memset(dst0, 0, DST_BUF_SIZE); | |
247 | 1110 | memset(dst1, 0, DST_BUF_SIZE); | |
248 | 1110 | call_ref(dst0, PIXEL_STRIDE, src0 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
249 | 1110 | call_new(dst1, PIXEL_STRIDE, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); | |
250 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1110 times.
|
1110 | if (memcmp(dst0, dst1, DST_BUF_SIZE)) |
251 | ✗ | fail(); | |
252 |
2/2✓ Branch 0 taken 185 times.
✓ Branch 1 taken 925 times.
|
1110 | if (w == h) |
253 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 185 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
|
185 | bench_new(dst1, PIXEL_STRIDE, src1 + SRC_OFFSET, PIXEL_STRIDE, h, hf, vf, w); |
254 | } | ||
255 | } | ||
256 | } | ||
257 | } | ||
258 | } | ||
259 | } | ||
260 | 13 | report("put_uni_chroma"); | |
261 | 13 | } | |
262 | |||
263 | #define AVG_SRC_BUF_SIZE (MAX_CTU_SIZE * MAX_CTU_SIZE) | ||
264 | #define AVG_DST_BUF_SIZE (MAX_PB_SIZE * MAX_PB_SIZE * 2) | ||
265 | |||
266 | 13 | static void check_avg(void) | |
267 | { | ||
268 | 13 | LOCAL_ALIGNED_32(int16_t, src00, [AVG_SRC_BUF_SIZE]); | |
269 | 13 | LOCAL_ALIGNED_32(int16_t, src01, [AVG_SRC_BUF_SIZE]); | |
270 | 13 | LOCAL_ALIGNED_32(int16_t, src10, [AVG_SRC_BUF_SIZE]); | |
271 | 13 | LOCAL_ALIGNED_32(int16_t, src11, [AVG_SRC_BUF_SIZE]); | |
272 | 13 | LOCAL_ALIGNED_32(uint8_t, dst0, [AVG_DST_BUF_SIZE]); | |
273 | 13 | LOCAL_ALIGNED_32(uint8_t, dst1, [AVG_DST_BUF_SIZE]); | |
274 | VVCDSPContext c; | ||
275 | |||
276 |
2/2✓ Branch 0 taken 39 times.
✓ Branch 1 taken 13 times.
|
52 | for (int bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
277 |
2/2✓ Branch 1 taken 319488 times.
✓ Branch 2 taken 39 times.
|
319527 | randomize_avg_src((uint8_t*)src00, (uint8_t*)src10, AVG_SRC_BUF_SIZE * sizeof(int16_t)); |
278 |
2/2✓ Branch 1 taken 319488 times.
✓ Branch 2 taken 39 times.
|
319527 | randomize_avg_src((uint8_t*)src01, (uint8_t*)src11, AVG_SRC_BUF_SIZE * sizeof(int16_t)); |
279 | 39 | ff_vvc_dsp_init(&c, bit_depth); | |
280 |
2/2✓ Branch 0 taken 273 times.
✓ Branch 1 taken 39 times.
|
312 | for (int h = 2; h <= MAX_CTU_SIZE; h *= 2) { |
281 |
2/2✓ Branch 0 taken 1911 times.
✓ Branch 1 taken 273 times.
|
2184 | for (int w = 2; w <= MAX_CTU_SIZE; w *= 2) { |
282 | { | ||
283 | 1911 | declare_func(void, uint8_t *dst, ptrdiff_t dst_stride, | |
284 | const int16_t *src0, const int16_t *src1, int width, int height); | ||
285 |
2/2✓ Branch 3 taken 294 times.
✓ Branch 4 taken 1617 times.
|
1911 | if (check_func(c.inter.avg, "avg_%d_%dx%d", bit_depth, w, h)) { |
286 | 294 | memset(dst0, 0, AVG_DST_BUF_SIZE); | |
287 | 294 | memset(dst1, 0, AVG_DST_BUF_SIZE); | |
288 | 294 | call_ref(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h); | |
289 | 294 | call_new(dst1, MAX_CTU_SIZE * SIZEOF_PIXEL, src10, src11, w, h); | |
290 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 294 times.
|
294 | if (memcmp(dst0, dst1, DST_BUF_SIZE)) |
291 | ✗ | fail(); | |
292 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 252 times.
|
294 | if (w == h) |
293 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 42 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
|
42 | bench_new(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h); |
294 | } | ||
295 | } | ||
296 | { | ||
297 | 1911 | declare_func(void, uint8_t *dst, ptrdiff_t dst_stride, | |
298 | const int16_t *src0, const int16_t *src1, int width, int height, | ||
299 | int denom, int w0, int w1, int o0, int o1); | ||
300 | { | ||
301 | 1911 | const int denom = rnd() % 8; | |
302 | 1911 | const int w0 = rnd() % 256 - 128; | |
303 | 1911 | const int w1 = rnd() % 256 - 128; | |
304 | 1911 | const int o0 = rnd() % 256 - 128; | |
305 | 1911 | const int o1 = rnd() % 256 - 128; | |
306 |
2/2✓ Branch 3 taken 294 times.
✓ Branch 4 taken 1617 times.
|
1911 | if (check_func(c.inter.w_avg, "w_avg_%d_%dx%d", bit_depth, w, h)) { |
307 | 294 | memset(dst0, 0, AVG_DST_BUF_SIZE); | |
308 | 294 | memset(dst1, 0, AVG_DST_BUF_SIZE); | |
309 | |||
310 | 294 | call_ref(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h, denom, w0, w1, o0, o1); | |
311 | 294 | call_new(dst1, MAX_CTU_SIZE * SIZEOF_PIXEL, src10, src11, w, h, denom, w0, w1, o0, o1); | |
312 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 294 times.
|
294 | if (memcmp(dst0, dst1, DST_BUF_SIZE)) |
313 | ✗ | fail(); | |
314 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 252 times.
|
294 | if (w == h) |
315 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 42 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
|
42 | bench_new(dst0, MAX_CTU_SIZE * SIZEOF_PIXEL, src00, src01, w, h, denom, w0, w1, o0, o1); |
316 | } | ||
317 | } | ||
318 | } | ||
319 | } | ||
320 | } | ||
321 | } | ||
322 | 13 | report("avg"); | |
323 | 13 | } | |
324 | |||
325 | 13 | void checkasm_check_vvc_mc(void) | |
326 | { | ||
327 | 13 | check_put_vvc_luma(); | |
328 | 13 | check_put_vvc_luma_uni(); | |
329 | 13 | check_put_vvc_chroma(); | |
330 | 13 | check_put_vvc_chroma_uni(); | |
331 | 13 | check_avg(); | |
332 | 13 | } | |
333 |