diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2016-07-28 15:53:48 +0300 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-11-08 13:14:54 +0100 |
commit | ff91d62415311279cb093395f1fa6b3369df1375 (patch) | |
tree | 67634bfcc6a4c5d6aae66892ea24b96bd3163476 /gst-libs | |
parent | dc583452d8d3e295a816da1efb35e0d0cbe7f9e2 (diff) |
libs: encoder: h264: Add new property "prediction-type"
Adds new property "prediction-type" to select different reference
picture selection modes like hierarchical-p, hierarchical-b etc.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=788918
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiencoder_h264.c | 50 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiencoder_h264.h | 2 |
2 files changed, 52 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c index d6e16386..4af46e9f 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c @@ -109,6 +109,38 @@ gst_vaapi_encoder_h264_compliance_mode_type (void) return gtype; } +typedef enum +{ + GST_VAAPI_ENCODER_H264_PREDICTION_DEFAULT, + GST_VAAPI_ENCODER_H264_PREDICTION_HIERARCHICAL_P, + GST_VAAPI_ENCODER_H264_PREDICTION_HIERARCHICAL_B +} GstVaapiEnoderH264PredictionType; + +static GType +gst_vaapi_encoder_h264_prediction_type (void) +{ + static GType gtype = 0; + + if (gtype == 0) { + static const GEnumValue values[] = { + {GST_VAAPI_ENCODER_H264_PREDICTION_DEFAULT, + "Default encode, prev/next frame as ref ", + "default"}, + {GST_VAAPI_ENCODER_H264_PREDICTION_HIERARCHICAL_P, + "Hierarchical P frame encode", + "hierarchical-p"}, + {GST_VAAPI_ENCODER_H264_PREDICTION_HIERARCHICAL_B, + "Hierarchical B frame encode", + "hierarchical-b"}, + {0, NULL, NULL}, + }; + + gtype = + g_enum_register_static ("GstVaapiEncoderH264PredictionType", values); + } + return gtype; +} + /* only for internal usage, values won't be equal to actual payload type */ typedef enum { @@ -724,6 +756,7 @@ struct _GstVaapiEncoderH264 gboolean use_dct8x8; guint temporal_levels; /* Number of temporal levels */ guint temporal_level_div[MAX_TEMPORAL_LEVELS]; /* to find the temporal id */ + guint prediction_type; GstClockTime cts_offset; gboolean config_changed; @@ -3168,6 +3201,9 @@ gst_vaapi_encoder_h264_set_property (GstVaapiEncoder * base_encoder, case GST_VAAPI_ENCODER_H264_PROP_TEMPORAL_LEVELS: encoder->temporal_levels = g_value_get_uint (value); break; + case GST_VAAPI_ENCODER_H264_PROP_PREDICTION_TYPE: + encoder->prediction_type = g_value_get_enum (value); + break; default: return GST_VAAPI_ENCODER_STATUS_ERROR_INVALID_PARAMETER; @@ -3363,6 +3399,20 @@ gst_vaapi_encoder_h264_get_default_properties (void) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** + * GstVaapiEncoderH264:prediction-type: + * + * Select the referece picture selection modes + */ + GST_VAAPI_ENCODER_PROPERTIES_APPEND (props, + GST_VAAPI_ENCODER_H264_PROP_PREDICTION_TYPE, + g_param_spec_enum ("prediction-type", + "RefPic Selection", + "Reference Picture Selection Modes", + gst_vaapi_encoder_h264_prediction_type (), + GST_VAAPI_ENCODER_H264_PREDICTION_DEFAULT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** * GstVaapiEncoderH264:cpb-length: * * The size of the CPB buffer in milliseconds. diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.h b/gst-libs/gst/vaapi/gstvaapiencoder_h264.h index 7b38e763..eb262783 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.h +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.h @@ -55,6 +55,7 @@ typedef struct _GstVaapiEncoderH264 GstVaapiEncoderH264; * @GST_VAAPI_ENCODER_H264_PROP_QP_IP: Difference of QP between I and P frame. * @GST_VAAPI_ENCODER_H264_PROP_QP_IB: Difference of QP between I and B frame. * @GST_VAAPI_ENCODER_H264_PROP_TEMPORAL_LEVELS: Number of temporal levels + * @GST_VAAPI_ENCODER_H264_PROP_PREDICTION_TYPE: Reference picture selection modes * * The set of H.264 encoder specific configurable properties. */ @@ -75,6 +76,7 @@ typedef enum { GST_VAAPI_ENCODER_H264_PROP_QP_IP = -14, GST_VAAPI_ENCODER_H264_PROP_QP_IB = -15, GST_VAAPI_ENCODER_H264_PROP_TEMPORAL_LEVELS = -16, + GST_VAAPI_ENCODER_H264_PROP_PREDICTION_TYPE = -17, } GstVaapiEncoderH264Prop; GstVaapiEncoder * |