* E-AC-3 encoder
*/
-#define CONFIG_AC3ENC_FLOAT 1
+#define AC3ENC_FLOAT 1
#include "libavutil/attributes.h"
#include "ac3enc.h"
#include "eac3_data.h"
-#define AC3ENC_TYPE AC3ENC_TYPE_EAC3
-#include "ac3enc_opts_template.c"
-
static const AVClass eac3enc_class = {
.class_name = "E-AC-3 Encoder",
.item_name = av_default_item_name,
- .option = ac3_options,
+ .option = &ff_ac3_enc_options[2], /* First two options are AC-3 only. */
.version = LIBAVUTIL_VERSION_INT,
};
/* frame header */
if (s->num_blocks == 6) {
- put_bits(&s->pb, 1, !s->use_frame_exp_strategy);/* exponent strategy syntax */
- put_bits(&s->pb, 1, 0); /* aht enabled = no */
+ put_bits(&s->pb, 1, !s->use_frame_exp_strategy); /* exponent strategy syntax */
+ put_bits(&s->pb, 1, 0); /* aht enabled = no */
}
put_bits(&s->pb, 2, 0); /* snr offset strategy = 1 */
put_bits(&s->pb, 1, 0); /* transient pre-noise processing enabled = no */
if (s->num_blocks != 6) {
put_bits(&s->pb, 1, 0);
} else {
- for (ch = 1; ch <= s->fbw_channels; ch++) {
- if (s->use_frame_exp_strategy)
- put_bits(&s->pb, 5, s->frame_exp_strategy[ch]);
- else
- put_bits(&s->pb, 5, 0);
- }
+ for (ch = 1; ch <= s->fbw_channels; ch++) {
+ if (s->use_frame_exp_strategy)
+ put_bits(&s->pb, 5, s->frame_exp_strategy[ch]);
+ else
+ put_bits(&s->pb, 5, 0);
+ }
}
/* snr offsets */
put_bits(&s->pb, 6, s->coarse_snr_offset);
}
-AVCodec ff_eac3_encoder = {
+const AVCodec ff_eac3_encoder = {
.name = "eac3",
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 E-AC-3"),
.type = AVMEDIA_TYPE_AUDIO,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &eac3enc_class,
+ .supported_samplerates = ff_ac3_sample_rate_tab,
.channel_layouts = ff_ac3_channel_layouts,
- .defaults = ac3_defaults,
+ .defaults = ff_ac3_enc_defaults,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};