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
20
22
24
25 #define randomize_float(buf, len) \
26 do { \
27 for (int i = 0; i < len; i++) { \
28 float f = (float)rnd() / (UINT_MAX >> 5) - 16.0f; \
29 buf[i] = f; \
30 } \
31 } while (0)
32
34 #define MAX_SIZE (960)
35
36 /* period is between 15 and 1022, inclusive */
38 {
41
42 /* This filter can explode very easily, so use a tapset from the codec.
43 * In the codec these are usually multiplied by at least 0.09375f,
44 * so its outside the largest filter value, but the filter is still stable
45 * so use it. */
46 float gains[3] = { 0.3066406250f, 0.2170410156f, 0.1296386719f };
47
48 /* The codec will always call with an offset which is aligned once
49 * (period + 2) is subtracted, but here we have to align it outselves. */
51
53
55 memcpy(data1, data0, (
MAX_SIZE + 1024)*
sizeof(
float));
56
59
63 }
64
66 {
70 float coeff0 = (
float)
rnd() / (UINT_MAX >> 5) - 16.0
f, coeff1 = coeff0;
71
73
75
78
83 }
84
86 {
89
93
97
100 report(
"postfilter_1022");
101
105 }