FFmpeg
Macros | Functions | Variables
avresample.c File Reference
#include <stdint.h>
#include <stdio.h>
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/lfg.h"
#include "libavutil/libm.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "libavresample/avresample.h"

Go to the source code of this file.

Macros

#define PUT_FUNC(name, fmt, type, expr)
 
#define PUT_SAMPLE   put_sample(data, sample_fmt, channels, k, ch, v);
 

Functions

static double dbl_rand (AVLFG *lfg)
 
 PUT_FUNC (u8, AV_SAMPLE_FMT_U8, uint8_t, av_clip_uint8(lrint(v_dbl *(1<< 7))+128))
 
static void audiogen (AVLFG *rnd, 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 uint64_t layouts []
 

Macro Definition Documentation

◆ PUT_FUNC

#define PUT_FUNC (   name,
  fmt,
  type,
  expr 
)
Value:
static void put_sample_ ## name(void **data, enum AVSampleFormat sample_fmt,\
int channels, int sample, int ch, \
double v_dbl) \
{ \
type v = expr; \
type **out = (type **)data; \
if (av_sample_fmt_is_planar(sample_fmt)) \
out[ch][sample] = v; \
else \
out[0][sample * channels + ch] = v; \
}

Definition at line 41 of file avresample.c.

◆ PUT_SAMPLE

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

Function Documentation

◆ dbl_rand()

static double dbl_rand ( AVLFG lfg)
static

Definition at line 36 of file avresample.c.

Referenced by audiogen().

◆ PUT_FUNC()

PUT_FUNC ( u8  ,
AV_SAMPLE_FMT_U8  ,
uint8_t  ,
av_clip_uint8(lrint(v_dbl *(1<< 7))+128)   
)

Definition at line 54 of file avresample.c.

◆ audiogen()

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

Definition at line 82 of file avresample.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 189 of file avresample.c.

Variable Documentation

◆ formats

enum AVSampleFormat formats[]
static

◆ rates

const int rates[]
static
Initial value:
= {
48000,
44100,
16000
}

Definition at line 176 of file avresample.c.

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

◆ layouts

const uint64_t layouts[]
static
Initial value:

Definition at line 182 of file avresample.c.

Referenced by main().

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
out
FILE * out
Definition: movenc.c:54
AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_MONO
Definition: channel_layout.h:90
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:68
data
const char data[16]
Definition: mxf.c:142
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_STEREO
Definition: channel_layout.h:91
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:112
channels
channels
Definition: aptx.h:33
AV_CH_LAYOUT_5POINT1
#define AV_CH_LAYOUT_5POINT1
Definition: channel_layout.h:101
AV_SAMPLE_FMT_U8
AV_SAMPLE_FMT_U8
Definition: audio_convert.c:194
AV_SAMPLE_FMT_U8P
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: samplefmt.h:66
sample
#define sample
Definition: flacdsp_template.c:44
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_7POINT1
Definition: channel_layout.h:112
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:61
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:70
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:64
AV_SAMPLE_FMT_S32
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition: samplefmt.h:62
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:63