ffmpeg | branch: release/7.1 | Michael Niedermayer <mich...@niedermayer.cc> | Thu Oct 10 19:57:07 2024 +0200| [2a39eeb8deb3d46c75dea8250df8a70d2630dd32] | committer: Michael Niedermayer
avcodec/ffv1enc: Move slice termination into threads Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> (cherry picked from commit 8e52b1525831987bcc389c89ccf53a76e7177fe1) Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a39eeb8deb3d46c75dea8250df8a70d2630dd32 --- libavcodec/ffv1enc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 56af7dc427..96beb86cfa 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -1097,6 +1097,13 @@ retry: ret = encode_rgb_frame(f, sc, planes, width, height, p->linesize); } + if (f->ac != AC_GOLOMB_RICE) { + sc->ac_byte_count = ff_rac_terminate(&sc->c, 1); + } else { + flush_put_bits(&sc->pb); // FIXME: nicer padding + sc->ac_byte_count += put_bytes_output(&sc->pb); + } + if (ret < 0) { av_assert0(sc->slice_coding_mode == 0); if (f->version < 4 || !f->ac) { @@ -1221,14 +1228,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, buf_p = pkt->data; for (i = 0; i < f->slice_count; i++) { FFV1SliceContext *sc = &f->slices[i]; - int bytes; - - if (f->ac != AC_GOLOMB_RICE) { - bytes = ff_rac_terminate(&sc->c, 1); - } else { - flush_put_bits(&sc->pb); // FIXME: nicer padding - bytes = sc->ac_byte_count + put_bytes_output(&sc->pb); - } + int bytes = sc->ac_byte_count; if (i > 0 || f->version > 2) { av_assert0(bytes < pkt->size / f->slice_count); memmove(buf_p, sc->c.bytestream_start, bytes); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".