1 /* GStreamer Intel MSDK plugin
2 * Copyright (c) 2018, Intel corporation
5 * Author:Sreerenj Balachandran <sreerenj.balachandran@intel.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
10 * 1. Redistributions of source code must retain the above copyright notice,
11 * this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
17 * 3. Neither the name of the copyright holder nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include "msdk-enums.h"
36 /*========= MSDK Decoder Enums =========================*/
38 gst_msdkdec_output_order_get_type (void)
40 static GType type = 0;
42 static const GEnumValue values[] = {
43 {GST_MSDKDEC_OUTPUT_ORDER_DISPLAY, "Output frames in Display order",
45 {GST_MSDKDEC_OUTPUT_ORDER_DECODE, "Output frames in Decoded order",
51 type = g_enum_register_static ("GstMsdkDecOutputOrder", values);
56 /*========= MSDK Encoder Enums =========================*/
58 gst_msdkenc_rate_control_get_type (void)
60 static GType type = 0;
62 static const GEnumValue values[] = {
63 {MFX_RATECONTROL_CBR, "Constant Bitrate", "cbr"},
64 {MFX_RATECONTROL_VBR, "Variable Bitrate", "vbr"},
65 {MFX_RATECONTROL_CQP, "Constant Quantizer", "cqp"},
66 {MFX_RATECONTROL_AVBR, "Average Bitrate", "avbr"},
67 {MFX_RATECONTROL_LA, "VBR with look ahead (Non HRD compliant)", "la_vbr"},
68 {MFX_RATECONTROL_ICQ, "Intelligent CQP", "icq"},
69 {MFX_RATECONTROL_VCM, "Video Conferencing Mode (Non HRD compliant)", "vcm"},
70 {MFX_RATECONTROL_LA_ICQ, "Intelligent CQP with LA (Non HRD compliant)",
73 /* intended for one to N transcode scenario */
74 {MFX_RATECONTROL_LA_EXT, "Extended LA", "la_ext"},
76 {MFX_RATECONTROL_LA_HRD, "HRD compliant LA", "la_hrd"},
77 {MFX_RATECONTROL_QVBR, "VBR with CQP", "qvbr"},
82 type = g_enum_register_static ("GstMsdkEncRateControl", values);
88 gst_msdkenc_trellis_quantization_get_type (void)
90 static GType type = 0;
92 static const GFlagsValue values[] = {
93 {_MFX_TRELLIS_NONE, "Disable for all frames", "None"},
94 {MFX_TRELLIS_I, "Enable for I frames", "i"},
95 {MFX_TRELLIS_P, "Enable for P frames", "p"},
96 {MFX_TRELLIS_B, "Enable for B frames", "b"},
101 type = g_flags_register_static ("GstMsdkEncTrellisQuantization", values);
107 gst_msdkenc_rc_lookahead_ds_get_type (void)
109 static GType type = 0;
111 static const GEnumValue values[] = {
112 {MFX_LOOKAHEAD_DS_UNKNOWN, "SDK desides what to do", "default"},
113 {MFX_LOOKAHEAD_DS_OFF, "No downsampling", "off"},
114 {MFX_LOOKAHEAD_DS_2x, "Down sample 2-times before estimation", "2x"},
115 {MFX_LOOKAHEAD_DS_4x, "Down sample 4-times before estimation", "4x"},
120 type = g_enum_register_static ("GstMsdkEncRCLookAheadDownsampling", values);
126 gst_msdkenc_mbbrc_get_type (void)
128 static GType type = 0;
130 static const GEnumValue values[] = {
131 {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
132 {MFX_CODINGOPTION_OFF, "Disable Macroblock level bit rate control", "off"},
133 {MFX_CODINGOPTION_ON, "Enable Macroblock level bit rate control ", "on"},
138 type = g_enum_register_static ("GstMsdkEncMbBitrateControl", values);
144 gst_msdkenc_lowdelay_brc_get_type (void)
146 static GType type = 0;
148 static const GEnumValue values[] = {
149 {MFX_CODINGOPTION_UNKNOWN, "SDK decides what to do", "auto"},
150 {MFX_CODINGOPTION_OFF, "Disable LowDelay bit rate control", "off"},
151 {MFX_CODINGOPTION_ON, "Enable LowDelay bit rate control ", "on"},
156 type = g_enum_register_static ("GstMsdkEncLowDelayBitrateControl", values);
162 gst_msdkenc_adaptive_i_get_type (void)
164 static GType type = 0;
166 static const GEnumValue values[] = {
167 {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
168 {MFX_CODINGOPTION_OFF, "Disable Adaptive I frame insertion ", "off"},
169 {MFX_CODINGOPTION_ON, "Enable Aaptive I frame insertion ", "on"},
174 type = g_enum_register_static ("GstMsdkEncAdaptiveI", values);
180 gst_msdkenc_adaptive_b_get_type (void)
182 static GType type = 0;
184 static const GEnumValue values[] = {
185 {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
186 {MFX_CODINGOPTION_OFF, "Disable Adaptive B-Frame insertion ", "off"},
187 {MFX_CODINGOPTION_ON, "Enable Aaptive B-Frame insertion ", "on"},
192 type = g_enum_register_static ("GstMsdkEncAdaptiveB", values);
198 gst_msdkenc_tune_mode_get_type (void)
200 static GType type = 0;
202 static const GEnumValue values[] = {
203 {MFX_CODINGOPTION_UNKNOWN, "Auto ", "auto"},
204 {MFX_CODINGOPTION_OFF, "None ", "none"},
205 {MFX_CODINGOPTION_ON, "Low power mode ", "low-power"},
210 type = g_enum_register_static ("GstMsdkEncTuneMode", values);
217 gst_msdkenc_transform_skip_get_type (void)
219 static GType type = 0;
221 static const GEnumValue values[] = {
222 {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
223 {MFX_CODINGOPTION_OFF,
224 "transform_skip_enabled_flag will be set to 0 in PPS ", "off"},
225 {MFX_CODINGOPTION_ON,
226 "transform_skip_enabled_flag will be set to 1 in PPS ", "on"},
231 type = g_enum_register_static ("GstMsdkEncTransformSkip", values);
237 gst_msdkenc_intra_refresh_type_get_type (void)
239 static GType type = 0;
241 static const GEnumValue values[] = {
242 {MFX_REFRESH_NO, "No (default)", "no"},
243 {MFX_REFRESH_VERTICAL, "Vertical", "vertical"},
244 {MFX_REFRESH_HORIZONTAL, "Horizontal ", "horizontal"},
245 {MFX_REFRESH_SLICE, "Slice ", "slice"},
250 type = g_enum_register_static ("GstMsdkEncIntraRefreshType", values);
256 /*========= MSDK VPP Enums =========================*/
258 #ifndef GST_REMOVE_DEPRECATED
260 gst_msdkvpp_rotation_get_type (void)
262 static GType type = 0;
264 static const GEnumValue values[] = {
265 {MFX_ANGLE_0, "Unrotated mode", "0"},
266 {MFX_ANGLE_90, "Rotated by 90°", "90"},
267 {MFX_ANGLE_180, "Rotated by 180°", "180"},
268 {MFX_ANGLE_270, "Rotated by 270°", "270"},
273 type = g_enum_register_static ("GstMsdkVPPRotation", values);
280 gst_msdkvpp_deinterlace_mode_get_type (void)
282 static GType type = 0;
284 static const GEnumValue values[] = {
285 {GST_MSDKVPP_DEINTERLACE_MODE_AUTO,
286 "Auto detection", "auto"},
287 {GST_MSDKVPP_DEINTERLACE_MODE_INTERLACED,
288 "Force deinterlacing", "interlaced"},
289 {GST_MSDKVPP_DEINTERLACE_MODE_DISABLED,
290 "Never deinterlace", "disabled"},
295 type = g_enum_register_static ("GstMsdkVPPDeinterlaceMode", values);
301 gst_msdkvpp_deinterlace_method_get_type (void)
303 static GType type = 0;
305 static const GEnumValue values[] = {
306 {_MFX_DEINTERLACE_METHOD_NONE,
307 "Disable deinterlacing", "none"},
308 {MFX_DEINTERLACING_BOB, "Bob deinterlacing", "bob"},
309 {MFX_DEINTERLACING_ADVANCED, "Advanced deinterlacing (Motion adaptive)",
312 {MFX_DEINTERLACING_AUTO_DOUBLE,
313 "Auto mode with deinterlacing double framerate output",
315 {MFX_DEINTERLACING_AUTO_SINGLE,
316 "Auto mode with deinterlacing single framerate output",
318 {MFX_DEINTERLACING_FULL_FR_OUT,
319 "Deinterlace only mode with full framerate output", "full-fr"},
320 {MFX_DEINTERLACING_HALF_FR_OUT,
321 "Deinterlace only Mode with half framerate output", "half-fr"},
322 {MFX_DEINTERLACING_24FPS_OUT, "24 fps fixed output mode", "24-fps"},
323 {MFX_DEINTERLACING_FIXED_TELECINE_PATTERN,
324 "Fixed telecine pattern removal mode", "fixed-telecine-removal"},
325 {MFX_DEINTERLACING_30FPS_OUT, "30 fps fixed output mode", "30-fps"},
326 {MFX_DEINTERLACING_DETECT_INTERLACE, "Only interlace detection",
329 {MFX_DEINTERLACING_ADVANCED_NOREF,
330 "Advanced deinterlacing mode without using of reference frames",
332 {MFX_DEINTERLACING_ADVANCED_SCD,
333 "Advanced deinterlacing mode with scene change detection",
335 {MFX_DEINTERLACING_FIELD_WEAVING, "Field weaving", "field-weave"},
340 type = g_enum_register_static ("GstMsdkVPPDeinterlaceMethod", values);
345 #ifndef GST_REMOVE_DEPRECATED
347 gst_msdkvpp_mirroring_get_type (void)
349 static GType type = 0;
351 static const GEnumValue values[] = {
352 {MFX_MIRRORING_DISABLED, "Disable mirroring", "disable"},
353 {MFX_MIRRORING_HORIZONTAL, "Horizontal Mirroring", "horizontal"},
354 {MFX_MIRRORING_VERTICAL, "Vertical Mirroring", "vertical"},
359 type = g_enum_register_static ("GstMsdkVPPMirroring", values);
366 gst_msdkvpp_scaling_mode_get_type (void)
368 static GType type = 0;
370 static const GEnumValue values[] = {
371 {MFX_SCALING_MODE_DEFAULT, "Default Scaling", "disable"},
372 {MFX_SCALING_MODE_LOWPOWER, "Lowpower Scaling", "lowpower"},
373 {MFX_SCALING_MODE_QUALITY, "High Quality Scaling", "quality"},
378 type = g_enum_register_static ("GstMsdkVPPScalingMode", values);
384 gst_msdkvpp_frc_algorithm_get_type (void)
386 static GType type = 0;
388 static const GEnumValue values[] = {
389 {_MFX_FRC_ALGORITHM_NONE, "No FrameRate Control algorithm", "none"},
390 {MFX_FRCALGM_PRESERVE_TIMESTAMP,
391 "Frame dropping/repetition, Preserve timestamp", "preserve-ts"},
392 {MFX_FRCALGM_DISTRIBUTED_TIMESTAMP,
393 "Frame dropping/repetition, Distribute timestamp", "distribute-ts"},
394 {MFX_FRCALGM_FRAME_INTERPOLATION, "Frame interpolation", "interpolate"},
395 {MFX_FRCALGM_FRAME_INTERPOLATION | MFX_FRCALGM_PRESERVE_TIMESTAMP,
396 "Frame interpolation, Preserve timestamp", "interpolate-preserve-ts"},
397 {MFX_FRCALGM_FRAME_INTERPOLATION | MFX_FRCALGM_DISTRIBUTED_TIMESTAMP,
398 "Frame interpolation, Distribute timestamp",
399 "interpolate-distribute-ts"},
404 type = g_enum_register_static ("GstMsdkVPPFrcAlgorithm", values);