1 /*
2 * Copyright (C) 2012-2013 Michael Niedermayer (michaelni@gmx.at)
3 *
4 * This file is part of libswresample
5 *
6 * libswresample is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * libswresample 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 GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with libswresample; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
23
25
28 #define TMP_EXTRA 2
30 int i;
31
34 seed = seed* 1664525 + 1013904223;
35
38 default:
40 v = ((double)seed) / UINT_MAX;
41 seed = seed*1664525 + 1013904223;
42 v-= ((double)seed) / UINT_MAX;
43 break;
44 }
46 }
47
50
52 default:
54 v = tmp[i];
55 break;
57 v = (- tmp[i] + 2*tmp[i+1] - tmp[i+2]) / sqrt(6);
58 break;
59 }
60
62
63 switch(noise_fmt){
69 }
70 }
71
73 }
74
76 {
77 int i;
79
82
85
90 }
95
97
100
106 for (i=0;
filters[i].coefs; i++) {
109 int j;
111 for (j=0; j<f->
len; j++)
114 break;
115 }
116 }
118 av_log(s,
AV_LOG_WARNING,
"Requested noise shaping dither not available at this sampling rate, using triangular hp dither\n");
120 }
121
129 }
130
131 return 0;
132 }
133
134 #define TEMPLATE_DITHER_S16
136 #undef TEMPLATE_DITHER_S16
137
138 #define TEMPLATE_DITHER_S32
140 #undef TEMPLATE_DITHER_S32
141
142 #define TEMPLATE_DITHER_FLT
144 #undef TEMPLATE_DITHER_FLT
145
146 #define TEMPLATE_DITHER_DBL
148 #undef TEMPLATE_DITHER_DBL