Go to the documentation of this file.
27 #define AC3ENC_FLOAT 1
59 for (
i = 0;
i < 32;
i++) {
74 if (
s->num_blocks < 6) {
75 s->use_frame_exp_strategy = 0;
79 s->use_frame_exp_strategy = 1;
80 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++) {
82 [
s->exp_strategy[ch][1]]
83 [
s->exp_strategy[ch][2]]
84 [
s->exp_strategy[ch][3]]
85 [
s->exp_strategy[ch][4]]
86 [
s->exp_strategy[ch][5]];
88 s->use_frame_exp_strategy = 0;
91 s->frame_exp_strategy[ch] = expstr;
103 for (ch = 1; ch <=
s->fbw_channels; ch++)
104 first_cpl_coords[ch] = 1;
107 for (ch = 1; ch <=
s->fbw_channels; ch++) {
108 if (
block->channel_in_cpl[ch]) {
109 if (first_cpl_coords[ch]) {
110 block->new_cpl_coords[ch] = 2;
111 first_cpl_coords[ch] = 0;
114 first_cpl_coords[ch] = 1;
122 if (
block->cpl_in_use) {
123 block->new_cpl_leak = 2;
142 put_bits(&
s->pb, 11, (
s->frame_size / 2) - 1);
156 put_bits(&
s->pb, 3,
s->ltrt_center_mix_level);
157 put_bits(&
s->pb, 3,
s->loro_center_mix_level);
159 if (
s->has_surround) {
160 put_bits(&
s->pb, 3,
s->ltrt_surround_mix_level);
161 put_bits(&
s->pb, 3,
s->loro_surround_mix_level);
192 if (
s->num_blocks != 6)
193 put_bits(&
s->pb, 1, !(
s->avctx->frame_num % 6));
197 if (
s->num_blocks == 6) {
198 put_bits(&
s->pb, 1, !
s->use_frame_exp_strategy);
216 if (
block->new_cpl_strategy)
221 if (
s->use_frame_exp_strategy) {
222 for (ch = !
s->cpl_on; ch <= s->fbw_channels; ch++)
223 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
226 for (ch = !
s->blocks[
blk].cpl_in_use; ch <= s->fbw_channels; ch++)
234 if (
s->num_blocks != 6) {
237 for (ch = 1; ch <=
s->fbw_channels; ch++) {
238 if (
s->use_frame_exp_strategy)
239 put_bits(&
s->pb, 5,
s->frame_exp_strategy[ch]);
248 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
#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[]
static void eac3_output_frame_header(AC3EncodeContext *s)
Write the E-AC-3 frame header to the output bitstream.
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