#include "libavutil/common.h"
#include "libavutil/avassert.h"
#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "get_bits.h"
#include "put_bits.h"
#include "dcaenc.h"
#include "dcadata.h"
Go to the source code of this file.
Data Structures | |
struct | DCAContext |
Defines | |
#define | MAX_CHANNELS 6 |
#define | DCA_SUBBANDS_32 32 |
#define | DCA_MAX_FRAME_SIZE 16383 |
#define | DCA_HEADER_SIZE 13 |
#define | DCA_SUBBANDS 32 |
Subband activity count. | |
#define | QUANTIZER_BITS 16 |
#define | SUBFRAMES 1 |
#define | SUBSUBFRAMES 4 |
#define | PCM_SAMPLES (SUBFRAMES*SUBSUBFRAMES*8) |
#define | LFE_BITS 8 |
#define | LFE_INTERPOLATION 64 |
#define | LFE_PRESENT 2 |
#define | LFE_MISSING 0 |
Functions | |
static int32_t | mul32 (int32_t a, int32_t b) |
static void | qmf_init (void) |
static int32_t | band_delta_factor (int band, int sample_num) |
static void | add_new_samples (DCAContext *c, const int32_t *in, int count, int channel) |
static void | qmf_decompose (DCAContext *c, int32_t in[32], int32_t out[32], int channel) |
static int | lfe_downsample (DCAContext *c, int32_t in[LFE_INTERPOLATION]) |
static void | init_lfe_fir (void) |
static void | put_frame_header (DCAContext *c) |
static void | put_primary_audio_header (DCAContext *c) |
static uint32_t | quantize (int32_t sample, int bits) |
8-23 bits quantization | |
static int | find_scale_factor7 (int64_t max_value, int bits) |
static void | put_sample7 (DCAContext *c, int64_t sample, int bits, int scale_factor) |
static void | put_subframe (DCAContext *c, int32_t subband_data[8 *SUBSUBFRAMES][MAX_CHANNELS][32], int subframe) |
static void | put_frame (DCAContext *c, int32_t subband_data[PCM_SAMPLES][MAX_CHANNELS][32], uint8_t *frame) |
static int | encode_frame (AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data) |
static int | encode_init (AVCodecContext *avctx) |
Variables | |
static const int8_t | dca_lfe_index [] |
static const int8_t | dca_channel_reorder_lfe [][9] |
static const int8_t | dca_channel_reorder_nolfe [][9] |
static int32_t | cos_table [128] |
static int32_t | lfe_fir_64i [512] |
AVCodec | ff_dca_encoder |
#define DCA_HEADER_SIZE 13 |
#define DCA_SUBBANDS_32 32 |
#define LFE_BITS 8 |
#define LFE_INTERPOLATION 64 |
#define LFE_MISSING 0 |
#define LFE_PRESENT 2 |
#define PCM_SAMPLES (SUBFRAMES*SUBSUBFRAMES*8) |
Definition at line 44 of file dcaenc.c.
Referenced by encode_frame(), encode_init(), and put_frame_header().
#define QUANTIZER_BITS 16 |
#define SUBFRAMES 1 |
Definition at line 42 of file dcaenc.c.
Referenced by formant_postfilter(), g723_1_decode_frame(), lsp_interpolate(), put_frame(), put_primary_audio_header(), and unpack_bitstream().
#define SUBSUBFRAMES 4 |
static void add_new_samples | ( | DCAContext * | c, | |
const int32_t * | in, | |||
int | count, | |||
int | channel | |||
) | [static] |
static int32_t band_delta_factor | ( | int | band, | |
int | sample_num | |||
) | [static] |
static int encode_frame | ( | AVCodecContext * | avctx, | |
uint8_t * | frame, | |||
int | buf_size, | |||
void * | data | |||
) | [static] |
static int encode_init | ( | AVCodecContext * | avctx | ) | [static] |
static int find_scale_factor7 | ( | int64_t | max_value, | |
int | bits | |||
) | [inline, static] |
static void init_lfe_fir | ( | void | ) | [static] |
static int lfe_downsample | ( | DCAContext * | c, | |
int32_t | in[LFE_INTERPOLATION] | |||
) | [static] |
static int32_t mul32 | ( | int32_t | a, | |
int32_t | b | |||
) | [inline, static] |
Definition at line 116 of file dcaenc.c.
Referenced by lfe_downsample(), qmf_decompose(), and qmf_init().
static void put_frame | ( | DCAContext * | c, | |
int32_t | subband_data[PCM_SAMPLES][MAX_CHANNELS][32], | |||
uint8_t * | frame | |||
) | [static] |
static void put_frame_header | ( | DCAContext * | c | ) | [static] |
static void put_primary_audio_header | ( | DCAContext * | c | ) | [static] |
static void put_sample7 | ( | DCAContext * | c, | |
int64_t | sample, | |||
int | bits, | |||
int | scale_factor | |||
) | [inline, static] |
static void put_subframe | ( | DCAContext * | c, | |
int32_t | subband_data[8 *SUBSUBFRAMES][MAX_CHANNELS][32], | |||
int | subframe | |||
) | [static] |
static void qmf_decompose | ( | DCAContext * | c, | |
int32_t | in[32], | |||
int32_t | out[32], | |||
int | channel | |||
) | [static] |
static void qmf_init | ( | void | ) | [static] |
static uint32_t quantize | ( | int32_t | sample, | |
int | bits | |||
) | [inline, static] |
8-23 bits quantization
sample | ||
bits |
Definition at line 364 of file dcaenc.c.
Referenced by put_sample7(), and ra144_encode_frame().
int32_t cos_table[128] [static] |
Definition at line 114 of file dcaenc.c.
Referenced by band_delta_factor(), encode_init(), int_cos(), and qmf_init().
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 }, { 1, 2, 0, -1, -1, -1, -1, -1, -1 }, { 0, 1, -1, 2, -1, -1, -1, -1, -1 }, { 1, 2, 0, -1, 3, -1, -1, -1, -1 }, { 0, 1, -1, 2, 3, -1, -1, -1, -1 }, { 1, 2, 0, -1, 3, 4, -1, -1, -1 }, { 2, 3, -1, 0, 1, 4, 5, -1, -1 }, { 1, 2, 0, -1, 3, 4, 5, -1, -1 }, { 0, -1, 4, 5, 2, 3, 1, -1, -1 }, { 3, 4, 1, -1, 0, 2, 5, 6, -1 }, { 2, 3, -1, 5, 7, 0, 1, 4, 6 }, { 3, 4, 1, -1, 0, 2, 5, 7, 6 }, }
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 }, { 1, 2, 0, -1, -1, -1, -1, -1, -1 }, { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, { 1, 2, 0, 3, -1, -1, -1, -1, -1 }, { 0, 1, 2, 3, -1, -1, -1, -1, -1 }, { 1, 2, 0, 3, 4, -1, -1, -1, -1 }, { 2, 3, 0, 1, 4, 5, -1, -1, -1 }, { 1, 2, 0, 3, 4, 5, -1, -1, -1 }, { 0, 4, 5, 2, 3, 1, -1, -1, -1 }, { 3, 4, 1, 0, 2, 5, 6, -1, -1 }, { 2, 3, 5, 7, 0, 1, 4, 6, -1 }, { 3, 4, 1, 0, 2, 5, 7, 6, -1 }, }
const int8_t dca_lfe_index[] [static] |
Initial value:
{ .name = "dca", .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_DTS, .priv_data_size = sizeof(DCAContext), .init = encode_init, .encode = encode_frame, .capabilities = CODEC_CAP_EXPERIMENTAL, .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), }
int32_t lfe_fir_64i[512] [static] |