From ceb591215d618a917d247cd5e9c048bab6332dfe Mon Sep 17 00:00:00 2001 From: Brad Hards Date: Wed, 30 Oct 2024 09:05:36 +1100 Subject: [PATCH] evc: lint cleanups --- libheif/codecs/evc_boxes.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libheif/codecs/evc_boxes.cc b/libheif/codecs/evc_boxes.cc index 569cefdbae..d09e6823db 100644 --- a/libheif/codecs/evc_boxes.cc +++ b/libheif/codecs/evc_boxes.cc @@ -24,6 +24,9 @@ #include "file.h" #include +#include +#include +#include #include @@ -142,10 +145,10 @@ Error Box_evcC::write(StreamWriter& writer) const writer.write8(m_configuration.level_idc); writer.write32(m_configuration.toolset_idc_h); writer.write32(m_configuration.toolset_idc_l); - uint8_t bit_depth_luma_minus8 = ((m_configuration.bit_depth_luma - 8) & 0b111); - uint8_t bit_depth_chroma_minus8 = ((m_configuration.bit_depth_chroma - 8) & 0b111); - uint8_t b = (m_configuration.chroma_format_idc << 6) | (bit_depth_luma_minus8 << 3) | bit_depth_chroma_minus8; - writer.write8(b); + uint8_t chroma_format_idc_bits = m_configuration.chroma_format_idc << 6; + uint8_t bit_depth_luma_minus8_bits = ((m_configuration.bit_depth_luma - 8) & 0b111) << 3; + uint8_t bit_depth_chroma_minus8_bits = ((m_configuration.bit_depth_chroma - 8) & 0b111); + writer.write8(chroma_format_idc_bits | bit_depth_luma_minus8_bits | bit_depth_chroma_minus8_bits); writer.write16(m_configuration.pic_width_in_luma_samples); writer.write16(m_configuration.pic_height_in_luma_samples); writer.write8(m_configuration.lengthSize - 1);