mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 17:18:15 +00:00
msdkh265enc: add transform-skip property
Since the SDK API 1.26, TransformSkip was added to control transform_skip_enabled_flag setting in PPS [1] [1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption3 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
This commit is contained in:
parent
bdff6f5e42
commit
ff206f6525
4 changed files with 49 additions and 0 deletions
|
@ -51,6 +51,7 @@ enum
|
||||||
PROP_TILE_COL,
|
PROP_TILE_COL,
|
||||||
PROP_MAX_SLICE_SIZE,
|
PROP_MAX_SLICE_SIZE,
|
||||||
PROP_TUNE_MODE,
|
PROP_TUNE_MODE,
|
||||||
|
PROP_TRANSFORM_SKIP,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -64,6 +65,7 @@ enum
|
||||||
#define PROP_TILE_COL_DEFAULT 1
|
#define PROP_TILE_COL_DEFAULT 1
|
||||||
#define PROP_MAX_SLICE_SIZE_DEFAULT 0
|
#define PROP_MAX_SLICE_SIZE_DEFAULT 0
|
||||||
#define PROP_TUNE_MODE_DEFAULT MFX_CODINGOPTION_UNKNOWN
|
#define PROP_TUNE_MODE_DEFAULT MFX_CODINGOPTION_UNKNOWN
|
||||||
|
#define PROP_TRANSFORM_SKIP_DEFAULT MFX_CODINGOPTION_UNKNOWN
|
||||||
|
|
||||||
#define RAW_FORMATS "NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA"
|
#define RAW_FORMATS "NV12, I420, YV12, YUY2, UYVY, BGRA, P010_10LE, VUYA"
|
||||||
#define PROFILES "main, main-10, main-444"
|
#define PROFILES "main, main-10, main-444"
|
||||||
|
@ -337,6 +339,14 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
|
||||||
|
|
||||||
/* Enable Extended coding options */
|
/* Enable Extended coding options */
|
||||||
encoder->option2.MaxSliceSize = h265enc->max_slice_size;
|
encoder->option2.MaxSliceSize = h265enc->max_slice_size;
|
||||||
|
|
||||||
|
#if (MFX_VERSION >= 1026)
|
||||||
|
if (h265enc->transform_skip != MFX_CODINGOPTION_UNKNOWN) {
|
||||||
|
encoder->option3.TransformSkip = h265enc->transform_skip;
|
||||||
|
encoder->enable_extopt3 = TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_msdkenc_ensure_extended_coding_options (encoder);
|
gst_msdkenc_ensure_extended_coding_options (encoder);
|
||||||
|
|
||||||
if (h265enc->num_tile_rows > 1 || h265enc->num_tile_cols > 1) {
|
if (h265enc->num_tile_rows > 1 || h265enc->num_tile_cols > 1) {
|
||||||
|
@ -516,6 +526,10 @@ gst_msdkh265enc_set_property (GObject * object, guint prop_id,
|
||||||
thiz->prop_flag |= GST_MSDK_FLAG_TUNE_MODE;
|
thiz->prop_flag |= GST_MSDK_FLAG_TUNE_MODE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_TRANSFORM_SKIP:
|
||||||
|
thiz->transform_skip = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -556,6 +570,10 @@ gst_msdkh265enc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
g_value_set_enum (value, thiz->tune_mode);
|
g_value_set_enum (value, thiz->tune_mode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_TRANSFORM_SKIP:
|
||||||
|
g_value_set_enum (value, thiz->transform_skip);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -675,6 +693,12 @@ gst_msdkh265enc_class_init (GstMsdkH265EncClass * klass)
|
||||||
gst_msdkenc_tune_mode_get_type (), PROP_TUNE_MODE_DEFAULT,
|
gst_msdkenc_tune_mode_get_type (), PROP_TUNE_MODE_DEFAULT,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class, PROP_TRANSFORM_SKIP,
|
||||||
|
g_param_spec_enum ("transform-skip", "Transform Skip",
|
||||||
|
"Transform Skip option",
|
||||||
|
gst_msdkenc_transform_skip_get_type (), PROP_TRANSFORM_SKIP_DEFAULT,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
"Intel MSDK H265 encoder",
|
"Intel MSDK H265 encoder",
|
||||||
"Codec/Encoder/Video/Hardware",
|
"Codec/Encoder/Video/Hardware",
|
||||||
|
@ -694,5 +718,6 @@ gst_msdkh265enc_init (GstMsdkH265Enc * thiz)
|
||||||
thiz->num_tile_cols = PROP_TILE_COL_DEFAULT;
|
thiz->num_tile_cols = PROP_TILE_COL_DEFAULT;
|
||||||
thiz->max_slice_size = PROP_MAX_SLICE_SIZE_DEFAULT;
|
thiz->max_slice_size = PROP_MAX_SLICE_SIZE_DEFAULT;
|
||||||
thiz->tune_mode = PROP_TUNE_MODE_DEFAULT;
|
thiz->tune_mode = PROP_TUNE_MODE_DEFAULT;
|
||||||
|
thiz->transform_skip = PROP_TRANSFORM_SKIP_DEFAULT;
|
||||||
msdk_enc->num_extra_frames = 1;
|
msdk_enc->num_extra_frames = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ struct _GstMsdkH265Enc
|
||||||
guint max_slice_size;
|
guint max_slice_size;
|
||||||
gint tune_mode;
|
gint tune_mode;
|
||||||
guint prop_flag;
|
guint prop_flag;
|
||||||
|
gushort transform_skip;
|
||||||
|
|
||||||
mfxExtHEVCTiles ext_tiles;
|
mfxExtHEVCTiles ext_tiles;
|
||||||
/* roi[0] for current ROI and roi[1] for previous ROI */
|
/* roi[0] for current ROI and roi[1] for previous ROI */
|
||||||
|
|
|
@ -195,6 +195,26 @@ gst_msdkenc_tune_mode_get_type (void)
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gst_msdkenc_transform_skip_get_type (void)
|
||||||
|
{
|
||||||
|
static GType type = 0;
|
||||||
|
|
||||||
|
static const GEnumValue values[] = {
|
||||||
|
{MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
|
||||||
|
{MFX_CODINGOPTION_OFF,
|
||||||
|
"transform_skip_enabled_flag will be set to 0 in PPS ", "off"},
|
||||||
|
{MFX_CODINGOPTION_ON,
|
||||||
|
"transform_skip_enabled_flag will be set to 1 in PPS ", "on"},
|
||||||
|
{0, NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!type) {
|
||||||
|
type = g_enum_register_static ("GstMsdkEncTransformSkip", values);
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
/*========= MSDK VPP Enums =========================*/
|
/*========= MSDK VPP Enums =========================*/
|
||||||
|
|
||||||
#ifndef GST_REMOVE_DEPRECATED
|
#ifndef GST_REMOVE_DEPRECATED
|
||||||
|
|
|
@ -101,5 +101,8 @@ gst_msdkvpp_scaling_mode_get_type (void);
|
||||||
GType
|
GType
|
||||||
gst_msdkvpp_frc_algorithm_get_type (void);
|
gst_msdkvpp_frc_algorithm_get_type (void);
|
||||||
|
|
||||||
|
GType
|
||||||
|
gst_msdkenc_transform_skip_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue