/* * 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_UTILS_TYPES_H_ #define LIBGAV1_SRC_UTILS_TYPES_H_ #include <array> #include <cstddef> #include <cstdint> #include <memory> #include "src/utils/array_2d.h" #include "src/utils/constants.h" #include "src/utils/memory.h" namespace libgav1 { MotionVector; CompoundMotionVector; // Stores the motion information used for motion field estimation. struct TemporalMotionField : public Allocable { … }; // MvContexts contains the contexts used to decode portions of an inter block // mode info to set the y_mode field in BlockParameters. // // The contexts in the struct correspond to the ZeroMvContext, RefMvContext, // and NewMvContext variables in the spec. struct MvContexts { … }; struct PaletteModeInfo { … }; // Stores the parameters used by the prediction process. The members of the // struct are filled in when parsing the bitstream and used when the prediction // is computed. The information in this struct is associated with a single // block. // While both BlockParameters and PredictionParameters store information // pertaining to a Block, the only difference is that BlockParameters outlives // the block itself (for example, some of the variables in BlockParameters are // used to compute the context for reading elements in the subsequent blocks). struct PredictionParameters : public Allocable { … }; // A lot of BlockParameters objects are created, so the smallest type is used // for each field. The ranges of some fields are documented to justify why // their types are large enough. struct BlockParameters : public Allocable { … }; // Used to store the left and top block parameters that are used for computing // the cdf context of the subsequent blocks. struct BlockCdfContext { … }; // A five dimensional array used to store the wedge masks. The dimensions are: // - block_size_index (returned by GetWedgeBlockSizeIndex() in prediction.cc). // - flip_sign (0 or 1). // - wedge_index (0 to 15). // - each of those three dimensions is a 2d array of block_width by // block_height. WedgeMaskArray; enum GlobalMotionTransformationType : uint8_t { … }; // Global motion and warped motion parameters. See the paper for more info: // S. Parker, Y. Chen, D. Barker, P. de Rivaz, D. Mukherjee, "Global and locally // adaptive warped motion compensation in video compression", Proc. IEEE // International Conference on Image Processing (ICIP), pp. 275-279, Sep. 2017. struct GlobalMotion { … }; // Loop filter parameters: // // If level[0] and level[1] are both equal to 0, the loop filter process is // not invoked. // // |sharpness| and |delta_enabled| are only used by the loop filter process. // // The |ref_deltas| and |mode_deltas| arrays are used not only by the loop // filter process but also by the reference frame update and loading // processes. The loop filter process uses |ref_deltas| and |mode_deltas| only // when |delta_enabled| is true. struct LoopFilter { … }; struct Delta { … }; struct Cdef { … }; struct TileInfo { … }; struct LoopRestoration { … }; // Stores the quantization parameters of Section 5.9.12. struct QuantizerParameters { … }; // The corresponding segment feature constants in the AV1 spec are named // SEG_LVL_xxx. enum SegmentFeature : uint8_t { … }; struct Segmentation { … }; // Section 6.8.20. // Note: In spec, film grain section uses YCbCr to denote variable names, // such as num_cb_points, num_cr_points. To keep it consistent with other // parts of code, we use YUV, i.e., num_u_points, num_v_points, etc. struct FilmGrainParams { … }; struct ObuFrameHeader { … }; // Structure used for traversing the partition tree. struct PartitionTreeNode { … }; // Structure used for storing the transform parameters in a superblock. struct TransformParameters { … }; } // namespace libgav1 #endif // LIBGAV1_SRC_UTILS_TYPES_H_