Go to the documentation of this file.
27 #define AC3ENC_FLOAT 1
54 for (
i = 0;
i < 32;
i++) {
69 if (
s->num_blocks < 6) {
70 s->use_frame_exp_strategy = 0;
74 s->use_frame_exp_strategy = 1;
75 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++) {
77 [
s->exp_strategy[ch][1]]
78 [
s->exp_strategy[ch][2]]
79 [
s->exp_strategy[ch][3]]
80 [
s->exp_strategy[ch][4]]
81 [
s->exp_strategy[ch][5]];
83 s->use_frame_exp_strategy = 0;
86 s->frame_exp_strategy[ch] = expstr;
98 for (ch = 1; ch <=
s->fbw_channels; ch++)
99 first_cpl_coords[ch] = 1;
102 for (ch = 1; ch <=
s->fbw_channels; ch++) {
103 if (
block->channel_in_cpl[ch]) {
104 if (first_cpl_coords[ch]) {
105 block->new_cpl_coords[ch] = 2;
106 first_cpl_coords[ch] = 0;
109 first_cpl_coords[ch] = 1;
117 if (
block->cpl_in_use) {
118 block->new_cpl_leak = 2;
135 put_bits(&
s->pb, 11, (
s->frame_size / 2) - 1);
136 if (
s->bit_alloc.sr_shift) {
154 put_bits(&
s->pb, 3,
s->ltrt_center_mix_level);
155 put_bits(&
s->pb, 3,
s->loro_center_mix_level);
157 if (
s->has_surround) {
158 put_bits(&
s->pb, 3,
s->ltrt_surround_mix_level);
159 put_bits(&
s->pb, 3,
s->loro_surround_mix_level);
190 if (
s->num_blocks != 6)
191 put_bits(&
s->pb, 1, !(
s->avctx->frame_number % 6));
195 if (
s->num_blocks == 6) {
196 put_bits(&
s->pb, 1, !
s->use_frame_exp_strategy);
214 if (
block->new_cpl_strategy)
219 if (
s->use_frame_exp_strategy) {
220 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++)
221 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
224 for (ch = !
s->blocks[
blk].cpl_in_use; ch <= s->fbw_channels; ch++)
232 if (
s->num_blocks != 6) {
235 for (ch = 1; ch <=
s->fbw_channels; ch++) {
236 if (
s->use_frame_exp_strategy)
237 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
246 if (
s->num_blocks > 1)
@ AV_SAMPLE_FMT_FLTP
float, planar
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
const AVCodecDefault ff_ac3_enc_defaults[]
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.
const AVOption ff_ac3_enc_options[]
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 AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int dolby_surround_ex_mode
const AVCodec ff_eac3_encoder
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)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
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
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