Skip to content

Commit

Permalink
evc: lint cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh committed Oct 29, 2024
1 parent 5adbf4c commit 12830ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions libheif/codecs/evc_boxes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "file.h"

#include <iomanip>
#include <string>
#include <utility>
#include <vector>
#include <libheif/api_structs.h>


Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 12830ab

Please sign in to comment.