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

◆ parse_gradient()

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

Definition at line 101 of file atrac9dec.c.

Referenced by atrac9_decode_block().

◆ calc_precision()

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

Definition at line 145 of file atrac9dec.c.

Referenced by atrac9_decode_block().

◆ parse_band_ext()

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().

◆ read_scalefactors()

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().

◆ calc_codebook_idx()

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().

◆ read_coeffs_coarse()

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().

◆ read_coeffs_fine()

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().

◆ dequantize()

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

Definition at line 448 of file atrac9dec.c.

Referenced by atrac9_decode_block().

◆ apply_intensity_stereo()

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().

◆ apply_scalefactors()

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().

◆ fill_with_noise()

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().

◆ scale_band_ext_coeffs()

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().

◆ 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().

◆ 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().

◆ 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.

◆ atrac9_decode_flush()

static void atrac9_decode_flush ( AVCodecContext avctx)
static

Definition at line 809 of file atrac9dec.c.

◆ atrac9_decode_close()

static av_cold int atrac9_decode_close ( AVCodecContext avctx)
static

Definition at line 823 of file atrac9dec.c.

◆ atrac9_decode_init()

static av_cold int atrac9_decode_init ( AVCodecContext avctx)
static

Definition at line 842 of file atrac9dec.c.

Variable Documentation

◆ ff_atrac9_decoder

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),
}

Definition at line 964 of file atrac9dec.c.

atrac9_decode_close
static av_cold int atrac9_decode_close(AVCodecContext *avctx)
Definition: atrac9dec.c:823
FF_CODEC_CAP_INIT_THREADSAFE
#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
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
ATRAC9Context
Definition: atrac9dec.c:78
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_ID_ATRAC9
@ AV_CODEC_ID_ATRAC9
Definition: codec_id.h:499
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:500
atrac9_decode_init
static av_cold int atrac9_decode_init(AVCodecContext *avctx)
Definition: atrac9dec.c:842
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:50
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
atrac9_decode_frame
static int atrac9_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: atrac9dec.c:779
FF_CODEC_CAP_INIT_CLEANUP
#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
atrac9_decode_flush
static void atrac9_decode_flush(AVCodecContext *avctx)
Definition: atrac9dec.c:809
AV_CODEC_CAP_SUBFRAMES
#define AV_CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time,...
Definition: codec.h:93