mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
Encode: Add support for Picture level Entrypoint
This is useful for JPEG encoding which is utilizing picture level entrypoint instead of slice level entrypoint like h264,mpeg2 etc.
This commit is contained in:
parent
4197c8de17
commit
d48ab9a3d6
4 changed files with 25 additions and 7 deletions
|
@ -557,6 +557,7 @@ ensure_profiles (GstVaapiDisplay * display)
|
|||
g_array_append_val (priv->decoders, config);
|
||||
break;
|
||||
case GST_VAAPI_ENTRYPOINT_SLICE_ENCODE:
|
||||
case GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE:
|
||||
g_array_append_val (priv->encoders, config);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -512,14 +512,22 @@ get_config_attribute (GstVaapiEncoder * encoder, VAConfigAttribType type,
|
|||
{
|
||||
GstVaapiProfile profile;
|
||||
VAProfile va_profile;
|
||||
VAEntrypoint va_entrypoint;
|
||||
const GstVaapiEncoderClassData *const cdata =
|
||||
GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data;
|
||||
|
||||
profile = get_profile (encoder);
|
||||
if (!profile)
|
||||
return FALSE;
|
||||
|
||||
va_profile = gst_vaapi_profile_get_va_profile (profile);
|
||||
|
||||
if (cdata->codec != GST_VAAPI_CODEC_JPEG)
|
||||
va_entrypoint = VAEntrypointEncSlice;
|
||||
else
|
||||
va_entrypoint = VAEntrypointEncPicture;
|
||||
|
||||
return gst_vaapi_get_config_attribute (encoder->display, va_profile,
|
||||
VAEntrypointEncSlice, type, out_value_ptr);
|
||||
va_entrypoint, type, out_value_ptr);
|
||||
}
|
||||
|
||||
/* Determines the set of supported packed headers */
|
||||
|
@ -550,10 +558,16 @@ set_context_info (GstVaapiEncoder * encoder)
|
|||
GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;
|
||||
const GstVideoFormat format =
|
||||
GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
|
||||
const GstVaapiEncoderClassData *const cdata =
|
||||
GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data;
|
||||
|
||||
cip->usage = GST_VAAPI_CONTEXT_USAGE_ENCODE;
|
||||
cip->profile = encoder->profile;
|
||||
cip->entrypoint = GST_VAAPI_ENTRYPOINT_SLICE_ENCODE;
|
||||
if (cdata->codec != GST_VAAPI_CODEC_JPEG)
|
||||
cip->entrypoint = GST_VAAPI_ENTRYPOINT_SLICE_ENCODE;
|
||||
else
|
||||
cip->entrypoint = GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE;
|
||||
cip->chroma_type = gst_vaapi_video_format_get_chroma_type (format);
|
||||
cip->width = GST_VAAPI_ENCODER_WIDTH (encoder);
|
||||
cip->height = GST_VAAPI_ENCODER_HEIGHT (encoder);
|
||||
|
|
|
@ -144,11 +144,12 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = {
|
|||
|
||||
/* Entry-points */
|
||||
static const GstVaapiEntrypointMap gst_vaapi_entrypoints[] = {
|
||||
{ GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD },
|
||||
{ GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT },
|
||||
{ GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp },
|
||||
{ GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD },
|
||||
{ GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT },
|
||||
{ GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp },
|
||||
#if VA_CHECK_VERSION(0,30,0)
|
||||
{ GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, VAEntrypointEncSlice },
|
||||
{ GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, VAEntrypointEncSlice },
|
||||
{ GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE, VAEntrypointEncPicture },
|
||||
#endif
|
||||
{ 0, }
|
||||
};
|
||||
|
|
|
@ -161,6 +161,7 @@ typedef enum {
|
|||
* @GST_VAAPI_ENTRYPOINT_IDCT: Inverse Decrete Cosine Transform
|
||||
* @GST_VAAPI_ENTRYPOINT_MOCO: Motion Compensation
|
||||
* @GST_VAAPI_ENTRYPOINT_SLICE_ENCODE: Encode Slice
|
||||
* @GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE: Encode Picture
|
||||
*
|
||||
* The set of all entrypoints for #GstVaapiEntrypoint
|
||||
*/
|
||||
|
@ -168,7 +169,8 @@ typedef enum {
|
|||
GST_VAAPI_ENTRYPOINT_VLD = 1,
|
||||
GST_VAAPI_ENTRYPOINT_IDCT,
|
||||
GST_VAAPI_ENTRYPOINT_MOCO,
|
||||
GST_VAAPI_ENTRYPOINT_SLICE_ENCODE
|
||||
GST_VAAPI_ENTRYPOINT_SLICE_ENCODE,
|
||||
GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE
|
||||
} GstVaapiEntrypoint;
|
||||
|
||||
const gchar *
|
||||
|
|
Loading…
Reference in a new issue