diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2017-07-31 18:45:44 -0700 |
---|---|---|
committer | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2017-07-31 18:48:40 -0700 |
commit | 04ac3212ea946f8133d45364d3ea4d87f377c8d9 (patch) | |
tree | 05837a552858cc61c7dd2a4a870938380f0d641d | |
parent | 69325590426034cae74308423e9b14ece6adc8f0 (diff) |
FEI: libs: Set intra-part-mask type as G_TYPE_FLAG
Intra-part-mask is specifies which Luma Intra partition is
enabled/disabled for intra mode decision.
xxxx1: luma_intra_16x16 disabled
xxx1x: luma_intra_8x8 disabled
xx1xx: luma_intra_4x4 disabled
xx111: intra prediction is disabled
Use G_TYPE_FLAG for this property
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c | 5 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapifeienc_h264.c | 5 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapifeiutils_h264.c | 14 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapifeiutils_h264.h | 14 |
4 files changed, 12 insertions, 26 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c index 60ea5777..a704c7a1 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c @@ -3329,6 +3329,7 @@ gst_vaapi_encoder_h264_fei_init (GstVaapiEncoder * base_encoder) encoder->len_sp = GST_VAAPI_FEI_H264_SEARCH_PATH_LENGTH_DEFAULT; encoder->ref_width = GST_VAAPI_FEI_H264_REF_WIDTH_DEFAULT; encoder->ref_height = GST_VAAPI_FEI_H264_REF_HEIGHT_DEFAULT; + encoder->intra_part_mask = GST_VAAPI_FEI_H264_INTRA_PART_MASK_DEFAULT; /* default num ref frames */ encoder->num_ref_frames = 1; /* Multi-view coding information */ @@ -3516,7 +3517,7 @@ gst_vaapi_encoder_h264_fei_set_property (GstVaapiEncoder * base_encoder, encoder->subpel_mode = g_value_get_enum (value); break; case GST_VAAPI_ENCODER_H264_PROP_INTRA_PART_MASK: - encoder->intra_part_mask = g_value_get_enum (value); + encoder->intra_part_mask = g_value_get_flags (value); break; case GST_VAAPI_ENCODER_H264_PROP_INTRA_SAD: encoder->intra_sad = g_value_get_enum (value); @@ -3866,7 +3867,7 @@ gst_vaapi_encoder_h264_get_fei_properties (GPtrArray * props) */ GST_VAAPI_ENCODER_PROPERTIES_APPEND (props, GST_VAAPI_ENCODER_H264_PROP_INTRA_PART_MASK, - g_param_spec_enum ("intrapart-mask", + g_param_spec_flags ("intrapart-mask", "intra part mask", "Specifies which Luma Intra partition is enabled/disabled for" "intra mode decision", diff --git a/gst-libs/gst/vaapi/gstvaapifeienc_h264.c b/gst-libs/gst/vaapi/gstvaapifeienc_h264.c index 294b7088..2359fd00 100644 --- a/gst-libs/gst/vaapi/gstvaapifeienc_h264.c +++ b/gst-libs/gst/vaapi/gstvaapifeienc_h264.c @@ -1693,6 +1693,7 @@ gst_vaapi_feienc_h264_init (GstVaapiEncoder * base_encoder) feienc->len_sp = GST_VAAPI_FEI_H264_SEARCH_PATH_LENGTH_DEFAULT; feienc->ref_width = GST_VAAPI_FEI_H264_REF_WIDTH_DEFAULT; feienc->ref_height = GST_VAAPI_FEI_H264_REF_HEIGHT_DEFAULT; + feienc->intra_part_mask = GST_VAAPI_FEI_H264_INTRA_PART_MASK_DEFAULT; /* Multi-view coding information */ feienc->is_mvc = FALSE; @@ -1821,7 +1822,7 @@ gst_vaapi_feienc_h264_set_property (GstVaapiEncoder * base_encoder, feienc->subpel_mode = g_value_get_enum (value); break; case GST_VAAPI_FEI_H264_ENC_PROP_INTRA_PART_MASK: - feienc->intra_part_mask = g_value_get_enum (value); + feienc->intra_part_mask = g_value_get_flags (value); break; case GST_VAAPI_FEI_H264_ENC_PROP_INTRA_SAD: feienc->intra_sad = g_value_get_enum (value); @@ -2009,7 +2010,7 @@ gst_vaapi_feienc_h264_get_fei_properties (GPtrArray * props) */ GST_VAAPI_ENCODER_PROPERTIES_APPEND (props, GST_VAAPI_FEI_H264_ENC_PROP_INTRA_PART_MASK, - g_param_spec_enum ("intrapart-mask", + g_param_spec_flags ("intrapart-mask", "intra part mask", "What block and sub-block partitions are disabled for intra MBs", GST_VAAPI_TYPE_FEI_H264_INTRA_PART_MASK, diff --git a/gst-libs/gst/vaapi/gstvaapifeiutils_h264.c b/gst-libs/gst/vaapi/gstvaapifeiutils_h264.c index 47210477..ce340468 100644 --- a/gst-libs/gst/vaapi/gstvaapifeiutils_h264.c +++ b/gst-libs/gst/vaapi/gstvaapifeiutils_h264.c @@ -161,30 +161,20 @@ gst_vaapi_fei_h264_intra_part_mask_get_type (void) { static volatile gsize g_type = 0; - static const GEnumValue intra_part_mask_values[] = { + static const GFlagsValue intra_part_mask_values[] = { {GST_VAAPI_FEI_H264_DISABLE_INTRA_NONE, "enable all intra mode", "enable all"}, {GST_VAAPI_FEI_H264_DISABLE_INTRA_16x16, "luma_intra_16x16 disabled", "intra16x16 disabled"}, {GST_VAAPI_FEI_H264_DISABLE_INTRA_8x8, "luma_intra_8x8 disabled", "intra8x8 disabled"}, - {GST_VAAPI_FEI_H264_DISABLE_INTRA_16x16_8x8, - "luma_intra_8x8 and luma_intra_16x16 disabled", - "intra8x8/16x16 disabled"}, {GST_VAAPI_FEI_H264_DISABLE_INTRA_4x4, "luma_intra_4x4 disabled", "intra4x4 disabled"}, - {GST_VAAPI_FEI_H264_DISABLE_INTRA_16x16_4x4, - "luma_intra_4x4 and luma_intra_16x16 disabled", - "intra4x4/16x16 disabled"}, - {GST_VAAPI_FEI_H264_DISABLE_INTRA_8x8_4x4, - "luma_intra_4x4 and luma_intra_8x8 disabled", "intra4x4/8x8 disabled"}, - {GST_VAAPI_FEI_H264_DISABLE_INTRA_ALL, - "intra prediction is disabled", "intra prediction is disabled"}, {0, NULL, NULL}, }; if (g_once_init_enter (&g_type)) { - GType type = g_enum_register_static ("GstVaapiFeiH264IntraPartMask", + GType type = g_flags_register_static ("GstVaapiFeiH264IntraPartMask", intra_part_mask_values); g_once_init_leave (&g_type, type); } diff --git a/gst-libs/gst/vaapi/gstvaapifeiutils_h264.h b/gst-libs/gst/vaapi/gstvaapifeiutils_h264.h index 6635ebd5..a3a7e8fd 100644 --- a/gst-libs/gst/vaapi/gstvaapifeiutils_h264.h +++ b/gst-libs/gst/vaapi/gstvaapifeiutils_h264.h @@ -101,18 +101,12 @@ typedef enum typedef enum { - GST_VAAPI_FEI_H264_DISABLE_INTRA_NONE = 0, - GST_VAAPI_FEI_H264_DISABLE_INTRA_16x16 = 1, - GST_VAAPI_FEI_H264_DISABLE_INTRA_8x8 = 2, - GST_VAAPI_FEI_H264_DISABLE_INTRA_16x16_8x8 = 3, - GST_VAAPI_FEI_H264_DISABLE_INTRA_4x4 = 4, - GST_VAAPI_FEI_H264_DISABLE_INTRA_16x16_4x4 = 5, - GST_VAAPI_FEI_H264_DISABLE_INTRA_8x8_4x4 = 6, - GST_VAAPI_FEI_H264_DISABLE_INTRA_ALL = 7, + GST_VAAPI_FEI_H264_DISABLE_INTRA_NONE = 0, + GST_VAAPI_FEI_H264_DISABLE_INTRA_16x16 = (1 << 0), + GST_VAAPI_FEI_H264_DISABLE_INTRA_8x8 = (1 << 1), + GST_VAAPI_FEI_H264_DISABLE_INTRA_4x4 = (1 << 2), } GstVaapiFeiH264IntraPartMask; - - #define GST_VAAPI_FEI_H264_SEARCH_PATH_DEFAULT GST_VAAPI_FEI_H264_FULL_SEARCH_PATH #define GST_VAAPI_FEI_H264_SEARCH_WINDOW_DEFAULT GST_VAAPI_FEI_H264_SEARCH_WINDOW_NONE #define GST_VAAPI_FEI_H264_SUB_PEL_MODE_DEFAULT GST_VAAPI_FEI_H264_INTEGER_ME |