MythTV  master
Classes | Macros | Functions
audioconvert.cpp File Reference
#include <cinttypes>
#include <cmath>
#include <sys/types.h>
#include "mythconfig.h"
#include "mythlogging.h"
#include "audioconvert.h"
#include "libavcodec/avcodec.h"
#include "libswresample/swresample.h"
Include dependency graph for audioconvert.cpp:

Go to the source code of this file.

Classes

class  AudioConvertInternal
 

Macros

#define LOC   QString("AudioConvert: ")
 
#define ISALIGN(x)   (((unsigned long)(x) & 0xf) == 0)
 

Functions

static av_always_inline av_const long int lrintf (float x)
 
static float clipcheck (float f)
 
static int toFloat8 (float *out, const uchar *in, int len)
 
static uchar clip_uchar (int a)
 
static int fromFloat8 (uchar *out, const float *in, int len)
 
static int toFloat16 (float *out, const short *in, int len)
 
static short clip_short (int a)
 
static int fromFloat16 (short *out, const float *in, int len)
 
static int toFloat32 (AudioFormat format, float *out, const int *in, int len)
 
static int fromFloat32 (AudioFormat format, int *out, const float *in, int len)
 
static int fromFloatFLT (float *out, const float *in, int len)
 
template<class AudioDataType >
void _DeinterleaveSample (AudioDataType *out, const AudioDataType *in, int channels, int frames)
 
template<class AudioDataType >
void _InterleaveSample (AudioDataType *out, const AudioDataType *in, int channels, int frames, const AudioDataType *const *inp=nullptr)
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("AudioConvert: ")

Definition at line 37 of file audioconvert.cpp.

◆ ISALIGN

#define ISALIGN (   x)    (((unsigned long)(x) & 0xf) == 0)

Definition at line 39 of file audioconvert.cpp.

Function Documentation

◆ lrintf()

static av_always_inline av_const long int lrintf ( float  x)
static

Definition at line 73 of file audioconvert.cpp.

Referenced by fromFloat16(), fromFloat32(), and fromFloat8().

◆ clipcheck()

static float clipcheck ( float  f)
inlinestatic

Definition at line 79 of file audioconvert.cpp.

Referenced by fromFloatFLT().

◆ toFloat8()

static int toFloat8 ( float *  out,
const uchar *  in,
int  len 
)
static

Definition at line 90 of file audioconvert.cpp.

Referenced by AudioConvert::toFloat().

◆ clip_uchar()

static uchar clip_uchar ( int  a)
inlinestatic

Definition at line 157 of file audioconvert.cpp.

Referenced by fromFloat8().

◆ fromFloat8()

static int fromFloat8 ( uchar *  out,
const float *  in,
int  len 
)
static

Definition at line 164 of file audioconvert.cpp.

Referenced by AudioConvert::fromFloat().

◆ toFloat16()

static int toFloat16 ( float *  out,
const short *  in,
int  len 
)
static

Definition at line 215 of file audioconvert.cpp.

Referenced by AudioConvert::toFloat().

◆ clip_short()

static short clip_short ( int  a)
inlinestatic

Definition at line 269 of file audioconvert.cpp.

Referenced by fromFloat16().

◆ fromFloat16()

static int fromFloat16 ( short *  out,
const float *  in,
int  len 
)
static

Definition at line 276 of file audioconvert.cpp.

Referenced by AudioConvert::fromFloat().

◆ toFloat32()

static int toFloat32 ( AudioFormat  format,
float *  out,
const int *  in,
int  len 
)
static

Definition at line 322 of file audioconvert.cpp.

Referenced by AudioConvert::toFloat().

◆ fromFloat32()

static int fromFloat32 ( AudioFormat  format,
int *  out,
const float *  in,
int  len 
)
static

Definition at line 378 of file audioconvert.cpp.

Referenced by AudioConvert::fromFloat().

◆ fromFloatFLT()

static int fromFloatFLT ( float *  out,
const float *  in,
int  len 
)
static

Definition at line 464 of file audioconvert.cpp.

Referenced by AudioConvert::fromFloat().

◆ _DeinterleaveSample()

template<class AudioDataType >
void _DeinterleaveSample ( AudioDataType *  out,
const AudioDataType *  in,
int  channels,
int  frames 
)

Definition at line 733 of file audioconvert.cpp.

Referenced by AudioConvert::DeinterleaveSamples().

◆ _InterleaveSample()

template<class AudioDataType >
void _InterleaveSample ( AudioDataType *  out,
const AudioDataType *  in,
int  channels,
int  frames,
const AudioDataType *const *  inp = nullptr 
)

Definition at line 782 of file audioconvert.cpp.

Referenced by AudioConvert::InterleaveSamples().