#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include "avcodec.h"
#include "dsputil.h"
#include "bitstream.h"
#include "dcadata.h"
#include "dcahuff.h"
#include "dca.h"
Go to the source code of this file.
Data Structures | |
struct | BitAlloc |
Bit allocation. More... | |
struct | DCAContext |
Defines | |
#define | DCA_PRIM_CHANNELS_MAX (5) |
#define | DCA_SUBBANDS (32) |
#define | DCA_ABITS_MAX (32) |
#define | DCA_SUBSUBFAMES_MAX (4) |
#define | DCA_LFE_MAX (3) |
#define | DCA_DOLBY 101 |
#define | DCA_CHANNEL_BITS 6 |
#define | DCA_CHANNEL_MASK 0x3F |
#define | DCA_LFE 0x80 |
#define | HEADER_SIZE 14 |
#define | CONVERT_BIAS 384 |
#define | DCA_MAX_FRAME_SIZE 16383 |
#define | MIX_REAR1(samples, si1, rs, coef) |
#define | MIX_REAR2(samples, si1, si2, 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 } |
Functions | |
static av_always_inline int | get_bitalloc (GetBitContext *gb, BitAlloc *ba, int idx) |
static void | dca_init_vlcs (void) |
static void | get_array (GetBitContext *gb, int *dst, int len, int bits) |
static int | dca_parse_frame_header (DCAContext *s) |
static int | get_scale (GetBitContext *gb, int level, int value) |
static int | dca_subframe_header (DCAContext *s) |
static void | qmf_32_subbands (DCAContext *s, int chans, float samples_in[32][8], float *samples_out, float scale, float bias) |
static void | lfe_interpolation_fir (int decimation_select, int num_deci_sample, float *samples_in, float *samples_out, float scale, float bias) |
static void | dca_downmix (float *samples, int srcfmt, int downmix_coef[DCA_PRIM_CHANNELS_MAX][2]) |
static int | decode_blockcode (int code, int levels, int *values) |
static int | dca_subsubframe (DCAContext *s) |
static int | dca_subframe_footer (DCAContext *s) |
static int | dca_decode_block (DCAContext *s) |
Decode a dca frame block. | |
static int | dca_convert_bitstream (const uint8_t *src, int src_size, uint8_t *dst, int max_size) |
Convert bitstream to one representation based on sync marker. | |
static int | dca_decode_frame (AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) |
Main frame decoding function FIXME add arguments. | |
static void | pre_calc_cosmod (DCAContext *s) |
Build the cosine modulation tables for the QMF. | |
static int | dca_decode_init (AVCodecContext *avctx) |
DCA initialization. | |
Variables | |
static BitAlloc | dca_bitalloc_index |
indexes for samples VLC select | |
static BitAlloc | dca_tmode |
transition mode VLCs | |
static BitAlloc | dca_scalefactor |
scalefactor VLCs | |
static BitAlloc | dca_smpl_bitalloc [11] |
samples VLCs | |
static float | cos_mod [544] |
Pre-calculated cosine modulation coefs for the QMF. | |
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 } |
AVCodec | dca_decoder |
Definition in file dca.c.
#define CONVERT_BIAS 384 |
#define DCA_CHANNEL_MASK 0x3F |
#define DCA_LFE 0x80 |
#define DCA_MAX_FRAME_SIZE 16383 |
#define DCA_PRIM_CHANNELS_MAX (5) |
#define DCA_SUBBANDS (32) |
#define DOWNMIX_TO_STEREO | ( | op1, | |||
op2 | ) |
Value:
for(i = 0; i < 256; i++){ \
op1 \
op2 \
}
Definition at line 768 of file dca.c.
Referenced by dca_downmix().
#define HEADER_SIZE 14 |
Definition at line 69 of file dca.c.
Referenced by a52_decode_frame(), decode_frame(), and mp_decode_frame().
#define MIX_FRONT3 | ( | samples, | |||
coef | ) |
#define MIX_REAR1 | ( | samples, | |||
si1, | |||||
rs, | |||||
coef | ) |
#define MIX_REAR2 | ( | samples, | |||
si1, | |||||
si2, | |||||
rs, | |||||
coef | ) |
enum DCAMode |
static int dca_convert_bitstream | ( | const uint8_t * | src, | |
int | src_size, | |||
uint8_t * | dst, | |||
int | max_size | |||
) | [static] |
Convert bitstream to one representation based on sync marker.
Definition at line 1094 of file dca.c.
Referenced by dca_decode_frame().
static int dca_decode_block | ( | DCAContext * | s | ) | [static] |
Decode a dca frame block.
s | pointer to the DCAContext |
Definition at line 1047 of file dca.c.
Referenced by dca_decode_frame().
static int dca_decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
static int dca_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static void dca_downmix | ( | float * | samples, | |
int | srcfmt, | |||
int | downmix_coef[DCA_PRIM_CHANNELS_MAX][2] | |||
) | [static] |
static void dca_init_vlcs | ( | void | ) | [static] |
static int dca_parse_frame_header | ( | DCAContext * | s | ) | [static] |
static int dca_subframe_footer | ( | DCAContext * | s | ) | [static] |
static int dca_subframe_header | ( | DCAContext * | s | ) | [static] |
static int dca_subsubframe | ( | DCAContext * | s | ) | [static] |
static int decode_blockcode | ( | int | code, | |
int | levels, | |||
int * | values | |||
) | [static] |
static void get_array | ( | GetBitContext * | gb, | |
int * | dst, | |||
int | len, | |||
int | bits | |||
) | [inline, static] |
static av_always_inline int get_bitalloc | ( | GetBitContext * | gb, | |
BitAlloc * | ba, | |||
int | idx | |||
) | [static] |
Definition at line 90 of file dca.c.
Referenced by dca_subframe_header(), dca_subsubframe(), and get_scale().
static int get_scale | ( | GetBitContext * | gb, | |
int | level, | |||
int | value | |||
) | [inline, static] |
static void lfe_interpolation_fir | ( | int | decimation_select, | |
int | num_deci_sample, | |||
float * | samples_in, | |||
float * | samples_out, | |||
float | scale, | |||
float | bias | |||
) | [static] |
static void pre_calc_cosmod | ( | DCAContext * | s | ) | [static] |
Build the cosine modulation tables for the QMF.
s | pointer to the DCAContext |
Definition at line 1195 of file dca.c.
Referenced by dca_decode_init().
static void qmf_32_subbands | ( | DCAContext * | s, | |
int | chans, | |||
float | samples_in[32][8], | |||
float * | samples_out, | |||
float | scale, | |||
float | bias | |||
) | [static] |
const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 } [static] |
const uint8_t abits_sizes[7] = { 7, 10, 12, 13, 15, 17, 19 } [static] |
float cos_mod[544] [static] |
Pre-calculated cosine modulation coefs for the QMF.
Definition at line 88 of file dca.c.
Referenced by pre_calc_cosmod(), and qmf_32_subbands().
BitAlloc dca_bitalloc_index [static] |
Initial value:
{ .name = "dca", .type = CODEC_TYPE_AUDIO, .id = CODEC_ID_DTS, .priv_data_size = sizeof(DCAContext), .init = dca_decode_init, .decode = dca_decode_frame, }
BitAlloc dca_scalefactor [static] |
BitAlloc dca_smpl_bitalloc[11] [static] |