FFmpeg
Macros | Functions | Variables
eac3enc.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/thread.h"
#include "ac3enc.h"
#include "codec_internal.h"
#include "eac3enc.h"
#include "eac3_data.h"

Go to the source code of this file.

Macros

#define AC3ENC_FLOAT   1
 

Functions

static av_cold void eac3_exponent_init (void)
 Initialize E-AC-3 exponent tables. More...
 
void ff_eac3_get_frame_exp_strategy (AC3EncodeContext *s)
 Determine frame exponent strategy use and indices. More...
 
void ff_eac3_set_cpl_states (AC3EncodeContext *s)
 Set coupling states. More...
 
static void eac3_output_frame_header (AC3EncodeContext *s)
 Write the E-AC-3 frame header to the output bitstream. More...
 
static av_cold int eac3_encode_init (AVCodecContext *avctx)
 

Variables

static const AVClass eac3enc_class
 
static int8_t eac3_frame_expstr_index_tab [3][4][4][4][4][4]
 LUT for finding a matching frame exponent strategy index from a set of exponent strategies for a single channel across all 6 blocks. More...
 
const FFCodec ff_eac3_encoder
 

Detailed Description

E-AC-3 encoder

Definition in file eac3enc.c.

Macro Definition Documentation

◆ AC3ENC_FLOAT

#define AC3ENC_FLOAT   1

Definition at line 27 of file eac3enc.c.

Function Documentation

◆ eac3_exponent_init()

static av_cold void eac3_exponent_init ( void  )
static

Initialize E-AC-3 exponent tables.

Definition at line 54 of file eac3enc.c.

Referenced by eac3_encode_init().

◆ ff_eac3_get_frame_exp_strategy()

void ff_eac3_get_frame_exp_strategy ( AC3EncodeContext s)

Determine frame exponent strategy use and indices.

Definition at line 70 of file eac3enc.c.

Referenced by compute_exp_strategy().

◆ ff_eac3_set_cpl_states()

void ff_eac3_set_cpl_states ( AC3EncodeContext s)

Set coupling states.

This determines whether certain flags must be written to the bitstream or whether they will be implicitly already known by the decoder.

Definition at line 97 of file eac3enc.c.

Referenced by apply_channel_coupling().

◆ eac3_output_frame_header()

static void eac3_output_frame_header ( AC3EncodeContext s)
static

Write the E-AC-3 frame header to the output bitstream.

Definition at line 132 of file eac3enc.c.

Referenced by eac3_encode_init().

◆ eac3_encode_init()

static av_cold int eac3_encode_init ( AVCodecContext avctx)
static

Definition at line 252 of file eac3enc.c.

Variable Documentation

◆ eac3enc_class

const AVClass eac3enc_class
static
Initial value:
= {
.class_name = "E-AC-3 Encoder",
.item_name = av_default_item_name,
.option = &ff_ac3_enc_options[2],
}

Definition at line 37 of file eac3enc.c.

◆ eac3_frame_expstr_index_tab

int8_t eac3_frame_expstr_index_tab[3][4][4][4][4][4]
static

LUT for finding a matching frame exponent strategy index from a set of exponent strategies for a single channel across all 6 blocks.

Definition at line 48 of file eac3enc.c.

Referenced by eac3_exponent_init(), and ff_eac3_get_frame_exp_strategy().

◆ ff_eac3_encoder

const FFCodec ff_eac3_encoder
Initial value:
= {
.p.name = "eac3",
CODEC_LONG_NAME("ATSC A/52 E-AC-3"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(AC3EncodeContext),
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
.p.priv_class = &eac3enc_class,
.p.supported_samplerates = ff_ac3_sample_rate_tab,
.p.ch_layouts = ff_ac3_ch_layouts,
.defaults = ff_ac3_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 265 of file eac3enc.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
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: codec_internal.h:42
ff_ac3_encode_frame
int ff_ac3_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: ac3enc.c:1984
eac3enc_class
static const AVClass eac3enc_class
Definition: eac3enc.c:37
ff_ac3_enc_options
const AVOption ff_ac3_enc_options[]
Definition: ac3enc.c:84
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:296
ff_ac3_ch_layouts
const AVChannelLayout ff_ac3_ch_layouts[19]
List of supported channel layouts.
Definition: ac3enc.c:156
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
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:237
AC3EncodeContext
AC-3 encoder private context.
Definition: ac3enc.h:157
AV_CODEC_ID_EAC3
@ AV_CODEC_ID_EAC3
Definition: codec_id.h:480
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
eac3_encode_init
static av_cold int eac3_encode_init(AVCodecContext *avctx)
Definition: eac3enc.c:252
ff_ac3_sample_rate_tab
const int ff_ac3_sample_rate_tab[]
Definition: ac3tab.c:95
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
ff_ac3_enc_defaults
const FFCodecDefault ff_ac3_enc_defaults[]
Definition: ac3enc.c:141
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:2157