From 529d3bb4944cd2bad90403ad8021e4991216546f Mon Sep 17 00:00:00 2001 From: Justin Turner Arthur Date: Sat, 16 Nov 2024 03:01:47 -0600 Subject: [PATCH] Treat non-subsampled XYZ tristimulus as RGB color family. It better conveys that they are matrix-able primaries. --- src/videosource.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/videosource.cpp b/src/videosource.cpp index d1cdbd9..0389288 100644 --- a/src/videosource.cpp +++ b/src/videosource.cpp @@ -55,6 +55,12 @@ static int GetColorFamily(const AVPixFmtDescriptor *Desc) { return 1; else if (Desc->flags & AV_PIX_FMT_FLAG_RGB) return 2; + else if ( + Desc->flags & AV_PIX_FMT_FLAG_XYZ + && Desc->log2_chroma_h == 0 + && Desc->log2_chroma_w == 0 + ) + return 2; else return 3; }