Skip to content
Permalink
Browse files

dcadec: make dts core work with integer coefficients

  • Loading branch information...
sasshka committed Oct 4, 2015
1 parent ac981d1 commit c5970a46590d120f2949faee8c881dc93e83a08c
Showing with 1,163 additions and 56 deletions.
  1. +6 −5 libavcodec/dca.h
  2. +521 −0 libavcodec/dcadata.c
  3. +4 −0 libavcodec/dcadata.h
  4. +119 −51 libavcodec/dcadec.c
  5. +459 −0 libavcodec/dcadsp.c
  6. +11 −0 libavcodec/dcadsp.h
  7. +43 −0 libavcodec/dcamath.h
@@ -139,23 +139,24 @@ typedef struct DCAAudioHeader {
int scalefactor_huffman[DCA_PRIM_CHANNELS_MAX]; ///< scale factor code book
int bitalloc_huffman[DCA_PRIM_CHANNELS_MAX]; ///< bit allocation quantizer select
int quant_index_huffman[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< quantization index codebook select
float scalefactor_adj[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< scale factor adjustment
int scalefactor_adj[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< scale factor adjustment

int subframes; ///< number of subframes
int total_channels; ///< number of channels including extensions
int prim_channels; ///< number of primary audio channels
} DCAAudioHeader;

typedef struct DCAChan {
DECLARE_ALIGNED(32, float, subband_samples)[DCA_BLOCKS_MAX][DCA_SUBBANDS][8];
DECLARE_ALIGNED(32, int, subband_samples)[DCA_BLOCKS_MAX][DCA_SUBBANDS][8];

/* Subband samples history (for ADPCM) */
DECLARE_ALIGNED(16, float, subband_samples_hist)[DCA_SUBBANDS][4];
DECLARE_ALIGNED(16, int, subband_samples_hist)[DCA_SUBBANDS][4];
int hist_index;

/* Half size is sufficient for core decoding, but for 96 kHz data
* we need QMF with 64 subbands and 1024 samples. */
DECLARE_ALIGNED(32, float, subband_fir_hist)[1024];
DECLARE_ALIGNED(32, int, subband_hist)[1024];
DECLARE_ALIGNED(32, float, subband_fir_noidea)[64];

/* Primary audio coding side information */
@@ -230,15 +231,15 @@ typedef struct DCAContext {

int output; ///< type of output

float *samples_chanptr[DCA_PRIM_CHANNELS_MAX + 1];
void *samples_chanptr[DCA_PRIM_CHANNELS_MAX + 1];
float *extra_channels[DCA_PRIM_CHANNELS_MAX + 1];
uint8_t *extra_channels_buffer;
unsigned int extra_channels_buffer_size;

uint8_t dca_buffer[DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE + DCA_BUFFER_PADDING_SIZE];
int dca_buffer_size; ///< how much data is in the dca_buffer

const int8_t *channel_order_tab; ///< channel reordering table, lfe and non lfe
const int8_t *channel_order_tab; ///< channel reordering floattable, lfe and non lfe
GetBitContext gb;
/* Current position in DCA frame */
int current_subframe;
Oops, something went wrong.

0 comments on commit c5970a4

Please sign in to comment.
You can’t perform that action at this time.