7#include <packager/media/codecs/av1_codec_configuration_record.h>
13#include <absl/strings/str_format.h>
15#include <packager/media/base/bit_reader.h>
16#include <packager/media/base/rcheck.h>
21AV1CodecConfigurationRecord::AV1CodecConfigurationRecord() =
default;
23AV1CodecConfigurationRecord::~AV1CodecConfigurationRecord() =
default;
50 RCHECK(data_size > 0);
59 RCHECK(reader.
ReadBits(7, &version));
62 RCHECK(reader.
ReadBits(3, &profile_));
68 RCHECK(reader.
ReadBits(1, &high_bitdepth));
69 RCHECK(reader.
ReadBits(1, &twelve_bit));
70 bit_depth_ = twelve_bit ? 12 : (high_bitdepth ? 10 : 8);
72 RCHECK(reader.
ReadBits(1, &mono_chrome_));
73 RCHECK(reader.
ReadBits(1, &chroma_subsampling_x_));
74 RCHECK(reader.
ReadBits(1, &chroma_subsampling_y_));
75 RCHECK(reader.
ReadBits(2, &chroma_sample_position_));
93 return absl::StrFormat(
"av01.%d.%02d%c.%02d", profile_, level_,
94 tier_ ?
'H' :
'M', bit_depth_);
100 uint16_t color_primaries,
101 uint16_t transfer_characteristics,
102 uint16_t matrix_coefficients,
103 uint8_t video_full_range_flag)
const {
104 return absl::StrFormat(
"av01.%d.%02d%c.%02d.%d.%d%d%d.%02d.%02d.%02d.%d",
105 profile_, level_, tier_ ?
'H' :
'M', bit_depth_,
106 mono_chrome_, chroma_subsampling_x_,
107 chroma_subsampling_y_, chroma_sample_position_,
108 color_primaries, transfer_characteristics,
109 matrix_coefficients, video_full_range_flag ? 1 : 0);
All the methods that are virtual are virtual for mocking.