FFmpeg
Data Structures | Macros | Typedefs | Functions | Variables
ac3enc.h File Reference
#include <stdint.h>
#include "libavutil/opt.h"
#include "libavutil/tx.h"
#include "ac3.h"
#include "ac3defs.h"
#include "ac3dsp.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "mathops.h"
#include "me_cmp.h"
#include "put_bits.h"
#include "audiodsp.h"
#include "libavutil/fixed_dsp.h"

Go to the source code of this file.

Data Structures

struct  AC3EncOptions
 Encoding Options used by AVOption. More...
 
struct  AC3Block
 Data for a single audio block. More...
 
struct  AC3EncodeContext
 AC-3 encoder private context. More...
 

Macros

#define AC3ENC_FLOAT   0
 
#define AC3_NAME(x)   ff_ac3_fixed_ ## x
 
#define MAC_COEF(d, a, b)   MAC64(d,a,b)
 
#define COEF_MIN   -16777215
 
#define COEF_MAX   16777215
 
#define NEW_CPL_COORD_THRESHOLD   503317
 
#define AC3ENC_OPT_NONE   -1
 
#define AC3ENC_OPT_AUTO   -1
 
#define AC3ENC_OPT_OFF   0
 
#define AC3ENC_OPT_ON   1
 
#define AC3ENC_OPT_NOT_INDICATED   0
 
#define AC3ENC_OPT_MODE_ON   2
 
#define AC3ENC_OPT_MODE_OFF   1
 
#define AC3ENC_OPT_DSUREX_DPLIIZ   3
 
#define AC3ENC_OPT_LARGE_ROOM   1
 
#define AC3ENC_OPT_SMALL_ROOM   2
 
#define AC3ENC_OPT_DOWNMIX_LTRT   1
 
#define AC3ENC_OPT_DOWNMIX_LORO   2
 
#define AC3ENC_OPT_DOWNMIX_DPLII   3
 
#define AC3ENC_OPT_ADCONV_STANDARD   0
 
#define AC3ENC_OPT_ADCONV_HDCD   1
 

Typedefs

typedef int32_t SampleType
 
typedef int32_t CoefType
 
typedef int64_t CoefSumType
 

Functions

int ff_ac3_encode_init (AVCodecContext *avctx)
 
int ff_ac3_float_encode_init (AVCodecContext *avctx)
 
int ff_ac3_encode_close (AVCodecContext *avctx)
 Finalize encoding and free any memory allocated by the encoder. More...
 
int ff_ac3_validate_metadata (AC3EncodeContext *s)
 Validate metadata options as set by AVOption system. More...
 
void ff_ac3_adjust_frame_size (AC3EncodeContext *s)
 Adjust the frame size to make the average bit rate match the target bit rate. More...
 
void ff_ac3_compute_coupling_strategy (AC3EncodeContext *s)
 Set the initial coupling strategy parameters prior to coupling analysis. More...
 
int ff_ac3_encode_frame_common_end (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 
int ff_ac3_fixed_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 
int ff_ac3_float_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

const AVChannelLayout ff_ac3_ch_layouts [19]
 List of supported channel layouts. More...
 
const AVOption ff_ac3_enc_options []
 
const AVClass ff_ac3enc_class
 
const FFCodecDefault ff_ac3_enc_defaults []
 

Detailed Description

AC-3 encoder & E-AC-3 encoder common header

Definition in file ac3enc.h.

Macro Definition Documentation

◆ AC3ENC_FLOAT

#define AC3ENC_FLOAT   0

Definition at line 47 of file ac3enc.h.

◆ AC3_NAME

#define AC3_NAME (   x)    ff_ac3_fixed_ ## x

Definition at line 62 of file ac3enc.h.

◆ MAC_COEF

#define MAC_COEF (   d,
  a,
  b 
)    MAC64(d,a,b)

Definition at line 63 of file ac3enc.h.

◆ COEF_MIN

#define COEF_MIN   -16777215

Definition at line 64 of file ac3enc.h.

◆ COEF_MAX

#define COEF_MAX   16777215

Definition at line 65 of file ac3enc.h.

◆ NEW_CPL_COORD_THRESHOLD

#define NEW_CPL_COORD_THRESHOLD   503317

Definition at line 66 of file ac3enc.h.

◆ AC3ENC_OPT_NONE

#define AC3ENC_OPT_NONE   -1

Definition at line 73 of file ac3enc.h.

◆ AC3ENC_OPT_AUTO

#define AC3ENC_OPT_AUTO   -1

Definition at line 74 of file ac3enc.h.

◆ AC3ENC_OPT_OFF

#define AC3ENC_OPT_OFF   0

Definition at line 75 of file ac3enc.h.

◆ AC3ENC_OPT_ON

#define AC3ENC_OPT_ON   1

Definition at line 76 of file ac3enc.h.

◆ AC3ENC_OPT_NOT_INDICATED

#define AC3ENC_OPT_NOT_INDICATED   0

Definition at line 77 of file ac3enc.h.

◆ AC3ENC_OPT_MODE_ON

#define AC3ENC_OPT_MODE_ON   2

Definition at line 78 of file ac3enc.h.

◆ AC3ENC_OPT_MODE_OFF

#define AC3ENC_OPT_MODE_OFF   1

Definition at line 79 of file ac3enc.h.

◆ AC3ENC_OPT_DSUREX_DPLIIZ

#define AC3ENC_OPT_DSUREX_DPLIIZ   3

Definition at line 80 of file ac3enc.h.

◆ AC3ENC_OPT_LARGE_ROOM

#define AC3ENC_OPT_LARGE_ROOM   1

Definition at line 83 of file ac3enc.h.

◆ AC3ENC_OPT_SMALL_ROOM

#define AC3ENC_OPT_SMALL_ROOM   2

Definition at line 84 of file ac3enc.h.

◆ AC3ENC_OPT_DOWNMIX_LTRT

#define AC3ENC_OPT_DOWNMIX_LTRT   1

Definition at line 85 of file ac3enc.h.

◆ AC3ENC_OPT_DOWNMIX_LORO

#define AC3ENC_OPT_DOWNMIX_LORO   2

Definition at line 86 of file ac3enc.h.

◆ AC3ENC_OPT_DOWNMIX_DPLII

#define AC3ENC_OPT_DOWNMIX_DPLII   3

Definition at line 87 of file ac3enc.h.

◆ AC3ENC_OPT_ADCONV_STANDARD

#define AC3ENC_OPT_ADCONV_STANDARD   0

Definition at line 88 of file ac3enc.h.

◆ AC3ENC_OPT_ADCONV_HDCD

#define AC3ENC_OPT_ADCONV_HDCD   1

Definition at line 89 of file ac3enc.h.

Typedef Documentation

◆ SampleType

Definition at line 67 of file ac3enc.h.

◆ CoefType

typedef int32_t CoefType

Definition at line 68 of file ac3enc.h.

◆ CoefSumType

typedef int64_t CoefSumType

Definition at line 69 of file ac3enc.h.

Function Documentation

◆ ff_ac3_encode_init()

int ff_ac3_encode_init ( AVCodecContext avctx)

Definition at line 2562 of file ac3enc.c.

Referenced by ac3_fixed_encode_init(), and ff_ac3_float_encode_init().

◆ ff_ac3_float_encode_init()

int ff_ac3_float_encode_init ( AVCodecContext avctx)

Definition at line 103 of file ac3enc_float.c.

◆ ff_ac3_encode_close()

int ff_ac3_encode_close ( AVCodecContext avctx)

Finalize encoding and free any memory allocated by the encoder.

Parameters
avctxCodec context

Definition at line 2167 of file ac3enc.c.

◆ ff_ac3_validate_metadata()

int ff_ac3_validate_metadata ( AC3EncodeContext s)

Validate metadata options as set by AVOption system.

These values can optionally be changed per-frame.

Parameters
sAC-3 encoder private context

Definition at line 1984 of file ac3enc.c.

Referenced by encode_frame(), and validate_options().

◆ ff_ac3_adjust_frame_size()

void ff_ac3_adjust_frame_size ( AC3EncodeContext s)

Adjust the frame size to make the average bit rate match the target bit rate.

This is only needed for 11025, 22050, and 44100 sample rates or any E-AC-3.

Parameters
sAC-3 encoder private context

Definition at line 305 of file ac3enc.c.

Referenced by encode_frame().

◆ ff_ac3_compute_coupling_strategy()

void ff_ac3_compute_coupling_strategy ( AC3EncodeContext s)

Set the initial coupling strategy parameters prior to coupling analysis.

Parameters
sAC-3 encoder private context

Definition at line 323 of file ac3enc.c.

Referenced by encode_frame().

◆ ff_ac3_encode_frame_common_end()

int ff_ac3_encode_frame_common_end ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)

Definition at line 1795 of file ac3enc.c.

Referenced by encode_frame().

◆ ff_ac3_fixed_encode_frame()

int ff_ac3_fixed_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)

◆ ff_ac3_float_encode_frame()

int ff_ac3_float_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)

Variable Documentation

◆ ff_ac3_ch_layouts

const AVChannelLayout ff_ac3_ch_layouts[19]

List of supported channel layouts.

Definition at line 176 of file ac3enc.c.

◆ ff_ac3_enc_options

const AVOption ff_ac3_enc_options[]

Definition at line 80 of file ac3enc.c.

◆ ff_ac3enc_class

const AVClass ff_ac3enc_class

Definition at line 130 of file ac3enc.c.

◆ ff_ac3_enc_defaults

const FFCodecDefault ff_ac3_enc_defaults[]

Definition at line 137 of file ac3enc.c.