aboutsummaryrefslogtreecommitdiff
path: root/core/inc/khronos/openmax/include/OMX_IntelVideoExt.h
blob: 9732d6498d967849ccbda8113de0ac99c75a83b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/*
 * Copyright (c) 2010 The Khronos Group Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

/** OMX_VideoExt.h - OpenMax IL version 1.1.2
 * The OMX_VideoExt header file contains extensions to the
 * definitions used by both the application and the component to
 * access video items.
 */

#ifndef OMX_IntelVideoExt_h
#define OMX_IntelVideoExt_h

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/* Each OMX header shall include all required header files to allow the
 * header to compile without errors.  The includes below are required
 * for this header file to compile successfully
 */
#include <OMX_Core.h>
/** NALU Formats */
typedef enum OMX_INTEL_NALUFORMATSTYPE {
    OMX_NaluFormatZeroByteInterleaveLength = 32,
    OMX_NaluFormatStartCodesSeparateFirstHeader = 64,
    OMX_NaluFormatLengthPrefixedSeparateFirstHeader = 128,
} OMX_INTEL_NALUFORMATSTYPE;


typedef struct OMX_VIDEO_PARAM_BYTESTREAMTYPE {
     OMX_U32 nSize;                 // Size of the structure
     OMX_VERSIONTYPE nVersion;      // OMX specification version
     OMX_U32 nPortIndex;            // Port that this structure applies to
     OMX_BOOL bBytestream;          // Enable/disable bytestream support
} OMX_VIDEO_PARAM_BYTESTREAMTYPE;

typedef struct OMX_VIDEO_CONFIG_INTEL_BITRATETYPE {
     OMX_U32 nSize;
     OMX_VERSIONTYPE nVersion;
     OMX_U32 nPortIndex;
     OMX_U32 nMaxEncodeBitrate;    // Maximum bitrate
     OMX_U32 nTargetPercentage;    // Target bitrate as percentage of maximum bitrate; e.g. 95 is 95%
     OMX_U32 nWindowSize;          // Window size in milliseconds allowed for bitrate to reach target
     OMX_U32 nInitialQP;           // Initial QP for I frames
     OMX_U32 nMinQP;
     OMX_U32 nMaxQP;
     OMX_U32 nFrameRate;
     OMX_U32 nTemporalID;
} OMX_VIDEO_CONFIG_INTEL_BITRATETYPE;

typedef enum OMX_VIDEO_INTEL_CONTROLRATETYPE {
    OMX_Video_Intel_ControlRateDisable,
    OMX_Video_Intel_ControlRateVariable,
    OMX_Video_Intel_ControlRateConstant,
    OMX_Video_Intel_ControlRateVideoConferencingMode,
    OMX_Video_Intel_ControlRateMax = 0x7FFFFFFF
} OMX_VIDEO_INTEL_CONTROLRATETYPE;

typedef struct OMX_VIDEO_PARAM_INTEL_BITRATETYPE {
     OMX_U32 nSize;
     OMX_VERSIONTYPE nVersion;
     OMX_U32 nPortIndex;
     OMX_VIDEO_INTEL_CONTROLRATETYPE eControlRate;
     OMX_U32 nTargetBitrate;
} OMX_VIDEO_PARAM_INTEL_BITRATETYPE;

typedef struct OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS {
     OMX_U32 nSize;                       // Size of the structure
     OMX_VERSIONTYPE nVersion;            // OMX specification version
     OMX_U32 nPortIndex;                  // Port that this structure applies to
     OMX_U32 nMaxNumberOfReferenceFrame;  // Maximum number of reference frames
     OMX_U32 nMaxWidth;                   // Maximum width of video
     OMX_U32 nMaxHeight;                  // Maximum height of video
} OMX_VIDEO_PARAM_INTEL_AVC_DECODE_SETTINGS;


typedef struct OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS {
     OMX_U32 nSize;                       // Size of the structure
     OMX_VERSIONTYPE nVersion;            // OMX specification version
     OMX_U32 nPortIndex;                  // Port that this structure applies to
     OMX_U32 nISliceNumber;               // I frame slice number
     OMX_U32 nPSliceNumber;               // P frame slice number
} OMX_VIDEO_CONFIG_INTEL_SLICE_NUMBERS;


typedef struct OMX_VIDEO_CONFIG_INTEL_AIR {
     OMX_U32 nSize;                       // Size of the structure
     OMX_VERSIONTYPE nVersion;            // OMX specification version
     OMX_U32 nPortIndex;                  // Port that this structure applies to
     OMX_BOOL bAirEnable;                 // Enable AIR
     OMX_BOOL bAirAuto;                   // AIR auto
     OMX_U32 nAirMBs;                     // Number of AIR MBs
     OMX_U32 nAirThreshold;               // AIR Threshold

} OMX_VIDEO_CONFIG_INTEL_AIR;

typedef struct OMX_VIDEO_PARAM_INTEL_AVCVUI {
     OMX_U32 nSize;                       // Size of the structure
     OMX_VERSIONTYPE nVersion;            // OMX specification version
     OMX_U32 nPortIndex;                  // Port that this structure applies to
     OMX_BOOL  bVuiGeneration;            // Enable/disable VUI generation

} OMX_VIDEO_PARAM_INTEL_AVCVUI;

typedef struct OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL {
     OMX_U32 nSize;                       // Size of the structure
     OMX_VERSIONTYPE nVersion;            // OMX specification version
     OMX_U32 nPortIndex;                  // Port that this structure applies to
     OMX_BOOL bEnable;                    // enable adaptive slice control
     OMX_U32 nMinPSliceNumber;            // minimum number of P slices
     OMX_U32 nNumPFramesToSkip;           // number of P frames after an I frame to skip before kicking in adaptive slice control
     OMX_U32 nSliceSizeThreshold;         // Slice size threshold for adaptive slice control to start a new slice
     OMX_U32 nSliceSizeSkipThreshold;     // Slice size skip threshold for adaptive slice control to start a new slice
} OMX_VIDEO_PARAM_INTEL_ADAPTIVE_SLICE_CONTROL;

/**
 * Vendor Private Configs
 *
 * STRUCT MEMBERS:
 *  nSize      : Size of the structure in bytes
 *  nVersion   : OMX specification version information
 *  nPortIndex : Port that this structure applies to
 *  nCapacity  : Specifies the private unit size
 *  nHolder    : Pointer to private unit address 
 */
typedef struct OMX_VIDEO_CONFIG_PRI_INFOTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nCapacity;
    OMX_PTR nHolder;
} OMX_VIDEO_CONFIG_PRI_INFOTYPE;

// Error reporting data structure
typedef struct OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnable;
} OMX_VIDEO_CONFIG_INTEL_ERROR_REPORT;

#define MAX_ERR_NUM 10

typedef enum
{
    OMX_Decode_HeaderError   = 0,
    OMX_Decode_MBError       = 1,
    OMX_Decode_SliceMissing  = 2,
    OMX_Decode_RefMissing    = 3,
} OMX_VIDEO_DECODE_ERRORTYPE;

typedef struct OMX_VIDEO_ERROR_INFO {
    OMX_VIDEO_DECODE_ERRORTYPE type;
    OMX_U32 num_mbs;
    union {
        struct {OMX_U32 start_mb; OMX_U32 end_mb;} mb_pos;
    } error_data;
};

typedef struct OMX_VIDEO_ERROR_BUFFER {
    OMX_U32 errorNumber;   // Error number should be no more than MAX_ERR_NUM
    OMX_S64 timeStamp;      // presentation time stamp
    OMX_VIDEO_ERROR_INFO errorArray[MAX_ERR_NUM];
};

// Force K frame for VP8 encode
typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bForceKFrame;
} OMX_VIDEO_CONFIG_INTEL_VP8_FORCE_KFRAME;

// max frame size for VP8 encode during WebRTC feature
typedef struct OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nMaxFrameSizeRatio;
} OMX_VIDEO_CONFIG_INTEL_VP8_MAX_FRAME_SIZE_RATIO;

// number of temporal layer for WebRTC and Sand
typedef struct OMX_VIDEO_PARAM_INTEL_NUMBER_OF_TEMPORAL_LAYER {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nNumberOfTemporalLayer;
} OMX_VIDEO_PARAM_INTEL_NUMBER_OF_TEMPORAL_LAYER;


// Request OMX to allocate a black frame to video mute feature
typedef struct OMX_VIDEO_INTEL_REQUEST_BALCK_FRAME_POINTER {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nFramePointer;
} OMX_VIDEO_INTEL_REQUEST_BALCK_FRAME_POINTER;

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* OMX_VideoExt_h */
/* File EOF */