Go to the documentation of this file.
27 #define CONFIG_AC3ENC_FLOAT 1
35 #define AC3ENC_TYPE AC3ENC_TYPE_EAC3
57 for (
i = 0;
i < 32;
i++) {
72 if (
s->num_blocks < 6) {
73 s->use_frame_exp_strategy = 0;
77 s->use_frame_exp_strategy = 1;
78 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++) {
80 [
s->exp_strategy[ch][1]]
81 [
s->exp_strategy[ch][2]]
82 [
s->exp_strategy[ch][3]]
83 [
s->exp_strategy[ch][4]]
84 [
s->exp_strategy[ch][5]];
86 s->use_frame_exp_strategy = 0;
89 s->frame_exp_strategy[ch] = expstr;
101 for (ch = 1; ch <=
s->fbw_channels; ch++)
102 first_cpl_coords[ch] = 1;
105 for (ch = 1; ch <=
s->fbw_channels; ch++) {
106 if (
block->channel_in_cpl[ch]) {
107 if (first_cpl_coords[ch]) {
108 block->new_cpl_coords[ch] = 2;
109 first_cpl_coords[ch] = 0;
112 first_cpl_coords[ch] = 1;
120 if (
block->cpl_in_use) {
121 block->new_cpl_leak = 2;
138 put_bits(&
s->pb, 11, (
s->frame_size / 2) - 1);
139 if (
s->bit_alloc.sr_shift) {
157 put_bits(&
s->pb, 3,
s->ltrt_center_mix_level);
158 put_bits(&
s->pb, 3,
s->loro_center_mix_level);
160 if (
s->has_surround) {
161 put_bits(&
s->pb, 3,
s->ltrt_surround_mix_level);
162 put_bits(&
s->pb, 3,
s->loro_surround_mix_level);
193 if (
s->num_blocks != 6)
194 put_bits(&
s->pb, 1, !(
s->avctx->frame_number % 6));
198 if (
s->num_blocks == 6) {
199 put_bits(&
s->pb, 1, !
s->use_frame_exp_strategy);
217 if (
block->new_cpl_strategy)
222 if (
s->use_frame_exp_strategy) {
223 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++)
224 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
227 for (ch = !
s->blocks[
blk].cpl_in_use; ch <= s->fbw_channels; ch++)
235 if (
s->num_blocks != 6) {
238 for (ch = 1; ch <=
s->fbw_channels; ch++) {
239 if (
s->use_frame_exp_strategy)
240 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
249 if (
s->num_blocks > 1)
@ AV_SAMPLE_FMT_FLTP
float, planar
static av_cold int init(AVCodecContext *avctx)
const uint8_t ff_eac3_frm_expstr[32][6]
Table E2.14 Frame Exponent Strategy Combinations.
static enum AVSampleFormat sample_fmts[]
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
void ff_eac3_get_frame_exp_strategy(AC3EncodeContext *s)
Determine frame exponent strategy use and indices.
static const AVClass eac3enc_class
int ff_ac3_float_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
void ff_eac3_set_cpl_states(AC3EncodeContext *s)
Set coupling states.
int ff_ac3_float_encode_init(AVCodecContext *avctx)
#define AC3_MAX_CHANNELS
maximum number of channels, including coupling channel
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 sing...
const uint64_t ff_ac3_channel_layouts[19]
List of supported channel layouts.
int audio_production_info
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const char * av_default_item_name(void *ptr)
Return the context name.
AC-3 encoder private context.
Data for a single audio block.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int dolby_surround_ex_mode
void ff_eac3_output_frame_header(AC3EncodeContext *s)
Write the E-AC-3 frame header to the output bitstream.
Encoding Options used by AVOption.
const int ff_ac3_sample_rate_tab[]
#define i(width, name, range_min, range_max)
AVSampleFormat
Audio sample formats.
const char * name
Name of the codec implementation.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
av_cold void ff_eac3_exponent_init(void)
Initialize E-AC-3 exponent tables.
int preferred_stereo_downmix
static const AVCodecDefault ac3_defaults[]
av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
Finalize encoding and free any memory allocated by the encoder.
The exact code depends on how similar the blocks are and how related they are to the block
static const AVOption ac3_options[]