From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id B4FC9450B8 for ; Thu, 5 Jan 2023 11:21:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D1C8B68BD12; Thu, 5 Jan 2023 13:21:42 +0200 (EET) Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 89EA268BC16 for ; Thu, 5 Jan 2023 13:21:36 +0200 (EET) Received: by mail-ot1-f50.google.com with SMTP id m6-20020a9d7e86000000b0066ec505ae93so22321640otp.9 for ; Thu, 05 Jan 2023 03:21:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Sv7Te0vJeNHiYOhimdDzKEXxcjhpGjeM6aJZNrRqbp8=; b=DfC5ZtVuTsIggN67a/hnh3I3QUBRf/gFZe7PuXDKZOVvNO7SgBSoMZm73aXhOkljTp xWpf+qfsWpcbXuI9lVglKzZkFd5m16vUu5+qGuf0LmedmQx0EW1NW8TZSBzw01fTSGA2 9CAkEvWrWBPc+m4XOiLdN7YTBZu5RERuQdrHpG/uQhqQtjss6JjJccpclYP8jyCU6ply 16O8Z1ryZLb2UgUnZ1uE4LR9drYNmwnXlniBP2rve1w5zWXgDK1Ws8OjOTF+1RbICWbL ph5/X4sGwC0K8BAfzxhNiqARmTcoUQ3d6HH3BqVzj/Xxa/igXaluoeHv6Yd6+XT5ar8Z yEDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Sv7Te0vJeNHiYOhimdDzKEXxcjhpGjeM6aJZNrRqbp8=; b=P7XlU5fDVqEZtod3ZwXV9FFYvsVg+TV5BW6DHCak5nGVFCeIEEC1g+a0+j8oarcanT 9XxDnym6G0j9Z9ZwHOZ01rSRCGygTOlicds+FNYItflJ6gbSP8QWlGrPpBlNqlziFs+u Tzi7H9sw7A/rfO0zl5CaIzTlpx+tI4jRVPiEipWwWVXoEYQ+QjcLFMmD7orVuPNHCLjY XVYyPWqxTOjFySVxEnx4BER8Rs5iWjvHHvNMQ7NGvve3BdFhFgdr21gadMDe8F6QtrdQ W0TsVJ2qx630PZ/Q1mEZ8iDYOHJH2iumNS5zLNopBhVC4GJw8SKSJWrqC56/vpNARqdl H/Rg== X-Gm-Message-State: AFqh2koVg70D5+u7Ugz8ZwyoSl1/Gd7XclwS8cvPk/RCntsCy87Vmtqh 6mJ9OOtVzUXEb7McTHVmqa8nX/qpwgc= X-Google-Smtp-Source: AMrXdXs1My3Q48fyUdos6/Xpyhcl6CE125aioOXyqDSoba5DNk2/uudzA6PHnSs8qykSLtcg4B9aeQ== X-Received: by 2002:a05:6830:555:b0:66c:43fe:2508 with SMTP id l21-20020a056830055500b0066c43fe2508mr34594542otb.25.1672917694765; Thu, 05 Jan 2023 03:21:34 -0800 (PST) Received: from [192.168.0.14] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id j69-20020a9d17cb000000b0066c45517c8fsm17089273otj.52.2023.01.05.03.21.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Jan 2023 03:21:34 -0800 (PST) Message-ID: <8cd994d5-e258-86ea-2069-4feb1b2267c0@gmail.com> Date: Thu, 5 Jan 2023 08:21:37 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230105161416.194463-1-quinkblack@foxmail.com> From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [RFC PATCH 3/4] avcodec/hevcdec: add nuh_layer_id option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 1/5/2023 1:14 PM, Zhao Zhili wrote: > From: Zhao Zhili > > It can be used to decode selected independent non-base layer. One > use case is alpha layer decoding. > > Signed-off-by: Zhao Zhili > --- > libavcodec/hevcdec.c | 20 +++++++++++++++++++- > libavcodec/version.h | 2 +- > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c > index 567e8d81d4..9641922834 100644 > --- a/libavcodec/hevcdec.c > +++ b/libavcodec/hevcdec.c > @@ -3216,7 +3216,8 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) > > if (s->avctx->skip_frame >= AVDISCARD_ALL || > (s->avctx->skip_frame >= AVDISCARD_NONREF > - && ff_hevc_nal_is_nonref(nal->type)) || nal->nuh_layer_id > 0) > + && ff_hevc_nal_is_nonref(nal->type)) || > + nal->nuh_layer_id != s->nuh_layer_id) > continue; > > ret = decode_nal_unit(s, nal); > @@ -3637,6 +3638,21 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx) > HEVCContext *s = avctx->priv_data; > int ret; > > + if (s->nuh_layer_id > 0) { > + if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { > + av_log(avctx, AV_LOG_ERROR, > + "Decode selected nuh_layer_id is undef development. " > + "Use -strict -2 to use it anyway.\n"); "Undef development"? Does decoding of these non-base layers work or not? One thing is something being experimental (thus known to be working in at least some cases, even if not spec compliant), and another is enabling something we don't know if it's going to work or not at all. > + return AVERROR(EINVAL); > + } > + > + if (avctx->hwaccel) { > + av_log(avctx, AV_LOG_ERROR, > + "Decode selected nuh_layer_id doesn't work with hwaccel.\n"); > + return AVERROR(EINVAL); > + } > + } > + > if (avctx->active_thread_type & FF_THREAD_SLICE) { > s->threads_number = avctx->thread_count; > ret = ff_slice_thread_init_progress(avctx); > @@ -3691,6 +3707,8 @@ static const AVOption options[] = { > AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, PAR }, > { "strict-displaywin", "stricly apply default display window size", OFFSET(apply_defdispwin), > AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, PAR }, > + { "nuh_layer_id", "Select which nuh_layer_id to decode (only works with INBL)", OFFSET(nuh_layer_id), > + AV_OPT_TYPE_INT, {.i64 = 0}, 0, 62, PAR }, > { NULL }, > }; > > diff --git a/libavcodec/version.h b/libavcodec/version.h > index 6b8a1dbb79..15f7c3fe3d 100644 > --- a/libavcodec/version.h > +++ b/libavcodec/version.h > @@ -30,7 +30,7 @@ > #include "version_major.h" > > #define LIBAVCODEC_VERSION_MINOR 56 > -#define LIBAVCODEC_VERSION_MICRO 100 > +#define LIBAVCODEC_VERSION_MICRO 101 > > #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ > LIBAVCODEC_VERSION_MINOR, \ _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".