FFmpeg
swresample.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2012 Michael Niedermayer (michaelni@gmx.at)
3  * Copyright (c) 2002 Fabrice Bellard
4  *
5  * This file is part of libswresample
6  *
7  * libswresample is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * libswresample is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with libswresample; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/avassert.h"
24 #include "libavutil/common.h"
25 #include "libavutil/opt.h"
26 
28 
29 #include <time.h>
30 
31 #define SAMPLES 1000
32 
33 #define SWR_CH_MAX 32
34 
35 #define ASSERT_LEVEL 2
36 
37 static double get(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f){
38  const uint8_t *p;
41  p= a[ch];
42  }else{
43  p= a[0];
44  index= ch + index*ch_count;
45  }
46 
47  switch(f){
48  case AV_SAMPLE_FMT_U8 : return ((const uint8_t*)p)[index]/127.0-1.0;
49  case AV_SAMPLE_FMT_S16: return ((const int16_t*)p)[index]/32767.0;
50  case AV_SAMPLE_FMT_S32: return ((const int32_t*)p)[index]/2147483647.0;
51  case AV_SAMPLE_FMT_FLT: return ((const float *)p)[index];
52  case AV_SAMPLE_FMT_DBL: return ((const double *)p)[index];
53  default: av_assert0(0);
54  }
55 }
56 
57 static void set(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f, double v){
58  uint8_t *p;
61  p= a[ch];
62  }else{
63  p= a[0];
64  index= ch + index*ch_count;
65  }
66  switch(f){
67  case AV_SAMPLE_FMT_U8 : ((uint8_t*)p)[index]= av_clip_uint8 (lrint((v+1.0)*127)); break;
68  case AV_SAMPLE_FMT_S16: ((int16_t*)p)[index]= av_clip_int16 (lrint(v*32767)); break;
69  case AV_SAMPLE_FMT_S32: ((int32_t*)p)[index]= av_clipl_int32(llrint(v*2147483647)); break;
70  case AV_SAMPLE_FMT_FLT: ((float *)p)[index]= v; break;
71  case AV_SAMPLE_FMT_DBL: ((double *)p)[index]= v; break;
72  default: av_assert2(0);
73  }
74 }
75 
76 static void shift(uint8_t *a[], int index, int ch_count, enum AVSampleFormat f){
77  int ch;
78 
81  for(ch= 0; ch<ch_count; ch++)
83  }else{
84  a[0] += index*ch_count*av_get_bytes_per_sample(f);
85  }
86 }
87 
88 static const enum AVSampleFormat formats[] = {
99 };
100 
101 static const int rates[] = {
102  8000,
103  11025,
104  16000,
105  22050,
106  32000,
107  48000,
108 };
109 
110 static const AVChannelLayout layouts[]={
125 };
126 
127 static void setup_array(uint8_t *out[SWR_CH_MAX], uint8_t *in, enum AVSampleFormat format, int samples){
129  int i;
130  int plane_size= av_get_bytes_per_sample(format&0xFF)*samples;
131  format&=0xFF;
132  for(i=0; i<SWR_CH_MAX; i++){
133  out[i]= in + i*plane_size;
134  }
135  }else{
136  out[0]= in;
137  }
138 }
139 
140 static int cmp(const void *a, const void *b){
141  return *(const int *)a - *(const int *)b;
142 }
143 
144 static void audiogen(void *data, enum AVSampleFormat sample_fmt,
145  int channels, int sample_rate, int nb_samples)
146 {
147  int i, ch, k;
148  double v, f, a, ampa;
149  double tabf1[SWR_CH_MAX];
150  double tabf2[SWR_CH_MAX];
151  double taba[SWR_CH_MAX];
152  unsigned static rnd;
153 
154 #define PUT_SAMPLE set(data, ch, k, channels, sample_fmt, v);
155 #define uint_rand(x) ((x) = (x) * 1664525 + 1013904223)
156 #define dbl_rand(x) (uint_rand(x)*2.0 / (double)UINT_MAX - 1)
157  k = 0;
158 
159  /* 1 second of single freq sinus at 1000 Hz */
160  a = 0;
161  for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {
162  v = sin(a) * 0.30;
163  for (ch = 0; ch < channels; ch++)
164  PUT_SAMPLE
165  a += M_PI * 1000.0 * 2.0 / sample_rate;
166  }
167 
168  /* 1 second of varying frequency between 100 and 10000 Hz */
169  a = 0;
170  for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {
171  v = sin(a) * 0.30;
172  for (ch = 0; ch < channels; ch++)
173  PUT_SAMPLE
174  f = 100.0 + (((10000.0 - 100.0) * i) / sample_rate);
175  a += M_PI * f * 2.0 / sample_rate;
176  }
177 
178  /* 0.5 second of low amplitude white noise */
179  for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {
180  v = dbl_rand(rnd) * 0.30;
181  for (ch = 0; ch < channels; ch++)
182  PUT_SAMPLE
183  }
184 
185  /* 0.5 second of high amplitude white noise */
186  for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {
187  v = dbl_rand(rnd);
188  for (ch = 0; ch < channels; ch++)
189  PUT_SAMPLE
190  }
191 
192  /* 1 second of unrelated ramps for each channel */
193  for (ch = 0; ch < channels; ch++) {
194  taba[ch] = 0;
195  tabf1[ch] = 100 + uint_rand(rnd) % 5000;
196  tabf2[ch] = 100 + uint_rand(rnd) % 5000;
197  }
198  for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {
199  for (ch = 0; ch < channels; ch++) {
200  v = sin(taba[ch]) * 0.30;
201  PUT_SAMPLE
202  f = tabf1[ch] + (((tabf2[ch] - tabf1[ch]) * i) / sample_rate);
203  taba[ch] += M_PI * f * 2.0 / sample_rate;
204  }
205  }
206 
207  /* 2 seconds of 500 Hz with varying volume */
208  a = 0;
209  ampa = 0;
210  for (i = 0; i < 2 * sample_rate && k < nb_samples; i++, k++) {
211  for (ch = 0; ch < channels; ch++) {
212  double amp = (1.0 + sin(ampa)) * 0.15;
213  if (ch & 1)
214  amp = 0.30 - amp;
215  v = sin(a) * amp;
216  PUT_SAMPLE
217  a += M_PI * 500.0 * 2.0 / sample_rate;
218  ampa += M_PI * 2.0 / sample_rate;
219  }
220  }
221 }
222 
223 int main(int argc, char **argv){
224  int in_sample_rate, out_sample_rate, ch ,i, flush_count;
225  AVChannelLayout in_ch_layout = { 0 }, out_ch_layout = { 0 };
227  uint8_t array_in[SAMPLES*8*8];
228  uint8_t array_mid[SAMPLES*8*8*3];
229  uint8_t array_out[SAMPLES*8*8+100];
230  uint8_t *ain[SWR_CH_MAX];
231  uint8_t *aout[SWR_CH_MAX];
232  uint8_t *amid[SWR_CH_MAX];
233  int flush_i=0;
234  int mode;
235  int num_tests = 10000;
236  uint32_t seed = 0;
237  uint32_t rand_seed = 0;
239  int max_tests = FF_ARRAY_ELEMS(remaining_tests);
240  int test;
241  int specific_test= -1;
242 
243  struct SwrContext * forw_ctx= NULL;
244  struct SwrContext *backw_ctx= NULL;
245 
246  if (argc > 1) {
247  if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
248  av_log(NULL, AV_LOG_INFO, "Usage: swresample-test [<num_tests>[ <test>]] \n"
249  "num_tests Default is %d\n", num_tests);
250  return 0;
251  }
252  num_tests = strtol(argv[1], NULL, 0);
253  if(num_tests < 0) {
254  num_tests = -num_tests;
255  rand_seed = time(0);
256  }
257  if(num_tests<= 0 || num_tests>max_tests)
258  num_tests = max_tests;
259  if(argc > 2) {
260  specific_test = strtol(argv[1], NULL, 0);
261  }
262  }
263 
264  for(i=0; i<max_tests; i++)
265  remaining_tests[i] = i;
266 
267  for(test=0; test<num_tests; test++){
268  unsigned r;
269  uint_rand(seed);
270  r = (seed * (uint64_t)(max_tests - test)) >>32;
271  FFSWAP(int, remaining_tests[r], remaining_tests[max_tests - test - 1]);
272  }
273  qsort(remaining_tests + max_tests - num_tests, num_tests, sizeof(remaining_tests[0]), cmp);
274  in_sample_rate=16000;
275  for(test=0; test<num_tests; test++){
276  char in_layout_string[256];
277  char out_layout_string[256];
278  unsigned vector= remaining_tests[max_tests - test - 1];
279  int in_ch_count;
280  int out_count, mid_count, out_ch_count;
281 
286  out_sample_rate = rates [vector % FF_ARRAY_ELEMS(rates )]; vector /= FF_ARRAY_ELEMS(rates);
287  av_assert0(!vector);
288 
289  if(specific_test == 0){
291  continue;
292  }
293 
294  in_ch_count= in_ch_layout.nb_channels;
295  out_ch_count= out_ch_layout.nb_channels;
296  av_channel_layout_describe(&in_ch_layout, in_layout_string, sizeof( in_layout_string));
297  av_channel_layout_describe(&out_ch_layout, out_layout_string, sizeof(out_layout_string));
298  fprintf(stderr, "TEST: %s->%s, rate:%5d->%5d, fmt:%s->%s\n",
299  in_layout_string, out_layout_string,
304  0, 0) < 0) {
305  fprintf(stderr, "Failed to init forw_cts\n");
306  return 1;
307  }
310  0, 0) < 0) {
311  fprintf(stderr, "Failed to init backw_ctx\n");
312  return 1;
313  }
314 
315  if(swr_init( forw_ctx) < 0)
316  fprintf(stderr, "swr_init(->) failed\n");
317  if(swr_init(backw_ctx) < 0)
318  fprintf(stderr, "swr_init(<-) failed\n");
319  //FIXME test planar
320  setup_array(ain , array_in , in_sample_fmt, SAMPLES);
321  setup_array(amid, array_mid, out_sample_fmt, 3*SAMPLES);
322  setup_array(aout, array_out, in_sample_fmt , SAMPLES);
323 #if 0
324  for(ch=0; ch<in_ch_count; ch++){
325  for(i=0; i<SAMPLES; i++)
326  set(ain, ch, i, in_ch_count, in_sample_fmt, sin(i*i*3/SAMPLES));
327  }
328 #else
329  audiogen(ain, in_sample_fmt, in_ch_count, SAMPLES/6+1, SAMPLES);
330 #endif
331  mode = uint_rand(rand_seed) % 3;
332  if(mode==0 /*|| out_sample_rate == in_sample_rate*/) {
333  mid_count= swr_convert(forw_ctx, amid, 3*SAMPLES, (const uint8_t **)ain, SAMPLES);
334  } else if(mode==1){
335  mid_count= swr_convert(forw_ctx, amid, 0, (const uint8_t **)ain, SAMPLES);
336  mid_count+=swr_convert(forw_ctx, amid, 3*SAMPLES, (const uint8_t **)ain, 0);
337  } else {
338  int tmp_count;
339  mid_count= swr_convert(forw_ctx, amid, 0, (const uint8_t **)ain, 1);
340  av_assert0(mid_count==0);
341  shift(ain, 1, in_ch_count, in_sample_fmt);
342  mid_count+=swr_convert(forw_ctx, amid, 3*SAMPLES, (const uint8_t **)ain, 0);
343  shift(amid, mid_count, out_ch_count, out_sample_fmt); tmp_count = mid_count;
344  mid_count+=swr_convert(forw_ctx, amid, 2, (const uint8_t **)ain, 2);
345  shift(amid, mid_count-tmp_count, out_ch_count, out_sample_fmt); tmp_count = mid_count;
346  shift(ain, 2, in_ch_count, in_sample_fmt);
347  mid_count+=swr_convert(forw_ctx, amid, 1, (const uint8_t **)ain, SAMPLES-3);
348  shift(amid, mid_count-tmp_count, out_ch_count, out_sample_fmt); tmp_count = mid_count;
349  shift(ain, -3, in_ch_count, in_sample_fmt);
350  mid_count+=swr_convert(forw_ctx, amid, 3*SAMPLES, (const uint8_t **)ain, 0);
351  shift(amid, -tmp_count, out_ch_count, out_sample_fmt);
352  }
353  out_count= swr_convert(backw_ctx,aout, SAMPLES, (const uint8_t **)amid, mid_count);
354 
355  for(ch=0; ch<in_ch_count; ch++){
356  double sse, maxdiff=0;
357  double sum_aa= 0;
358  double sum_bb= 0;
359  double sum_ab= 0;
360  for(i=0; i<out_count; i++){
361  double a= get(ain , ch, i, in_ch_count, in_sample_fmt);
362  double b= get(aout, ch, i, in_ch_count, in_sample_fmt);
363  sum_aa+= a*a;
364  sum_bb+= b*b;
365  sum_ab+= a*b;
366  maxdiff= FFMAX(maxdiff, fabs(a-b));
367  }
368  sse= sum_aa + sum_bb - 2*sum_ab;
369  if(sse < 0 && sse > -0.00001) sse=0; //fix rounding error
370 
371  fprintf(stderr, "[e:%f c:%f max:%f] len:%5d\n", out_count ? sqrt(sse/out_count) : 0, sum_ab/(sqrt(sum_aa*sum_bb)), maxdiff, out_count);
372  }
373 
374  flush_i++;
375  flush_i%=21;
376  flush_count = swr_convert(backw_ctx,aout, flush_i, 0, 0);
377  shift(aout, flush_i, in_ch_count, in_sample_fmt);
378  flush_count+= swr_convert(backw_ctx,aout, SAMPLES-flush_i, 0, 0);
379  shift(aout, -flush_i, in_ch_count, in_sample_fmt);
380  if(flush_count){
381  for(ch=0; ch<in_ch_count; ch++){
382  double sse, maxdiff=0;
383  double sum_aa= 0;
384  double sum_bb= 0;
385  double sum_ab= 0;
386  for(i=0; i<flush_count; i++){
387  double a= get(ain , ch, i+out_count, in_ch_count, in_sample_fmt);
388  double b= get(aout, ch, i, in_ch_count, in_sample_fmt);
389  sum_aa+= a*a;
390  sum_bb+= b*b;
391  sum_ab+= a*b;
392  maxdiff= FFMAX(maxdiff, fabs(a-b));
393  }
394  sse= sum_aa + sum_bb - 2*sum_ab;
395  if(sse < 0 && sse > -0.00001) sse=0; //fix rounding error
396 
397  fprintf(stderr, "[e:%f c:%f max:%f] len:%5d F:%3d\n", sqrt(sse/flush_count), sum_ab/(sqrt(sum_aa*sum_bb)), maxdiff, flush_count, flush_i);
398  }
399  }
400 
401 
402  fprintf(stderr, "\n");
403  }
404 
405  return 0;
406 }
formats
formats
Definition: signature.h:47
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
r
const char * r
Definition: vf_curves.c:127
opt.h
out
FILE * out
Definition: movenc.c:55
AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_STEREO
Definition: channel_layout.h:395
SwrContext::in_sample_rate
int in_sample_rate
input sample rate
Definition: swresample_internal.h:105
AV_CHANNEL_LAYOUT_2_2
#define AV_CHANNEL_LAYOUT_2_2
Definition: channel_layout.h:402
sse
static int sse(const MPVEncContext *const s, const uint8_t *src1, const uint8_t *src2, int w, int h, int stride)
Definition: mpegvideo_enc.c:2775
mode
Definition: swscale.c:56
SwrContext::out_sample_rate
int out_sample_rate
output sample rate
Definition: swresample_internal.h:106
b
#define b
Definition: input.c:42
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:65
SwrContext::out_ch_layout
AVChannelLayout out_ch_layout
output channel layout
Definition: swresample_internal.h:104
data
const char data[16]
Definition: mxf.c:149
test
Definition: idctdsp.c:35
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:329
cmp
static int cmp(const void *a, const void *b)
Definition: swresample.c:140
audiogen
static void audiogen(void *data, enum AVSampleFormat sample_fmt, int channels, int sample_rate, int nb_samples)
Definition: swresample.c:144
AV_CHANNEL_LAYOUT_7POINT1_WIDE
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE
Definition: channel_layout.h:418
setup_array
static void setup_array(uint8_t *out[SWR_CH_MAX], uint8_t *in, enum AVSampleFormat format, int samples)
Definition: swresample.c:127
SwrContext::out_sample_fmt
enum AVSampleFormat out_sample_fmt
output sample format
Definition: swresample_internal.h:101
AV_CHANNEL_LAYOUT_SURROUND
#define AV_CHANNEL_LAYOUT_SURROUND
Definition: channel_layout.h:398
swr_convert
int attribute_align_arg swr_convert(struct SwrContext *s, uint8_t *const *out_arg, int out_count, const uint8_t *const *in_arg, int in_count)
Convert audio.
Definition: swresample.c:717
SAMPLES
#define SAMPLES
Definition: swresample.c:31
avassert.h
lrint
#define lrint
Definition: tablegen.h:53
rnd
#define rnd()
Definition: checkasm.h:192
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
set
static void set(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f, double v)
Definition: swresample.c:57
swr_init
av_cold int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
Definition: swresample.c:138
av_channel_layout_describe
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
Definition: channel_layout.c:653
AV_CHANNEL_LAYOUT_4POINT0
#define AV_CHANNEL_LAYOUT_4POINT0
Definition: channel_layout.h:400
AV_CHANNEL_LAYOUT_7POINT1
#define AV_CHANNEL_LAYOUT_7POINT1
Definition: channel_layout.h:417
AV_CHANNEL_LAYOUT_5POINT0_BACK
#define AV_CHANNEL_LAYOUT_5POINT0_BACK
Definition: channel_layout.h:406
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:41
av_sample_fmt_is_planar
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
Definition: samplefmt.c:114
channels
channels
Definition: aptx.h:31
av_get_sample_fmt_name
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
Definition: samplefmt.c:51
SwrContext
The libswresample context.
Definition: swresample_internal.h:95
SwrContext::in_ch_layout
AVChannelLayout in_ch_layout
input channel layout
Definition: swresample_internal.h:103
fabs
static __device__ float fabs(float a)
Definition: cuda_runtime.h:182
av_clip_int16
#define av_clip_int16
Definition: common.h:115
NULL
#define NULL
Definition: coverity.c:32
format
New swscale design to change SwsGraph is what coordinates multiple passes These can include cascaded scaling error diffusion and so on Or we could have separate passes for the vertical and horizontal scaling In between each SwsPass lies a fully allocated image buffer Graph passes may have different levels of e g we can have a single threaded error diffusion pass following a multi threaded scaling pass SwsGraph is internally recreated whenever the image format
Definition: swscale-v2.txt:14
time.h
seed
static unsigned int seed
Definition: videogen.c:78
swresample.h
index
int index
Definition: gxfenc.c:90
uint_rand
#define uint_rand(x)
dbl_rand
#define dbl_rand(x)
main
int main(int argc, char **argv)
Definition: swresample.c:223
get
static double get(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f)
Definition: swresample.c:37
f
f
Definition: af_crystalizer.c:122
swr_alloc_set_opts2
int swr_alloc_set_opts2(struct SwrContext **ps, const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)
Allocate SwrContext if needed and set/reset common parameters.
Definition: swresample.c:40
AV_SAMPLE_FMT_U8P
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: samplefmt.h:63
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:319
av_clipl_int32
#define av_clipl_int32
Definition: common.h:118
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
M_PI
#define M_PI
Definition: mathematics.h:67
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
av_channel_layout_compare
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
Check whether two channel layouts are semantically the same, i.e.
Definition: channel_layout.c:809
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:221
av_assert2
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:68
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
av_get_bytes_per_sample
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
Definition: samplefmt.c:108
AV_CHANNEL_LAYOUT_QUAD
#define AV_CHANNEL_LAYOUT_QUAD
Definition: channel_layout.h:403
AV_SAMPLE_FMT_U8
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: samplefmt.h:57
common.h
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
FFSWAP
#define FFSWAP(type, a, b)
Definition: macros.h:52
SwrContext::in_sample_fmt
enum AVSampleFormat in_sample_fmt
input sample format
Definition: swresample_internal.h:99
AV_CHANNEL_LAYOUT_7POINT0
#define AV_CHANNEL_LAYOUT_7POINT0
Definition: channel_layout.h:415
AV_CHANNEL_LAYOUT_2_1
#define AV_CHANNEL_LAYOUT_2_1
Definition: channel_layout.h:397
channel_layout.h
rates
static const int rates[]
Definition: swresample.c:101
mode
mode
Definition: ebur128.h:83
shift
static void shift(uint8_t *a[], int index, int ch_count, enum AVSampleFormat f)
Definition: swresample.c:76
test
static void test(const char *pattern, const char *host)
Definition: noproxy.c:23
layouts
static const AVChannelLayout layouts[]
Definition: swresample.c:110
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:67
samples
Filter the word “frame” indicates either a video frame or a group of audio samples
Definition: filter_design.txt:8
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
av_clip_uint8
#define av_clip_uint8
Definition: common.h:106
av_channel_layout_copy
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
Definition: channel_layout.c:449
av_get_alt_sample_fmt
enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar)
Return the planar<->packed alternative form of the given sample format, or AV_SAMPLE_FMT_NONE on erro...
Definition: samplefmt.c:68
llrint
#define llrint(x)
Definition: libm.h:396
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:394
SwrContext::in
AudioData in
input audio data
Definition: swresample_internal.h:146
int32_t
int32_t
Definition: audioconvert.c:56
AV_CHANNEL_LAYOUT_5POINT1_BACK
#define AV_CHANNEL_LAYOUT_5POINT1_BACK
Definition: channel_layout.h:407
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
SWR_CH_MAX
#define SWR_CH_MAX
Definition: swresample.c:33
AV_CHANNEL_LAYOUT_5POINT0
#define AV_CHANNEL_LAYOUT_5POINT0
Definition: channel_layout.h:404
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:61
AV_CHANNEL_LAYOUT_5POINT1
#define AV_CHANNEL_LAYOUT_5POINT1
Definition: channel_layout.h:405
AV_SAMPLE_FMT_S32
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition: samplefmt.h:59
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:60
PUT_SAMPLE
#define PUT_SAMPLE