FFmpeg
Data Structures | Functions | Variables
atrac9dec.c File Reference
#include "internal.h"
#include "get_bits.h"
#include "fft.h"
#include "atrac9tab.h"
#include "libavutil/lfg.h"
#include "libavutil/float_dsp.h"

Go to the source code of this file.

Data Structures

struct  ATRAC9ChannelData
 
struct  ATRAC9BlockData
 
struct  ATRAC9Context
 

Functions

static int parse_gradient (ATRAC9Context *s, ATRAC9BlockData *b, GetBitContext *gb)
 
static void calc_precision (ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c)
 
static int parse_band_ext (ATRAC9Context *s, ATRAC9BlockData *b, GetBitContext *gb, int stereo)
 
static int read_scalefactors (ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c, GetBitContext *gb, int channel_idx, int first_in_pkt)
 
static void calc_codebook_idx (ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c)
 
static void read_coeffs_coarse (ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c, GetBitContext *gb)
 
static void read_coeffs_fine (ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c, GetBitContext *gb)
 
static void dequantize (ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c)
 
static void apply_intensity_stereo (ATRAC9Context *s, ATRAC9BlockData *b, const int stereo)
 
static void apply_scalefactors (ATRAC9Context *s, ATRAC9BlockData *b, const int stereo)
 
static void fill_with_noise (ATRAC9Context *s, ATRAC9ChannelData *c, int start, int count)
 
static void scale_band_ext_coeffs (ATRAC9ChannelData *c, float sf[6], const int s_unit, const int e_unit)
 
static void apply_band_extension (ATRAC9Context *s, ATRAC9BlockData *b, const int stereo)
 
static int atrac9_decode_block (ATRAC9Context *s, GetBitContext *gb, ATRAC9BlockData *b, AVFrame *frame, int frame_idx, int block_idx)
 
static int atrac9_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 
static void atrac9_decode_flush (AVCodecContext *avctx)
 
static av_cold int atrac9_decode_close (AVCodecContext *avctx)
 
static av_cold int atrac9_decode_init (AVCodecContext *avctx)
 

Variables

AVCodec ff_atrac9_decoder
 

Function Documentation

static int parse_gradient ( ATRAC9Context s,
ATRAC9BlockData b,
GetBitContext gb 
)
inlinestatic

Definition at line 101 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void calc_precision ( ATRAC9Context s,
ATRAC9BlockData b,
ATRAC9ChannelData c 
)
inlinestatic

Definition at line 145 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static int parse_band_ext ( ATRAC9Context s,
ATRAC9BlockData b,
GetBitContext gb,
int  stereo 
)
inlinestatic

Definition at line 196 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static int read_scalefactors ( ATRAC9Context s,
ATRAC9BlockData b,
ATRAC9ChannelData c,
GetBitContext gb,
int  channel_idx,
int  first_in_pkt 
)
inlinestatic

Definition at line 251 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void calc_codebook_idx ( ATRAC9Context s,
ATRAC9BlockData b,
ATRAC9ChannelData c 
)
inlinestatic

Definition at line 350 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void read_coeffs_coarse ( ATRAC9Context s,
ATRAC9BlockData b,
ATRAC9ChannelData c,
GetBitContext gb 
)
inlinestatic

Definition at line 394 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void read_coeffs_fine ( ATRAC9Context s,
ATRAC9BlockData b,
ATRAC9ChannelData c,
GetBitContext gb 
)
inlinestatic

Definition at line 430 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void dequantize ( ATRAC9Context s,
ATRAC9BlockData b,
ATRAC9ChannelData c 
)
inlinestatic

Definition at line 448 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void apply_intensity_stereo ( ATRAC9Context s,
ATRAC9BlockData b,
const int  stereo 
)
inlinestatic

Definition at line 468 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void apply_scalefactors ( ATRAC9Context s,
ATRAC9BlockData b,
const int  stereo 
)
inlinestatic

Definition at line 489 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static void fill_with_noise ( ATRAC9Context s,
ATRAC9ChannelData c,
int  start,
int  count 
)
inlinestatic

Definition at line 505 of file atrac9dec.c.

Referenced by apply_band_extension().

static void scale_band_ext_coeffs ( ATRAC9ChannelData c,
float  sf[6],
const int  s_unit,
const int  e_unit 
)
inlinestatic

Definition at line 521 of file atrac9dec.c.

Referenced by apply_band_extension().

static void apply_band_extension ( ATRAC9Context s,
ATRAC9BlockData b,
const int  stereo 
)
inlinestatic

Definition at line 532 of file atrac9dec.c.

Referenced by atrac9_decode_block().

static int atrac9_decode_block ( ATRAC9Context s,
GetBitContext gb,
ATRAC9BlockData b,
AVFrame frame,
int  frame_idx,
int  block_idx 
)
static

Definition at line 634 of file atrac9dec.c.

Referenced by atrac9_decode_frame().

static int atrac9_decode_frame ( AVCodecContext avctx,
void data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 779 of file atrac9dec.c.

static void atrac9_decode_flush ( AVCodecContext avctx)
static

Definition at line 809 of file atrac9dec.c.

static av_cold int atrac9_decode_close ( AVCodecContext avctx)
static

Definition at line 823 of file atrac9dec.c.

static av_cold int atrac9_decode_init ( AVCodecContext avctx)
static

Definition at line 842 of file atrac9dec.c.

Variable Documentation

AVCodec ff_atrac9_decoder
Initial value:
= {
.name = "atrac9",
.long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"),
.priv_data_size = sizeof(ATRAC9Context),
}
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int atrac9_decode_init(AVCodecContext *avctx)
Definition: atrac9dec.c:842
#define AV_CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time...
Definition: avcodec.h:448
static av_cold int atrac9_decode_close(AVCodecContext *avctx)
Definition: atrac9dec.c:823
static int atrac9_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: atrac9dec.c:779
static void atrac9_decode_flush(AVCodecContext *avctx)
Definition: atrac9dec.c:809
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:405

Definition at line 964 of file atrac9dec.c.