#include <math.h>#include <stddef.h>#include <stdio.h>#include "libavutil/common.h"#include "libavutil/float_dsp.h"#include "libavutil/intmath.h"#include "libavutil/intreadwrite.h"#include "libavutil/mathematics.h"#include "libavutil/audioconvert.h"#include "avcodec.h"#include "dsputil.h"#include "fft.h"#include "get_bits.h"#include "put_bits.h"#include "dcadata.h"#include "dcahuff.h"#include "dca.h"#include "dca_parser.h"#include "synth_filter.h"#include "dcadsp.h"#include "fmtconvert.h"Go to the source code of this file.
| #define DCA_CHANNEL_MASK 0x3F |
| #define DCA_CHSET_CHANS_MAX (8) |
| #define DCA_CHSETS_MAX (4) |
| #define DCA_CORE_EXTS (DCA_EXT_XCH | DCA_EXT_XXCH | DCA_EXT_X96) |
| #define DCA_LFE 0x80 |
Definition at line 319 of file dcadec.c.
Referenced by dca_filter_channels(), and dca_parse_frame_header().
| #define DCA_MAX_EXSS_HEADER_SIZE 4096 |
| #define DCA_MAX_FRAME_SIZE 16384 |
Definition at line 323 of file dcadec.c.
Referenced by dca_decode_frame(), encode_frame(), and put_frame().
| #define DCA_PRIM_CHANNELS_MAX (7) |
Definition at line 54 of file dcadec.c.
Referenced by dca_decode_init(), and dca_parse_audio_coding_header().
| #define DCA_SUBBANDS (64) |
Definition at line 55 of file dcadec.c.
Referenced by dca_filter_channels(), dca_parse_audio_coding_header(), dca_subsubframe(), dca_xbr_parse_frame(), put_primary_audio_header(), and put_subframe().
| #define DOWNMIX_TO_STEREO | ( | op1, | |||
| op2 | ) |
Value:
for (i = 0; i < 256; i++) { \
op1 \
op2 \
}
Definition at line 1187 of file dcadec.c.
Referenced by dca_downmix().
| #define MIX_FRONT3 | ( | samples, | |||
| coef | ) |
| #define MIX_REAR1 | ( | samples, | |||
| si1, | |||||
| rs, | |||||
| coef | ) |
| #define MIX_REAR2 | ( | samples, | |||
| si1, | |||||
| si2, | |||||
| rs, | |||||
| coef | ) |
| enum DCAExSSSpeakerMask |
| enum DCAExtensionMask |
| 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 |
| enum DCAMode |
| enum DCAXxchSpeakerMask |
| static int dca_decode_block | ( | DCAContext * | s, | |
| int | base_channel, | |||
| int | block_index | |||
| ) | [static] |
Decode a dca frame block.
| s | pointer to the DCAContext |
Definition at line 1498 of file dcadec.c.
Referenced by dca_decode_frame(), and dca_xxch_decode_frame().
| static av_cold int dca_decode_end | ( | AVCodecContext * | avctx | ) | [static] |
| static int dca_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | got_frame_ptr, | |||
| AVPacket * | avpkt | |||
| ) | [static] |
| static av_cold int dca_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Return the number of channels in an ExSS speaker mask (HD).
Definition at line 1546 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 1578 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 1944 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 1564 of file dcadec.c.
Referenced by dca_exss_parse_asset_header().
| static int dca_filter_channels | ( | DCAContext * | s, | |
| int | block_index | |||
| ) | [static] |
| static av_cold void dca_init_vlcs | ( | void | ) | [static] |
| 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] |
| static int dca_subframe_footer | ( | DCAContext * | s, | |
| int | base_channel | |||
| ) | [static] |
| static int dca_subframe_header | ( | DCAContext * | s, | |
| int | base_channel, | |||
| int | block_index | |||
| ) | [static] |
| static int dca_subsubframe | ( | DCAContext * | s, | |
| int | base_channel, | |||
| int | block_index | |||
| ) | [static] |
| static int dca_xbr_parse_frame | ( | DCAContext * | s | ) | [static] |
| static int dca_xxch2index | ( | DCAContext * | s, | |
| int | xxch_ch | |||
| ) | [inline, static] |
| static int dca_xxch_decode_frame | ( | DCAContext * | s | ) | [static] |
Definition at line 1887 of file dcadec.c.
Referenced by dca_decode_frame(), and dca_exss_parse_header().
Definition at line 1270 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 | |||
| ) | [inline, static] |
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 341 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 | |||
| ) | [inline, static] |
| static void int8x8_fmul_int32 | ( | float * | dst, | |
| const int8_t * | src, | |||
| int | scale | |||
| ) | [inline, static] |
| static void lfe_interpolation_fir | ( | DCAContext * | s, | |
| int | decimation_select, | |||
| int | num_deci_sample, | |||
| float * | samples_in, | |||
| float * | samples_out, | |||
| float | scale | |||
| ) | [static] |
| static void qmf_32_subbands | ( | DCAContext * | s, | |
| int | chans, | |||
| float | samples_in[32][8], | |||
| float * | samples_out, | |||
| float | scale | |||
| ) | [static] |
const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 } [static] |
Definition at line 1278 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 1277 of file dcadec.c.
Referenced by dca_subsubframe(), and dca_xbr_parse_frame().
BitAlloc dca_bitalloc_index [static] |
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 238 of file dcadec.c.
Referenced by dca_decode_frame(), and encode_init().
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 257 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 276 of file dcadec.c.
Referenced by dca_decode_frame(), and encode_init().
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 295 of file dcadec.c.
Referenced by dca_decode_frame().
const uint64_t dca_core_channel_layout[] [static] |
const int dca_ext_audio_descr_mask[] [static] |
Initial value:
{
DCA_EXT_XCH,
-1,
DCA_EXT_X96,
DCA_EXT_XCH | DCA_EXT_X96,
-1,
-1,
DCA_EXT_XXCH,
-1,
}
Definition at line 174 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 234 of file dcadec.c.
Referenced by dca_decode_frame(), and encode_init().
BitAlloc dca_scalefactor [static] |
BitAlloc dca_smpl_bitalloc[11] [static] |
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().
Initial value:
{
.name = "dca",
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_DTS,
.priv_data_size = sizeof(DCAContext),
.init = dca_decode_init,
.decode = dca_decode_frame,
.close = dca_decode_end,
.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles),
}
const uint32_t map_xxch_to_native[28] [static] |
Initial value:
{
AV_CH_FRONT_CENTER,
AV_CH_FRONT_LEFT,
AV_CH_FRONT_RIGHT,
AV_CH_SIDE_LEFT,
AV_CH_SIDE_RIGHT,
AV_CH_LOW_FREQUENCY,
AV_CH_BACK_CENTER,
AV_CH_BACK_LEFT,
AV_CH_BACK_RIGHT,
AV_CH_SIDE_LEFT,
AV_CH_SIDE_RIGHT,
AV_CH_FRONT_LEFT_OF_CENTER,
AV_CH_FRONT_RIGHT_OF_CENTER,
AV_CH_TOP_FRONT_LEFT,
AV_CH_TOP_FRONT_CENTER,
AV_CH_TOP_FRONT_RIGHT,
AV_CH_LOW_FREQUENCY,
AV_CH_FRONT_LEFT_OF_CENTER,
AV_CH_FRONT_RIGHT_OF_CENTER,
AV_CH_TOP_CENTER,
AV_CH_TOP_FRONT_LEFT,
AV_CH_TOP_FRONT_RIGHT,
AV_CH_TOP_BACK_CENTER,
AV_CH_TOP_BACK_LEFT,
AV_CH_TOP_BACK_RIGHT,
AV_CH_BACK_CENTER,
AV_CH_BACK_LEFT,
AV_CH_BACK_RIGHT
}
Definition at line 129 of file dcadec.c.
Referenced by dca_decode_frame().
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" },
{ FF_PROFILE_UNKNOWN },
}
1.5.8