summaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc_template.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-03 15:28:35 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-01-09 04:06:32 +0100
commit277281ac8eb7337a8d6dbddc9ffcfffabe44b40c (patch)
tree8e4a964eb424e8496988d19521c3193331d52648 /libavcodec/ac3enc_template.c
parent49a12ac4af32f82643b840c40d2af2f9e2623729 (diff)
avcodec/ac3enc: Factor common end of float/fixed encode_frame out
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/ac3enc_template.c')
-rw-r--r--libavcodec/ac3enc_template.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
index a486c95c8e..0fdc95b968 100644
--- a/libavcodec/ac3enc_template.c
+++ b/libavcodec/ac3enc_template.c
@@ -407,27 +407,5 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
if (AC3ENC_FLOAT)
scale_coefficients(s);
- ff_ac3_apply_rematrixing(s);
-
- ff_ac3_process_exponents(s);
-
- ret = ff_ac3_compute_bit_allocation(s);
- if (ret) {
- av_log(avctx, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");
- return ret;
- }
-
- ff_ac3_group_exponents(s);
-
- ff_ac3_quantize_mantissas(s);
-
- if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size, 0)) < 0)
- return ret;
- ff_ac3_output_frame(s, avpkt->data);
-
- if (frame->pts != AV_NOPTS_VALUE)
- avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
-
- *got_packet_ptr = 1;
- return 0;
+ return ff_ac3_encode_frame_common_end(avctx, avpkt, frame, got_packet_ptr);
}