dcadec.c File Reference
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/float_dsp.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/samplefmt.h"
#include "avcodec.h"
#include "fft.h"
#include "get_bits.h"
#include "put_bits.h"
#include "dcadata.h"
#include "dcahuff.h"
#include "dca.h"
#include "mathops.h"
#include "synth_filter.h"
#include "dcadsp.h"
#include "fmtconvert.h"
#include "internal.h"
Include dependency graph for dcadec.c:

Go to the source code of this file.

Data Structures

struct  BitAlloc
 Bit allocation. More...
 
struct  DCAContext
 

Macros

#define DCA_PRIM_CHANNELS_MAX   (7)
 
#define DCA_SUBBANDS   (64)
 
#define DCA_ABITS_MAX   (32) /* Should be 28 */
 
#define DCA_SUBSUBFRAMES_MAX   (4)
 
#define DCA_SUBFRAMES_MAX   (16)
 
#define DCA_BLOCKS_MAX   (16)
 
#define DCA_LFE_MAX   (3)
 
#define DCA_CHSETS_MAX   (4)
 
#define DCA_CHSET_CHANS_MAX   (8)
 
#define DCA_CORE_EXTS   (DCA_EXT_XCH | DCA_EXT_XXCH | DCA_EXT_X96)
 
#define DCA_DOLBY   101 /* FIXME */
 
#define DCA_CHANNEL_BITS   6
 
#define DCA_CHANNEL_MASK   0x3F
 
#define DCA_LFE   0x80
 
#define HEADER_SIZE   14
 
#define DCA_MAX_FRAME_SIZE   16384
 
#define DCA_MAX_EXSS_HEADER_SIZE   4096
 
#define DCA_BUFFER_PADDING_SIZE   1024
 
#define MIX_REAR1(samples, s1, rs, coef)
 
#define MIX_REAR2(samples, s1, s2, rs, coef)
 
#define MIX_FRONT3(samples, coef)
 
#define DOWNMIX_TO_STEREO(op1, op2)
 

Enumerations

enum  DCAMode {
  DCA_MONO = 0, DCA_CHANNEL, DCA_STEREO, DCA_STEREO_SUMDIFF,
  DCA_STEREO_TOTAL, DCA_3F, DCA_2F1R, DCA_3F1R,
  DCA_2F2R, DCA_3F2R, DCA_4F2R
}
 
enum  DCAExSSSpeakerMask {
  DCA_EXSS_FRONT_CENTER = 0x0001, DCA_EXSS_FRONT_LEFT_RIGHT = 0x0002, DCA_EXSS_SIDE_REAR_LEFT_RIGHT = 0x0004, DCA_EXSS_LFE = 0x0008,
  DCA_EXSS_REAR_CENTER = 0x0010, DCA_EXSS_FRONT_HIGH_LEFT_RIGHT = 0x0020, DCA_EXSS_REAR_LEFT_RIGHT = 0x0040, DCA_EXSS_FRONT_HIGH_CENTER = 0x0080,
  DCA_EXSS_OVERHEAD = 0x0100, DCA_EXSS_CENTER_LEFT_RIGHT = 0x0200, DCA_EXSS_WIDE_LEFT_RIGHT = 0x0400, DCA_EXSS_SIDE_LEFT_RIGHT = 0x0800,
  DCA_EXSS_LFE2 = 0x1000, DCA_EXSS_SIDE_HIGH_LEFT_RIGHT = 0x2000, DCA_EXSS_REAR_HIGH_CENTER = 0x4000, DCA_EXSS_REAR_HIGH_LEFT_RIGHT = 0x8000
}
 
enum  DCAXxchSpeakerMask {
  DCA_XXCH_FRONT_CENTER = 0x0000001, DCA_XXCH_FRONT_LEFT = 0x0000002, DCA_XXCH_FRONT_RIGHT = 0x0000004, DCA_XXCH_SIDE_REAR_LEFT = 0x0000008,
  DCA_XXCH_SIDE_REAR_RIGHT = 0x0000010, DCA_XXCH_LFE1 = 0x0000020, DCA_XXCH_REAR_CENTER = 0x0000040, DCA_XXCH_SURROUND_REAR_LEFT = 0x0000080,
  DCA_XXCH_SURROUND_REAR_RIGHT = 0x0000100, DCA_XXCH_SIDE_SURROUND_LEFT = 0x0000200, DCA_XXCH_SIDE_SURROUND_RIGHT = 0x0000400, DCA_XXCH_FRONT_CENTER_LEFT = 0x0000800,
  DCA_XXCH_FRONT_CENTER_RIGHT = 0x0001000, DCA_XXCH_FRONT_HIGH_LEFT = 0x0002000, DCA_XXCH_FRONT_HIGH_CENTER = 0x0004000, DCA_XXCH_FRONT_HIGH_RIGHT = 0x0008000,
  DCA_XXCH_LFE2 = 0x0010000, DCA_XXCH_SIDE_FRONT_LEFT = 0x0020000, DCA_XXCH_SIDE_FRONT_RIGHT = 0x0040000, DCA_XXCH_OVERHEAD = 0x0080000,
  DCA_XXCH_SIDE_HIGH_LEFT = 0x0100000, DCA_XXCH_SIDE_HIGH_RIGHT = 0x0200000, DCA_XXCH_REAR_HIGH_CENTER = 0x0400000, DCA_XXCH_REAR_HIGH_LEFT = 0x0800000,
  DCA_XXCH_REAR_HIGH_RIGHT = 0x1000000, DCA_XXCH_REAR_LOW_CENTER = 0x2000000, DCA_XXCH_REAR_LOW_LEFT = 0x4000000, DCA_XXCH_REAR_LOW_RIGHT = 0x8000000
}
 
enum  DCAExtensionMask {
  DCA_EXT_CORE = 0x001, DCA_EXT_XXCH = 0x002, DCA_EXT_X96 = 0x004, DCA_EXT_XCH = 0x008,
  DCA_EXT_EXSS_CORE = 0x010, DCA_EXT_EXSS_XBR = 0x020, DCA_EXT_EXSS_XXCH = 0x040, DCA_EXT_EXSS_X96 = 0x080,
  DCA_EXT_EXSS_LBR = 0x100, DCA_EXT_EXSS_XLL = 0x200
}
 

Functions

static av_always_inline int get_bitalloc (GetBitContext *gb, BitAlloc *ba, int idx)
 
static av_cold void dca_init_vlcs (void)
 
static void get_array (GetBitContext *gb, int *dst, int len, int bits)
 
static int dca_xxch2index (DCAContext *s, int xxch_ch)
 
static int dca_parse_audio_coding_header (DCAContext *s, int base_channel, int xxch)
 
static int dca_parse_frame_header (DCAContext *s)
 
static int get_scale (GetBitContext *gb, int level, int value, int log2range)
 
static int dca_subframe_header (DCAContext *s, int base_channel, int block_index)
 
static void qmf_32_subbands (DCAContext *s, int chans, float samples_in[32][8], float *samples_out, float scale)
 
static void lfe_interpolation_fir (DCAContext *s, int decimation_select, int num_deci_sample, float *samples_in, float *samples_out, float scale)
 
static void dca_downmix (float **samples, int srcfmt, int downmix_coef[DCA_PRIM_CHANNELS_MAX][2], const int8_t *channel_mapping)
 
static int decode_blockcode (int code, int levels, int *values)
 
static int decode_blockcodes (int code1, int code2, int levels, int *values)
 
static void int8x8_fmul_int32 (float *dst, const int8_t *src, int scale)
 
static int dca_subsubframe (DCAContext *s, int base_channel, int block_index)
 
static int dca_filter_channels (DCAContext *s, int block_index)
 
static int dca_subframe_footer (DCAContext *s, int base_channel)
 
static int dca_decode_block (DCAContext *s, int base_channel, int block_index)
 Decode a dca frame block. More...
 
static int dca_exss_mask2count (int mask)
 Return the number of channels in an ExSS speaker mask (HD) More...
 
static void dca_exss_skip_mix_coeffs (GetBitContext *gb, int channels, int out_ch)
 Skip mixing coefficients of a single mix out configuration (HD) More...
 
static int dca_exss_parse_asset_header (DCAContext *s)
 Parse extension substream asset header (HD) More...
 
static int dca_xbr_parse_frame (DCAContext *s)
 
static int dca_xxch_decode_frame (DCAContext *s)
 
static void dca_exss_parse_header (DCAContext *s)
 Parse extension substream header (HD) More...
 
static int dca_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 Main frame decoding function FIXME add arguments. More...
 
static av_cold int dca_decode_init (AVCodecContext *avctx)
 DCA initialization. More...
 
static av_cold int dca_decode_end (AVCodecContext *avctx)
 

Variables

static const uint32_t map_xxch_to_native [28]
 
static const int dca_ext_audio_descr_mask []
 
static const uint64_t dca_core_channel_layout []
 
static const int8_t dca_lfe_index []
 
static const int8_t dca_channel_reorder_lfe [][9]
 
static const int8_t dca_channel_reorder_lfe_xch [][9]
 
static const int8_t dca_channel_reorder_nolfe [][9]
 
static const int8_t dca_channel_reorder_nolfe_xch [][9]
 
static BitAlloc dca_bitalloc_index
 indexes for samples VLC select More...
 
static BitAlloc dca_tmode
 transition mode VLCs More...
 
static BitAlloc dca_scalefactor
 scalefactor VLCs More...
 
static BitAlloc dca_smpl_bitalloc [11]
 samples VLCs More...
 
static const uint16_t dca_vlc_offs []
 
static const uint8_t abits_sizes [7] = { 7, 10, 12, 13, 15, 17, 19 }
 
static const uint8_t abits_levels [7] = { 3, 5, 7, 9, 13, 17, 25 }
 
static const AVProfile profiles []
 
AVCodec ff_dca_decoder
 

Macro Definition Documentation

#define DCA_ABITS_MAX   (32) /* Should be 28 */

Definition at line 57 of file dcadec.c.

#define DCA_BLOCKS_MAX   (16)

Definition at line 60 of file dcadec.c.

#define DCA_BUFFER_PADDING_SIZE   1024

Definition at line 327 of file dcadec.c.

#define DCA_CHANNEL_BITS   6

Definition at line 317 of file dcadec.c.

#define DCA_CHANNEL_MASK   0x3F

Definition at line 318 of file dcadec.c.

Referenced by dca_subframe_header().

#define DCA_CHSET_CHANS_MAX   (8)

Definition at line 63 of file dcadec.c.

Referenced by dca_xbr_parse_frame().

#define DCA_CHSETS_MAX   (4)

Definition at line 62 of file dcadec.c.

Referenced by dca_xbr_parse_frame().

#define DCA_CORE_EXTS   (DCA_EXT_XCH | DCA_EXT_XXCH | DCA_EXT_X96)

Definition at line 187 of file dcadec.c.

Referenced by dca_exss_parse_asset_header().

#define DCA_DOLBY   101 /* FIXME */

Definition at line 315 of file dcadec.c.

#define DCA_LFE   0x80

Definition at line 320 of file dcadec.c.

Referenced by dca_filter_channels(), and dca_parse_frame_header().

#define DCA_LFE_MAX   (3)

Definition at line 61 of file dcadec.c.

#define DCA_MAX_EXSS_HEADER_SIZE   4096

Definition at line 325 of file dcadec.c.

Referenced by dca_decode_frame().

#define DCA_MAX_FRAME_SIZE   16384

Definition at line 324 of file dcadec.c.

Referenced by dca_decode_frame().

#define DCA_PRIM_CHANNELS_MAX   (7)

Definition at line 55 of file dcadec.c.

Referenced by dca_downmix(), and dca_parse_audio_coding_header().

#define DCA_SUBBANDS   (64)
#define DCA_SUBFRAMES_MAX   (16)

Definition at line 59 of file dcadec.c.

#define DCA_SUBSUBFRAMES_MAX   (4)

Definition at line 58 of file dcadec.c.

#define DOWNMIX_TO_STEREO (   op1,
  op2 
)
Value:
for (i = 0; i < 256; i++) { \
op1 \
op2 \
}
synthesis window for stochastic i

Definition at line 1192 of file dcadec.c.

Referenced by dca_downmix().

#define HEADER_SIZE   14

Definition at line 322 of file dcadec.c.

#define MIX_FRONT3 (   samples,
  coef 
)
Value:
t = samples[c][i]; \
u = samples[l][i]; \
v = samples[r][i]; \
samples[0][i] = t * coef[0][0] + u * coef[1][0] + v * coef[2][0]; \
samples[1][i] = t * coef[0][1] + u * coef[1][1] + v * coef[2][1];
float v
const char * r
Definition: vf_curves.c:94
t
Definition: genspecsines3.m:6
float u
synthesis window for stochastic i
static double c[64]
Filter the word “frame” indicates either a video frame or a group of audio samples

Definition at line 1185 of file dcadec.c.

Referenced by dca_downmix().

#define MIX_REAR1 (   samples,
  s1,
  rs,
  coef 
)
Value:
samples[0][i] += samples[s1][i] * coef[rs][0]; \
samples[1][i] += samples[s1][i] * coef[rs][1];
synthesis window for stochastic i
#define s1
Definition: regdef.h:38
Filter the word “frame” indicates either a video frame or a group of audio samples

Definition at line 1177 of file dcadec.c.

Referenced by dca_downmix().

#define MIX_REAR2 (   samples,
  s1,
  s2,
  rs,
  coef 
)
Value:
samples[0][i] += samples[s1][i] * coef[rs][0] + samples[s2][i] * coef[rs + 1][0]; \
samples[1][i] += samples[s1][i] * coef[rs][1] + samples[s2][i] * coef[rs + 1][1];
#define s2
Definition: regdef.h:39
synthesis window for stochastic i
#define s1
Definition: regdef.h:38
Filter the word “frame” indicates either a video frame or a group of audio samples

Definition at line 1181 of file dcadec.c.

Referenced by dca_downmix().

Enumeration Type Documentation

Enumerator
DCA_EXSS_FRONT_CENTER 
DCA_EXSS_FRONT_LEFT_RIGHT 
DCA_EXSS_SIDE_REAR_LEFT_RIGHT 
DCA_EXSS_LFE 
DCA_EXSS_REAR_CENTER 
DCA_EXSS_FRONT_HIGH_LEFT_RIGHT 
DCA_EXSS_REAR_LEFT_RIGHT 
DCA_EXSS_FRONT_HIGH_CENTER 
DCA_EXSS_OVERHEAD 
DCA_EXSS_CENTER_LEFT_RIGHT 
DCA_EXSS_WIDE_LEFT_RIGHT 
DCA_EXSS_SIDE_LEFT_RIGHT 
DCA_EXSS_LFE2 
DCA_EXSS_SIDE_HIGH_LEFT_RIGHT 
DCA_EXSS_REAR_HIGH_CENTER 
DCA_EXSS_REAR_HIGH_LEFT_RIGHT 

Definition at line 80 of file dcadec.c.

Enumerator
DCA_EXT_CORE 

core in core substream

DCA_EXT_XXCH 

XXCh channels extension in core substream.

DCA_EXT_X96 

96/24 extension in core substream

DCA_EXT_XCH 

XCh channel extension in core substream.

DCA_EXT_EXSS_CORE 

core in ExSS (extension substream)

DCA_EXT_EXSS_XBR 

extended bitrate extension in ExSS

DCA_EXT_EXSS_XXCH 

XXCh channels extension in ExSS.

DCA_EXT_EXSS_X96 

96/24 extension in ExSS

DCA_EXT_EXSS_LBR 

low bitrate component in ExSS

DCA_EXT_EXSS_XLL 

lossless extension in ExSS

Definition at line 161 of file dcadec.c.

enum DCAMode
Enumerator
DCA_MONO 
DCA_CHANNEL 
DCA_STEREO 
DCA_STEREO_SUMDIFF 
DCA_STEREO_TOTAL 
DCA_3F 
DCA_2F1R 
DCA_3F1R 
DCA_2F2R 
DCA_3F2R 
DCA_4F2R 

Definition at line 65 of file dcadec.c.

Enumerator
DCA_XXCH_FRONT_CENTER 
DCA_XXCH_FRONT_LEFT 
DCA_XXCH_FRONT_RIGHT 
DCA_XXCH_SIDE_REAR_LEFT 
DCA_XXCH_SIDE_REAR_RIGHT 
DCA_XXCH_LFE1 
DCA_XXCH_REAR_CENTER 
DCA_XXCH_SURROUND_REAR_LEFT 
DCA_XXCH_SURROUND_REAR_RIGHT 
DCA_XXCH_SIDE_SURROUND_LEFT 
DCA_XXCH_SIDE_SURROUND_RIGHT 
DCA_XXCH_FRONT_CENTER_LEFT 
DCA_XXCH_FRONT_CENTER_RIGHT 
DCA_XXCH_FRONT_HIGH_LEFT 
DCA_XXCH_FRONT_HIGH_CENTER 
DCA_XXCH_FRONT_HIGH_RIGHT 
DCA_XXCH_LFE2 
DCA_XXCH_SIDE_FRONT_LEFT 
DCA_XXCH_SIDE_FRONT_RIGHT 
DCA_XXCH_OVERHEAD 
DCA_XXCH_SIDE_HIGH_LEFT 
DCA_XXCH_SIDE_HIGH_RIGHT 
DCA_XXCH_REAR_HIGH_CENTER 
DCA_XXCH_REAR_HIGH_LEFT 
DCA_XXCH_REAR_HIGH_RIGHT 
DCA_XXCH_REAR_LOW_CENTER 
DCA_XXCH_REAR_LOW_LEFT 
DCA_XXCH_REAR_LOW_RIGHT 

Definition at line 99 of file dcadec.c.

Function Documentation

static int dca_decode_block ( DCAContext s,
int  base_channel,
int  block_index 
)
static

Decode a dca frame block.

Parameters
spointer to the DCAContext

Definition at line 1504 of file dcadec.c.

Referenced by dca_decode_frame(), and dca_xxch_decode_frame().

static av_cold int dca_decode_end ( AVCodecContext avctx)
static

Definition at line 2494 of file dcadec.c.

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

Main frame decoding function FIXME add arguments.

Definition at line 2066 of file dcadec.c.

static av_cold int dca_decode_init ( AVCodecContext avctx)
static

DCA initialization.

Parameters
avctxpointer to the AVCodecContext

Definition at line 2470 of file dcadec.c.

static void dca_downmix ( float **  samples,
int  srcfmt,
int  downmix_coef[DCA_PRIM_CHANNELS_MAX][2],
const int8_t *  channel_mapping 
)
static

Definition at line 1198 of file dcadec.c.

Referenced by dca_filter_channels().

static int dca_exss_mask2count ( int  mask)
static

Return the number of channels in an ExSS speaker mask (HD)

Definition at line 1552 of file dcadec.c.

Referenced by dca_exss_parse_asset_header(), and dca_exss_parse_header().

static int dca_exss_parse_asset_header ( DCAContext s)
static

Parse extension substream asset header (HD)

Definition at line 1584 of file dcadec.c.

Referenced by dca_exss_parse_header().

static void dca_exss_parse_header ( DCAContext s)
static

Parse extension substream header (HD)

Definition at line 1949 of file dcadec.c.

Referenced by dca_decode_frame().

static void dca_exss_skip_mix_coeffs ( GetBitContext gb,
int  channels,
int  out_ch 
)
static

Skip mixing coefficients of a single mix out configuration (HD)

Definition at line 1570 of file dcadec.c.

Referenced by dca_exss_parse_asset_header().

static int dca_filter_channels ( DCAContext s,
int  block_index 
)
static

Definition at line 1439 of file dcadec.c.

Referenced by dca_decode_frame().

static av_cold void dca_init_vlcs ( void  )
static

Definition at line 481 of file dcadec.c.

Referenced by dca_decode_init().

static int dca_parse_audio_coding_header ( DCAContext s,
int  base_channel,
int  xxch 
)
static

Definition at line 554 of file dcadec.c.

Referenced by dca_decode_frame(), dca_parse_frame_header(), and dca_xxch_decode_frame().

static int dca_parse_frame_header ( DCAContext s)
static

Definition at line 704 of file dcadec.c.

Referenced by dca_decode_frame().

static int dca_subframe_footer ( DCAContext s,
int  base_channel 
)
static

Definition at line 1472 of file dcadec.c.

Referenced by dca_decode_block().

static int dca_subframe_header ( DCAContext s,
int  base_channel,
int  block_index 
)
static

Definition at line 824 of file dcadec.c.

Referenced by dca_decode_block().

static int dca_subsubframe ( DCAContext s,
int  base_channel,
int  block_index 
)
static

Definition at line 1295 of file dcadec.c.

Referenced by dca_decode_block().

static int dca_xbr_parse_frame ( DCAContext s)
static

Definition at line 1732 of file dcadec.c.

Referenced by dca_exss_parse_header().

static int dca_xxch2index ( DCAContext s,
int  xxch_ch 
)
inlinestatic

Definition at line 542 of file dcadec.c.

Referenced by dca_parse_audio_coding_header().

static int dca_xxch_decode_frame ( DCAContext s)
static

Definition at line 1893 of file dcadec.c.

Referenced by dca_decode_frame(), and dca_exss_parse_header().

static int decode_blockcode ( int  code,
int  levels,
int *  values 
)
static

Definition at line 1261 of file dcadec.c.

Referenced by decode_blockcodes().

static int decode_blockcodes ( int  code1,
int  code2,
int  levels,
int *  values 
)
static

Definition at line 1275 of file dcadec.c.

Referenced by dca_subsubframe(), and dca_xbr_parse_frame().

static void get_array ( GetBitContext gb,
int *  dst,
int  len,
int  bits 
)
inlinestatic

Definition at line 536 of file dcadec.c.

Referenced by dca_parse_audio_coding_header(), and dca_xbr_parse_frame().

static av_always_inline int get_bitalloc ( GetBitContext gb,
BitAlloc ba,
int  idx 
)
static

Definition at line 342 of file dcadec.c.

Referenced by dca_subframe_header(), dca_subsubframe(), and get_scale().

static int get_scale ( GetBitContext gb,
int  level,
int  value,
int  log2range 
)
inlinestatic

Definition at line 807 of file dcadec.c.

Referenced by dca_subframe_header().

static void int8x8_fmul_int32 ( float *  dst,
const int8_t *  src,
int  scale 
)
inlinestatic

Definition at line 1286 of file dcadec.c.

Referenced by dca_subsubframe().

static void lfe_interpolation_fir ( DCAContext s,
int  decimation_select,
int  num_deci_sample,
float *  samples_in,
float *  samples_out,
float  scale 
)
static

Definition at line 1144 of file dcadec.c.

Referenced by dca_filter_channels().

static void qmf_32_subbands ( DCAContext s,
int  chans,
float  samples_in[32][8],
float *  samples_out,
float  scale 
)
static

Definition at line 1105 of file dcadec.c.

Referenced by dca_filter_channels().

Variable Documentation

const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 }
static

Definition at line 1283 of file dcadec.c.

Referenced by dca_subsubframe(), and dca_xbr_parse_frame().

const uint8_t abits_sizes[7] = { 7, 10, 12, 13, 15, 17, 19 }
static

Definition at line 1282 of file dcadec.c.

Referenced by dca_subsubframe(), and dca_xbr_parse_frame().

BitAlloc dca_bitalloc_index
static

indexes for samples VLC select

Definition at line 337 of file dcadec.c.

const int8_t dca_channel_reorder_lfe[][9]
static
Initial value:
= {
{ 0, -1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 2, 0, 1, -1, -1, -1, -1, -1, -1},
{ 0, 1, 3, -1, -1, -1, -1, -1, -1},
{ 2, 0, 1, 4, -1, -1, -1, -1, -1},
{ 0, 1, 3, 4, -1, -1, -1, -1, -1},
{ 2, 0, 1, 4, 5, -1, -1, -1, -1},
{ 3, 4, 0, 1, 5, 6, -1, -1, -1},
{ 2, 0, 1, 4, 5, 6, -1, -1, -1},
{ 0, 6, 4, 5, 2, 3, -1, -1, -1},
{ 4, 2, 5, 0, 1, 6, 7, -1, -1},
{ 5, 6, 0, 1, 7, 3, 8, 4, -1},
{ 4, 2, 5, 0, 1, 6, 8, 7, -1},
}

Definition at line 239 of file dcadec.c.

Referenced by dca_decode_frame().

const int8_t dca_channel_reorder_lfe_xch[][9]
static
Initial value:
= {
{ 0, 2, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, 3, -1, -1, -1, -1, -1, -1},
{ 0, 1, 3, -1, -1, -1, -1, -1, -1},
{ 0, 1, 3, -1, -1, -1, -1, -1, -1},
{ 0, 1, 3, -1, -1, -1, -1, -1, -1},
{ 2, 0, 1, 4, -1, -1, -1, -1, -1},
{ 0, 1, 3, 4, -1, -1, -1, -1, -1},
{ 2, 0, 1, 4, 5, -1, -1, -1, -1},
{ 0, 1, 4, 5, 3, -1, -1, -1, -1},
{ 2, 0, 1, 5, 6, 4, -1, -1, -1},
{ 3, 4, 0, 1, 6, 7, 5, -1, -1},
{ 2, 0, 1, 4, 5, 6, 7, -1, -1},
{ 0, 6, 4, 5, 2, 3, 7, -1, -1},
{ 4, 2, 5, 0, 1, 7, 8, 6, -1},
{ 5, 6, 0, 1, 8, 3, 9, 4, 7},
{ 4, 2, 5, 0, 1, 6, 9, 8, 7},
}

Definition at line 258 of file dcadec.c.

Referenced by dca_decode_frame().

const int8_t dca_channel_reorder_nolfe[][9]
static
Initial value:
= {
{ 0, -1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 2, 0, 1, -1, -1, -1, -1, -1, -1},
{ 0, 1, 2, -1, -1, -1, -1, -1, -1},
{ 2, 0, 1, 3, -1, -1, -1, -1, -1},
{ 0, 1, 2, 3, -1, -1, -1, -1, -1},
{ 2, 0, 1, 3, 4, -1, -1, -1, -1},
{ 2, 3, 0, 1, 4, 5, -1, -1, -1},
{ 2, 0, 1, 3, 4, 5, -1, -1, -1},
{ 0, 5, 3, 4, 1, 2, -1, -1, -1},
{ 3, 2, 4, 0, 1, 5, 6, -1, -1},
{ 4, 5, 0, 1, 6, 2, 7, 3, -1},
{ 3, 2, 4, 0, 1, 5, 7, 6, -1},
}

Definition at line 277 of file dcadec.c.

Referenced by dca_decode_frame().

const int8_t dca_channel_reorder_nolfe_xch[][9]
static
Initial value:
= {
{ 0, 1, -1, -1, -1, -1, -1, -1, -1},
{ 0, 1, 2, -1, -1, -1, -1, -1, -1},
{ 0, 1, 2, -1, -1, -1, -1, -1, -1},
{ 0, 1, 2, -1, -1, -1, -1, -1, -1},
{ 0, 1, 2, -1, -1, -1, -1, -1, -1},
{ 2, 0, 1, 3, -1, -1, -1, -1, -1},
{ 0, 1, 2, 3, -1, -1, -1, -1, -1},
{ 2, 0, 1, 3, 4, -1, -1, -1, -1},
{ 0, 1, 3, 4, 2, -1, -1, -1, -1},
{ 2, 0, 1, 4, 5, 3, -1, -1, -1},
{ 2, 3, 0, 1, 5, 6, 4, -1, -1},
{ 2, 0, 1, 3, 4, 5, 6, -1, -1},
{ 0, 5, 3, 4, 1, 2, 6, -1, -1},
{ 3, 2, 4, 0, 1, 6, 7, 5, -1},
{ 4, 5, 0, 1, 7, 2, 8, 3, 6},
{ 3, 2, 4, 0, 1, 5, 8, 7, 6},
}

Definition at line 296 of file dcadec.c.

Referenced by dca_decode_frame().

const uint64_t dca_core_channel_layout[]
static

Definition at line 198 of file dcadec.c.

Referenced by dca_decode_frame().

const int dca_ext_audio_descr_mask[]
static
Initial value:
= {
-1,
-1,
-1,
-1,
}
XXCh channels extension in core substream.
Definition: dcadec.c:163
XCh channel extension in core substream.
Definition: dcadec.c:165
96/24 extension in core substream
Definition: dcadec.c:164

Definition at line 175 of file dcadec.c.

Referenced by dca_decode_frame().

const int8_t dca_lfe_index[]
static
Initial value:
= {
1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3
}

Definition at line 235 of file dcadec.c.

Referenced by dca_decode_frame().

BitAlloc dca_scalefactor
static

scalefactor VLCs

Definition at line 339 of file dcadec.c.

BitAlloc dca_smpl_bitalloc[11]
static

samples VLCs

Definition at line 340 of file dcadec.c.

BitAlloc dca_tmode
static

transition mode VLCs

Definition at line 338 of file dcadec.c.

const uint16_t dca_vlc_offs[]
static
Initial value:
= {
0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364,
5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508,
5572, 5604, 5668, 5796, 5860, 5892, 6412, 6668, 6796, 7308, 7564,
7820, 8076, 8620, 9132, 9388, 9910, 10166, 10680, 11196, 11726, 12240,
12752, 13298, 13810, 14326, 14840, 15500, 16022, 16540, 17158, 17678, 18264,
18796, 19352, 19926, 20468, 21472, 22398, 23014, 23622,
}

Definition at line 472 of file dcadec.c.

Referenced by dca_init_vlcs().

AVCodec ff_dca_decoder
Initial value:
= {
.name = "dca",
.priv_data_size = sizeof(DCAContext),
.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
}
static const AVProfile profiles[]
Definition: dcadec.c:2502
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int dca_decode_end(AVCodecContext *avctx)
Definition: dcadec.c:2494
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
float, planar
Definition: samplefmt.h:60
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int dca_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Main frame decoding function FIXME add arguments.
Definition: dcadec.c:2066
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static av_cold int dca_decode_init(AVCodecContext *avctx)
DCA initialization.
Definition: dcadec.c:2470
#define CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:49
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868

Definition at line 2511 of file dcadec.c.

const uint32_t map_xxch_to_native[28]
static
Initial value:
= {
AV_CH_BACK_RIGHT
}
#define AV_CH_TOP_FRONT_RIGHT
#define AV_CH_TOP_FRONT_LEFT
#define AV_CH_TOP_FRONT_CENTER
#define AV_CH_TOP_BACK_LEFT
#define AV_CH_TOP_BACK_CENTER
#define AV_CH_LOW_FREQUENCY
#define AV_CH_BACK_LEFT
#define AV_CH_TOP_CENTER
#define AV_CH_FRONT_LEFT_OF_CENTER
#define AV_CH_FRONT_CENTER
#define AV_CH_FRONT_RIGHT_OF_CENTER
#define AV_CH_FRONT_LEFT
#define AV_CH_TOP_BACK_RIGHT
#define AV_CH_BACK_CENTER
#define AV_CH_SIDE_RIGHT
#define AV_CH_FRONT_RIGHT
#define AV_CH_SIDE_LEFT
#define AV_CH_BACK_RIGHT

Definition at line 130 of file dcadec.c.

Referenced by dca_decode_frame().

const AVProfile profiles[]
static
Initial value:
= {
{ FF_PROFILE_DTS, "DTS" },
{ FF_PROFILE_DTS_ES, "DTS-ES" },
{ FF_PROFILE_DTS_96_24, "DTS 96/24" },
{ FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
{ FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
}
#define FF_PROFILE_DTS_ES
#define FF_PROFILE_UNKNOWN
#define FF_PROFILE_DTS_96_24
#define FF_PROFILE_DTS
#define FF_PROFILE_DTS_HD_HRA
#define FF_PROFILE_DTS_HD_MA

Definition at line 2502 of file dcadec.c.