| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (c) 2015 Ronald S. Bultje <rsbultje@gmail.com> | ||
| 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 <math.h> | ||
| 22 | #include <string.h> | ||
| 23 | #include "checkasm.h" | ||
| 24 | #include "libavcodec/vp9data.h" | ||
| 25 | #include "libavcodec/vp9.h" | ||
| 26 | #include "libavutil/common.h" | ||
| 27 | #include "libavutil/emms.h" | ||
| 28 | #include "libavutil/internal.h" | ||
| 29 | #include "libavutil/intreadwrite.h" | ||
| 30 | #include "libavutil/mathematics.h" | ||
| 31 | #include "libavutil/mem_internal.h" | ||
| 32 | |||
| 33 | static const uint32_t pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }; | ||
| 34 | #define SIZEOF_PIXEL ((bit_depth + 7) / 8) | ||
| 35 | |||
| 36 | #define randomize_buffers() \ | ||
| 37 | do { \ | ||
| 38 | uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \ | ||
| 39 | int k; \ | ||
| 40 | for (k = -4; k < SIZEOF_PIXEL * FFMAX(8, size); k += 4) { \ | ||
| 41 | uint32_t r = rnd() & mask; \ | ||
| 42 | AV_WN32A(a + k, r); \ | ||
| 43 | } \ | ||
| 44 | for (k = 0; k < size * SIZEOF_PIXEL; k += 4) { \ | ||
| 45 | uint32_t r = rnd() & mask; \ | ||
| 46 | AV_WN32A(l + k, r); \ | ||
| 47 | } \ | ||
| 48 | } while (0) | ||
| 49 | |||
| 50 | 14 | void checkasm_check_vp9_ipred(void) | |
| 51 | { | ||
| 52 | 14 | LOCAL_ALIGNED_32(uint8_t, a_buf, [64 * 2]); | |
| 53 | 14 | uint8_t *a = &a_buf[32 * 2]; | |
| 54 | 14 | LOCAL_ALIGNED_32(uint8_t, l, [32 * 2]); | |
| 55 | 14 | LOCAL_ALIGNED_32(uint8_t, dst0, [32 * 32 * 2]); | |
| 56 | 14 | LOCAL_ALIGNED_32(uint8_t, dst1, [32 * 32 * 2]); | |
| 57 | VP9DSPContext dsp; | ||
| 58 | int tx, mode, bit_depth; | ||
| 59 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 2 taken 1 times.
|
14 | declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t stride, |
| 60 | const uint8_t *left, const uint8_t *top); | ||
| 61 | static const char *const mode_names[N_INTRA_PRED_MODES] = { | ||
| 62 | [VERT_PRED] = "vert", | ||
| 63 | [HOR_PRED] = "hor", | ||
| 64 | [DC_PRED] = "dc", | ||
| 65 | [DIAG_DOWN_LEFT_PRED] = "diag_downleft", | ||
| 66 | [DIAG_DOWN_RIGHT_PRED] = "diag_downright", | ||
| 67 | [VERT_RIGHT_PRED] = "vert_right", | ||
| 68 | [HOR_DOWN_PRED] = "hor_down", | ||
| 69 | [VERT_LEFT_PRED] = "vert_left", | ||
| 70 | [HOR_UP_PRED] = "hor_up", | ||
| 71 | [TM_VP8_PRED] = "tm", | ||
| 72 | [LEFT_DC_PRED] = "dc_left", | ||
| 73 | [TOP_DC_PRED] = "dc_top", | ||
| 74 | [DC_128_PRED] = "dc_128", | ||
| 75 | [DC_127_PRED] = "dc_127", | ||
| 76 | [DC_129_PRED] = "dc_129", | ||
| 77 | }; | ||
| 78 | |||
| 79 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 14 times.
|
56 | for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
| 80 | 42 | ff_vp9dsp_init(&dsp, bit_depth, 0); | |
| 81 |
2/2✓ Branch 0 taken 168 times.
✓ Branch 1 taken 42 times.
|
210 | for (tx = 0; tx < 4; tx++) { |
| 82 | 168 | int size = 4 << tx; | |
| 83 | |||
| 84 |
2/2✓ Branch 0 taken 2520 times.
✓ Branch 1 taken 168 times.
|
2688 | for (mode = 0; mode < N_INTRA_PRED_MODES; mode++) { |
| 85 |
2/2✓ Branch 3 taken 498 times.
✓ Branch 4 taken 2022 times.
|
2520 | if (check_func(dsp.intra_pred[tx][mode], "vp9_%s_%dx%d_%dbpp", |
| 86 | mode_names[mode], size, size, bit_depth)) { | ||
| 87 |
4/4✓ Branch 1 taken 3910 times.
✓ Branch 2 taken 498 times.
✓ Branch 4 taken 3229 times.
✓ Branch 5 taken 498 times.
|
7637 | randomize_buffers(); |
| 88 | 498 | call_ref(dst0, size * SIZEOF_PIXEL, l, a); | |
| 89 | 498 | call_new(dst1, size * SIZEOF_PIXEL, l, a); | |
| 90 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 498 times.
|
498 | if (memcmp(dst0, dst1, size * size * SIZEOF_PIXEL)) |
| 91 | ✗ | fail(); | |
| 92 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 498 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
498 | bench_new(dst1, size * SIZEOF_PIXEL,l, a); |
| 93 | } | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | 14 | report("ipred"); | |
| 98 | 14 | } | |
| 99 | |||
| 100 | #undef randomize_buffers | ||
| 101 | |||
| 102 | #define randomize_buffers() \ | ||
| 103 | do { \ | ||
| 104 | uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \ | ||
| 105 | for (y = 0; y < sz; y++) { \ | ||
| 106 | for (x = 0; x < sz * SIZEOF_PIXEL; x += 4) { \ | ||
| 107 | uint32_t r = rnd() & mask; \ | ||
| 108 | AV_WN32A(dst + y * sz * SIZEOF_PIXEL + x, r); \ | ||
| 109 | AV_WN32A(src + y * sz * SIZEOF_PIXEL + x, rnd() & mask); \ | ||
| 110 | } \ | ||
| 111 | for (x = 0; x < sz; x++) { \ | ||
| 112 | if (bit_depth == 8) { \ | ||
| 113 | coef[y * sz + x] = src[y * sz + x] - dst[y * sz + x]; \ | ||
| 114 | } else { \ | ||
| 115 | ((int32_t *) coef)[y * sz + x] = \ | ||
| 116 | ((uint16_t *) src)[y * sz + x] - \ | ||
| 117 | ((uint16_t *) dst)[y * sz + x]; \ | ||
| 118 | } \ | ||
| 119 | } \ | ||
| 120 | } \ | ||
| 121 | } while(0) | ||
| 122 | |||
| 123 | // wht function copied from libvpx | ||
| 124 | 56 | static void fwht_1d(double *out, const double *in, int sz) | |
| 125 | { | ||
| 126 | 56 | double t0 = in[0] + in[1]; | |
| 127 | 56 | double t3 = in[3] - in[2]; | |
| 128 | 56 | double t4 = trunc((t0 - t3) * 0.5); | |
| 129 | 56 | double t1 = t4 - in[1]; | |
| 130 | 56 | double t2 = t4 - in[2]; | |
| 131 | |||
| 132 | 56 | out[0] = t0 - t2; | |
| 133 | 56 | out[1] = t2; | |
| 134 | 56 | out[2] = t3 + t1; | |
| 135 | 56 | out[3] = t1; | |
| 136 | 56 | } | |
| 137 | |||
| 138 | // standard DCT-II | ||
| 139 | 7792 | static void fdct_1d(double *out, const double *in, int sz) | |
| 140 | { | ||
| 141 | int k, n; | ||
| 142 | |||
| 143 |
2/2✓ Branch 0 taken 198592 times.
✓ Branch 1 taken 7792 times.
|
206384 | for (k = 0; k < sz; k++) { |
| 144 | 198592 | out[k] = 0.0; | |
| 145 |
2/2✓ Branch 0 taken 5746432 times.
✓ Branch 1 taken 198592 times.
|
5945024 | for (n = 0; n < sz; n++) |
| 146 | 5746432 | out[k] += in[n] * cos(M_PI * (2 * n + 1) * k / (sz * 2.0)); | |
| 147 | } | ||
| 148 | 7792 | out[0] *= M_SQRT1_2; | |
| 149 | 7792 | } | |
| 150 | |||
| 151 | // see "Towards jointly optimal spatial prediction and adaptive transform in | ||
| 152 | // video/image coding", by J. Han, A. Saxena, and K. Rose | ||
| 153 | // IEEE Proc. ICASSP, pp. 726-729, Mar. 2010. | ||
| 154 | 144 | static void fadst4_1d(double *out, const double *in, int sz) | |
| 155 | { | ||
| 156 | int k, n; | ||
| 157 | |||
| 158 |
2/2✓ Branch 0 taken 576 times.
✓ Branch 1 taken 144 times.
|
720 | for (k = 0; k < sz; k++) { |
| 159 | 576 | out[k] = 0.0; | |
| 160 |
2/2✓ Branch 0 taken 2304 times.
✓ Branch 1 taken 576 times.
|
2880 | for (n = 0; n < sz; n++) |
| 161 | 2304 | out[k] += in[n] * sin(M_PI * (n + 1) * (2 * k + 1) / (sz * 2.0 + 1.0)); | |
| 162 | } | ||
| 163 | 144 | } | |
| 164 | |||
| 165 | // see "A Butterfly Structured Design of The Hybrid Transform Coding Scheme", | ||
| 166 | // by Jingning Han, Yaowu Xu, and Debargha Mukherjee | ||
| 167 | // http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41418.pdf | ||
| 168 | 768 | static void fadst_1d(double *out, const double *in, int sz) | |
| 169 | { | ||
| 170 | int k, n; | ||
| 171 | |||
| 172 |
2/2✓ Branch 0 taken 10240 times.
✓ Branch 1 taken 768 times.
|
11008 | for (k = 0; k < sz; k++) { |
| 173 | 10240 | out[k] = 0.0; | |
| 174 |
2/2✓ Branch 0 taken 147456 times.
✓ Branch 1 taken 10240 times.
|
157696 | for (n = 0; n < sz; n++) |
| 175 | 147456 | out[k] += in[n] * sin(M_PI * (2 * n + 1) * (2 * k + 1) / (sz * 4.0)); | |
| 176 | } | ||
| 177 | 768 | } | |
| 178 | |||
| 179 | typedef void (*ftx1d_fn)(double *out, const double *in, int sz); | ||
| 180 | 263 | static void ftx_2d(double *out, const double *in, enum TxfmMode tx, | |
| 181 | enum TxfmType txtp, int sz) | ||
| 182 | { | ||
| 183 | static const double scaling_factors[5][4] = { | ||
| 184 | { 4.0, 16.0 * M_SQRT1_2 / 3.0, 16.0 * M_SQRT1_2 / 3.0, 32.0 / 9.0 }, | ||
| 185 | { 2.0, 2.0, 2.0, 2.0 }, | ||
| 186 | { 1.0, 1.0, 1.0, 1.0 }, | ||
| 187 | { 0.25 }, | ||
| 188 | { 4.0 } | ||
| 189 | }; | ||
| 190 | static const ftx1d_fn ftx1d_tbl[5][4][2] = { | ||
| 191 | { | ||
| 192 | { fdct_1d, fdct_1d }, | ||
| 193 | { fadst4_1d, fdct_1d }, | ||
| 194 | { fdct_1d, fadst4_1d }, | ||
| 195 | { fadst4_1d, fadst4_1d }, | ||
| 196 | }, { | ||
| 197 | { fdct_1d, fdct_1d }, | ||
| 198 | { fadst_1d, fdct_1d }, | ||
| 199 | { fdct_1d, fadst_1d }, | ||
| 200 | { fadst_1d, fadst_1d }, | ||
| 201 | }, { | ||
| 202 | { fdct_1d, fdct_1d }, | ||
| 203 | { fadst_1d, fdct_1d }, | ||
| 204 | { fdct_1d, fadst_1d }, | ||
| 205 | { fadst_1d, fadst_1d }, | ||
| 206 | }, { | ||
| 207 | { fdct_1d, fdct_1d }, | ||
| 208 | }, { | ||
| 209 | { fwht_1d, fwht_1d }, | ||
| 210 | }, | ||
| 211 | }; | ||
| 212 | double temp[1024]; | ||
| 213 | 263 | double scaling_factor = scaling_factors[tx][txtp]; | |
| 214 | int i, j; | ||
| 215 | |||
| 216 | // cols | ||
| 217 |
2/2✓ Branch 0 taken 4380 times.
✓ Branch 1 taken 263 times.
|
4643 | for (i = 0; i < sz; ++i) { |
| 218 | double temp_out[32]; | ||
| 219 | |||
| 220 | 4380 | ftx1d_tbl[tx][txtp][0](temp_out, &in[i * sz], sz); | |
| 221 | // scale and transpose | ||
| 222 |
2/2✓ Branch 0 taken 104816 times.
✓ Branch 1 taken 4380 times.
|
109196 | for (j = 0; j < sz; ++j) |
| 223 | 104816 | temp[j * sz + i] = temp_out[j] * scaling_factor; | |
| 224 | } | ||
| 225 | |||
| 226 | // rows | ||
| 227 |
2/2✓ Branch 0 taken 4380 times.
✓ Branch 1 taken 263 times.
|
4643 | for (i = 0; i < sz; i++) |
| 228 | 4380 | ftx1d_tbl[tx][txtp][1](&out[i * sz], &temp[i * sz], sz); | |
| 229 | 263 | } | |
| 230 | |||
| 231 | 263 | static void ftx(int16_t *buf, enum TxfmMode tx, | |
| 232 | enum TxfmType txtp, int sz, int bit_depth) | ||
| 233 | { | ||
| 234 | double ind[1024], outd[1024]; | ||
| 235 | int n; | ||
| 236 | |||
| 237 | 263 | emms_c(); | |
| 238 |
2/2✓ Branch 0 taken 104816 times.
✓ Branch 1 taken 263 times.
|
105079 | for (n = 0; n < sz * sz; n++) { |
| 239 |
2/2✓ Branch 0 taken 52352 times.
✓ Branch 1 taken 52464 times.
|
104816 | if (bit_depth == 8) |
| 240 | 52352 | ind[n] = buf[n]; | |
| 241 | else | ||
| 242 | 52464 | ind[n] = ((int32_t *) buf)[n]; | |
| 243 | } | ||
| 244 | 263 | ftx_2d(outd, ind, tx, txtp, sz); | |
| 245 |
2/2✓ Branch 0 taken 104816 times.
✓ Branch 1 taken 263 times.
|
105079 | for (n = 0; n < sz * sz; n++) { |
| 246 |
2/2✓ Branch 0 taken 52352 times.
✓ Branch 1 taken 52464 times.
|
104816 | if (bit_depth == 8) |
| 247 | 52352 | buf[n] = lrint(outd[n]); | |
| 248 | else | ||
| 249 | 52464 | ((int32_t *) buf)[n] = lrint(outd[n]); | |
| 250 | } | ||
| 251 | 263 | } | |
| 252 | |||
| 253 | 150 | static int copy_subcoefs(int16_t *out, const int16_t *in, enum TxfmMode tx, | |
| 254 | enum TxfmType txtp, int sz, int sub, int bit_depth) | ||
| 255 | { | ||
| 256 | // copy the topleft coefficients such that the return value (being the | ||
| 257 | // coefficient scantable index for the eob token) guarantees that only | ||
| 258 | // the topleft $sub out of $sz (where $sz >= $sub) coefficients in both | ||
| 259 | // dimensions are non-zero. This leads to branching to specific optimized | ||
| 260 | // simd versions (e.g. dc-only) so that we get full asm coverage in this | ||
| 261 | // test | ||
| 262 | |||
| 263 | int n; | ||
| 264 | 150 | const int16_t *scan = ff_vp9_scans[tx][txtp]; | |
| 265 | int eob; | ||
| 266 | |||
| 267 |
1/2✓ Branch 0 taken 11649 times.
✗ Branch 1 not taken.
|
11649 | for (n = 0; n < sz * sz; n++) { |
| 268 | 11649 | int rc = scan[n], rcx = rc % sz, rcy = rc / sz; | |
| 269 | |||
| 270 | // find eob for this sub-idct | ||
| 271 |
3/4✓ Branch 0 taken 11499 times.
✓ Branch 1 taken 150 times.
✓ Branch 2 taken 11499 times.
✗ Branch 3 not taken.
|
11649 | if (rcx >= sub || rcy >= sub) |
| 272 | break; | ||
| 273 | |||
| 274 | // copy coef | ||
| 275 |
2/2✓ Branch 0 taken 5747 times.
✓ Branch 1 taken 5752 times.
|
11499 | if (bit_depth == 8) { |
| 276 | 5747 | out[rc] = in[rc]; | |
| 277 | } else { | ||
| 278 | 5752 | AV_COPY32(&out[rc * 2], &in[rc * 2]); | |
| 279 | } | ||
| 280 | } | ||
| 281 | |||
| 282 | 150 | eob = n; | |
| 283 | |||
| 284 |
2/2✓ Branch 0 taken 74229 times.
✓ Branch 1 taken 150 times.
|
74379 | for (; n < sz * sz; n++) { |
| 285 | 74229 | int rc = scan[n]; | |
| 286 | |||
| 287 | // zero | ||
| 288 |
2/2✓ Branch 0 taken 37101 times.
✓ Branch 1 taken 37128 times.
|
74229 | if (bit_depth == 8) { |
| 289 | 37101 | out[rc] = 0; | |
| 290 | } else { | ||
| 291 | 37128 | AV_ZERO32(&out[rc * 2]); | |
| 292 | } | ||
| 293 | } | ||
| 294 | |||
| 295 | 150 | return eob; | |
| 296 | } | ||
| 297 | |||
| 298 | 526 | static int is_zero(const int16_t *c, int sz) | |
| 299 | { | ||
| 300 | int n; | ||
| 301 | |||
| 302 |
2/2✓ Branch 0 taken 157280 times.
✓ Branch 1 taken 526 times.
|
157806 | for (n = 0; n < sz / sizeof(int16_t); n += 2) |
| 303 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 157280 times.
|
157280 | if (AV_RN32A(&c[n])) |
| 304 | ✗ | return 0; | |
| 305 | |||
| 306 | 526 | return 1; | |
| 307 | } | ||
| 308 | |||
| 309 | #define SIZEOF_COEF (2 * ((bit_depth + 7) / 8)) | ||
| 310 | |||
| 311 | 14 | void checkasm_check_vp9_itxfm(void) | |
| 312 | { | ||
| 313 | 14 | LOCAL_ALIGNED_64(uint8_t, src, [32 * 32 * 2]); | |
| 314 | 14 | LOCAL_ALIGNED_64(uint8_t, dst, [32 * 32 * 2]); | |
| 315 | 14 | LOCAL_ALIGNED_64(uint8_t, dst0, [32 * 32 * 2]); | |
| 316 | 14 | LOCAL_ALIGNED_64(uint8_t, dst1, [32 * 32 * 2]); | |
| 317 | 14 | LOCAL_ALIGNED_64(int16_t, coef, [32 * 32 * 2]); | |
| 318 | 14 | LOCAL_ALIGNED_64(int16_t, subcoef0, [32 * 32 * 2]); | |
| 319 | 14 | LOCAL_ALIGNED_64(int16_t, subcoef1, [32 * 32 * 2]); | |
| 320 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 2 taken 1 times.
|
14 | declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t stride, int16_t *block, int eob); |
| 321 | VP9DSPContext dsp; | ||
| 322 | int y, x, tx, txtp, bit_depth, sub; | ||
| 323 | static const char *const txtp_types[N_TXFM_TYPES] = { | ||
| 324 | [DCT_DCT] = "dct_dct", [DCT_ADST] = "adst_dct", | ||
| 325 | [ADST_DCT] = "dct_adst", [ADST_ADST] = "adst_adst" | ||
| 326 | }; | ||
| 327 | |||
| 328 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 14 times.
|
56 | for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
| 329 | 42 | ff_vp9dsp_init(&dsp, bit_depth, 0); | |
| 330 | |||
| 331 |
2/2✓ Branch 0 taken 210 times.
✓ Branch 1 taken 42 times.
|
252 | for (tx = TX_4X4; tx <= N_TXFM_SIZES /* 4 = lossless */; tx++) { |
| 332 | 210 | int sz = 4 << (tx & 3); | |
| 333 |
2/2✓ Branch 0 taken 126 times.
✓ Branch 1 taken 84 times.
|
210 | int n_txtps = tx < TX_32X32 ? N_TXFM_TYPES : 1; |
| 334 | |||
| 335 |
2/2✓ Branch 0 taken 588 times.
✓ Branch 1 taken 210 times.
|
798 | for (txtp = 0; txtp < n_txtps; txtp++) { |
| 336 | // skip testing sub-IDCTs for WHT or ADST since they don't | ||
| 337 | // implement it in any of the SIMD functions. If they do, | ||
| 338 | // consider changing this to ensure we have complete test | ||
| 339 | // coverage. Test sub=1 for dc-only, then 2, 4, 8, 12, etc, | ||
| 340 | // since the arm version can distinguish them at that level. | ||
| 341 |
6/6✓ Branch 0 taken 210 times.
✓ Branch 1 taken 378 times.
✓ Branch 2 taken 42 times.
✓ Branch 3 taken 168 times.
✓ Branch 4 taken 1386 times.
✓ Branch 5 taken 588 times.
|
1974 | for (sub = (txtp == 0 && tx < 4) ? 1 : sz; sub <= sz; |
| 342 |
2/2✓ Branch 0 taken 336 times.
✓ Branch 1 taken 1050 times.
|
1386 | sub < 4 ? (sub <<= 1) : (sub += 4)) { |
| 343 |
4/4✓ Branch 2 taken 1344 times.
✓ Branch 3 taken 42 times.
✓ Branch 5 taken 263 times.
✓ Branch 6 taken 1123 times.
|
1386 | if (check_func(dsp.itxfm_add[tx][txtp], |
| 344 | "vp9_inv_%s_%dx%d_sub%d_add_%d", | ||
| 345 | tx == 4 ? "wht_wht" : txtp_types[txtp], | ||
| 346 | sz, sz, sub, bit_depth)) { | ||
| 347 | int eob; | ||
| 348 | |||
| 349 |
8/8✓ Branch 2 taken 39320 times.
✓ Branch 3 taken 4380 times.
✓ Branch 4 taken 52352 times.
✓ Branch 5 taken 52464 times.
✓ Branch 6 taken 104816 times.
✓ Branch 7 taken 4380 times.
✓ Branch 8 taken 4380 times.
✓ Branch 9 taken 263 times.
|
148779 | randomize_buffers(); |
| 350 | 263 | ftx(coef, tx, txtp, sz, bit_depth); | |
| 351 | |||
| 352 |
2/2✓ Branch 0 taken 150 times.
✓ Branch 1 taken 113 times.
|
263 | if (sub < sz) { |
| 353 | 150 | eob = copy_subcoefs(subcoef0, coef, tx, txtp, | |
| 354 | sz, sub, bit_depth); | ||
| 355 | } else { | ||
| 356 | 113 | eob = sz * sz; | |
| 357 | 113 | memcpy(subcoef0, coef, sz * sz * SIZEOF_COEF); | |
| 358 | } | ||
| 359 | |||
| 360 | 263 | memcpy(dst0, dst, sz * sz * SIZEOF_PIXEL); | |
| 361 | 263 | memcpy(dst1, dst, sz * sz * SIZEOF_PIXEL); | |
| 362 | 263 | memcpy(subcoef1, subcoef0, sz * sz * SIZEOF_COEF); | |
| 363 | 263 | call_ref(dst0, sz * SIZEOF_PIXEL, subcoef0, eob); | |
| 364 | 263 | call_new(dst1, sz * SIZEOF_PIXEL, subcoef1, eob); | |
| 365 |
1/2✓ Branch 0 taken 263 times.
✗ Branch 1 not taken.
|
263 | if (memcmp(dst0, dst1, sz * sz * SIZEOF_PIXEL) || |
| 366 |
1/2✓ Branch 1 taken 263 times.
✗ Branch 2 not taken.
|
263 | !is_zero(subcoef0, sz * sz * SIZEOF_COEF) || |
| 367 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 263 times.
|
263 | !is_zero(subcoef1, sz * sz * SIZEOF_COEF)) |
| 368 | ✗ | fail(); | |
| 369 | |||
| 370 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 263 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
263 | bench_new(dst, sz * SIZEOF_PIXEL, coef, eob); |
| 371 | } | ||
| 372 | } | ||
| 373 | } | ||
| 374 | } | ||
| 375 | } | ||
| 376 | 14 | report("itxfm"); | |
| 377 | 14 | } | |
| 378 | |||
| 379 | #undef randomize_buffers | ||
| 380 | |||
| 381 | #define setpx(a,b,c) \ | ||
| 382 | do { \ | ||
| 383 | if (SIZEOF_PIXEL == 1) { \ | ||
| 384 | buf0[(a) + (b) * jstride] = av_clip_uint8(c); \ | ||
| 385 | } else { \ | ||
| 386 | ((uint16_t *)buf0)[(a) + (b) * jstride] = av_clip_uintp2(c, bit_depth); \ | ||
| 387 | } \ | ||
| 388 | } while (0) | ||
| 389 | |||
| 390 | // c can be an assignment and must not be put under () | ||
| 391 | #define setdx(a,b,c,d) setpx(a,b,c-(d)+(rnd()%((d)*2+1))) | ||
| 392 | #define setsx(a,b,c,d) setdx(a,b,c,(d) << (bit_depth - 8)) | ||
| 393 | 298 | static void randomize_loopfilter_buffers(int bidx, int lineoff, int str, | |
| 394 | int bit_depth, int dir, const int *E, | ||
| 395 | const int *F, const int *H, const int *I, | ||
| 396 | uint8_t *buf0, uint8_t *buf1) | ||
| 397 | { | ||
| 398 | 298 | uint32_t mask = (1 << bit_depth) - 1; | |
| 399 |
2/2✓ Branch 0 taken 149 times.
✓ Branch 1 taken 149 times.
|
298 | int off = dir ? lineoff : lineoff * 16; |
| 400 |
2/2✓ Branch 0 taken 149 times.
✓ Branch 1 taken 149 times.
|
298 | int istride = dir ? 1 : 16; |
| 401 |
2/2✓ Branch 0 taken 149 times.
✓ Branch 1 taken 149 times.
|
298 | int jstride = dir ? str : 1; |
| 402 | int i, j; | ||
| 403 |
2/2✓ Branch 0 taken 596 times.
✓ Branch 1 taken 298 times.
|
894 | for (i = 0; i < 2; i++) /* flat16 */ { |
| 404 | 596 | int idx = off + i * istride, p0, q0; | |
| 405 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setpx(idx, 0, q0 = rnd() & mask); |
| 406 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, -1, p0 = q0, E[bidx] >> 2); |
| 407 |
2/2✓ Branch 0 taken 4172 times.
✓ Branch 1 taken 596 times.
|
4768 | for (j = 1; j < 8; j++) { |
| 408 |
2/2✓ Branch 0 taken 1260 times.
✓ Branch 1 taken 2912 times.
|
4172 | setsx(idx, -1 - j, p0, F[bidx]); |
| 409 |
2/2✓ Branch 0 taken 1260 times.
✓ Branch 1 taken 2912 times.
|
4172 | setsx(idx, j, q0, F[bidx]); |
| 410 | } | ||
| 411 | } | ||
| 412 |
2/2✓ Branch 0 taken 596 times.
✓ Branch 1 taken 298 times.
|
894 | for (i = 2; i < 4; i++) /* flat8 */ { |
| 413 | 596 | int idx = off + i * istride, p0, q0; | |
| 414 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setpx(idx, 0, q0 = rnd() & mask); |
| 415 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, -1, p0 = q0, E[bidx] >> 2); |
| 416 |
2/2✓ Branch 0 taken 1788 times.
✓ Branch 1 taken 596 times.
|
2384 | for (j = 1; j < 4; j++) { |
| 417 |
2/2✓ Branch 0 taken 540 times.
✓ Branch 1 taken 1248 times.
|
1788 | setsx(idx, -1 - j, p0, F[bidx]); |
| 418 |
2/2✓ Branch 0 taken 540 times.
✓ Branch 1 taken 1248 times.
|
1788 | setsx(idx, j, q0, F[bidx]); |
| 419 | } | ||
| 420 |
2/2✓ Branch 0 taken 2384 times.
✓ Branch 1 taken 596 times.
|
2980 | for (j = 4; j < 8; j++) { |
| 421 |
2/2✓ Branch 0 taken 720 times.
✓ Branch 1 taken 1664 times.
|
2384 | setpx(idx, -1 - j, rnd() & mask); |
| 422 |
2/2✓ Branch 0 taken 720 times.
✓ Branch 1 taken 1664 times.
|
2384 | setpx(idx, j, rnd() & mask); |
| 423 | } | ||
| 424 | } | ||
| 425 |
2/2✓ Branch 0 taken 596 times.
✓ Branch 1 taken 298 times.
|
894 | for (i = 4; i < 6; i++) /* regular */ { |
| 426 | 596 | int idx = off + i * istride, p2, p1, p0, q0, q1, q2; | |
| 427 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setpx(idx, 0, q0 = rnd() & mask); |
| 428 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, 1, q1 = q0, I[bidx]); |
| 429 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, 2, q2 = q1, I[bidx]); |
| 430 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, 3, q2, I[bidx]); |
| 431 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, -1, p0 = q0, E[bidx] >> 2); |
| 432 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, -2, p1 = p0, I[bidx]); |
| 433 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, -3, p2 = p1, I[bidx]); |
| 434 |
2/2✓ Branch 0 taken 180 times.
✓ Branch 1 taken 416 times.
|
596 | setsx(idx, -4, p2, I[bidx]); |
| 435 |
2/2✓ Branch 0 taken 2384 times.
✓ Branch 1 taken 596 times.
|
2980 | for (j = 4; j < 8; j++) { |
| 436 |
2/2✓ Branch 0 taken 720 times.
✓ Branch 1 taken 1664 times.
|
2384 | setpx(idx, -1 - j, rnd() & mask); |
| 437 |
2/2✓ Branch 0 taken 720 times.
✓ Branch 1 taken 1664 times.
|
2384 | setpx(idx, j, rnd() & mask); |
| 438 | } | ||
| 439 | } | ||
| 440 |
2/2✓ Branch 0 taken 596 times.
✓ Branch 1 taken 298 times.
|
894 | for (i = 6; i < 8; i++) /* off */ { |
| 441 | 596 | int idx = off + i * istride; | |
| 442 |
2/2✓ Branch 0 taken 4768 times.
✓ Branch 1 taken 596 times.
|
5364 | for (j = 0; j < 8; j++) { |
| 443 |
2/2✓ Branch 0 taken 1440 times.
✓ Branch 1 taken 3328 times.
|
4768 | setpx(idx, -1 - j, rnd() & mask); |
| 444 |
2/2✓ Branch 0 taken 1440 times.
✓ Branch 1 taken 3328 times.
|
4768 | setpx(idx, j, rnd() & mask); |
| 445 | } | ||
| 446 | } | ||
| 447 | 298 | } | |
| 448 | #define randomize_buffers(bidx, lineoff, str) \ | ||
| 449 | randomize_loopfilter_buffers(bidx, lineoff, str, bit_depth, dir, \ | ||
| 450 | E, F, H, I, buf0, buf1) | ||
| 451 | |||
| 452 | 14 | void checkasm_check_vp9_loopfilter(void) | |
| 453 | { | ||
| 454 | 14 | LOCAL_ALIGNED_32(uint8_t, base0, [32 + 16 * 16 * 2]); | |
| 455 | 14 | LOCAL_ALIGNED_32(uint8_t, base1, [32 + 16 * 16 * 2]); | |
| 456 | VP9DSPContext dsp; | ||
| 457 | int dir, wd, wd2, bit_depth; | ||
| 458 | static const char *const dir_name[2] = { "h", "v" }; | ||
| 459 | static const int E[2] = { 20, 28 }, I[2] = { 10, 16 }; | ||
| 460 | static const int H[2] = { 7, 11 }, F[2] = { 1, 1 }; | ||
| 461 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 2 taken 1 times.
|
14 | declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t stride, int E, int I, int H); |
| 462 | |||
| 463 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 14 times.
|
56 | for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
| 464 | 42 | ff_vp9dsp_init(&dsp, bit_depth, 0); | |
| 465 | |||
| 466 |
2/2✓ Branch 0 taken 84 times.
✓ Branch 1 taken 42 times.
|
126 | for (dir = 0; dir < 2; dir++) { |
| 467 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 42 times.
|
84 | int midoff = (dir ? 8 * 8 : 8) * SIZEOF_PIXEL; |
| 468 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 42 times.
|
84 | int midoff_aligned = (dir ? 8 * 8 : 16) * SIZEOF_PIXEL; |
| 469 | 84 | uint8_t *buf0 = base0 + midoff_aligned; | |
| 470 | 84 | uint8_t *buf1 = base1 + midoff_aligned; | |
| 471 | |||
| 472 |
2/2✓ Branch 0 taken 252 times.
✓ Branch 1 taken 84 times.
|
336 | for (wd = 0; wd < 3; wd++) { |
| 473 | // 4/8/16wd_8px | ||
| 474 |
2/2✓ Branch 3 taken 58 times.
✓ Branch 4 taken 194 times.
|
252 | if (check_func(dsp.loop_filter_8[wd][dir], |
| 475 | "vp9_loop_filter_%s_%d_8_%dbpp", | ||
| 476 | dir_name[dir], 4 << wd, bit_depth)) { | ||
| 477 | 58 | randomize_buffers(0, 0, 8); | |
| 478 | 58 | memcpy(buf1 - midoff, buf0 - midoff, | |
| 479 | 58 | 16 * 8 * SIZEOF_PIXEL); | |
| 480 | 58 | call_ref(buf0, 16 * SIZEOF_PIXEL >> dir, E[0], I[0], H[0]); | |
| 481 | 58 | call_new(buf1, 16 * SIZEOF_PIXEL >> dir, E[0], I[0], H[0]); | |
| 482 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 58 times.
|
58 | if (memcmp(buf0 - midoff, buf1 - midoff, 16 * 8 * SIZEOF_PIXEL)) |
| 483 | ✗ | fail(); | |
| 484 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 58 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
58 | bench_new(buf1, 16 * SIZEOF_PIXEL >> dir, E[0], I[0], H[0]); |
| 485 | } | ||
| 486 | } | ||
| 487 | |||
| 488 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 42 times.
|
84 | midoff = (dir ? 16 * 8 : 8) * SIZEOF_PIXEL; |
| 489 |
2/2✓ Branch 0 taken 42 times.
✓ Branch 1 taken 42 times.
|
84 | midoff_aligned = (dir ? 16 * 8 : 16) * SIZEOF_PIXEL; |
| 490 | |||
| 491 | 84 | buf0 = base0 + midoff_aligned; | |
| 492 | 84 | buf1 = base1 + midoff_aligned; | |
| 493 | |||
| 494 | // 16wd_16px loopfilter | ||
| 495 |
2/2✓ Branch 3 taken 24 times.
✓ Branch 4 taken 60 times.
|
84 | if (check_func(dsp.loop_filter_16[dir], |
| 496 | "vp9_loop_filter_%s_16_16_%dbpp", | ||
| 497 | dir_name[dir], bit_depth)) { | ||
| 498 | 24 | randomize_buffers(0, 0, 16); | |
| 499 | 24 | randomize_buffers(0, 8, 16); | |
| 500 | 24 | memcpy(buf1 - midoff, buf0 - midoff, 16 * 16 * SIZEOF_PIXEL); | |
| 501 | 24 | call_ref(buf0, 16 * SIZEOF_PIXEL, E[0], I[0], H[0]); | |
| 502 | 24 | call_new(buf1, 16 * SIZEOF_PIXEL, E[0], I[0], H[0]); | |
| 503 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
|
24 | if (memcmp(buf0 - midoff, buf1 - midoff, 16 * 16 * SIZEOF_PIXEL)) |
| 504 | ✗ | fail(); | |
| 505 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
24 | bench_new(buf1, 16 * SIZEOF_PIXEL, E[0], I[0], H[0]); |
| 506 | } | ||
| 507 | |||
| 508 |
2/2✓ Branch 0 taken 168 times.
✓ Branch 1 taken 84 times.
|
252 | for (wd = 0; wd < 2; wd++) { |
| 509 |
2/2✓ Branch 0 taken 336 times.
✓ Branch 1 taken 168 times.
|
504 | for (wd2 = 0; wd2 < 2; wd2++) { |
| 510 | // mix2 loopfilter | ||
| 511 |
2/2✓ Branch 3 taken 96 times.
✓ Branch 4 taken 240 times.
|
336 | if (check_func(dsp.loop_filter_mix2[wd][wd2][dir], |
| 512 | "vp9_loop_filter_mix2_%s_%d%d_16_%dbpp", | ||
| 513 | dir_name[dir], 4 << wd, 4 << wd2, bit_depth)) { | ||
| 514 | 96 | randomize_buffers(0, 0, 16); | |
| 515 | 96 | randomize_buffers(1, 8, 16); | |
| 516 | 96 | memcpy(buf1 - midoff, buf0 - midoff, 16 * 16 * SIZEOF_PIXEL); | |
| 517 | #define M(a) (((a)[1] << 8) | (a)[0]) | ||
| 518 | 96 | call_ref(buf0, 16 * SIZEOF_PIXEL, M(E), M(I), M(H)); | |
| 519 | 96 | call_new(buf1, 16 * SIZEOF_PIXEL, M(E), M(I), M(H)); | |
| 520 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 96 times.
|
96 | if (memcmp(buf0 - midoff, buf1 - midoff, 16 * 16 * SIZEOF_PIXEL)) |
| 521 | ✗ | fail(); | |
| 522 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 96 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
96 | bench_new(buf1, 16 * SIZEOF_PIXEL, M(E), M(I), M(H)); |
| 523 | #undef M | ||
| 524 | } | ||
| 525 | } | ||
| 526 | } | ||
| 527 | } | ||
| 528 | } | ||
| 529 | 14 | report("loopfilter"); | |
| 530 | 14 | } | |
| 531 | |||
| 532 | #undef setsx | ||
| 533 | #undef setpx | ||
| 534 | #undef setdx | ||
| 535 | #undef randomize_buffers | ||
| 536 | |||
| 537 | #define DST_BUF_SIZE (size * size * SIZEOF_PIXEL) | ||
| 538 | #define SRC_BUF_STRIDE 72 | ||
| 539 | #define SRC_BUF_SIZE ((size + 7) * SRC_BUF_STRIDE * SIZEOF_PIXEL) | ||
| 540 | #define src (buf + 3 * SIZEOF_PIXEL * (SRC_BUF_STRIDE + 1)) | ||
| 541 | |||
| 542 | #define randomize_buffers() \ | ||
| 543 | do { \ | ||
| 544 | uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \ | ||
| 545 | int k; \ | ||
| 546 | for (k = 0; k < SRC_BUF_SIZE; k += 4) { \ | ||
| 547 | uint32_t r = rnd() & mask; \ | ||
| 548 | AV_WN32A(buf + k, r); \ | ||
| 549 | } \ | ||
| 550 | if (op == 1) { \ | ||
| 551 | for (k = 0; k < DST_BUF_SIZE; k += 4) { \ | ||
| 552 | uint32_t r = rnd() & mask; \ | ||
| 553 | AV_WN32A(dst0 + k, r); \ | ||
| 554 | AV_WN32A(dst1 + k, r); \ | ||
| 555 | } \ | ||
| 556 | } \ | ||
| 557 | } while (0) | ||
| 558 | |||
| 559 | 14 | void checkasm_check_vp9_mc(void) | |
| 560 | { | ||
| 561 | 14 | LOCAL_ALIGNED_64(uint8_t, buf, [72 * 72 * 2]); | |
| 562 | 14 | LOCAL_ALIGNED_64(uint8_t, dst0, [64 * 64 * 2]); | |
| 563 | 14 | LOCAL_ALIGNED_64(uint8_t, dst1, [64 * 64 * 2]); | |
| 564 | VP9DSPContext dsp; | ||
| 565 | int op, hsize, bit_depth, filter, dx, dy; | ||
| 566 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 2 taken 1 times.
|
14 | declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dst_stride, |
| 567 | const uint8_t *ref, ptrdiff_t ref_stride, | ||
| 568 | int h, int mx, int my); | ||
| 569 | static const char *const filter_names[4] = { | ||
| 570 | "8tap_smooth", "8tap_regular", "8tap_sharp", "bilin" | ||
| 571 | }; | ||
| 572 | static const char *const subpel_names[2][2] = { { "", "h" }, { "v", "hv" } }; | ||
| 573 | static const char *const op_names[2] = { "put", "avg" }; | ||
| 574 | char str[256]; | ||
| 575 | |||
| 576 |
2/2✓ Branch 0 taken 28 times.
✓ Branch 1 taken 14 times.
|
42 | for (op = 0; op < 2; op++) { |
| 577 |
2/2✓ Branch 0 taken 84 times.
✓ Branch 1 taken 28 times.
|
112 | for (bit_depth = 8; bit_depth <= 12; bit_depth += 2) { |
| 578 | 84 | ff_vp9dsp_init(&dsp, bit_depth, 0); | |
| 579 |
2/2✓ Branch 0 taken 420 times.
✓ Branch 1 taken 84 times.
|
504 | for (hsize = 0; hsize < 5; hsize++) { |
| 580 | 420 | int size = 64 >> hsize; | |
| 581 | |||
| 582 |
2/2✓ Branch 0 taken 1680 times.
✓ Branch 1 taken 420 times.
|
2100 | for (filter = 0; filter < 4; filter++) { |
| 583 |
2/2✓ Branch 0 taken 3360 times.
✓ Branch 1 taken 1680 times.
|
5040 | for (dx = 0; dx < 2; dx++) { |
| 584 |
2/2✓ Branch 0 taken 6720 times.
✓ Branch 1 taken 3360 times.
|
10080 | for (dy = 0; dy < 2; dy++) { |
| 585 |
4/4✓ Branch 0 taken 3360 times.
✓ Branch 1 taken 3360 times.
✓ Branch 2 taken 1680 times.
✓ Branch 3 taken 1680 times.
|
6720 | if (dx || dy) { |
| 586 | 5040 | snprintf(str, sizeof(str), | |
| 587 | 5040 | "%s_%s_%d%s", op_names[op], | |
| 588 | 5040 | filter_names[filter], size, | |
| 589 | 5040 | subpel_names[dy][dx]); | |
| 590 | } else { | ||
| 591 | 1680 | snprintf(str, sizeof(str), | |
| 592 | 1680 | "%s%d", op_names[op], size); | |
| 593 | } | ||
| 594 |
2/2✓ Branch 3 taken 922 times.
✓ Branch 4 taken 5798 times.
|
6720 | if (check_func(dsp.mc[hsize][filter][op][dx][dy], |
| 595 | "vp9_%s_%dbpp", str, bit_depth)) { | ||
| 596 |
2/2✓ Branch 0 taken 564 times.
✓ Branch 1 taken 358 times.
|
922 | int mx = dx ? 1 + (rnd() % 14) : 0; |
| 597 |
2/2✓ Branch 0 taken 564 times.
✓ Branch 1 taken 358 times.
|
922 | int my = dy ? 1 + (rnd() % 14) : 0; |
| 598 |
6/6✓ Branch 1 taken 937332 times.
✓ Branch 2 taken 922 times.
✓ Branch 3 taken 461 times.
✓ Branch 4 taken 461 times.
✓ Branch 6 taken 235660 times.
✓ Branch 7 taken 461 times.
|
1173914 | randomize_buffers(); |
| 599 | 922 | call_ref(dst0, size * SIZEOF_PIXEL, | |
| 600 | src, SRC_BUF_STRIDE * SIZEOF_PIXEL, | ||
| 601 | size, mx, my); | ||
| 602 | 922 | call_new(dst1, size * SIZEOF_PIXEL, | |
| 603 | src, SRC_BUF_STRIDE * SIZEOF_PIXEL, | ||
| 604 | size, mx, my); | ||
| 605 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 922 times.
|
922 | if (memcmp(dst0, dst1, DST_BUF_SIZE)) |
| 606 | ✗ | fail(); | |
| 607 | |||
| 608 | // simd implementations for each filter of subpel | ||
| 609 | // functions are identical | ||
| 610 |
4/4✓ Branch 0 taken 594 times.
✓ Branch 1 taken 328 times.
✓ Branch 2 taken 504 times.
✓ Branch 3 taken 90 times.
|
922 | if (filter >= 1 && filter <= 2) continue; |
| 611 | // 10/12 bpp for bilin are identical | ||
| 612 |
4/4✓ Branch 0 taken 134 times.
✓ Branch 1 taken 284 times.
✓ Branch 2 taken 30 times.
✓ Branch 3 taken 104 times.
|
418 | if (bit_depth == 12 && filter == 3) continue; |
| 613 | |||
| 614 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 388 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
388 | bench_new(dst1, size * SIZEOF_PIXEL, |
| 615 | src, SRC_BUF_STRIDE * SIZEOF_PIXEL, | ||
| 616 | size, mx, my); | ||
| 617 | } | ||
| 618 | } | ||
| 619 | } | ||
| 620 | } | ||
| 621 | } | ||
| 622 | } | ||
| 623 | } | ||
| 624 | 14 | report("mc"); | |
| 625 | 14 | } | |
| 626 | |||
| 627 | 14 | void checkasm_check_vp9dsp(void) | |
| 628 | { | ||
| 629 | 14 | checkasm_check_vp9_ipred(); | |
| 630 | 14 | checkasm_check_vp9_itxfm(); | |
| 631 | 14 | checkasm_check_vp9_loopfilter(); | |
| 632 | 14 | checkasm_check_vp9_mc(); | |
| 633 | 14 | } | |
| 634 |