[FFmpeg-devel] [PATCH WIP 5/5] avcodec/hevc: Add alpha layer support

Zhao Zhili quinkblack at foxmail.com
Sun Dec 15 09:01:57 EET 2024



> On Dec 14, 2024, at 17:43, Anton Khirnov <anton at khirnov.net> wrote:
> 
> Quoting Zhao Zhili (2024-12-11 05:23:33)
>> From: Zhao Zhili <zhilizhao at tencent.com>
>> 
>> ---
>> libavcodec/hevc/hevcdec.c | 75 ++++++++++++++++++++++++++++++++++++++-
>> libavcodec/hevc/hevcdec.h |  2 ++
>> libavcodec/hevc/refs.c    | 10 +++++-
>> 3 files changed, 85 insertions(+), 2 deletions(-)
>> 
>> diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
>> index be35a9de82..782c9382bc 100644
>> --- a/libavcodec/hevc/hevcdec.c
>> +++ b/libavcodec/hevc/hevcdec.c
>> @@ -458,6 +458,26 @@ static int export_multilayer(HEVCContext *s, const HEVCVPS *vps)
>>     return 0;
>> }
>> 
>> +int ff_hevc_is_alpha_video(const HEVCContext *s) {
>> +    const HEVCVPS *vps;
>> +    int ret = 0;
>> +
>> +    if (!s->vps)
>> +        return 0;
> 
> This seems like something that should not happen.
> 
>> +    vps = s->vps;
>> +    if (vps->nb_layers != 2 || !vps->layer_id_in_nuh[1])
>> +        return 0;
>> +
>> +    ret = (s->vps->scalability_mask_flag & HEVC_SCALABILITY_AUXILIARY) &&
>> +          s->sei.alpha.has_alpha_channel_info;
> 
> Is the SEI really necessary? I thought it's enough to have an auxiliary
> picture with AuxId=AUX_ALPHA.
> 

V2 dropped the SEI patch.

> Also, I'd prefer the interaction with multiview to be clearer, with e.g.
> a warning message when both are present, and fewer assumptions about
> only one of them being present spread over the code.

V2 added a warning message in vps extension decode.

x265 set both MULTIVIEW and AUXILIARY for alpha video, which should be a mistake.

I don’t know how to create a multiview alpha video.

> 
> -- 
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org <mailto:ffmpeg-devel at ffmpeg.org>
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org <mailto:ffmpeg-devel-request at ffmpeg.org> with subject "unsubscribe".



More information about the ffmpeg-devel mailing list