FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
aptx.h File Reference
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "internal.h"
#include "mathops.h"
#include "audio_frame_queue.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

#define NB_FILTERS   2

Definition at line 47 of file aptx.h.

#define FILTER_TAPS   16

Definition at line 48 of file aptx.h.

Referenced by aptx_qmf_convolution(), and aptx_qmf_filter_signal_push().

#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); \
}
static int shift(int a, int b)
Definition: sonic.c:82
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:108
ptrdiff_t size
Definition: opengl_enc.c:100
static const uint16_t mask[17]
Definition: lzw.c:38
int
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return

Definition at line 115 of file aptx.h.

Enumeration Type Documentation

enum channels
Enumerator
LEFT 
RIGHT 
NB_CHANNELS 
Examples:
filter_audio.c.

Definition at line 33 of file aptx.h.

enum subbands
Enumerator
LF 
MLF 
MHF 
HF 
NB_SUBBANDS 

Definition at line 39 of file aptx.h.

Function Documentation

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

Definition at line 165 of file aptx.h.

Referenced by aptx_qmf_polyphase_analysis(), and aptx_qmf_polyphase_synthesis().

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

Definition at line 177 of file aptx.h.

Referenced by aptx_qmf_polyphase_analysis(), and aptx_qmf_polyphase_synthesis().

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

Definition at line 204 of file aptx.h.

Referenced by aptx_decode_samples(), and aptx_insert_sync().

void ff_aptx_invert_quantize_and_prediction ( Channel channel,
int  hd 
)

Definition at line 496 of file aptx.c.

Referenced by aptx_check_parity(), aptx_decode_samples(), and aptx_encode_samples().

void ff_aptx_generate_dither ( Channel channel)

Definition at line 384 of file aptx.c.

Referenced by aptx_check_parity(), aptx_decode_samples(), and aptx_encode_channel().

int ff_aptx_init ( AVCodecContext avctx)

Definition at line 507 of file aptx.c.

Referenced by aptx_check_parity(), aptx_close(), and aptx_decode_frame().

Variable Documentation

ConstTables ff_aptx_quant_tables[2][NB_SUBBANDS]

Definition at line 312 of file aptx.c.

Referenced by aptx_encode_channel().

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 135 of file aptx.h.

Referenced by aptx_qmf_tree_analysis(), and aptx_qmf_tree_synthesis().

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 150 of file aptx.h.

Referenced by aptx_qmf_tree_analysis(), and aptx_qmf_tree_synthesis().