annotate libaf/af_resample.c @ 21644:f0923677efc3

Trnaslated section "CODEC SPECIFIC ENCODING OPTIONS (MENCODER ONLY)" Now man page translaton is complete. However, translation contains many FIXME issues and needs additional checks.
author voroshil
date Sun, 17 Dec 2006 20:25:06 +0000
parents 1ed61a0494c4
children ecf562795caf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
1 /*=============================================================================
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
2 //
13602
14090f7300a8 The full name of the GPL is GNU General Public License.
diego
parents: 8905
diff changeset
3 // This software has been released under the terms of the GNU General Public
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
4 // license. See http://www.gnu.org/copyleft/gpl.html for details.
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
5 //
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
6 // Copyright 2002 Anders Johansson ajh@atri.curtin.edu.au
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
7 //
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
8 //=============================================================================
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
9 */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
10
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
11 /* This audio filter changes the sample rate. */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
12 #include <stdio.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
13 #include <stdlib.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
14 #include <unistd.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
15 #include <inttypes.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
16
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
17 #include "af.h"
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
18 #include "dsp.h"
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
19
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
20 /* Below definition selects the length of each poly phase component.
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
21 Valid definitions are L8 and L16, where the number denotes the
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
22 length of the filter. This definition affects the computational
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
23 complexity (see play()), the performance (see filter.h) and the
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
24 memory usage. The filterlenght is choosen to 8 if the machine is
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
25 slow and to 16 if the machine is fast and has MMX.
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
26 */
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
27
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
28 #if !defined(HAVE_MMX) // This machine is slow
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
29 #define L8
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
30 #else
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
31 #define L16
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
32 #endif
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
33
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
34 #include "af_resample.h"
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
35
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
36 // Filtering types
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
37 #define RSMP_LIN (0<<0) // Linear interpolation
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
38 #define RSMP_INT (1<<0) // 16 bit integer
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
39 #define RSMP_FLOAT (2<<0) // 32 bit floating point
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
40 #define RSMP_MASK (3<<0)
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
41
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
42 // Defines for sloppy or exact resampling
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
43 #define FREQ_SLOPPY (0<<2)
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
44 #define FREQ_EXACT (1<<2)
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
45 #define FREQ_MASK (1<<2)
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
46
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
47 // Accuracy for linear interpolation
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
48 #define STEPACCURACY 32
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
49
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
50 // local data
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
51 typedef struct af_resample_s
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
52 {
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
53 void* w; // Current filter weights
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
54 void** xq; // Circular buffers
7580
255039c14525 Changing to 32 bit aritmetics for counters
anders
parents: 7571
diff changeset
55 uint32_t xi; // Index for circular buffers
255039c14525 Changing to 32 bit aritmetics for counters
anders
parents: 7571
diff changeset
56 uint32_t wi; // Index for w
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
57 uint32_t i; // Number of new samples to put in x queue
7580
255039c14525 Changing to 32 bit aritmetics for counters
anders
parents: 7571
diff changeset
58 uint32_t dn; // Down sampling factor
255039c14525 Changing to 32 bit aritmetics for counters
anders
parents: 7571
diff changeset
59 uint32_t up; // Up sampling factor
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
60 uint64_t step; // Step size for linear interpolation
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
61 uint64_t pt; // Pointer remainder for linear interpolation
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
62 int setup; // Setup parameters cmdline or through postcreate
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
63 } af_resample_t;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
64
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
65 // Fast linear interpolation resample with modest audio quality
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
66 static int linint(af_data_t* c,af_data_t* l, af_resample_t* s)
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
67 {
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
68 uint32_t len = 0; // Number of input samples
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
69 uint32_t nch = l->nch; // Words pre transfer
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
70 uint64_t step = s->step;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
71 int16_t* in16 = ((int16_t*)c->audio);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
72 int16_t* out16 = ((int16_t*)l->audio);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
73 int32_t* in32 = ((int32_t*)c->audio);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
74 int32_t* out32 = ((int32_t*)l->audio);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
75 uint64_t end = ((((uint64_t)c->len)/2LL)<<STEPACCURACY);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
76 uint64_t pt = s->pt;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
77 uint16_t tmp;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
78
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
79 switch (nch){
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
80 case 1:
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
81 while(pt < end){
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
82 out16[len++]=in16[pt>>STEPACCURACY];
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
83 pt+=step;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
84 }
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
85 s->pt=pt & ((1LL<<STEPACCURACY)-1);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
86 break;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
87 case 2:
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
88 end/=2;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
89 while(pt < end){
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
90 out32[len++]=in32[pt>>STEPACCURACY];
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
91 pt+=step;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
92 }
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
93 len=(len<<1);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
94 s->pt=pt & ((1LL<<STEPACCURACY)-1);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
95 break;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
96 default:
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
97 end /=nch;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
98 while(pt < end){
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
99 tmp=nch;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
100 do {
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
101 tmp--;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
102 out16[len+tmp]=in16[tmp+(pt>>STEPACCURACY)*nch];
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
103 } while (tmp);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
104 len+=nch;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
105 pt+=step;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
106 }
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
107 s->pt=pt & ((1LL<<STEPACCURACY)-1);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
108 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
109 return len;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
110 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
111
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
112 /* Determine resampling type and format */
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
113 static int set_types(struct af_instance_s* af, af_data_t* data)
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
114 {
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
115 af_resample_t* s = af->setup;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
116 int rv = AF_OK;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
117 float rd = 0;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
118
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
119 // Make sure this filter isn't redundant
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
120 if((af->data->rate == data->rate) || (af->data->rate == 0))
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
121 return AF_DETACH;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
122 /* If sloppy and small resampling difference (2%) */
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
123 rd = abs((float)af->data->rate - (float)data->rate)/(float)data->rate;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
124 if((((s->setup & FREQ_MASK) == FREQ_SLOPPY) && (rd < 0.02) &&
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13602
diff changeset
125 (data->format != (AF_FORMAT_FLOAT_NE))) ||
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
126 ((s->setup & RSMP_MASK) == RSMP_LIN)){
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
127 s->setup = (s->setup & ~RSMP_MASK) | RSMP_LIN;
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13602
diff changeset
128 af->data->format = AF_FORMAT_S16_NE;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
129 af->data->bps = 2;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
130 af_msg(AF_MSG_VERBOSE,"[resample] Using linear interpolation. \n");
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
131 }
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
132 else{
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
133 /* If the input format is float or if float is explicitly selected
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
134 use float, otherwise use int */
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13602
diff changeset
135 if((data->format == (AF_FORMAT_FLOAT_NE)) ||
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
136 ((s->setup & RSMP_MASK) == RSMP_FLOAT)){
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
137 s->setup = (s->setup & ~RSMP_MASK) | RSMP_FLOAT;
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13602
diff changeset
138 af->data->format = AF_FORMAT_FLOAT_NE;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
139 af->data->bps = 4;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
140 }
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
141 else{
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
142 s->setup = (s->setup & ~RSMP_MASK) | RSMP_INT;
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 13602
diff changeset
143 af->data->format = AF_FORMAT_S16_NE;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
144 af->data->bps = 2;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
145 }
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
146 af_msg(AF_MSG_VERBOSE,"[resample] Using %s processing and %s frequecy"
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
147 " conversion.\n",
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
148 ((s->setup & RSMP_MASK) == RSMP_FLOAT)?"floating point":"integer",
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
149 ((s->setup & FREQ_MASK) == FREQ_SLOPPY)?"inexact":"exact");
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
150 }
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
151
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
152 if(af->data->format != data->format || af->data->bps != data->bps)
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
153 rv = AF_FALSE;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
154 data->format = af->data->format;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
155 data->bps = af->data->bps;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
156 af->data->nch = data->nch;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
157 return rv;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
158 }
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
159
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
160 // Initialization and runtime control
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
161 static int control(struct af_instance_s* af, int cmd, void* arg)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
162 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
163 switch(cmd){
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
164 case AF_CONTROL_REINIT:{
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
165 af_resample_t* s = (af_resample_t*)af->setup;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
166 af_data_t* n = (af_data_t*)arg; // New configureation
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
167 int i,d = 0;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
168 int rv = AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
169
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
170 // Free space for circular bufers
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
171 if(s->xq){
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
172 for(i=1;i<af->data->nch;i++)
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
173 if(s->xq[i])
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
174 free(s->xq[i]);
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
175 free(s->xq);
21017
32d611b59079 Fix double free in af_resample when reinited with suitable parameters
uau
parents: 17366
diff changeset
176 s->xq = NULL;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
177 }
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
178
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
179 if(AF_DETACH == (rv = set_types(af,n)))
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
180 return AF_DETACH;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
181
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
182 // If linear interpolation
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
183 if((s->setup & RSMP_MASK) == RSMP_LIN){
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
184 s->pt=0LL;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
185 s->step=((uint64_t)n->rate<<STEPACCURACY)/(uint64_t)af->data->rate+1LL;
17366
934380353fd6 massive attack: mp_msg printf format fixes
rathann
parents: 14433
diff changeset
186 af_msg(AF_MSG_DEBUG0,"[resample] Linear interpolation step: 0x%016"PRIX64".\n",
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
187 s->step);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
188 af->mul.n = af->data->rate;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
189 af->mul.d = n->rate;
14433
95bb94a930a3 always cancel down fractions (frac_t) to avoid overflows and playback
reimar
parents: 14275
diff changeset
190 af_frac_cancel(&af->mul);
8905
295c20099f12 10l sig 11 bug reported by Fabian Franz
anders
parents: 8868
diff changeset
191 return rv;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
192 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
193
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
194 // Calculate up and down sampling factors
14433
95bb94a930a3 always cancel down fractions (frac_t) to avoid overflows and playback
reimar
parents: 14275
diff changeset
195 d=af_gcd(af->data->rate,n->rate);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
196
7998
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
197 // If sloppy resampling is enabled limit the upsampling factor
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
198 if(((s->setup & FREQ_MASK) == FREQ_SLOPPY) && (af->data->rate/d > 5000)){
7998
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
199 int up=af->data->rate/2;
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
200 int dn=n->rate/2;
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
201 int m=2;
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
202 while(af->data->rate/(d*m) > 5000){
14433
95bb94a930a3 always cancel down fractions (frac_t) to avoid overflows and playback
reimar
parents: 14275
diff changeset
203 d=af_gcd(up,dn);
7998
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
204 up/=2; dn/=2; m*=2;
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
205 }
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
206 d*=m;
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
207 }
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
208
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
209 // Create space for circular bufers
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
210 s->xq = malloc(n->nch*sizeof(void*));
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
211 for(i=0;i<n->nch;i++)
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
212 s->xq[i] = malloc(2*L*af->data->bps);
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
213 s->xi = 0;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
214
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
215 // Check if the the design needs to be redone
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
216 if(s->up != af->data->rate/d || s->dn != n->rate/d){
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
217 float* w;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
218 float* wt;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
219 float fc;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
220 int j;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
221 s->up = af->data->rate/d;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
222 s->dn = n->rate/d;
21058
1ed61a0494c4 Reinitialize some variables on af_resample reinit, fixes crash
uau
parents: 21017
diff changeset
223 s->wi = 0;
1ed61a0494c4 Reinitialize some variables on af_resample reinit, fixes crash
uau
parents: 21017
diff changeset
224 s->i = 0;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
225
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
226 // Calculate cuttof frequency for filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
227 fc = 1/(float)(max(s->up,s->dn));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
228 // Allocate space for polyphase filter bank and protptype filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
229 w = malloc(sizeof(float) * s->up *L);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
230 if(NULL != s->w)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
231 free(s->w);
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
232 s->w = malloc(L*s->up*af->data->bps);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
233
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
234 // Design prototype filter type using Kaiser window with beta = 10
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
235 if(NULL == w || NULL == s->w ||
14275
de13fd557440 less namespace pollution #2 (prefixed globals in filter.c with af_filter_)
alex
parents: 14245
diff changeset
236 -1 == af_filter_design_fir(s->up*L, w, &fc, LP|KAISER , 10.0)){
8167
e8832e66babd New features:
anders
parents: 8071
diff changeset
237 af_msg(AF_MSG_ERROR,"[resample] Unable to design prototype filter.\n");
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
238 return AF_ERROR;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
239 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
240 // Copy data from prototype to polyphase filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
241 wt=w;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
242 for(j=0;j<L;j++){//Columns
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
243 for(i=0;i<s->up;i++){//Rows
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
244 if((s->setup & RSMP_MASK) == RSMP_INT){
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
245 float t=(float)s->up*32767.0*(*wt);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
246 ((int16_t*)s->w)[i*L+j] = (int16_t)((t>=0.0)?(t+0.5):(t-0.5));
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
247 }
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
248 else
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
249 ((float*)s->w)[i*L+j] = (float)s->up*(*wt);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
250 wt++;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
251 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
252 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
253 free(w);
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
254 af_msg(AF_MSG_VERBOSE,"[resample] New filter designed up: %i "
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
255 "down: %i\n", s->up, s->dn);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
256 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
257
7665
fbd5445cc853 Adding function for calculating the delay caused by the filters
anders
parents: 7616
diff changeset
258 // Set multiplier and delay
fbd5445cc853 Adding function for calculating the delay caused by the filters
anders
parents: 7616
diff changeset
259 af->delay = (double)(1000*L/2)/((double)n->rate);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
260 af->mul.n = s->up;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
261 af->mul.d = s->dn;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
262 return rv;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
263 }
7998
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
264 case AF_CONTROL_COMMAND_LINE:{
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
265 af_resample_t* s = (af_resample_t*)af->setup;
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
266 int rate=0;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
267 int type=RSMP_INT;
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
268 int sloppy=1;
8868
398e3fb7c103 10l bug for float conversion control + feature fix in volume control
anders
parents: 8867
diff changeset
269 sscanf((char*)arg,"%i:%i:%i", &rate, &sloppy, &type);
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
270 s->setup = (sloppy?FREQ_SLOPPY:FREQ_EXACT) |
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
271 (clamp(type,RSMP_LIN,RSMP_FLOAT));
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
272 return af->control(af,AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET, &rate);
7998
d48a06d07afb Adding commandline options for filters and fixing stupid bug in cfg
anders
parents: 7894
diff changeset
273 }
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
274 case AF_CONTROL_POST_CREATE:
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
275 if((((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == AF_INIT_FLOAT)
8868
398e3fb7c103 10l bug for float conversion control + feature fix in volume control
anders
parents: 8867
diff changeset
276 ((af_resample_t*)af->setup)->setup = RSMP_FLOAT;
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
277 return AF_OK;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
278 case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET:
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
279 // Reinit must be called after this function has been called
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
280
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
281 // Sanity check
7616
d09c125a88fa Changing frequency limit for resampling
anders
parents: 7615
diff changeset
282 if(((int*)arg)[0] < 8000 || ((int*)arg)[0] > 192000){
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
283 af_msg(AF_MSG_ERROR,"[resample] The output sample frequency "
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
284 "must be between 8kHz and 192kHz. Current value is %i \n",
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
285 ((int*)arg)[0]);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
286 return AF_ERROR;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
287 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
288
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
289 af->data->rate=((int*)arg)[0];
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
290 af_msg(AF_MSG_VERBOSE,"[resample] Changing sample rate "
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
291 "to %iHz\n",af->data->rate);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
292 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
293 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
294 return AF_UNKNOWN;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
295 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
296
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
297 // Deallocate memory
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
298 static void uninit(struct af_instance_s* af)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
299 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
300 if(af->data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
301 free(af->data);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
302 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
303
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
304 // Filter data through filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
305 static af_data_t* play(struct af_instance_s* af, af_data_t* data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
306 {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
307 int len = 0; // Length of output data
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
308 af_data_t* c = data; // Current working data
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
309 af_data_t* l = af->data; // Local data
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
310 af_resample_t* s = (af_resample_t*)af->setup;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
311
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
312 if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
313 return NULL;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
314
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
315 // Run resampling
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
316 switch(s->setup & RSMP_MASK){
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
317 case(RSMP_INT):
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
318 # define FORMAT_I 1
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
319 if(s->up>s->dn){
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
320 # define UP
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
321 # include "af_resample.h"
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
322 # undef UP
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
323 }
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
324 else{
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
325 # define DN
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
326 # include "af_resample.h"
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
327 # undef DN
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
328 }
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
329 break;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
330 case(RSMP_FLOAT):
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
331 # undef FORMAT_I
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
332 # define FORMAT_F 1
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
333 if(s->up>s->dn){
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
334 # define UP
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
335 # include "af_resample.h"
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
336 # undef UP
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
337 }
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
338 else{
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
339 # define DN
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
340 # include "af_resample.h"
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
341 # undef DN
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
342 }
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
343 break;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
344 case(RSMP_LIN):
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
345 len = linint(c, l, s);
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
346 break;
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
347 }
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
348
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
349 // Set output data
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
350 c->audio = l->audio;
8607
d6f40a06867b Changes includes:
anders
parents: 8451
diff changeset
351 c->len = len*l->bps;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
352 c->rate = l->rate;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
353
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
354 return c;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
355 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
356
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
357 // Allocate memory and set function pointers
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
358 static int open(af_instance_t* af){
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
359 af->control=control;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
360 af->uninit=uninit;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
361 af->play=play;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
362 af->mul.n=1;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
363 af->mul.d=1;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
364 af->data=calloc(1,sizeof(af_data_t));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
365 af->setup=calloc(1,sizeof(af_resample_t));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
366 if(af->data == NULL || af->setup == NULL)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
367 return AF_ERROR;
8867
558f0b1f45ee New auto config for volume and resample and added support for float flag in configuration
anders
parents: 8711
diff changeset
368 ((af_resample_t*)af->setup)->setup = RSMP_INT | FREQ_SLOPPY;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
369 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
370 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
371
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
372 // Description of this plugin
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
373 af_info_t af_info_resample = {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
374 "Sample frequency conversion",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
375 "resample",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
376 "Anders",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
377 "",
7615
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7602
diff changeset
378 AF_FLAGS_REENTRANT,
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
379 open
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
380 };
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
381