[FFmpeg-devel] [PATCH 2/2] avfilter/vf_zscale: fix mapping of zimg_chroma_location_e to AVChromaLocation

Jan Ekström jeebjp at gmail.com
Thu Oct 28 01:20:24 EEST 2021


The AVChromaLocation values are one higher than zimg's, not one
lower as the undefined value is set to zero (as opposed to zimg's
-1).
---
 libavfilter/vf_zscale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
index 439c0c8548..1288c5efc1 100644
--- a/libavfilter/vf_zscale.c
+++ b/libavfilter/vf_zscale.c
@@ -569,7 +569,7 @@ static void update_output_color_information(ZScaleContext *s, AVFrame *frame)
         frame->color_trc = (int)s->dst_format.transfer_characteristics;
 
     if (s->chromal != -1)
-        frame->chroma_location = (int)s->dst_format.chroma_location - 1;
+        frame->chroma_location = (int)s->dst_format.chroma_location + 1;
 }
 
 static int filter_frame(AVFilterLink *link, AVFrame *in)
-- 
2.31.1



More information about the ffmpeg-devel mailing list