diff mbox series

[FFmpeg-devel] avcodec/ffv1enc: 2Pass mode is not possible with golomb coding

Message ID 20241001011125.1446217-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel] avcodec/ffv1enc: 2Pass mode is not possible with golomb coding | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Oct. 1, 2024, 1:11 a.m. UTC
"Fixes" Ticket7063

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/ffv1enc.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michael Niedermayer Oct. 1, 2024, 7:16 p.m. UTC | #1
On Tue, Oct 01, 2024 at 03:11:25AM +0200, Michael Niedermayer wrote:
> "Fixes" Ticket7063
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/ffv1enc.c | 5 +++++
>  1 file changed, 5 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index a6f405289eb..3222496daca 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -528,6 +528,11 @@  static av_cold int encode_init(AVCodecContext *avctx)
         avctx->slices > 1)
         s->version = FFMAX(s->version, 2);
 
+    if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) && s->ac == AC_GOLOMB_RICE) {
+        av_log(avctx, AV_LOG_ERROR, "2 Pass mode is not possible with golomb coding\n");
+        return AVERROR(EINVAL);
+    }
+
     // Unspecified level & slices, we choose version 1.2+ to ensure multithreaded decodability
     if (avctx->slices == 0 && avctx->level < 0 && avctx->width * avctx->height > 720*576)
         s->version = FFMAX(s->version, 2);