FFmpeg
Enumerations | Functions | Variables
dca_core.c File Reference
#include "libavutil/channel_layout.h"
#include "dcaadpcm.h"
#include "dcadec.h"
#include "dcadata.h"
#include "dcahuff.h"
#include "dcamath.h"
#include "dca_syncwords.h"
#include "decode.h"

Go to the source code of this file.

Enumerations

enum  HeaderType { HEADER_CORE, HEADER_XCH, HEADER_XXCH }
 

Functions

static int dca_get_vlc (GetBitContext *s, const VLC *vlc)
 
static void get_array (GetBitContext *s, int32_t *array, int size, int n)
 
static int parse_frame_header (DCACoreDecoder *s)
 
static int parse_coding_header (DCACoreDecoder *s, enum HeaderType header, int xch_base)
 
static int parse_scale (DCACoreDecoder *s, int *scale_index, int sel)
 
static int parse_joint_scale (DCACoreDecoder *s, int sel)
 
static int parse_subframe_header (DCACoreDecoder *s, int sf, enum HeaderType header, int xch_base)
 
static int decode_blockcodes (int code1, int code2, int levels, int32_t *audio)
 
static int parse_block_codes (DCACoreDecoder *s, int32_t *audio, int abits)
 
static int parse_huffman_codes (DCACoreDecoder *s, int32_t *audio, int abits, int sel)
 
static int extract_audio (DCACoreDecoder *s, int32_t *audio, int abits, int ch)
 
static void inverse_adpcm (int32_t **subband_samples, const int16_t *vq_index, const int8_t *prediction_mode, int sb_start, int sb_end, int ofs, int len)
 
static int parse_subframe_audio (DCACoreDecoder *s, int sf, enum HeaderType header, int xch_base, int *sub_pos, int *lfe_pos)
 
static void erase_adpcm_history (DCACoreDecoder *s)
 
static int alloc_sample_buffer (DCACoreDecoder *s)
 
static int parse_frame_data (DCACoreDecoder *s, enum HeaderType header, int xch_base)
 
static int parse_xch_frame (DCACoreDecoder *s)
 
static int parse_xxch_frame (DCACoreDecoder *s)
 
static int parse_xbr_subframe (DCACoreDecoder *s, int xbr_base_ch, int xbr_nchannels, int *xbr_nsubbands, int xbr_transition_mode, int sf, int *sub_pos)
 
static int parse_xbr_frame (DCACoreDecoder *s)
 
static int rand_x96 (DCACoreDecoder *s)
 
static int parse_x96_subframe_audio (DCACoreDecoder *s, int sf, int xch_base, int *sub_pos)
 
static void erase_x96_adpcm_history (DCACoreDecoder *s)
 
static int alloc_x96_sample_buffer (DCACoreDecoder *s)
 
static int parse_x96_subframe_header (DCACoreDecoder *s, int xch_base)
 
static int parse_x96_coding_header (DCACoreDecoder *s, int exss, int xch_base)
 
static int parse_x96_frame_data (DCACoreDecoder *s, int exss, int xch_base)
 
static int parse_x96_frame (DCACoreDecoder *s)
 
static int parse_x96_frame_exss (DCACoreDecoder *s)
 
static int parse_aux_data (DCACoreDecoder *s)
 
static int parse_optional_info (DCACoreDecoder *s)
 
int ff_dca_core_parse (DCACoreDecoder *s, const uint8_t *data, int size)
 
int ff_dca_core_parse_exss (DCACoreDecoder *s, const uint8_t *data, DCAExssAsset *asset)
 
static int map_prm_ch_to_spkr (DCACoreDecoder *s, int ch)
 
static void erase_dsp_history (DCACoreDecoder *s)
 
static void set_filter_mode (DCACoreDecoder *s, int mode)
 
int ff_dca_core_filter_fixed (DCACoreDecoder *s, int x96_synth)
 
static int filter_frame_fixed (DCACoreDecoder *s, AVFrame *frame)
 
static int filter_frame_float (DCACoreDecoder *s, AVFrame *frame)
 
int ff_dca_core_filter_frame (DCACoreDecoder *s, AVFrame *frame)
 
av_cold void ff_dca_core_flush (DCACoreDecoder *s)
 
av_cold int ff_dca_core_init (DCACoreDecoder *s)
 
av_cold void ff_dca_core_close (DCACoreDecoder *s)
 

Variables

static const int8_t prm_ch_to_spkr_map [DCA_AMODE_COUNT][5]
 
static const uint8_t audio_mode_ch_mask [DCA_AMODE_COUNT]
 
static const uint8_t block_code_nbits [7]
 

Enumeration Type Documentation

◆ HeaderType

enum HeaderType
Enumerator
HEADER_CORE 
HEADER_XCH 
HEADER_XXCH 

Definition at line 34 of file dca_core.c.

Function Documentation

◆ dca_get_vlc()

static int dca_get_vlc ( GetBitContext s,
const VLC vlc 
)
static

◆ get_array()

static void get_array ( GetBitContext s,
int32_t array,
int  size,
int  n 
)
static

Definition at line 75 of file dca_core.c.

Referenced by extract_audio(), parse_subframe_audio(), and parse_xbr_subframe().

◆ parse_frame_header()

static int parse_frame_header ( DCACoreDecoder s)
static

Definition at line 84 of file dca_core.c.

Referenced by ff_dca_core_parse().

◆ parse_coding_header()

static int parse_coding_header ( DCACoreDecoder s,
enum HeaderType  header,
int  xch_base 
)
static

Definition at line 153 of file dca_core.c.

Referenced by parse_frame_data().

◆ parse_scale()

static int parse_scale ( DCACoreDecoder s,
int scale_index,
int  sel 
)
inlinestatic

Definition at line 349 of file dca_core.c.

Referenced by parse_subframe_header(), and parse_x96_subframe_header().

◆ parse_joint_scale()

static int parse_joint_scale ( DCACoreDecoder s,
int  sel 
)
inlinestatic

Definition at line 379 of file dca_core.c.

Referenced by parse_subframe_header(), and parse_x96_subframe_header().

◆ parse_subframe_header()

static int parse_subframe_header ( DCACoreDecoder s,
int  sf,
enum HeaderType  header,
int  xch_base 
)
static

Definition at line 403 of file dca_core.c.

Referenced by parse_frame_data().

◆ decode_blockcodes()

static int decode_blockcodes ( int  code1,
int  code2,
int  levels,
int32_t audio 
)
inlinestatic

Definition at line 531 of file dca_core.c.

Referenced by parse_block_codes().

◆ parse_block_codes()

static int parse_block_codes ( DCACoreDecoder s,
int32_t audio,
int  abits 
)
inlinestatic

Definition at line 551 of file dca_core.c.

Referenced by extract_audio(), and parse_xbr_subframe().

◆ parse_huffman_codes()

static int parse_huffman_codes ( DCACoreDecoder s,
int32_t audio,
int  abits,
int  sel 
)
inlinestatic

Definition at line 567 of file dca_core.c.

Referenced by extract_audio().

◆ extract_audio()

static int extract_audio ( DCACoreDecoder s,
int32_t audio,
int  abits,
int  ch 
)
inlinestatic

Definition at line 578 of file dca_core.c.

Referenced by parse_subframe_audio(), and parse_x96_subframe_audio().

◆ inverse_adpcm()

static void inverse_adpcm ( int32_t **  subband_samples,
const int16_t *  vq_index,
const int8_t *  prediction_mode,
int  sb_start,
int  sb_end,
int  ofs,
int  len 
)
inlinestatic

Definition at line 605 of file dca_core.c.

Referenced by parse_subframe_audio(), and parse_x96_subframe_audio().

◆ parse_subframe_audio()

static int parse_subframe_audio ( DCACoreDecoder s,
int  sf,
enum HeaderType  header,
int  xch_base,
int sub_pos,
int lfe_pos 
)
static

Definition at line 626 of file dca_core.c.

Referenced by parse_frame_data().

◆ erase_adpcm_history()

static void erase_adpcm_history ( DCACoreDecoder s)
static

Definition at line 763 of file dca_core.c.

Referenced by alloc_sample_buffer(), and ff_dca_core_flush().

◆ alloc_sample_buffer()

static int alloc_sample_buffer ( DCACoreDecoder s)
static

Definition at line 778 of file dca_core.c.

Referenced by ff_dca_core_parse().

◆ parse_frame_data()

static int parse_frame_data ( DCACoreDecoder s,
enum HeaderType  header,
int  xch_base 
)
static

Definition at line 806 of file dca_core.c.

Referenced by ff_dca_core_parse(), parse_xch_frame(), and parse_xxch_frame().

◆ parse_xch_frame()

static int parse_xch_frame ( DCACoreDecoder s)
static

Definition at line 846 of file dca_core.c.

Referenced by ff_dca_core_parse_exss().

◆ parse_xxch_frame()

static int parse_xxch_frame ( DCACoreDecoder s)
static

Definition at line 867 of file dca_core.c.

Referenced by ff_dca_core_parse_exss().

◆ parse_xbr_subframe()

static int parse_xbr_subframe ( DCACoreDecoder s,
int  xbr_base_ch,
int  xbr_nchannels,
int xbr_nsubbands,
int  xbr_transition_mode,
int  sf,
int sub_pos 
)
static

Definition at line 944 of file dca_core.c.

Referenced by parse_xbr_frame().

◆ parse_xbr_frame()

static int parse_xbr_frame ( DCACoreDecoder s)
static

Definition at line 1079 of file dca_core.c.

Referenced by ff_dca_core_parse_exss().

◆ rand_x96()

static int rand_x96 ( DCACoreDecoder s)
static

Definition at line 1162 of file dca_core.c.

Referenced by parse_x96_subframe_audio().

◆ parse_x96_subframe_audio()

static int parse_x96_subframe_audio ( DCACoreDecoder s,
int  sf,
int  xch_base,
int sub_pos 
)
static

Definition at line 1168 of file dca_core.c.

Referenced by parse_x96_frame_data().

◆ erase_x96_adpcm_history()

static void erase_x96_adpcm_history ( DCACoreDecoder s)
static

Definition at line 1276 of file dca_core.c.

Referenced by alloc_x96_sample_buffer(), and ff_dca_core_flush().

◆ alloc_x96_sample_buffer()

static int alloc_x96_sample_buffer ( DCACoreDecoder s)
static

Definition at line 1291 of file dca_core.c.

Referenced by parse_x96_frame(), and parse_x96_frame_exss().

◆ parse_x96_subframe_header()

static int parse_x96_subframe_header ( DCACoreDecoder s,
int  xch_base 
)
static

Definition at line 1317 of file dca_core.c.

Referenced by parse_x96_frame_data().

◆ parse_x96_coding_header()

static int parse_x96_coding_header ( DCACoreDecoder s,
int  exss,
int  xch_base 
)
static

Definition at line 1401 of file dca_core.c.

Referenced by parse_x96_frame_data().

◆ parse_x96_frame_data()

static int parse_x96_frame_data ( DCACoreDecoder s,
int  exss,
int  xch_base 
)
static

Definition at line 1488 of file dca_core.c.

Referenced by parse_x96_frame(), and parse_x96_frame_exss().

◆ parse_x96_frame()

static int parse_x96_frame ( DCACoreDecoder s)
static

Definition at line 1525 of file dca_core.c.

Referenced by ff_dca_core_parse_exss().

◆ parse_x96_frame_exss()

static int parse_x96_frame_exss ( DCACoreDecoder s)
static

Definition at line 1554 of file dca_core.c.

Referenced by ff_dca_core_parse_exss().

◆ parse_aux_data()

static int parse_aux_data ( DCACoreDecoder s)
static

Definition at line 1630 of file dca_core.c.

Referenced by parse_optional_info().

◆ parse_optional_info()

static int parse_optional_info ( DCACoreDecoder s)
static

Definition at line 1698 of file dca_core.c.

Referenced by ff_dca_core_parse().

◆ ff_dca_core_parse()

int ff_dca_core_parse ( DCACoreDecoder s,
const uint8_t *  data,
int  size 
)

Definition at line 1811 of file dca_core.c.

Referenced by dcadec_decode_frame().

◆ ff_dca_core_parse_exss()

int ff_dca_core_parse_exss ( DCACoreDecoder s,
const uint8_t *  data,
DCAExssAsset asset 
)

Definition at line 1844 of file dca_core.c.

Referenced by dcadec_decode_frame().

◆ map_prm_ch_to_spkr()

static int map_prm_ch_to_spkr ( DCACoreDecoder s,
int  ch 
)
static

Definition at line 1921 of file dca_core.c.

Referenced by ff_dca_core_filter_fixed(), filter_frame_fixed(), and filter_frame_float().

◆ erase_dsp_history()

static void erase_dsp_history ( DCACoreDecoder s)
static

Definition at line 1957 of file dca_core.c.

Referenced by ff_dca_core_flush(), and set_filter_mode().

◆ set_filter_mode()

static void set_filter_mode ( DCACoreDecoder s,
int  mode 
)
static

Definition at line 1964 of file dca_core.c.

Referenced by ff_dca_core_filter_fixed(), and filter_frame_float().

◆ ff_dca_core_filter_fixed()

int ff_dca_core_filter_fixed ( DCACoreDecoder s,
int  x96_synth 
)

Definition at line 1972 of file dca_core.c.

Referenced by dcadec_decode_frame(), and filter_frame_fixed().

◆ filter_frame_fixed()

static int filter_frame_fixed ( DCACoreDecoder s,
AVFrame frame 
)
static

Definition at line 2076 of file dca_core.c.

Referenced by ff_dca_core_filter_frame().

◆ filter_frame_float()

static int filter_frame_float ( DCACoreDecoder s,
AVFrame frame 
)
static

Definition at line 2173 of file dca_core.c.

Referenced by ff_dca_core_filter_frame().

◆ ff_dca_core_filter_frame()

int ff_dca_core_filter_frame ( DCACoreDecoder s,
AVFrame frame 
)

Definition at line 2359 of file dca_core.c.

Referenced by dcadec_decode_frame().

◆ ff_dca_core_flush()

av_cold void ff_dca_core_flush ( DCACoreDecoder s)

Definition at line 2413 of file dca_core.c.

Referenced by dcadec_flush().

◆ ff_dca_core_init()

av_cold int ff_dca_core_init ( DCACoreDecoder s)

Definition at line 2426 of file dca_core.c.

Referenced by dcadec_init().

◆ ff_dca_core_close()

av_cold void ff_dca_core_close ( DCACoreDecoder s)

Definition at line 2452 of file dca_core.c.

Referenced by dcadec_close().

Variable Documentation

◆ prm_ch_to_spkr_map

const int8_t prm_ch_to_spkr_map[DCA_AMODE_COUNT][5]
static

◆ audio_mode_ch_mask

const uint8_t audio_mode_ch_mask[DCA_AMODE_COUNT]
static

◆ block_code_nbits

const uint8_t block_code_nbits[7]
static
Initial value:
= {
7, 10, 12, 13, 15, 17, 19
}

Definition at line 66 of file dca_core.c.

Referenced by parse_block_codes().

DCA_SPEAKER_C
@ DCA_SPEAKER_C
Definition: dca.h:78
DCA_SPEAKER_LAYOUT_5POINT0
#define DCA_SPEAKER_LAYOUT_5POINT0
Definition: dca.h:128
DCA_SPEAKER_LAYOUT_STEREO
#define DCA_SPEAKER_LAYOUT_STEREO
Definition: dca.h:122
DCA_SPEAKER_Cs
@ DCA_SPEAKER_Cs
Definition: dca.h:79
DCA_SPEAKER_Ls
@ DCA_SPEAKER_Ls
Definition: dca.h:78
DCA_SPEAKER_LAYOUT_3_0
#define DCA_SPEAKER_LAYOUT_3_0
Definition: dca.h:124
DCA_SPEAKER_Rs
@ DCA_SPEAKER_Rs
Definition: dca.h:79
DCA_SPEAKER_LAYOUT_2_2
#define DCA_SPEAKER_LAYOUT_2_2
Definition: dca.h:127
DCA_SPEAKER_LAYOUT_MONO
#define DCA_SPEAKER_LAYOUT_MONO
Definition: dca.h:121
DCA_SPEAKER_R
@ DCA_SPEAKER_R
Definition: dca.h:78
DCA_SPEAKER_LAYOUT_3_1
#define DCA_SPEAKER_LAYOUT_3_1
Definition: dca.h:126
DCA_SPEAKER_LAYOUT_2_1
#define DCA_SPEAKER_LAYOUT_2_1
Definition: dca.h:125
DCA_SPEAKER_L
@ DCA_SPEAKER_L
Definition: dca.h:78