[FFmpeg-devel] [PATCH 03/11] avcodec/ffv1enc: remap mode 2 is for floats only

Michael Niedermayer michael at niedermayer.cc
Mon Mar 24 19:39:37 EET 2025


(you could use it for others but it makes no sense)

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

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 432e1493582..05b43c12abf 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -951,6 +951,11 @@ av_cold int ff_ffv1_encode_setup_plane_info(AVCodecContext *avctx,
         av_log(avctx, AV_LOG_ERROR, "32bit requires remap\n");
         return AVERROR(EINVAL);
     }
+    if (s->remap_mode == 2 &&
+        !((s->bits_per_raw_sample == 16 || s->bits_per_raw_sample == 32 || s->bits_per_raw_sample == 64) && s->flt)) {
+        av_log(avctx, AV_LOG_ERROR, "remap 2 is for float16/32/64 only\n");
+        return AVERROR(EINVAL);
+    }
 
     return av_pix_fmt_get_chroma_sub_sample(pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
 }
-- 
2.48.1



More information about the ffmpeg-devel mailing list