/* * Copyright 2019 The libgav1 Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LIBGAV1_SRC_OBU_PARSER_H_ #define LIBGAV1_SRC_OBU_PARSER_H_ #include <array> #include <cstddef> #include <cstdint> #include <memory> #include <type_traits> #include <utility> #include "src/buffer_pool.h" #include "src/decoder_state.h" #include "src/dsp/common.h" #include "src/gav1/decoder_buffer.h" #include "src/gav1/status_code.h" #include "src/quantizer.h" #include "src/utils/common.h" #include "src/utils/compiler_attributes.h" #include "src/utils/constants.h" #include "src/utils/raw_bit_reader.h" #include "src/utils/segmentation.h" #include "src/utils/vector.h" namespace libgav1 { // structs and enums related to Open Bitstream Units (OBU). enum { … }; // anonymous enum struct ObuHeader { … }; enum BitstreamProfile : uint8_t { … }; // In the bitstream the level is encoded in five bits: the first three bits // encode |major| - 2 and the last two bits encode |minor|. // // If the mapped level (major.minor) is in the tables in Annex A.3, there are // bitstream conformance requirements on the maximum or minimum values of // several variables. The encoded value of 31 (which corresponds to the mapped // level 9.3) is the "maximum parameters" level and imposes no level-based // constraints on the bitstream. struct BitStreamLevel { … }; struct ColorConfig { … }; struct TimingInfo { … }; struct DecoderModelInfo { … }; struct OperatingParameters { … }; struct ObuSequenceHeader { … }; // Verify it is safe to use offsetof with ObuSequenceHeader and to use memcmp // to compare two ObuSequenceHeader objects. static_assert …; // Verify operating_parameters is the last member of ObuSequenceHeader. The // second assertion assumes that ObuSequenceHeader has no padding after the // operating_parameters field. The first assertion is a sufficient condition // for ObuSequenceHeader to have no padding after the operating_parameters // field. static_assert …; static_assert …; struct TileBuffer { … }; enum MetadataType : uint8_t { … }; class ObuParser : public Allocable { … }; } // namespace libgav1 #endif // LIBGAV1_SRC_OBU_PARSER_H_