mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
vaapi_encode: Choose profiles dynamically
Previously there was one fixed choice for each codec (e.g. H.265 -> Main profile), and using anything else then required an explicit option from the user. This changes to selecting the profile based on the input format and the set of profiles actually supported by the driver (e.g. P010 input will choose Main 10 profile for H.265 if the driver supports it). The entrypoint and render target format are also chosen dynamically in the same way, removing those explicit selections from the per-codec code.
This commit is contained in:
parent
a00763be88
commit
3b188666f1
9 changed files with 315 additions and 181 deletions
|
|
@ -359,7 +359,15 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = {
|
||||
{ FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
|
||||
8, 3, 1, 1, VAProfileJPEGBaseline },
|
||||
{ FF_PROFILE_UNKNOWN }
|
||||
};
|
||||
|
||||
static const VAAPIEncodeType vaapi_encode_type_mjpeg = {
|
||||
.profiles = vaapi_encode_mjpeg_profiles,
|
||||
|
||||
.configure = &vaapi_encode_mjpeg_configure,
|
||||
|
||||
.picture_params_size = sizeof(VAEncPictureParameterBufferJPEG),
|
||||
|
|
@ -380,11 +388,6 @@ static av_cold int vaapi_encode_mjpeg_init(AVCodecContext *avctx)
|
|||
|
||||
ctx->codec = &vaapi_encode_type_mjpeg;
|
||||
|
||||
ctx->va_profile = VAProfileJPEGBaseline;
|
||||
ctx->va_entrypoint = VAEntrypointEncPicture;
|
||||
|
||||
ctx->va_rt_format = VA_RT_FORMAT_YUV420;
|
||||
|
||||
ctx->va_rc_mode = VA_RC_CQP;
|
||||
|
||||
// The JPEG image header - see note above.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue