1 /* GStreamer Intel MSDK plugin
2 * Copyright (c) 2016, Oblong Industries, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
15 * 3. Neither the name of the copyright holder nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 #include <gst/allocators/gstdmabuf.h>
38 #include "gstmsdkh265enc.h"
40 GST_DEBUG_CATEGORY_EXTERN (gst_msdkh265enc_debug);
41 #define GST_CAT_DEFAULT gst_msdkh265enc_debug
45 #ifndef GST_REMOVE_DEPRECATED
46 PROP_LOW_POWER = GST_MSDKENC_PROP_MAX,
49 PROP_TILE_ROW = GST_MSDKENC_PROP_MAX,
58 GST_MSDK_FLAG_LOW_POWER = 1 << 0,
59 GST_MSDK_FLAG_TUNE_MODE = 1 << 1,
62 #define PROP_LOWPOWER_DEFAULT FALSE
63 #define PROP_TILE_ROW_DEFAULT 1
64 #define PROP_TILE_COL_DEFAULT 1
65 #define PROP_MAX_SLICE_SIZE_DEFAULT 0
66 #define PROP_TUNE_MODE_DEFAULT MFX_CODINGOPTION_UNKNOWN
68 #define RAW_FORMATS "NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA"
69 #define PROFILES "main, main-10, main-444"
70 #define COMMON_FORMAT "{ " RAW_FORMATS " }"
71 #define PRFOLIE_STR "{ " PROFILES " }"
74 #if (MFX_VERSION >= 1027)
77 #define FORMATS_1027 RAW_FORMATS ", Y410, Y210"
78 #define PROFILES_1027 PROFILES ", main-444-10, main-422-10"
79 #define COMMON_FORMAT "{ " FORMATS_1027 " }"
80 #define PRFOLIE_STR "{ " PROFILES_1027 " }"
83 #if (MFX_VERSION >= 1031)
86 #define FORMATS_1031 FORMATS_1027 ", P012_LE"
87 #define PROFILES_1031 PROFILES_1027 ", main-12"
88 #define COMMON_FORMAT "{ " FORMATS_1031 " }"
89 #define PRFOLIE_STR "{ " PROFILES_1031 " }"
92 #if (MFX_VERSION >= 1032)
95 #define FORMATS_1032 FORMATS_1031
96 #define PROFILES_1032 PROFILES_1031 ", screen-extended-main, " \
97 "screen-extended-main-10, screen-extended-main-444, " \
98 "screen-extended-main-444-10"
99 #define COMMON_FORMAT "{ " FORMATS_1032 " }"
100 #define PRFOLIE_STR "{ " PROFILES_1032 " }"
103 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
106 GST_STATIC_CAPS (GST_MSDK_CAPS_STR (COMMON_FORMAT,
107 "{ NV12, P010_10LE }")));
109 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
112 GST_STATIC_CAPS ("video/x-h265, "
113 "framerate = (fraction) [0/1, MAX], "
114 "width = (int) [ 1, MAX ], height = (int) [ 1, MAX ], "
115 "stream-format = (string) byte-stream , alignment = (string) au , "
116 "profile = (string) " PRFOLIE_STR)
119 #define gst_msdkh265enc_parent_class parent_class
120 G_DEFINE_TYPE (GstMsdkH265Enc, gst_msdkh265enc, GST_TYPE_MSDKENC);
123 gst_msdkh265enc_insert_sei (GstMsdkH265Enc * thiz, GstVideoCodecFrame * frame,
126 GstBuffer *new_buffer;
129 thiz->parser = gst_h265_parser_new ();
131 new_buffer = gst_h265_parser_insert_sei (thiz->parser,
132 frame->output_buffer, sei_mem);
135 GST_WARNING_OBJECT (thiz, "Cannot insert SEI nal into AU buffer");
139 gst_buffer_unref (frame->output_buffer);
140 frame->output_buffer = new_buffer;
144 gst_msdkh265enc_add_cc (GstMsdkH265Enc * thiz, GstVideoCodecFrame * frame)
146 GstVideoCaptionMeta *cc_meta;
147 gpointer iter = NULL;
148 GstBuffer *in_buf = frame->input_buffer;
149 GstMemory *mem = NULL;
151 if (thiz->cc_sei_array)
152 g_array_set_size (thiz->cc_sei_array, 0);
155 (GstVideoCaptionMeta *) gst_buffer_iterate_meta_filtered (in_buf,
156 &iter, GST_VIDEO_CAPTION_META_API_TYPE))) {
157 GstH265SEIMessage sei;
158 GstH265RegisteredUserData *rud;
161 if (cc_meta->caption_type != GST_VIDEO_CAPTION_TYPE_CEA708_RAW)
164 memset (&sei, 0, sizeof (GstH265SEIMessage));
165 sei.payloadType = GST_H265_SEI_REGISTERED_USER_DATA;
166 rud = &sei.payload.registered_user_data;
168 rud->country_code = 181;
169 rud->size = cc_meta->size + 10;
171 data = g_malloc (rud->size);
172 memcpy (data + 9, cc_meta->data, cc_meta->size);
174 data[0] = 0; /* 16-bits itu_t_t35_provider_code */
176 data[2] = 'G'; /* 32-bits ATSC_user_identifier */
180 data[6] = 3; /* 8-bits ATSC1_data_user_data_type_code */
182 * 1 bit process_em_data_flag (0)
183 * 1 bit process_cc_data_flag (1)
184 * 1 bit additional_data_flag (0)
187 data[7] = ((cc_meta->size / 3) & 0x1f) | 0x40;
188 data[8] = 255; /* 8 bits em_data, unused */
189 data[cc_meta->size + 9] = 255; /* 8 marker bits */
193 if (!thiz->cc_sei_array) {
195 g_array_new (FALSE, FALSE, sizeof (GstH265SEIMessage));
196 g_array_set_clear_func (thiz->cc_sei_array,
197 (GDestroyNotify) gst_h265_sei_free);
200 g_array_append_val (thiz->cc_sei_array, sei);
203 if (!thiz->cc_sei_array || !thiz->cc_sei_array->len)
206 /* layer_id and temporal_id will be updated by parser later */
207 mem = gst_h265_create_sei_memory (0, 1, 4, thiz->cc_sei_array);
210 GST_WARNING_OBJECT (thiz, "Cannot create SEI nal unit");
214 GST_DEBUG_OBJECT (thiz,
215 "Inserting %d closed caption SEI message(s)", thiz->cc_sei_array->len);
217 gst_msdkh265enc_insert_sei (thiz, frame, mem);
218 gst_memory_unref (mem);
222 gst_msdkh265enc_pre_push (GstVideoEncoder * encoder, GstVideoCodecFrame * frame)
224 GstMsdkH265Enc *thiz = GST_MSDKH265ENC (encoder);
226 gst_msdkh265enc_add_cc (thiz, frame);
232 gst_msdkh265enc_set_format (GstMsdkEnc * encoder)
234 GstMsdkH265Enc *thiz = GST_MSDKH265ENC (encoder);
235 GstCaps *template_caps, *allowed_caps;
237 g_free (thiz->profile_name);
238 thiz->profile_name = NULL;
240 allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder));
242 if (!allowed_caps || gst_caps_is_empty (allowed_caps)) {
244 gst_caps_unref (allowed_caps);
248 template_caps = gst_static_pad_template_get_caps (&src_factory);
250 if (gst_caps_is_equal (allowed_caps, template_caps)) {
251 GST_INFO_OBJECT (thiz,
252 "downstream have the same caps, profile set to auto");
255 const gchar *profile;
257 allowed_caps = gst_caps_make_writable (allowed_caps);
258 allowed_caps = gst_caps_fixate (allowed_caps);
259 s = gst_caps_get_structure (allowed_caps, 0);
260 profile = gst_structure_get_string (s, "profile");
263 thiz->profile_name = g_strdup (profile);
267 gst_caps_unref (allowed_caps);
268 gst_caps_unref (template_caps);
274 gst_msdkh265enc_configure (GstMsdkEnc * encoder)
276 GstMsdkH265Enc *h265enc = GST_MSDKH265ENC (encoder);
278 const mfxPluginUID *uid;
280 session = gst_msdk_context_get_session (encoder->context);
282 if (encoder->hardware)
283 uid = &MFX_PLUGINID_HEVCE_HW;
285 uid = &MFX_PLUGINID_HEVCE_SW;
287 if (!gst_msdk_load_plugin (session, uid, 1, "msdkh265enc"))
290 encoder->param.mfx.CodecId = MFX_CODEC_HEVC;
292 if (h265enc->profile_name) {
293 encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN;
295 if (!strcmp (h265enc->profile_name, "main-10"))
296 encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN10;
297 else if (!strcmp (h265enc->profile_name, "main-444") ||
298 !strcmp (h265enc->profile_name, "main-422-10") ||
299 !strcmp (h265enc->profile_name, "main-444-10") ||
300 !strcmp (h265enc->profile_name, "main-12"))
301 encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT;
303 #if (MFX_VERSION >= 1032)
304 else if (!strcmp (h265enc->profile_name, "screen-extended-main") ||
305 !strcmp (h265enc->profile_name, "screen-extended-main-10") ||
306 !strcmp (h265enc->profile_name, "screen-extended-main-444") ||
307 !strcmp (h265enc->profile_name, "screen-extended-main-444-10"))
308 encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_SCC;
311 switch (encoder->param.mfx.FrameInfo.FourCC) {
312 case MFX_FOURCC_P010:
313 encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN10;
315 case MFX_FOURCC_AYUV:
316 case MFX_FOURCC_YUY2:
317 #if (MFX_VERSION >= 1027)
318 case MFX_FOURCC_Y410:
319 case MFX_FOURCC_Y210:
321 #if (MFX_VERSION >= 1031)
322 case MFX_FOURCC_P016:
324 encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT;
327 encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN;
331 /* IdrInterval field of MediaSDK HEVC encoder behaves differently
332 * than other encoders. IdrInteval == 1 indicate every
333 * I-frame should be an IDR, IdrInteval == 2 means every other
334 * I-frame is an IDR etc. So we generalize the behaviour of property
335 * "i-frames" by incrementing the value by one in each case*/
336 encoder->param.mfx.IdrInterval += 1;
338 /* Enable Extended coding options */
339 encoder->option2.MaxSliceSize = h265enc->max_slice_size;
340 gst_msdkenc_ensure_extended_coding_options (encoder);
342 if (h265enc->num_tile_rows > 1 || h265enc->num_tile_cols > 1) {
343 h265enc->ext_tiles.Header.BufferId = MFX_EXTBUFF_HEVC_TILES;
344 h265enc->ext_tiles.Header.BufferSz = sizeof (h265enc->ext_tiles);
345 h265enc->ext_tiles.NumTileRows = h265enc->num_tile_rows;
346 h265enc->ext_tiles.NumTileColumns = h265enc->num_tile_cols;
348 gst_msdkenc_add_extra_param (encoder,
349 (mfxExtBuffer *) & h265enc->ext_tiles);
351 /* Set a valid value to NumSlice */
352 if (encoder->param.mfx.NumSlice == 0)
353 encoder->param.mfx.NumSlice =
354 h265enc->num_tile_rows * h265enc->num_tile_cols;
357 encoder->param.mfx.LowPower = h265enc->tune_mode;
362 static inline const gchar *
363 level_to_string (gint level)
366 case MFX_LEVEL_HEVC_1:
368 case MFX_LEVEL_HEVC_2:
370 case MFX_LEVEL_HEVC_21:
372 case MFX_LEVEL_HEVC_3:
374 case MFX_LEVEL_HEVC_31:
376 case MFX_LEVEL_HEVC_4:
378 case MFX_LEVEL_HEVC_41:
380 case MFX_LEVEL_HEVC_5:
382 case MFX_LEVEL_HEVC_51:
384 case MFX_LEVEL_HEVC_52:
386 case MFX_LEVEL_HEVC_6:
388 case MFX_LEVEL_HEVC_61:
390 case MFX_LEVEL_HEVC_62:
400 gst_msdkh265enc_set_src_caps (GstMsdkEnc * encoder)
402 GstMsdkH265Enc *thiz = GST_MSDKH265ENC (encoder);
404 GstStructure *structure;
407 caps = gst_caps_new_empty_simple ("video/x-h265");
408 structure = gst_caps_get_structure (caps, 0);
410 gst_structure_set (structure, "stream-format", G_TYPE_STRING, "byte-stream",
413 gst_structure_set (structure, "alignment", G_TYPE_STRING, "au", NULL);
415 if (thiz->profile_name)
416 gst_structure_set (structure, "profile", G_TYPE_STRING, thiz->profile_name,
419 switch (encoder->param.mfx.FrameInfo.FourCC) {
420 case MFX_FOURCC_P010:
421 gst_structure_set (structure, "profile", G_TYPE_STRING, "main-10",
424 case MFX_FOURCC_AYUV:
425 gst_structure_set (structure, "profile", G_TYPE_STRING, "main-444",
428 case MFX_FOURCC_YUY2:
429 /* The profile is main-422-10 for 8-bit 422 */
430 gst_structure_set (structure, "profile", G_TYPE_STRING, "main-422-10",
433 #if (MFX_VERSION >= 1027)
434 case MFX_FOURCC_Y410:
435 gst_structure_set (structure, "profile", G_TYPE_STRING, "main-444-10",
438 case MFX_FOURCC_Y210:
439 gst_structure_set (structure, "profile", G_TYPE_STRING, "main-422-10",
443 #if (MFX_VERSION >= 1031)
444 case MFX_FOURCC_P016:
445 gst_structure_set (structure, "profile", G_TYPE_STRING, "main-12",
450 gst_structure_set (structure, "profile", G_TYPE_STRING, "main", NULL);
455 level = level_to_string (encoder->param.mfx.CodecLevel);
457 gst_structure_set (structure, "level", G_TYPE_STRING, level, NULL);
463 gst_msdkh265enc_finalize (GObject * object)
465 GstMsdkH265Enc *thiz = GST_MSDKH265ENC (object);
468 gst_h265_parser_free (thiz->parser);
469 if (thiz->cc_sei_array)
470 g_array_unref (thiz->cc_sei_array);
472 g_free (thiz->profile_name);
474 G_OBJECT_CLASS (parent_class)->finalize (object);
478 gst_msdkh265enc_set_property (GObject * object, guint prop_id,
479 const GValue * value, GParamSpec * pspec)
481 GstMsdkH265Enc *thiz = GST_MSDKH265ENC (object);
483 if (gst_msdkenc_set_common_property (object, prop_id, value, pspec))
486 GST_OBJECT_LOCK (thiz);
489 #ifndef GST_REMOVE_DEPRECATED
491 thiz->lowpower = g_value_get_boolean (value);
492 thiz->prop_flag |= GST_MSDK_FLAG_LOW_POWER;
494 /* Ignore it if user set tune mode explicitly */
495 if (!(thiz->prop_flag & GST_MSDK_FLAG_TUNE_MODE))
497 thiz->lowpower ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
503 thiz->num_tile_rows = g_value_get_uint (value);
507 thiz->num_tile_cols = g_value_get_uint (value);
510 case PROP_MAX_SLICE_SIZE:
511 thiz->max_slice_size = g_value_get_uint (value);
515 thiz->tune_mode = g_value_get_enum (value);
516 thiz->prop_flag |= GST_MSDK_FLAG_TUNE_MODE;
520 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
523 GST_OBJECT_UNLOCK (thiz);
527 gst_msdkh265enc_get_property (GObject * object, guint prop_id, GValue * value,
530 GstMsdkH265Enc *thiz = GST_MSDKH265ENC (object);
532 if (gst_msdkenc_get_common_property (object, prop_id, value, pspec))
535 GST_OBJECT_LOCK (thiz);
537 #ifndef GST_REMOVE_DEPRECATED
539 g_value_set_boolean (value, thiz->lowpower);
544 g_value_set_uint (value, thiz->num_tile_rows);
548 g_value_set_uint (value, thiz->num_tile_cols);
551 case PROP_MAX_SLICE_SIZE:
552 g_value_set_uint (value, thiz->max_slice_size);
556 g_value_set_enum (value, thiz->tune_mode);
560 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
563 GST_OBJECT_UNLOCK (thiz);
567 gst_msdkh265enc_need_reconfig (GstMsdkEnc * encoder, GstVideoCodecFrame * frame)
569 GstMsdkH265Enc *h265enc = GST_MSDKH265ENC (encoder);
571 return gst_msdkenc_get_roi_params (encoder, frame, h265enc->roi);
575 gst_msdkh265enc_set_extra_params (GstMsdkEnc * encoder,
576 GstVideoCodecFrame * frame)
578 GstMsdkH265Enc *h265enc = GST_MSDKH265ENC (encoder);
580 if (h265enc->roi[0].NumROI)
581 gst_msdkenc_add_extra_param (encoder, (mfxExtBuffer *) & h265enc->roi[0]);
585 gst_msdkh265enc_need_conversion (GstMsdkEnc * encoder, GstVideoInfo * info,
586 GstVideoFormat * out_format)
588 GstMsdkH265Enc *h265enc = GST_MSDKH265ENC (encoder);
590 switch (GST_VIDEO_INFO_FORMAT (info)) {
591 case GST_VIDEO_FORMAT_NV12:
592 case GST_VIDEO_FORMAT_P010_10LE:
593 case GST_VIDEO_FORMAT_VUYA:
594 #if (MFX_VERSION >= 1027)
595 case GST_VIDEO_FORMAT_Y410:
596 case GST_VIDEO_FORMAT_Y210:
598 #if (MFX_VERSION >= 1031)
599 case GST_VIDEO_FORMAT_P012_LE:
603 case GST_VIDEO_FORMAT_YUY2:
604 #if (MFX_VERSION >= 1027)
605 if (encoder->codename >= MFX_PLATFORM_ICELAKE &&
606 h265enc->tune_mode == MFX_CODINGOPTION_OFF)
610 if (GST_VIDEO_INFO_COMP_DEPTH (info, 0) == 10)
611 *out_format = GST_VIDEO_FORMAT_P010_10LE;
613 *out_format = GST_VIDEO_FORMAT_NV12;
619 gst_msdkh265enc_class_init (GstMsdkH265EncClass * klass)
621 GObjectClass *gobject_class;
622 GstElementClass *element_class;
623 GstVideoEncoderClass *videoencoder_class;
624 GstMsdkEncClass *encoder_class;
626 gobject_class = G_OBJECT_CLASS (klass);
627 element_class = GST_ELEMENT_CLASS (klass);
628 videoencoder_class = GST_VIDEO_ENCODER_CLASS (klass);
629 encoder_class = GST_MSDKENC_CLASS (klass);
631 gobject_class->finalize = gst_msdkh265enc_finalize;
632 gobject_class->set_property = gst_msdkh265enc_set_property;
633 gobject_class->get_property = gst_msdkh265enc_get_property;
635 videoencoder_class->pre_push = gst_msdkh265enc_pre_push;
637 encoder_class->set_format = gst_msdkh265enc_set_format;
638 encoder_class->configure = gst_msdkh265enc_configure;
639 encoder_class->set_src_caps = gst_msdkh265enc_set_src_caps;
640 encoder_class->need_reconfig = gst_msdkh265enc_need_reconfig;
641 encoder_class->set_extra_params = gst_msdkh265enc_set_extra_params;
642 encoder_class->need_conversion = gst_msdkh265enc_need_conversion;
644 gst_msdkenc_install_common_properties (encoder_class);
646 #ifndef GST_REMOVE_DEPRECATED
647 g_object_class_install_property (gobject_class, PROP_LOW_POWER,
648 g_param_spec_boolean ("low-power", "Low power",
649 "Enable low power mode (DEPRECATED, use tune instead)",
650 PROP_LOWPOWER_DEFAULT,
651 G_PARAM_DEPRECATED | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
654 g_object_class_install_property (gobject_class, PROP_TILE_ROW,
655 g_param_spec_uint ("num-tile-rows", "number of rows for tiled encoding",
656 "number of rows for tiled encoding",
657 1, 8192, PROP_TILE_ROW_DEFAULT,
658 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
660 g_object_class_install_property (gobject_class, PROP_TILE_COL,
661 g_param_spec_uint ("num-tile-cols",
662 "number of columns for tiled encoding",
663 "number of columns for tiled encoding", 1, 8192,
664 PROP_TILE_COL_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
666 g_object_class_install_property (gobject_class, PROP_MAX_SLICE_SIZE,
667 g_param_spec_uint ("max-slice-size", "Max Slice Size",
668 "Maximum slice size in bytes (if enabled MSDK will ignore the control over num-slices)",
669 0, G_MAXUINT32, PROP_MAX_SLICE_SIZE_DEFAULT,
670 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
672 g_object_class_install_property (gobject_class, PROP_TUNE_MODE,
673 g_param_spec_enum ("tune", "Encoder tuning",
674 "Encoder tuning option",
675 gst_msdkenc_tune_mode_get_type (), PROP_TUNE_MODE_DEFAULT,
676 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
678 gst_element_class_set_static_metadata (element_class,
679 "Intel MSDK H265 encoder",
680 "Codec/Encoder/Video/Hardware",
681 "H265 video encoder based on Intel Media SDK",
682 "Josep Torra <jtorra@oblong.com>");
684 gst_element_class_add_static_pad_template (element_class, &sink_factory);
685 gst_element_class_add_static_pad_template (element_class, &src_factory);
689 gst_msdkh265enc_init (GstMsdkH265Enc * thiz)
691 GstMsdkEnc *msdk_enc = (GstMsdkEnc *) thiz;
692 thiz->lowpower = PROP_LOWPOWER_DEFAULT;
693 thiz->num_tile_rows = PROP_TILE_ROW_DEFAULT;
694 thiz->num_tile_cols = PROP_TILE_COL_DEFAULT;
695 thiz->max_slice_size = PROP_MAX_SLICE_SIZE_DEFAULT;
696 thiz->tune_mode = PROP_TUNE_MODE_DEFAULT;
697 msdk_enc->num_extra_frames = 1;