diff mbox series

[FFmpeg-devel,RFC,2/4] avcodec/cbs_h2645: keep nal->nuh_layer_id > 0

Message ID tencent_B8C075B70868EE03216BA67D8AAC6239810A@qq.com
State New
Headers show
Series [FFmpeg-devel,RFC,1/4] avcodec/hevc_parse: keep nal->nuh_layer_id > 0 | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Zhao Zhili Jan. 5, 2023, 4:14 p.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

---
 libavcodec/cbs_h2645.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

James Almer Jan. 5, 2023, 11:18 a.m. UTC | #1
On 1/5/2023 1:14 PM, Zhao Zhili wrote:
> From: Zhao Zhili <zhilizhao@tencent.com>
> 
> ---
>   libavcodec/cbs_h2645.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> index 4ee06003c3..b12abede29 100644
> --- a/libavcodec/cbs_h2645.c
> +++ b/libavcodec/cbs_h2645.c
> @@ -477,9 +477,6 @@ static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
>           AVBufferRef *ref;
>           size_t size = nal->size;
>   
> -        if (nal->nuh_layer_id > 0)
> -            continue;

Have you tested samples with NALUs with a layer > 0? How does CBS handle 
them in both reading and writing?

> -
>           // Remove trailing zeroes.
>           while (size > 0 && nal->data[size - 1] == 0)
>               --size;
Zhao Zhili Jan. 5, 2023, 12:06 p.m. UTC | #2
> On Jan 5, 2023, at 19:18, James Almer <jamrial@gmail.com> wrote:
> 
> On 1/5/2023 1:14 PM, Zhao Zhili wrote:
>> From: Zhao Zhili <zhilizhao@tencent.com>
>> ---
>>  libavcodec/cbs_h2645.c | 3 ---
>>  1 file changed, 3 deletions(-)
>> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
>> index 4ee06003c3..b12abede29 100644
>> --- a/libavcodec/cbs_h2645.c
>> +++ b/libavcodec/cbs_h2645.c
>> @@ -477,9 +477,6 @@ static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
>>          AVBufferRef *ref;
>>          size_t size = nal->size;
>>  -        if (nal->nuh_layer_id > 0)
>> -            continue;
> 
> Have you tested samples with NALUs with a layer > 0? How does CBS handle them in both reading and writing?

Yes, only with hevc alpha layer encoding. Both reading and writing work
fine. What is missing is parse VPS extension, SEI alpha channel info and
so on.

Patch 4/4 rewrite nuh_layer_id from non-zero to zero, and it works from
my test (for independent non-base layer).

> 
>> -
>>          // Remove trailing zeroes.
>>          while (size > 0 && nal->data[size - 1] == 0)
>>              --size;
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 4ee06003c3..b12abede29 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -477,9 +477,6 @@  static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
         AVBufferRef *ref;
         size_t size = nal->size;
 
-        if (nal->nuh_layer_id > 0)
-            continue;
-
         // Remove trailing zeroes.
         while (size > 0 && nal->data[size - 1] == 0)
             --size;