From a36f5028d9845b7da4d86e0041d04105dd9e18d2 Mon Sep 17 00:00:00 2001 From: Radzivon Bartoshyk Date: Fri, 1 Nov 2024 22:56:26 +0000 Subject: [PATCH] Removed unnecessary check for identity --- src/codecs/avif/decoder.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/codecs/avif/decoder.rs b/src/codecs/avif/decoder.rs index f64acd8478..910036bcac 100644 --- a/src/codecs/avif/decoder.rs +++ b/src/codecs/avif/decoder.rs @@ -343,13 +343,12 @@ impl ImageDecoder for AvifDecoder { dav1d::pixel::YUVRange::Full => YuvIntensityRange::Pc, }; - let is_identity = - self.picture.matrix_coefficients() == dav1d::pixel::MatrixCoefficients::Identity; - let color_matrix = get_matrix(self.picture.matrix_coefficients())?; // Identity matrix should be possible only on 4:4:4 - if is_identity && self.picture.pixel_layout() != PixelLayout::I444 { + if color_matrix == YuvStandardMatrix::Identity + && self.picture.pixel_layout() != PixelLayout::I444 + { return Err(ImageError::Decoding(DecodingError::new( ImageFormat::Avif.into(), AvifDecoderError::YuvLayoutOnIdentityMatrix(self.picture.pixel_layout()),