[FFmpeg-devel] [PATCH v3 1/2] lavc/vaapi_encode_h265: Map HEVC AV REXT profile to VA REXT profile

Mark Thompson sw at jkqxz.net
Tue Apr 16 01:07:56 EEST 2024


On 15/04/2024 02:21, Xiang, Haihao wrote:
> On Ma, 2024-03-18 at 12:21 +0800, fei.w.wang-at-intel.com at ffmpeg.org wrote:
>> From: Fei Wang <fei.w.wang at intel.com>
>>
>> There is no Main8/10 profile defined in HEVC REXT profiles. Use Main12
>> which is compatible with 8/10bit.
>>
>> Signed-off-by: Fei Wang <fei.w.wang at intel.com>
>> ---
>>  libavcodec/vaapi_encode_h265.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
>> index c4aabbf5ed..43755e2188 100644
>> --- a/libavcodec/vaapi_encode_h265.c
>> +++ b/libavcodec/vaapi_encode_h265.c
>> @@ -1305,12 +1305,12 @@ static av_cold int
>> vaapi_encode_h265_configure(AVCodecContext *avctx)
>>  
>>  static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
>>      { AV_PROFILE_HEVC_MAIN,     8, 3, 1, 1, VAProfileHEVCMain       },
>> -    { AV_PROFILE_HEVC_REXT,     8, 3, 1, 1, VAProfileHEVCMain       },
>>  #if VA_CHECK_VERSION(0, 37, 0)
>>      { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10     },
>> -    { AV_PROFILE_HEVC_REXT,    10, 3, 1, 1, VAProfileHEVCMain10     },
>>  #endif
>>  #if VA_CHECK_VERSION(1, 2, 0)
>> +    { AV_PROFILE_HEVC_REXT,     8, 3, 1, 1, VAProfileHEVCMain12 },
>> +    { AV_PROFILE_HEVC_REXT,    10, 3, 1, 1, VAProfileHEVCMain12 },
>>      { AV_PROFILE_HEVC_REXT,    12, 3, 1, 1, VAProfileHEVCMain12 },
>>      { AV_PROFILE_HEVC_REXT,     8, 3, 1, 0, VAProfileHEVCMain422_10 },
>>      { AV_PROFILE_HEVC_REXT,    10, 3, 1, 0, VAProfileHEVCMain422_10 },
> 
> Patchset LGTM, I'll push it if there are no comments.

Why is this change helpful?

We don't use the rext features allowed in these cases (unlike in the decoder where we have to support them), so Main / Main 10 encoders will be able to produce a compatible stream without pointlessly requiring Main 12 support which many devices do not have.

Thanks,

- Mark


More information about the ffmpeg-devel mailing list