Go to the documentation of this file.
27 #define AC3ENC_FLOAT 1
55 for (
i = 0;
i < 32;
i++) {
70 if (
s->num_blocks < 6) {
71 s->use_frame_exp_strategy = 0;
75 s->use_frame_exp_strategy = 1;
76 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++) {
78 [
s->exp_strategy[ch][1]]
79 [
s->exp_strategy[ch][2]]
80 [
s->exp_strategy[ch][3]]
81 [
s->exp_strategy[ch][4]]
82 [
s->exp_strategy[ch][5]];
84 s->use_frame_exp_strategy = 0;
87 s->frame_exp_strategy[ch] = expstr;
99 for (ch = 1; ch <=
s->fbw_channels; ch++)
100 first_cpl_coords[ch] = 1;
103 for (ch = 1; ch <=
s->fbw_channels; ch++) {
104 if (
block->channel_in_cpl[ch]) {
105 if (first_cpl_coords[ch]) {
106 block->new_cpl_coords[ch] = 2;
107 first_cpl_coords[ch] = 0;
110 first_cpl_coords[ch] = 1;
118 if (
block->cpl_in_use) {
119 block->new_cpl_leak = 2;
136 put_bits(&
s->pb, 11, (
s->frame_size / 2) - 1);
137 if (
s->bit_alloc.sr_shift) {
155 put_bits(&
s->pb, 3,
s->ltrt_center_mix_level);
156 put_bits(&
s->pb, 3,
s->loro_center_mix_level);
158 if (
s->has_surround) {
159 put_bits(&
s->pb, 3,
s->ltrt_surround_mix_level);
160 put_bits(&
s->pb, 3,
s->loro_surround_mix_level);
191 if (
s->num_blocks != 6)
192 put_bits(&
s->pb, 1, !(
s->avctx->frame_number % 6));
196 if (
s->num_blocks == 6) {
197 put_bits(&
s->pb, 1, !
s->use_frame_exp_strategy);
215 if (
block->new_cpl_strategy)
220 if (
s->use_frame_exp_strategy) {
221 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++)
222 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
225 for (ch = !
s->blocks[
blk].cpl_in_use; ch <= s->fbw_channels; ch++)
233 if (
s->num_blocks != 6) {
236 for (ch = 1; ch <=
s->fbw_channels; ch++) {
237 if (
s->use_frame_exp_strategy)
238 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
247 if (
s->num_blocks > 1)
267 #if FF_API_OLD_CHANNEL_LAYOUT
268 .p.channel_layouts = ff_ac3_channel_layouts,
#define FF_ENABLE_DEPRECATION_WARNINGS
@ AV_SAMPLE_FMT_FLTP
float, planar
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
const uint8_t ff_eac3_frm_expstr[32][6]
Table E2.14 Frame Exponent Strategy Combinations.
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[]
AVCodec p
The public AVCodec.
int ff_ac3_float_encode_init(AVCodecContext *avctx)
#define FF_CODEC_ENCODE_CB(func)
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 AVChannelLayout ff_ac3_ch_layouts[19]
List of supported channel layouts.
const FF_DISABLE_DEPRECATION_WARNINGS FFCodec ff_eac3_encoder
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.
#define AC3_MAX_CHANNELS
maximum number of channels, including coupling channel
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
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.
#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 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
#define FF_DISABLE_DEPRECATION_WARNINGS
const FFCodecDefault ff_ac3_enc_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