Debian Codegraph @

va/va_str.c

raw
1 /*
2 * Copyright (c) 2017 Intel Corporation. All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 #include "va_str.h"
26
27 #define TOSTR(enumCase) case enumCase: return #enumCase
28
29 const char *vaProfileStr(VAProfile profile)
30 {
31 switch (profile) {
32 TOSTR(VAProfileNone);
33 TOSTR(VAProfileMPEG2Simple);
34 TOSTR(VAProfileMPEG2Main);
35 TOSTR(VAProfileMPEG4Simple);
36 TOSTR(VAProfileMPEG4AdvancedSimple);
37 TOSTR(VAProfileMPEG4Main);
38 TOSTR(VAProfileH264Main);
39 TOSTR(VAProfileH264High);
40 TOSTR(VAProfileH264High10);
41 TOSTR(VAProfileH264High422);
42 TOSTR(VAProfileVC1Simple);
43 TOSTR(VAProfileVC1Main);
44 TOSTR(VAProfileVC1Advanced);
45 TOSTR(VAProfileH263Baseline);
46 TOSTR(VAProfileH264ConstrainedBaseline);
47 TOSTR(VAProfileJPEGBaseline);
48 TOSTR(VAProfileVP8Version0_3);
49 TOSTR(VAProfileH264MultiviewHigh);
50 TOSTR(VAProfileH264StereoHigh);
51 TOSTR(VAProfileHEVCMain);
52 TOSTR(VAProfileHEVCMain10);
53 TOSTR(VAProfileVP9Profile0);
54 TOSTR(VAProfileVP9Profile1);
55 TOSTR(VAProfileVP9Profile2);
56 TOSTR(VAProfileVP9Profile3);
57 TOSTR(VAProfileHEVCMain12);
58 TOSTR(VAProfileHEVCMain422_10);
59 TOSTR(VAProfileHEVCMain422_12);
60 TOSTR(VAProfileHEVCMain444);
61 TOSTR(VAProfileHEVCMain444_10);
62 TOSTR(VAProfileHEVCMain444_12);
63 TOSTR(VAProfileHEVCSccMain);
64 TOSTR(VAProfileHEVCSccMain10);
65 TOSTR(VAProfileHEVCSccMain444);
66 TOSTR(VAProfileAV1Profile0);
67 TOSTR(VAProfileAV1Profile1);
68 TOSTR(VAProfileAV1Profile2);
69 TOSTR(VAProfileHEVCSccMain444_10);
70 TOSTR(VAProfileProtected);
71 TOSTR(VAProfileVVCMain10);
72 TOSTR(VAProfileVVCMultilayerMain10);
73 default:
74 break;
75 }
76 return "<unknown profile>";
77 }
78
79
80 const char *vaEntrypointStr(VAEntrypoint entrypoint)
81 {
82 switch (entrypoint) {
83 TOSTR(VAEntrypointVLD);
84 TOSTR(VAEntrypointIZZ);
85 TOSTR(VAEntrypointIDCT);
86 TOSTR(VAEntrypointMoComp);
87 TOSTR(VAEntrypointDeblocking);
88 TOSTR(VAEntrypointEncSlice);
89 TOSTR(VAEntrypointEncPicture);
90 TOSTR(VAEntrypointEncSliceLP);
91 TOSTR(VAEntrypointVideoProc);
92 TOSTR(VAEntrypointFEI);
93 TOSTR(VAEntrypointStats);
94 TOSTR(VAEntrypointProtectedTEEComm);
95 TOSTR(VAEntrypointProtectedContent);
96 }
97 return "<unknown entrypoint>";
98 }
99
100 const char *vaConfigAttribTypeStr(VAConfigAttribType configAttribType)
101 {
102 switch (configAttribType) {
103 TOSTR(VAConfigAttribRTFormat);
104 TOSTR(VAConfigAttribSpatialResidual);
105 TOSTR(VAConfigAttribSpatialClipping);
106 TOSTR(VAConfigAttribIntraResidual);
107 TOSTR(VAConfigAttribEncryption);
108 TOSTR(VAConfigAttribRateControl);
109 TOSTR(VAConfigAttribDecSliceMode);
110 TOSTR(VAConfigAttribEncPackedHeaders);
111 TOSTR(VAConfigAttribEncInterlaced);
112 TOSTR(VAConfigAttribEncMaxRefFrames);
113 TOSTR(VAConfigAttribEncMaxSlices);
114 TOSTR(VAConfigAttribEncSliceStructure);
115 TOSTR(VAConfigAttribEncMacroblockInfo);
116 TOSTR(VAConfigAttribEncJPEG);
117 TOSTR(VAConfigAttribEncQualityRange);
118 TOSTR(VAConfigAttribEncSkipFrame);
119 TOSTR(VAConfigAttribEncROI);
120 TOSTR(VAConfigAttribEncRateControlExt);
121 TOSTR(VAConfigAttribFEIFunctionType);
122 TOSTR(VAConfigAttribFEIMVPredictors);
123 TOSTR(VAConfigAttribDecJPEG);
124 TOSTR(VAConfigAttribMaxPictureWidth);
125 TOSTR(VAConfigAttribMaxPictureHeight);
126 TOSTR(VAConfigAttribEncQuantization);
127 TOSTR(VAConfigAttribEncIntraRefresh);
128 TOSTR(VAConfigAttribProcessingRate);
129 TOSTR(VAConfigAttribEncDirtyRect);
130 TOSTR(VAConfigAttribEncParallelRateControl);
131 TOSTR(VAConfigAttribEncDynamicScaling);
132 TOSTR(VAConfigAttribDecProcessing);
133 TOSTR(VAConfigAttribFrameSizeToleranceSupport);
134 TOSTR(VAConfigAttribEncTileSupport);
135 TOSTR(VAConfigAttribCustomRoundingControl);
136 TOSTR(VAConfigAttribQPBlockSize);
137 TOSTR(VAConfigAttribStats);
138 TOSTR(VAConfigAttribMaxFrameSize);
139 TOSTR(VAConfigAttribPredictionDirection);
140 TOSTR(VAConfigAttribMultipleFrame);
141 TOSTR(VAConfigAttribContextPriority);
142 TOSTR(VAConfigAttribDecAV1Features);
143 TOSTR(VAConfigAttribTEEType);
144 TOSTR(VAConfigAttribTEETypeClient);
145 TOSTR(VAConfigAttribProtectedContentCipherAlgorithm);
146 TOSTR(VAConfigAttribProtectedContentCipherBlockSize);
147 TOSTR(VAConfigAttribProtectedContentCipherMode);
148 TOSTR(VAConfigAttribProtectedContentCipherSampleType);
149 TOSTR(VAConfigAttribProtectedContentUsage);
150 TOSTR(VAConfigAttribEncHEVCFeatures);
151 TOSTR(VAConfigAttribEncHEVCBlockSizes);
152 TOSTR(VAConfigAttribEncAV1);
153 TOSTR(VAConfigAttribEncAV1Ext1);
154 TOSTR(VAConfigAttribEncAV1Ext2);
155 TOSTR(VAConfigAttribEncPerBlockControl);
156 TOSTR(VAConfigAttribEncMaxTileRows);
157 TOSTR(VAConfigAttribEncMaxTileCols);
158 TOSTR(VAConfigAttribEncVP9);
159 case VAConfigAttribTypeMax:
160 break;
161 }
162 return "<unknown config attribute type>";
163 }
164
165 const char *vaBufferTypeStr(VABufferType bufferType)
166 {
167 switch (bufferType) {
168 TOSTR(VAPictureParameterBufferType);
169 TOSTR(VAIQMatrixBufferType);
170 TOSTR(VABitPlaneBufferType);
171 TOSTR(VASliceGroupMapBufferType);
172 TOSTR(VASliceParameterBufferType);
173 TOSTR(VASliceDataBufferType);
174 TOSTR(VAMacroblockParameterBufferType);
175 TOSTR(VAResidualDataBufferType);
176 TOSTR(VADeblockingParameterBufferType);
177 TOSTR(VAImageBufferType);
178 TOSTR(VAProtectedSliceDataBufferType);
179 TOSTR(VAQMatrixBufferType);
180 TOSTR(VAHuffmanTableBufferType);
181 TOSTR(VAProbabilityBufferType);
182 TOSTR(VAEncCodedBufferType);
183 TOSTR(VAEncSequenceParameterBufferType);
184 TOSTR(VAEncPictureParameterBufferType);
185 TOSTR(VAEncSliceParameterBufferType);
186 TOSTR(VAEncPackedHeaderParameterBufferType);
187 TOSTR(VAEncPackedHeaderDataBufferType);
188 TOSTR(VAEncMiscParameterBufferType);
189 TOSTR(VAEncMacroblockParameterBufferType);
190 TOSTR(VAEncMacroblockMapBufferType);
191 TOSTR(VAProcPipelineParameterBufferType);
192 TOSTR(VAProcFilterParameterBufferType);
193 TOSTR(VAEncQPBufferType);
194 TOSTR(VAEncFEIMVBufferType);
195 TOSTR(VAEncFEIMBCodeBufferType);
196 TOSTR(VAEncFEIDistortionBufferType);
197 TOSTR(VAEncFEIMBControlBufferType);
198 TOSTR(VAEncFEIMVPredictorBufferType);
199 TOSTR(VAEncMacroblockDisableSkipMapBufferType);
200 TOSTR(VADecodeStreamoutBufferType);
201 TOSTR(VAStatsStatisticsParameterBufferType);
202 TOSTR(VAStatsStatisticsBufferType);
203 TOSTR(VAStatsStatisticsBottomFieldBufferType);
204 TOSTR(VAStatsMVBufferType);
205 TOSTR(VAStatsMVPredictorBufferType);
206 TOSTR(VAEncFEICTBCmdBufferType);
207 TOSTR(VAEncFEICURecordBufferType);
208 TOSTR(VASubsetsParameterBufferType);
209 TOSTR(VAContextParameterUpdateBufferType);
210 TOSTR(VAProtectedSessionExecuteBufferType);
211 TOSTR(VAEncryptionParameterBufferType);
212 TOSTR(VAEncDeltaQpPerBlockBufferType);
213 TOSTR(VAAlfBufferType);
214 TOSTR(VALmcsBufferType);
215 TOSTR(VASubPicBufferType);
216 TOSTR(VATileBufferType);
217 TOSTR(VASliceStructBufferType);
218 case VABufferTypeMax:
219 break;
220 }
221 return "<unknown buffer type>";
222 }
223
224 const char *vaStatusStr(VAStatus status)
225 {
226 switch (status) {
227 TOSTR(VA_STATUS_SUCCESS);
228 TOSTR(VA_STATUS_ERROR_OPERATION_FAILED);
229 TOSTR(VA_STATUS_ERROR_ALLOCATION_FAILED);
230 TOSTR(VA_STATUS_ERROR_INVALID_DISPLAY);
231 TOSTR(VA_STATUS_ERROR_INVALID_CONFIG);
232 TOSTR(VA_STATUS_ERROR_INVALID_CONTEXT);
233 TOSTR(VA_STATUS_ERROR_INVALID_SURFACE);
234 TOSTR(VA_STATUS_ERROR_INVALID_BUFFER);
235 TOSTR(VA_STATUS_ERROR_INVALID_IMAGE);
236 TOSTR(VA_STATUS_ERROR_INVALID_SUBPICTURE);
237 TOSTR(VA_STATUS_ERROR_ATTR_NOT_SUPPORTED);
238 TOSTR(VA_STATUS_ERROR_MAX_NUM_EXCEEDED);
239 TOSTR(VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
240 TOSTR(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
241 TOSTR(VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT);
242 TOSTR(VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE);
243 TOSTR(VA_STATUS_ERROR_SURFACE_BUSY);
244 TOSTR(VA_STATUS_ERROR_FLAG_NOT_SUPPORTED);
245 TOSTR(VA_STATUS_ERROR_INVALID_PARAMETER);
246 TOSTR(VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED);
247 TOSTR(VA_STATUS_ERROR_UNIMPLEMENTED);
248 TOSTR(VA_STATUS_ERROR_SURFACE_IN_DISPLAYING);
249 TOSTR(VA_STATUS_ERROR_INVALID_IMAGE_FORMAT);
250 TOSTR(VA_STATUS_ERROR_DECODING_ERROR);
251 TOSTR(VA_STATUS_ERROR_ENCODING_ERROR);
252 TOSTR(VA_STATUS_ERROR_INVALID_VALUE);
253 TOSTR(VA_STATUS_ERROR_UNSUPPORTED_FILTER);
254 TOSTR(VA_STATUS_ERROR_INVALID_FILTER_CHAIN);
255 TOSTR(VA_STATUS_ERROR_HW_BUSY);
256 TOSTR(VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE);
257 TOSTR(VA_STATUS_ERROR_NOT_ENOUGH_BUFFER);
258 TOSTR(VA_STATUS_ERROR_UNKNOWN);
259 default:
260 break;
261 }
262 return "unknown return value";
263 }
264
265 #undef TOSTR