• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 HiHope Open Source Organization .
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef VideoExt_h
17 #define VideoExt_h
18 
19 #include <OMX_IVCommon.h>
20 #include <codec_omx_ext.h>
21 typedef enum OMX_RANGE {
22     RangeUnspecified,
23     RangeFull,
24     RangeLimited,
25     RangeOther = 0xff,
26 } OMX_RANGE;
27 
28 typedef enum OMX_PRIMARIES {
29     PrimariesUnspecified,
30     PrimariesBT709_5,       // Rec.ITU-R BT.709-5 or equivalent
31     PrimariesBT470_6M,      // Rec.ITU-R BT.470-6 System M or equivalent
32     PrimariesBT601_6_625,   // Rec.ITU-R BT.601-6 625 or equivalent
33     PrimariesBT601_6_525,   // Rec.ITU-R BT.601-6 525 or equivalent
34     PrimariesGenericFilm,   // Generic Film
35     PrimariesBT2020,        // Rec.ITU-R BT.2020 or equivalent
36     PrimariesOther = 0xff,
37 } OMX_PRIMARIES;
38 
39 typedef enum OMX_TRANSFER {
40     TransferUnspecified,
41     TransferLinear,         // Linear transfer characteristics
42     TransferSRGB,           // sRGB or equivalent
43     TransferSMPTE170M,      // SMPTE 170M or equivalent (e.g. BT.601/709/2020)
44     TransferGamma22,        // Assumed display gamma 2.2
45     TransferGamma28,        // Assumed display gamma 2.8
46     TransferST2084,         // SMPTE ST 2084 for 10/12/14/16 bit systems
47     TransferHLG,            // ARIB STD-B67 hybrid-log-gamma
48     TransferSMPTE240M = 0x40, // SMPTE 240M
49     TransferXvYCC,          // IEC 61966-2-4
50     TransferBT1361,         // Rec.ITU-R BT.1361 extended gamut
51     TransferST428,          // SMPTE ST 428-1
52     TransferOther = 0xff,
53 } OMX_TRANSFER;
54 
55 typedef enum OMX_MATRIXCOEFFS {
56     MatrixUnspecified,
57     MatrixBT709_5,          // Rec.ITU-R BT.709-5 or equivalent
58     MatrixBT470_6M,         // KR=0.30, KB=0.11 or equivalent
59     MatrixBT601_6,          // Rec.ITU-R BT.601-6 625 or equivalent
60     MatrixSMPTE240M,        // SMPTE 240M or equivalent
61     MatrixBT2020,           // Rec.ITU-R BT.2020 non-constant luminance
62     MatrixBT2020Constant,   // Rec.ITU-R BT.2020 constant luminance
63     MatrixOther = 0xff,
64 } OMX_MATRIXCOEFFS;
65 
66 typedef struct OMX_COLORASPECTS {
67     OMX_RANGE mRange;                // IN/OUT
68     OMX_PRIMARIES mPrimaries;        // IN/OUT
69     OMX_TRANSFER mTransfer;          // IN/OUT
70     OMX_MATRIXCOEFFS mMatrixCoeffs;  // IN/OUT
71 } OMX_COLORASPECTS;
72 
73 typedef struct ISO_COLORASPECTS {
74     OMX_U32 mRange;                 // IN/OUT
75     OMX_U32 mPrimaries;             // IN/OUT
76     OMX_U32 mTransfer;              // IN/OUT
77     OMX_U32 mMatrixCoeffs;          // IN/OUT
78 } ISO_COLORASPECTS;
79 
80 typedef struct OMX_CONFIG_DESCRIBECOLORASPECTSPARAMS {
81     OMX_U32  nSize;                // IN
82     OMX_VERSIONTYPE nVersion;      // IN
83     OMX_U32  nPortIndex;           // IN
84     OMX_BOOL bRequestingDataSpace; // IN
85     OMX_BOOL bDataSpaceChanged;    // IN
86     OMX_U32  nPixelFormat;         // IN
87     OMX_U32  nDataSpace;           // OUT
88     OMX_COLORASPECTS sAspects;  // IN/OUT
89 } OMX_CONFIG_DESCRIBECOLORASPECTSPARAMS;
90 
91 typedef enum OMX_VIDEO_CODINGTYPEEXT {
92     OMX_VIDEO_CodingVP8EXT = 9,
93     OMX_VIDEO_AVCLevel52  = 0x10000,
94 }OMX_VIDEO_CODINGTYPEEXT;
95 
96 typedef enum OMX_VIDEO_VP9PROFILETYPE {
97     OMX_VIDEO_VP9Profile0       = 0x1,
98     OMX_VIDEO_VP9Profile1       = 0x2,
99     OMX_VIDEO_VP9Profile2       = 0x4,
100     OMX_VIDEO_VP9Profile3       = 0x8,
101     // HDR profiles also support passing HDR metadata
102     OMX_VIDEO_VP9Profile2HDR    = 0x1000,
103     OMX_VIDEO_VP9Profile3HDR    = 0x2000,
104     OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF,
105     OMX_VIDEO_VP9ProfileMax     = 0x7FFFFFFF
106 } OMX_VIDEO_VP9PROFILETYPE;
107 
108 /** VP9 levels */
109 typedef enum OMX_VIDEO_VP9LEVELTYPE {
110     OMX_VIDEO_VP9Level1       = 0x1,
111     OMX_VIDEO_VP9Level11      = 0x2,
112     OMX_VIDEO_VP9Level2       = 0x4,
113     OMX_VIDEO_VP9Level21      = 0x8,
114     OMX_VIDEO_VP9Level3       = 0x10,
115     OMX_VIDEO_VP9Level31      = 0x20,
116     OMX_VIDEO_VP9Level4       = 0x40,
117     OMX_VIDEO_VP9Level41      = 0x80,
118     OMX_VIDEO_VP9Level5       = 0x100,
119     OMX_VIDEO_VP9Level51      = 0x200,
120     OMX_VIDEO_VP9Level52      = 0x400,
121     OMX_VIDEO_VP9Level6       = 0x800,
122     OMX_VIDEO_VP9Level61      = 0x1000,
123     OMX_VIDEO_VP9Level62      = 0x2000,
124     OMX_VIDEO_VP9LevelUnknown = 0x6EFFFFFF,
125     OMX_VIDEO_VP9LevelMax     = 0x7FFFFFFF
126 } OMX_VIDEO_VP9LEVELTYPE;
127 
128 /** Structure to define if dependent slice segments should be used */
129 typedef struct OMX_VIDEO_SLICESEGMENTSTYPE {
130     OMX_U32 nSize;
131     OMX_VERSIONTYPE nVersion;
132     OMX_U32 nPortIndex;
133     OMX_BOOL bDepedentSegments;
134     OMX_BOOL bEnableLoopFilterAcrossSlices;
135 } OMX_VIDEO_SLICESEGMENTSTYPE;
136 #endif