FFmpeg
Macros | Functions | Variables
ac3enc_fixed.c File Reference
#include "internal.h"
#include "audiodsp.h"
#include "ac3enc.h"
#include "eac3enc.h"
#include "kbdwin.h"
#include "ac3enc_template.c"

Go to the source code of this file.

Macros

#define AC3ENC_FLOAT   0
 
#define FFT_FLOAT   0
 
#define FFT_FIXED_32   1
 

Functions

static void sum_square_butterfly (AC3EncodeContext *s, int64_t sum[4], const int32_t *coef0, const int32_t *coef1, int len)
 
static void clip_coefficients (AudioDSPContext *adsp, int32_t *coef, unsigned int len)
 
static CoefType calc_cpl_coord (CoefSumType energy_ch, CoefSumType energy_cpl)
 
static av_cold void ac3_fixed_mdct_end (AC3EncodeContext *s)
 Finalize MDCT and free allocated memory. More...
 
static av_cold int ac3_fixed_mdct_init (AC3EncodeContext *s)
 Initialize MDCT tables. More...
 
static av_cold int ac3_fixed_encode_init (AVCodecContext *avctx)
 

Variables

static const AVClass ac3enc_class
 
AVCodec ff_ac3_fixed_encoder
 

Detailed Description

fixed-point AC-3 encoder.

Definition in file ac3enc_fixed.c.

Macro Definition Documentation

◆ AC3ENC_FLOAT

#define AC3ENC_FLOAT   0

Definition at line 29 of file ac3enc_fixed.c.

◆ FFT_FLOAT

#define FFT_FLOAT   0

Definition at line 30 of file ac3enc_fixed.c.

◆ FFT_FIXED_32

#define FFT_FIXED_32   1

Definition at line 31 of file ac3enc_fixed.c.

Function Documentation

◆ sum_square_butterfly()

static void sum_square_butterfly ( AC3EncodeContext s,
int64_t  sum[4],
const int32_t coef0,
const int32_t coef1,
int  len 
)
static

Definition at line 45 of file ac3enc_fixed.c.

Referenced by compute_rematrixing_strategy().

◆ clip_coefficients()

static void clip_coefficients ( AudioDSPContext adsp,
int32_t coef,
unsigned int  len 
)
static

Definition at line 55 of file ac3enc_fixed.c.

Referenced by apply_channel_coupling().

◆ calc_cpl_coord()

static CoefType calc_cpl_coord ( CoefSumType  energy_ch,
CoefSumType  energy_cpl 
)
static

Definition at line 65 of file ac3enc_fixed.c.

Referenced by apply_channel_coupling().

◆ ac3_fixed_mdct_end()

static av_cold void ac3_fixed_mdct_end ( AC3EncodeContext s)
static

Finalize MDCT and free allocated memory.

Parameters
sAC-3 encoder private context

Definition at line 86 of file ac3enc_fixed.c.

Referenced by ac3_fixed_encode_init().

◆ ac3_fixed_mdct_init()

static av_cold int ac3_fixed_mdct_init ( AC3EncodeContext s)
static

Initialize MDCT tables.

Parameters
sAC-3 encoder private context
Returns
0 on success, negative error code on failure

Definition at line 97 of file ac3enc_fixed.c.

Referenced by ac3_fixed_encode_init().

◆ ac3_fixed_encode_init()

static av_cold int ac3_fixed_encode_init ( AVCodecContext avctx)
static

Definition at line 119 of file ac3enc_fixed.c.

Variable Documentation

◆ ac3enc_class

const AVClass ac3enc_class
static
Initial value:
= {
.class_name = "Fixed-Point AC-3 Encoder",
.item_name = av_default_item_name,
.option = ff_ac3_enc_options,
}

Definition at line 38 of file ac3enc_fixed.c.

◆ ff_ac3_fixed_encoder

AVCodec ff_ac3_fixed_encoder
Initial value:
= {
.name = "ac3_fixed",
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
.priv_data_size = sizeof(AC3EncodeContext),
.priv_class = &ac3enc_class,
.supported_samplerates = ff_ac3_sample_rate_tab,
.channel_layouts = ff_ac3_channel_layouts,
.defaults = ff_ac3_enc_defaults,
}

Definition at line 130 of file ac3enc_fixed.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:41
AV_CODEC_ID_AC3
@ AV_CODEC_ID_AC3
Definition: codec_id.h:427
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
ff_ac3_enc_defaults
const AVCodecDefault ff_ac3_enc_defaults[]
Definition: ac3enc.c:127
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:925
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:68
ff_ac3_enc_options
const AVOption ff_ac3_enc_options[]
Definition: ac3enc.c:77
ac3_fixed_encode_init
static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
Definition: ac3enc_fixed.c:119
ff_ac3_channel_layouts
const uint64_t ff_ac3_channel_layouts[19]
List of supported channel layouts.
Definition: ac3enc.c:142
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
AC3EncodeContext
AC-3 encoder private context.
Definition: ac3enc.h:154
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
ff_ac3_sample_rate_tab
const int ff_ac3_sample_rate_tab[]
Definition: ac3tab.c:111
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:49
ff_ac3_fixed_encode_frame
int ff_ac3_fixed_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
ac3enc_class
static const AVClass ac3enc_class
Definition: ac3enc_fixed.c:38
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
ff_ac3_encode_close
av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
Finalize encoding and free any memory allocated by the encoder.
Definition: ac3enc.c:2113