FFmpeg
Macros | Functions | Variables
swresample.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libswresample/swresample.h"
#include <time.h>

Go to the source code of this file.

Macros

#define SAMPLES   1000
 
#define SWR_CH_MAX   32
 
#define ASSERT_LEVEL   2
 
#define PUT_SAMPLE   set(data, ch, k, channels, sample_fmt, v);
 
#define uint_rand(x)   ((x) = (x) * 1664525 + 1013904223)
 
#define dbl_rand(x)   (uint_rand(x)*2.0 / (double)UINT_MAX - 1)
 

Functions

static double get (uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f)
 
static void set (uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f, double v)
 
static void shift (uint8_t *a[], int index, int ch_count, enum AVSampleFormat f)
 
static void setup_array (uint8_t *out[SWR_CH_MAX], uint8_t *in, enum AVSampleFormat format, int samples)
 
static int cmp (const void *a, const void *b)
 
static void audiogen (void *data, enum AVSampleFormat sample_fmt, int channels, int sample_rate, int nb_samples)
 
int main (int argc, char **argv)
 

Variables

static enum AVSampleFormat formats []
 
static const int rates []
 
static const AVChannelLayout layouts []
 

Macro Definition Documentation

◆ SAMPLES

#define SAMPLES   1000

Definition at line 33 of file swresample.c.

◆ SWR_CH_MAX

#define SWR_CH_MAX   32

Definition at line 35 of file swresample.c.

◆ ASSERT_LEVEL

#define ASSERT_LEVEL   2

Definition at line 37 of file swresample.c.

◆ PUT_SAMPLE

#define PUT_SAMPLE   set(data, ch, k, channels, sample_fmt, v);

◆ uint_rand

#define uint_rand (   x)    ((x) = (x) * 1664525 + 1013904223)

◆ dbl_rand

#define dbl_rand (   x)    (uint_rand(x)*2.0 / (double)UINT_MAX - 1)

Function Documentation

◆ get()

static double get ( uint8_t *  a[],
int  ch,
int  index,
int  ch_count,
enum AVSampleFormat  f 
)
static

Definition at line 39 of file swresample.c.

Referenced by main().

◆ set()

static void set ( uint8_t *  a[],
int  ch,
int  index,
int  ch_count,
enum AVSampleFormat  f,
double  v 
)
static

◆ shift()

static void shift ( uint8_t *  a[],
int  index,
int  ch_count,
enum AVSampleFormat  f 
)
static

Definition at line 78 of file swresample.c.

Referenced by main().

◆ setup_array()

static void setup_array ( uint8_t *  out[SWR_CH_MAX],
uint8_t *  in,
enum AVSampleFormat  format,
int  samples 
)
static

Definition at line 129 of file swresample.c.

Referenced by main().

◆ cmp()

static int cmp ( const void *  a,
const void *  b 
)
static

Definition at line 142 of file swresample.c.

Referenced by main().

◆ audiogen()

static void audiogen ( void *  data,
enum AVSampleFormat  sample_fmt,
int  channels,
int  sample_rate,
int  nb_samples 
)
static

Definition at line 146 of file swresample.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 225 of file swresample.c.

Variable Documentation

◆ formats

enum AVSampleFormat formats[]
static

◆ rates

const int rates[]
static
Initial value:
= {
8000,
11025,
16000,
22050,
32000,
48000,
}

Definition at line 103 of file swresample.c.

Referenced by get_wb_bitrate_mode(), main(), query_formats(), and test_av_parse_video_rate().

◆ layouts

const AVChannelLayout layouts[]
static
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_STEREO
Definition: channel_layout.h:379
AV_CHANNEL_LAYOUT_2_2
#define AV_CHANNEL_LAYOUT_2_2
Definition: channel_layout.h:386
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:65
AV_CHANNEL_LAYOUT_7POINT1_WIDE
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE
Definition: channel_layout.h:402
AV_CHANNEL_LAYOUT_SURROUND
#define AV_CHANNEL_LAYOUT_SURROUND
Definition: channel_layout.h:382
AV_CHANNEL_LAYOUT_4POINT0
#define AV_CHANNEL_LAYOUT_4POINT0
Definition: channel_layout.h:384
AV_CHANNEL_LAYOUT_7POINT1
#define AV_CHANNEL_LAYOUT_7POINT1
Definition: channel_layout.h:401
AV_CHANNEL_LAYOUT_5POINT0_BACK
#define AV_CHANNEL_LAYOUT_5POINT0_BACK
Definition: channel_layout.h:390
AV_SAMPLE_FMT_U8P
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: samplefmt.h:63
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
AV_CHANNEL_LAYOUT_QUAD
#define AV_CHANNEL_LAYOUT_QUAD
Definition: channel_layout.h:387
AV_SAMPLE_FMT_U8
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: samplefmt.h:57
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
AV_CHANNEL_LAYOUT_7POINT0
#define AV_CHANNEL_LAYOUT_7POINT0
Definition: channel_layout.h:399
AV_CHANNEL_LAYOUT_2_1
#define AV_CHANNEL_LAYOUT_2_1
Definition: channel_layout.h:381
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:67
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:378
AV_CHANNEL_LAYOUT_5POINT1_BACK
#define AV_CHANNEL_LAYOUT_5POINT1_BACK
Definition: channel_layout.h:391
AV_CHANNEL_LAYOUT_5POINT0
#define AV_CHANNEL_LAYOUT_5POINT0
Definition: channel_layout.h:388
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:389
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