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 "config.h"
20
22 #include <stdint.h>
23
28
30
31 #define randomize_buffer(buf) \
32 do { \
33 int i; \
34 double bmg[2], stddev = 10.0, mean = 0.0; \
35 \
36 for (i = 0; i < BUF_SIZE; i += 2) { \
37 av_bmg_get(&checkasm_lfg, bmg); \
38 buf[i] = bmg[0] * stddev + mean; \
39 buf[i + 1] = bmg[1] * stddev + mean; \
40 } \
41 } while(0);
42
44 {
45 #define BUF_SIZE LEN*2+8
49
53
58
59 declare_func(
void,
float *sum,
const float *t,
const float *
c,
61
66 for (
i = 0;
i <=
LEN*2;
i++) {
68 float cre =
src2[idx];
69 float cim =
src2[idx + 1];
70 float tre =
src1[idx];
71 float tim =
src1[idx + 1];
76 fabs(tre * cre - tim * cim) +
77 fabs(tre * cim + tim * cre) +
80 fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n",
81 i, cdst[
i], odst[
i], cdst[
i] - odst[
i]);
83 break;
84 }
85 }
88 }
89
91 }
92
94 {
95 #define BUF_SIZE LEN*2+8
99
103
108
109 declare_func(
void,
double *sum,
const double *t,
const double *
c,
111
116 for (
i = 0;
i <=
LEN*2;
i++) {
118 double cre =
src2[idx];
119 double cim =
src2[idx + 1];
120 double tre =
src1[idx];
121 double tim =
src1[idx + 1];
126 fabs(tre * cre - tim * cim) +
127 fabs(tre * cim + tim * cre) +
130 fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n",
131 i, cdst[
i], odst[
i], cdst[
i] - odst[
i]);
133 break;
134 }
135 }
138 }
139
141 }
142
143
145 {
147
151 }