| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file is part of FFmpeg. | ||
| 3 | * | ||
| 4 | * FFmpeg is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * FFmpeg is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along | ||
| 15 | * with FFmpeg; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <float.h> | ||
| 20 | #include <stdint.h> | ||
| 21 | #include <string.h> | ||
| 22 | |||
| 23 | #include "libavutil/float_dsp.h" | ||
| 24 | #include "libavutil/internal.h" | ||
| 25 | #include "libavutil/mem.h" | ||
| 26 | #include "libavutil/mem_internal.h" | ||
| 27 | |||
| 28 | #include "checkasm.h" | ||
| 29 | |||
| 30 | #define LEN 256 | ||
| 31 | |||
| 32 | 7 | static void test_vector_fmul(const float *src0, const float *src1) | |
| 33 | { | ||
| 34 | 7 | LOCAL_ALIGNED_32(float, cdst, [LEN]); | |
| 35 | 7 | LOCAL_ALIGNED_32(float, odst, [LEN]); | |
| 36 | int i; | ||
| 37 | |||
| 38 | 7 | declare_func(void, float *dst, const float *src0, const float *src1, | |
| 39 | int len); | ||
| 40 | |||
| 41 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 7 times.
|
7 | call_ref(cdst, src0, src1, LEN); |
| 42 | 7 | call_new(odst, src0, src1, LEN); | |
| 43 |
2/2✓ Branch 0 taken 1792 times.
✓ Branch 1 taken 7 times.
|
1799 | for (i = 0; i < LEN; i++) { |
| 44 | 1792 | double t = fabs(src0[i]) + fabs(src1[i]) + fabs(src0[i] * src1[i]) + 1.0; | |
| 45 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1792 times.
|
1792 | if (!float_near_abs_eps(cdst[i], odst[i], t * 2 * FLT_EPSILON)) { |
| 46 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 47 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 48 | ✗ | fail(); | |
| 49 | ✗ | break; | |
| 50 | } | ||
| 51 | } | ||
| 52 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
7 | bench_new(odst, src0, src1, LEN); |
| 53 | 7 | } | |
| 54 | |||
| 55 | 3 | static void test_vector_dmul(const double *src0, const double *src1) | |
| 56 | { | ||
| 57 | 3 | LOCAL_ALIGNED_32(double, cdst, [LEN]); | |
| 58 | 3 | LOCAL_ALIGNED_32(double, odst, [LEN]); | |
| 59 | int i; | ||
| 60 | |||
| 61 | 3 | declare_func(void, double *dst, const double *src0, const double *src1, | |
| 62 | int len); | ||
| 63 | |||
| 64 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 3 times.
|
3 | call_ref(cdst, src0, src1, LEN); |
| 65 | 3 | call_new(odst, src0, src1, LEN); | |
| 66 |
2/2✓ Branch 0 taken 768 times.
✓ Branch 1 taken 3 times.
|
771 | for (i = 0; i < LEN; i++) { |
| 67 | 768 | double t = fabs(src0[i]) + fabs(src1[i]) + fabs(src0[i] * src1[i]) + 1.0; | |
| 68 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 768 times.
|
768 | if (!double_near_abs_eps(cdst[i], odst[i], t * 2 * DBL_EPSILON)) { |
| 69 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 70 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 71 | ✗ | fail(); | |
| 72 | ✗ | break; | |
| 73 | } | ||
| 74 | } | ||
| 75 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
3 | bench_new(odst, src0, src1, LEN); |
| 76 | 3 | } | |
| 77 | |||
| 78 | #define ARBITRARY_FMUL_ADD_CONST 0.005 | ||
| 79 | 4 | static void test_vector_fmul_add(const float *src0, const float *src1, const float *src2) | |
| 80 | { | ||
| 81 | 4 | LOCAL_ALIGNED_32(float, cdst, [LEN]); | |
| 82 | 4 | LOCAL_ALIGNED_32(float, odst, [LEN]); | |
| 83 | int i; | ||
| 84 | |||
| 85 | 4 | declare_func(void, float *dst, const float *src0, const float *src1, | |
| 86 | const float *src2, int len); | ||
| 87 | |||
| 88 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
|
4 | call_ref(cdst, src0, src1, src2, LEN); |
| 89 | 4 | call_new(odst, src0, src1, src2, LEN); | |
| 90 |
2/2✓ Branch 0 taken 1024 times.
✓ Branch 1 taken 4 times.
|
1028 | for (i = 0; i < LEN; i++) { |
| 91 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1024 times.
|
1024 | if (!float_near_abs_eps(cdst[i], odst[i], ARBITRARY_FMUL_ADD_CONST)) { |
| 92 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 93 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 94 | ✗ | fail(); | |
| 95 | ✗ | break; | |
| 96 | } | ||
| 97 | } | ||
| 98 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
4 | bench_new(odst, src0, src1, src2, LEN); |
| 99 | 4 | } | |
| 100 | |||
| 101 | 2 | static void test_vector_fmul_scalar(const float *src0, const float *src1) | |
| 102 | { | ||
| 103 | 2 | LOCAL_ALIGNED_16(float, cdst, [LEN]); | |
| 104 | 2 | LOCAL_ALIGNED_16(float, odst, [LEN]); | |
| 105 | int i; | ||
| 106 | |||
| 107 | 2 | declare_func(void, float *dst, const float *src, float mul, int len); | |
| 108 | |||
| 109 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
|
2 | call_ref(cdst, src0, src1[0], LEN); |
| 110 | 2 | call_new(odst, src0, src1[0], LEN); | |
| 111 |
2/2✓ Branch 0 taken 512 times.
✓ Branch 1 taken 2 times.
|
514 | for (i = 0; i < LEN; i++) { |
| 112 | 512 | double t = fabs(src0[i]) + fabs(src1[0]) + fabs(src0[i] * src1[0]) + 1.0; | |
| 113 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 512 times.
|
512 | if (!float_near_abs_eps(cdst[i], odst[i], t * 2 * FLT_EPSILON)) { |
| 114 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 115 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 116 | ✗ | fail(); | |
| 117 | ✗ | break; | |
| 118 | } | ||
| 119 | } | ||
| 120 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
2 | bench_new(odst, src0, src1[0], LEN); |
| 121 | 2 | } | |
| 122 | |||
| 123 | #define ARBITRARY_FMUL_WINDOW_CONST 0.008 | ||
| 124 | 2 | static void test_vector_fmul_window(const float *src0, const float *src1, const float *win) | |
| 125 | { | ||
| 126 | 2 | LOCAL_ALIGNED_16(float, cdst, [LEN]); | |
| 127 | 2 | LOCAL_ALIGNED_16(float, odst, [LEN]); | |
| 128 | int i; | ||
| 129 | |||
| 130 | 2 | declare_func(void, float *dst, const float *src0, const float *src1, | |
| 131 | const float *win, int len); | ||
| 132 | |||
| 133 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
|
2 | call_ref(cdst, src0, src1, win, LEN / 2); |
| 134 | 2 | call_new(odst, src0, src1, win, LEN / 2); | |
| 135 |
2/2✓ Branch 0 taken 512 times.
✓ Branch 1 taken 2 times.
|
514 | for (i = 0; i < LEN; i++) { |
| 136 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 512 times.
|
512 | if (!float_near_abs_eps(cdst[i], odst[i], ARBITRARY_FMUL_WINDOW_CONST)) { |
| 137 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 138 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 139 | ✗ | fail(); | |
| 140 | ✗ | break; | |
| 141 | } | ||
| 142 | } | ||
| 143 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
2 | bench_new(odst, src0, src1, win, LEN / 2); |
| 144 | 2 | } | |
| 145 | |||
| 146 | #define ARBITRARY_FMAC_SCALAR_CONST 0.005 | ||
| 147 | 4 | static void test_vector_fmac_scalar(const float *src0, const float *src1, const float *src2) | |
| 148 | { | ||
| 149 | 4 | LOCAL_ALIGNED_32(float, cdst, [LEN]); | |
| 150 | 4 | LOCAL_ALIGNED_32(float, odst, [LEN]); | |
| 151 | int i; | ||
| 152 | |||
| 153 | 4 | declare_func(void, float *dst, const float *src, float mul, int len); | |
| 154 | |||
| 155 | 4 | memcpy(cdst, src2, LEN * sizeof(*src2)); | |
| 156 | 4 | memcpy(odst, src2, LEN * sizeof(*src2)); | |
| 157 | |||
| 158 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
|
4 | call_ref(cdst, src0, src1[0], LEN); |
| 159 | 4 | call_new(odst, src0, src1[0], LEN); | |
| 160 |
2/2✓ Branch 0 taken 1024 times.
✓ Branch 1 taken 4 times.
|
1028 | for (i = 0; i < LEN; i++) { |
| 161 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1024 times.
|
1024 | if (!float_near_abs_eps(cdst[i], odst[i], ARBITRARY_FMAC_SCALAR_CONST)) { |
| 162 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 163 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 164 | ✗ | fail(); | |
| 165 | ✗ | break; | |
| 166 | } | ||
| 167 | } | ||
| 168 | 4 | memcpy(odst, src2, LEN * sizeof(*src2)); | |
| 169 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
4 | bench_new(odst, src0, src1[0], LEN); |
| 170 | 4 | } | |
| 171 | |||
| 172 | 3 | static void test_vector_dmul_scalar(const double *src0, const double *src1) | |
| 173 | { | ||
| 174 | 3 | LOCAL_ALIGNED_32(double, cdst, [LEN]); | |
| 175 | 3 | LOCAL_ALIGNED_32(double, odst, [LEN]); | |
| 176 | int i; | ||
| 177 | |||
| 178 | 3 | declare_func(void, double *dst, const double *src, double mul, int len); | |
| 179 | |||
| 180 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 3 times.
|
3 | call_ref(cdst, src0, src1[0], LEN); |
| 181 | 3 | call_new(odst, src0, src1[0], LEN); | |
| 182 |
2/2✓ Branch 0 taken 768 times.
✓ Branch 1 taken 3 times.
|
771 | for (i = 0; i < LEN; i++) { |
| 183 | 768 | double t = fabs(src1[0]) + fabs(src0[i]) + fabs(src1[0] * src0[i]) + 1.0; | |
| 184 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 768 times.
|
768 | if (!double_near_abs_eps(cdst[i], odst[i], t * 2 * DBL_EPSILON)) { |
| 185 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", i, | |
| 186 | ✗ | cdst[i], odst[i], cdst[i] - odst[i]); | |
| 187 | ✗ | fail(); | |
| 188 | ✗ | break; | |
| 189 | } | ||
| 190 | } | ||
| 191 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
3 | bench_new(odst, src0, src1[0], LEN); |
| 192 | 3 | } | |
| 193 | |||
| 194 | #define ARBITRARY_DMAC_SCALAR_CONST 0.005 | ||
| 195 | 4 | static void test_vector_dmac_scalar(const double *src0, const double *src1, const double *src2) | |
| 196 | { | ||
| 197 | 4 | LOCAL_ALIGNED_32(double, cdst, [LEN]); | |
| 198 | 4 | LOCAL_ALIGNED_32(double, odst, [LEN]); | |
| 199 | int i; | ||
| 200 | |||
| 201 | 4 | declare_func(void, double *dst, const double *src, double mul, int len); | |
| 202 | |||
| 203 | 4 | memcpy(cdst, src2, LEN * sizeof(*src2)); | |
| 204 | 4 | memcpy(odst, src2, LEN * sizeof(*src2)); | |
| 205 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
|
4 | call_ref(cdst, src0, src1[0], LEN); |
| 206 | 4 | call_new(odst, src0, src1[0], LEN); | |
| 207 |
2/2✓ Branch 0 taken 1024 times.
✓ Branch 1 taken 4 times.
|
1028 | for (i = 0; i < LEN; i++) { |
| 208 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1024 times.
|
1024 | if (!double_near_abs_eps(cdst[i], odst[i], ARBITRARY_DMAC_SCALAR_CONST)) { |
| 209 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 210 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 211 | ✗ | fail(); | |
| 212 | ✗ | break; | |
| 213 | } | ||
| 214 | } | ||
| 215 | 4 | memcpy(odst, src2, LEN * sizeof(*src2)); | |
| 216 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
4 | bench_new(odst, src0, src1[0], LEN); |
| 217 | 4 | } | |
| 218 | |||
| 219 | 2 | static void test_butterflies_float(const float *src0, const float *src1) | |
| 220 | { | ||
| 221 | 2 | LOCAL_ALIGNED_16(float, cdst, [LEN]); | |
| 222 | 2 | LOCAL_ALIGNED_16(float, odst, [LEN]); | |
| 223 | 2 | LOCAL_ALIGNED_16(float, cdst1, [LEN]); | |
| 224 | 2 | LOCAL_ALIGNED_16(float, odst1, [LEN]); | |
| 225 | int i; | ||
| 226 | |||
| 227 | 2 | declare_func(void, float *restrict src0, float *restrict src1, | |
| 228 | int len); | ||
| 229 | |||
| 230 | 2 | memcpy(cdst, src0, LEN * sizeof(*src0)); | |
| 231 | 2 | memcpy(cdst1, src1, LEN * sizeof(*src1)); | |
| 232 | 2 | memcpy(odst, src0, LEN * sizeof(*src0)); | |
| 233 | 2 | memcpy(odst1, src1, LEN * sizeof(*src1)); | |
| 234 | |||
| 235 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
|
2 | call_ref(cdst, cdst1, LEN); |
| 236 | 2 | call_new(odst, odst1, LEN); | |
| 237 |
2/2✓ Branch 0 taken 512 times.
✓ Branch 1 taken 2 times.
|
514 | for (i = 0; i < LEN; i++) { |
| 238 |
2/4✓ Branch 1 taken 512 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 512 times.
|
1024 | if (!float_near_abs_eps(cdst[i], odst[i], FLT_EPSILON) || |
| 239 | 512 | !float_near_abs_eps(cdst1[i], odst1[i], FLT_EPSILON)) { | |
| 240 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 241 | ✗ | i, cdst[i], odst[i], cdst[i] - odst[i]); | |
| 242 | ✗ | fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n", | |
| 243 | ✗ | i, cdst1[i], odst1[i], cdst1[i] - odst1[i]); | |
| 244 | ✗ | fail(); | |
| 245 | ✗ | break; | |
| 246 | } | ||
| 247 | } | ||
| 248 | 2 | memcpy(odst, src0, LEN * sizeof(*src0)); | |
| 249 | 2 | memcpy(odst1, src1, LEN * sizeof(*src1)); | |
| 250 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
2 | bench_new(odst, odst1, LEN); |
| 251 | 2 | } | |
| 252 | |||
| 253 | #define ARBITRARY_SCALARPRODUCT_CONST 0.2 | ||
| 254 | 3 | static void test_scalarproduct_float(const float *src0, const float *src1) | |
| 255 | { | ||
| 256 | float cprod, oprod; | ||
| 257 | |||
| 258 | 3 | declare_func_float(float, const float *src0, const float *src1, int len); | |
| 259 | |||
| 260 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 3 times.
|
3 | cprod = call_ref(src0, src1, LEN); |
| 261 | 3 | oprod = call_new(src0, src1, LEN); | |
| 262 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!float_near_abs_eps(cprod, oprod, ARBITRARY_SCALARPRODUCT_CONST)) { |
| 263 | ✗ | fprintf(stderr, "%- .12f - %- .12f = % .12g\n", | |
| 264 | ✗ | cprod, oprod, cprod - oprod); | |
| 265 | ✗ | fail(); | |
| 266 | } | ||
| 267 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
3 | bench_new(src0, src1, LEN); |
| 268 | 3 | } | |
| 269 | |||
| 270 | 3 | static void test_scalarproduct_double(const double *src0, const double *src1) | |
| 271 | { | ||
| 272 | double cprod, oprod; | ||
| 273 | |||
| 274 | 3 | declare_func_float(double, const double *, const double *, size_t); | |
| 275 | |||
| 276 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 3 times.
|
3 | cprod = call_ref(src0, src1, LEN); |
| 277 | 3 | oprod = call_new(src0, src1, LEN); | |
| 278 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!double_near_abs_eps(cprod, oprod, ARBITRARY_SCALARPRODUCT_CONST)) { |
| 279 | ✗ | fprintf(stderr, "%- .12f - %- .12f = % .12g\n", | |
| 280 | cprod, oprod, cprod - oprod); | ||
| 281 | ✗ | fail(); | |
| 282 | } | ||
| 283 |
1/18✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
|
3 | bench_new(src0, src1, LEN); |
| 284 | 3 | } | |
| 285 | |||
| 286 | 14 | void checkasm_check_float_dsp(void) | |
| 287 | { | ||
| 288 | 14 | LOCAL_ALIGNED_32(float, src0, [LEN]); | |
| 289 | 14 | LOCAL_ALIGNED_32(float, src1, [LEN]); | |
| 290 | 14 | LOCAL_ALIGNED_32(float, src2, [LEN]); | |
| 291 | 14 | LOCAL_ALIGNED_16(float, src3, [LEN]); | |
| 292 | 14 | LOCAL_ALIGNED_16(float, src4, [LEN]); | |
| 293 | 14 | LOCAL_ALIGNED_16(float, src5, [LEN]); | |
| 294 | 14 | LOCAL_ALIGNED_32(double, dbl_src0, [LEN]); | |
| 295 | 14 | LOCAL_ALIGNED_32(double, dbl_src1, [LEN]); | |
| 296 | 14 | LOCAL_ALIGNED_32(double, dbl_src2, [LEN]); | |
| 297 | 14 | AVFloatDSPContext *fdsp = avpriv_float_dsp_alloc(1); | |
| 298 | |||
| 299 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
|
14 | if (!fdsp) { |
| 300 | ✗ | fprintf(stderr, "floatdsp: Out of memory error\n"); | |
| 301 | ✗ | return; | |
| 302 | } | ||
| 303 | |||
| 304 | 14 | randomize_stddev(src0, LEN, 10.0); | |
| 305 | 14 | randomize_stddev(src1, LEN, 10.0); | |
| 306 | 14 | randomize_stddev(src2, LEN, 10.0); | |
| 307 | 14 | randomize_stddev(src3, LEN, 10.0); | |
| 308 | 14 | randomize_stddev(src4, LEN, 10.0); | |
| 309 | 14 | randomize_stddev(src5, LEN, 10.0); | |
| 310 | 14 | randomize_stddev_dbl(dbl_src0, LEN, 10.0); | |
| 311 | 14 | randomize_stddev_dbl(dbl_src1, LEN, 10.0); | |
| 312 | 14 | randomize_stddev_dbl(dbl_src2, LEN, 10.0); | |
| 313 | |||
| 314 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 11 times.
|
14 | if (check_func(fdsp->vector_fmul, "vector_fmul")) |
| 315 | 3 | test_vector_fmul(src0, src1); | |
| 316 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 10 times.
|
14 | if (check_func(fdsp->vector_fmul_add, "vector_fmul_add")) |
| 317 | 4 | test_vector_fmul_add(src0, src1, src2); | |
| 318 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 12 times.
|
14 | if (check_func(fdsp->vector_fmul_scalar, "vector_fmul_scalar")) |
| 319 | 2 | test_vector_fmul_scalar(src3, src4); | |
| 320 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 10 times.
|
14 | if (check_func(fdsp->vector_fmul_reverse, "vector_fmul_reverse")) |
| 321 | 4 | test_vector_fmul(src0, src1); | |
| 322 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 12 times.
|
14 | if (check_func(fdsp->vector_fmul_window, "vector_fmul_window")) |
| 323 | 2 | test_vector_fmul_window(src3, src4, src5); | |
| 324 | 14 | report("vector_fmul"); | |
| 325 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 10 times.
|
14 | if (check_func(fdsp->vector_fmac_scalar, "vector_fmac_scalar")) |
| 326 | 4 | test_vector_fmac_scalar(src0, src1, src2); | |
| 327 | 14 | report("vector_fmac"); | |
| 328 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 11 times.
|
14 | if (check_func(fdsp->vector_dmul, "vector_dmul")) |
| 329 | 3 | test_vector_dmul(dbl_src0, dbl_src1); | |
| 330 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 11 times.
|
14 | if (check_func(fdsp->vector_dmul_scalar, "vector_dmul_scalar")) |
| 331 | 3 | test_vector_dmul_scalar(dbl_src0, dbl_src1); | |
| 332 | 14 | report("vector_dmul"); | |
| 333 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 10 times.
|
14 | if (check_func(fdsp->vector_dmac_scalar, "vector_dmac_scalar")) |
| 334 | 4 | test_vector_dmac_scalar(dbl_src0, dbl_src1, dbl_src2); | |
| 335 | 14 | report("vector_dmac"); | |
| 336 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 12 times.
|
14 | if (check_func(fdsp->butterflies_float, "butterflies_float")) |
| 337 | 2 | test_butterflies_float(src3, src4); | |
| 338 | 14 | report("butterflies_float"); | |
| 339 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 11 times.
|
14 | if (check_func(fdsp->scalarproduct_float, "scalarproduct_float")) |
| 340 | 3 | test_scalarproduct_float(src3, src4); | |
| 341 | 14 | report("scalarproduct_float"); | |
| 342 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 11 times.
|
14 | if (check_func(fdsp->scalarproduct_double, "scalarproduct_double")) |
| 343 | 3 | test_scalarproduct_double(dbl_src0, dbl_src1); | |
| 344 | 14 | report("scalarproduct_double"); | |
| 345 | |||
| 346 | 14 | av_freep(&fdsp); | |
| 347 | } | ||
| 348 |