Go to the documentation of this file.
27 #define AC3ENC_FLOAT 1
60 for (
i = 0;
i < 32;
i++) {
75 if (
s->num_blocks < 6) {
76 s->use_frame_exp_strategy = 0;
80 s->use_frame_exp_strategy = 1;
81 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++) {
83 [
s->exp_strategy[ch][1]]
84 [
s->exp_strategy[ch][2]]
85 [
s->exp_strategy[ch][3]]
86 [
s->exp_strategy[ch][4]]
87 [
s->exp_strategy[ch][5]];
89 s->use_frame_exp_strategy = 0;
92 s->frame_exp_strategy[ch] = expstr;
104 for (ch = 1; ch <=
s->fbw_channels; ch++)
105 first_cpl_coords[ch] = 1;
108 for (ch = 1; ch <=
s->fbw_channels; ch++) {
109 if (
block->channel_in_cpl[ch]) {
110 if (first_cpl_coords[ch]) {
111 block->new_cpl_coords[ch] = 2;
112 first_cpl_coords[ch] = 0;
115 first_cpl_coords[ch] = 1;
123 if (
block->cpl_in_use) {
124 block->new_cpl_leak = 2;
143 put_bits(pb, 11, (
s->frame_size / 2) - 1);
157 put_bits(pb, 3,
s->ltrt_center_mix_level);
158 put_bits(pb, 3,
s->loro_center_mix_level);
160 if (
s->has_surround) {
161 put_bits(pb, 3,
s->ltrt_surround_mix_level);
162 put_bits(pb, 3,
s->loro_surround_mix_level);
193 if (
s->num_blocks != 6)
194 put_bits(pb, 1, !(
s->avctx->frame_num % 6));
198 if (
s->num_blocks == 6) {
199 put_bits(pb, 1, !
s->use_frame_exp_strategy);
213 put_bits(pb, 1,
s->blocks[0].cpl_in_use);
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(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(pb, 5,
s->frame_exp_strategy[ch]);
249 if (
s->num_blocks > 1)
@ 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
int ff_ac3_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
void ff_eac3_get_frame_exp_strategy(AC3EncodeContext *s)
Determine frame exponent strategy use and indices.
static const AVClass eac3enc_class
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)
static av_cold void eac3_exponent_init(void)
Initialize E-AC-3 exponent tables.
#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.
static int ff_thread_once(char *control, void(*routine)(void))
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
int audio_production_info
static void eac3_output_frame_header(AC3EncodeContext *s, PutBitContext *pb)
Write the E-AC-3 frame header to the output bitstream.
#define CODEC_LONG_NAME(str)
#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.
const FFCodec ff_eac3_encoder
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
int dolby_surround_ex_mode
static av_cold int eac3_encode_init(AVCodecContext *avctx)
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...
int preferred_stereo_downmix
main external API structure.
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