FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
aptx.h File Reference
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "mathops.h"

Go to the source code of this file.

Data Structures

struct  FilterSignal
 
struct  QMFAnalysis
 
struct  Quantize
 
struct  InvertQuantize
 
struct  Prediction
 
struct  Channel
 
struct  AptXContext
 
struct  ConstTables
 

Macros

#define NB_FILTERS   2
 
#define FILTER_TAPS   16
 
#define RSHIFT_SIZE(size)
 

Enumerations

enum  channels { LEFT, RIGHT, NB_CHANNELS }
 
enum  subbands {
  LF, MLF, MHF, HF,
  NB_SUBBANDS
}
 

Functions

static av_always_inline void aptx_qmf_filter_signal_push (FilterSignal *signal, int32_t sample)
 
static av_always_inline int32_t aptx_qmf_convolution (FilterSignal *signal, const int32_t coeffs[FILTER_TAPS], int shift)
 
static int32_t aptx_quantized_parity (Channel *channel)
 
static int aptx_check_parity (Channel channels[NB_CHANNELS], int32_t *idx)
 
void ff_aptx_invert_quantize_and_prediction (Channel *channel, int hd)
 
void ff_aptx_generate_dither (Channel *channel)
 
int ff_aptx_init (AVCodecContext *avctx)
 

Variables

ConstTables ff_aptx_quant_tables [2][NB_SUBBANDS]
 
static const int32_t aptx_qmf_outer_coeffs [NB_FILTERS][FILTER_TAPS]
 
static const int32_t aptx_qmf_inner_coeffs [NB_FILTERS][FILTER_TAPS]
 

Macro Definition Documentation

◆ NB_FILTERS

#define NB_FILTERS   2

Definition at line 45 of file aptx.h.

◆ FILTER_TAPS

#define FILTER_TAPS   16

Definition at line 46 of file aptx.h.

◆ RSHIFT_SIZE

#define RSHIFT_SIZE (   size)
Value:
av_always_inline \
static int##size##_t rshift##size(int##size##_t value, int shift) \
{ \
int##size##_t rounding = (int##size##_t)1 << (shift - 1); \
int##size##_t mask = ((int##size##_t)1 << (shift + 1)) - 1; \
return ((value + rounding) >> shift) - ((value & mask) == rounding); \
} \
av_always_inline \
static int##size##_t rshift##size##_clip24(int##size##_t value, int shift) \
{ \
return av_clip_intp2(rshift##size(value, shift), 23); \
}

Definition at line 112 of file aptx.h.

Enumeration Type Documentation

◆ channels

enum channels
Enumerator
LEFT 
RIGHT 
NB_CHANNELS 
Examples
filter_audio.c.

Definition at line 31 of file aptx.h.

◆ subbands

enum subbands
Enumerator
LF 
MLF 
MHF 
HF 
NB_SUBBANDS 

Definition at line 37 of file aptx.h.

Function Documentation

◆ aptx_qmf_filter_signal_push()

static av_always_inline void aptx_qmf_filter_signal_push ( FilterSignal signal,
int32_t  sample 
)
static

Definition at line 162 of file aptx.h.

Referenced by aptx_qmf_polyphase_analysis(), and aptx_qmf_polyphase_synthesis().

◆ aptx_qmf_convolution()

static av_always_inline int32_t aptx_qmf_convolution ( FilterSignal signal,
const int32_t  coeffs[FILTER_TAPS],
int  shift 
)
static

Definition at line 174 of file aptx.h.

Referenced by aptx_qmf_polyphase_analysis(), and aptx_qmf_polyphase_synthesis().

◆ aptx_quantized_parity()

static int32_t aptx_quantized_parity ( Channel channel)
inlinestatic

◆ aptx_check_parity()

static int aptx_check_parity ( Channel  channels[NB_CHANNELS],
int32_t idx 
)
inlinestatic

Definition at line 201 of file aptx.h.

Referenced by aptx_decode_samples(), and aptx_insert_sync().

◆ ff_aptx_invert_quantize_and_prediction()

void ff_aptx_invert_quantize_and_prediction ( Channel channel,
int  hd 
)

Definition at line 497 of file aptx.c.

Referenced by aptx_decode_samples(), and aptx_encode_samples().

◆ ff_aptx_generate_dither()

void ff_aptx_generate_dither ( Channel channel)

Definition at line 385 of file aptx.c.

Referenced by aptx_decode_samples(), and aptx_encode_channel().

◆ ff_aptx_init()

int ff_aptx_init ( AVCodecContext avctx)

Definition at line 508 of file aptx.c.

Referenced by aptx_encode_init().

Variable Documentation

◆ ff_aptx_quant_tables

ConstTables ff_aptx_quant_tables[2][NB_SUBBANDS]

Definition at line 313 of file aptx.c.

Referenced by aptx_encode_channel(), and ff_aptx_invert_quantize_and_prediction().

◆ aptx_qmf_outer_coeffs

const int32_t aptx_qmf_outer_coeffs[NB_FILTERS][FILTER_TAPS]
static
Initial value:
= {
{
730, -413, -9611, 43626, -121026, 269973, -585547, 2801966,
697128, -160481, 27611, 8478, -10043, 3511, 688, -897,
},
{
-897, 688, 3511, -10043, 8478, 27611, -160481, 697128,
2801966, -585547, 269973, -121026, 43626, -9611, -413, 730,
},
}

Definition at line 132 of file aptx.h.

Referenced by aptx_qmf_tree_analysis(), and aptx_qmf_tree_synthesis().

◆ aptx_qmf_inner_coeffs

const int32_t aptx_qmf_inner_coeffs[NB_FILTERS][FILTER_TAPS]
static
Initial value:
= {
{
1033, -584, -13592, 61697, -171156, 381799, -828088, 3962579,
985888, -226954, 39048, 11990, -14203, 4966, 973, -1268,
},
{
-1268, 973, 4966, -14203, 11990, 39048, -226954, 985888,
3962579, -828088, 381799, -171156, 61697, -13592, -584, 1033,
},
}

Definition at line 147 of file aptx.h.

Referenced by aptx_qmf_tree_analysis(), and aptx_qmf_tree_synthesis().

mask
static const uint16_t mask[17]
Definition: lzw.c:38
av_clip_intp2
#define av_clip_intp2
Definition: common.h:117
shift
static int shift(int a, int b)
Definition: bonk.c:262
size
int size
Definition: twinvq_data.h:10344
value
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 value
Definition: writing_filters.txt:86