Skip to content

Commit

Permalink
Removed unnecessary check for identity
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Nov 1, 2024
1 parent ba51763 commit a36f502
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/codecs/avif/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,12 @@ impl<R: Read> ImageDecoder for AvifDecoder<R> {
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()),
Expand Down

0 comments on commit a36f502

Please sign in to comment.