FFmpeg
Loading...
Searching...
No Matches
ac3dec_fixed.c File Reference
#include "config_components.h"
#include "ac3dec.h"
#include "codec_internal.h"
#include "ac3dec.c"

Go to the source code of this file.

Macros

#define USE_FIXED   1
 
#define IMDCT_TYPE   AV_TX_INT32_MDCT
 
#define AC3_FIXED_COEFF_BITS   2
 
#define AC3_FIXED_EXPONENT_MAX   24
 

Functions

static av_always_inline int fixed_coeff_bits (const AC3DecodeContext *s)
 
static void scale_coefs (int32_t *dst, const int32_t *src, int dynrng, int len)
 
static void scale_coefs_q2 (int32_t *dst, const int32_t *src, int dynrng, int len)
 
static void ac3_downmix_c_fixed16 (int16_t **samples, int16_t **matrix, int out_ch, int in_ch, int len)
 Downmix samples from original signal to stereo or mono (this is for 16-bit samples and fixed point decoder - original (for 32-bit samples) is in ac3dsp.c).
 

Variables

static const int end_freq_inv_tab [8]
 
static const AVOption options []
 
static const AVClass ac3_decoder_class
 
const FFCodec ff_ac3_fixed_decoder
 

Macro Definition Documentation

◆ USE_FIXED

#define USE_FIXED   1

Definition at line 51 of file ac3dec_fixed.c.

◆ IMDCT_TYPE

#define IMDCT_TYPE   AV_TX_INT32_MDCT

Definition at line 54 of file ac3dec_fixed.c.

Referenced by ac3_decode_init().

◆ AC3_FIXED_COEFF_BITS

#define AC3_FIXED_COEFF_BITS   2

Definition at line 59 of file ac3dec_fixed.c.

Referenced by dequantize_dexp24_dither(), and fixed_coeff_bits().

◆ AC3_FIXED_EXPONENT_MAX

#define AC3_FIXED_EXPONENT_MAX   24

Definition at line 60 of file ac3dec_fixed.c.

Referenced by ac3_decode_transform_coeffs_ch(), and dequantize_dexp24_dither().

Function Documentation

◆ fixed_coeff_bits()

static av_always_inline int fixed_coeff_bits ( const AC3DecodeContext * s)
static

◆ scale_coefs()

static void scale_coefs ( int32_t * dst,
const int32_t * src,
int dynrng,
int len )
static

Definition at line 74 of file ac3dec_fixed.c.

Referenced by decode_audio_block().

◆ scale_coefs_q2()

static void scale_coefs_q2 ( int32_t * dst,
const int32_t * src,
int dynrng,
int len )
static

Definition at line 138 of file ac3dec_fixed.c.

Referenced by decode_audio_block().

◆ ac3_downmix_c_fixed16()

static void ac3_downmix_c_fixed16 ( int16_t ** samples,
int16_t ** matrix,
int out_ch,
int in_ch,
int len )
static

Downmix samples from original signal to stereo or mono (this is for 16-bit samples and fixed point decoder - original (for 32-bit samples) is in ac3dsp.c).

Definition at line 185 of file ac3dec_fixed.c.

Referenced by decode_audio_block().

Variable Documentation

◆ end_freq_inv_tab

const int end_freq_inv_tab[8]
static
Initial value:
=
{
50529027, 44278013, 39403370, 32292987, 27356480, 23729101, 20951060, 18755316
}

Definition at line 69 of file ac3dec_fixed.c.

Referenced by spx_strategy().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "cons_noisegen", "enable consistent noise generation", OFFSET(consistent_noise_generation), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, PAR },
{ "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 6.0, PAR },
{ "heavy_compr", "enable heavy dynamic range compression", OFFSET(heavy_compression), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, PAR },
{ "downmix", "Request a specific channel layout from the decoder", OFFSET(downmix_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, .flags = PAR },
{ NULL},
}
#define PAR
Definition apedec.c:1740
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_CHLAYOUT
Underlying C type is AVChannelLayout.
Definition opt.h:330
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition opt.h:270
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326

Definition at line 215 of file ac3dec_fixed.c.

◆ ac3_decoder_class

const AVClass ac3_decoder_class
static
Initial value:
= {
.class_name = "Fixed-Point AC-3 Decoder",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 223 of file ac3dec_fixed.c.

◆ ff_ac3_fixed_decoder

const FFCodec ff_ac3_fixed_decoder
Initial value:
= {
.p.name = "ac3_fixed",
CODEC_LONG_NAME("ATSC A/52A (AC-3)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_AC3,
.p.priv_class = &ac3_decoder_class,
.priv_data_size = sizeof (AC3DecodeContext),
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static const AVClass ac3_decoder_class
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define CODEC_SAMPLEFMTS(...)
void(* flush)(AVBSFContext *ctx)
Definition dts2pts.c:610
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition codec.h:94
@ AV_CODEC_ID_AC3
Definition codec_id.h:456
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition samplefmt.h:64
static av_cold void ac3_decode_flush(AVCodecContext *avctx)
Definition ac3dec.c:157
static av_cold int ac3_decode_end(AVCodecContext *avctx)
Uninitialize the AC-3 decoder.
Definition ac3dec.c:1812
static int ac3_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Decode a single AC-3 frame.
Definition ac3dec.c:1408
static av_cold int ac3_decode_init(AVCodecContext *avctx)
AVCodec initialization.
Definition ac3dec.c:106

Definition at line 230 of file ac3dec_fixed.c.