Re: [FFmpeg-devel] [PATCH]lavc/hevcdec: Treat clean random access nals as keyframes for -skip_frame

2018-05-27 Thread Carl Eugen Hoyos
2018-05-26 18:38 GMT+02:00, Mark Thompson :
> On 24/05/18 17:57, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch fixes ticket #7227 here, -skip_frame nokey shows no
>> warnings on decoding with this change and still decodes less frames
>> than -skip_frame nointra (which shows many warnings).
>>
>> Please comment, Carl Eugen
>>
>>
>> From ea5cf5aab2a9360971f5291fce19e5daae833de0 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos 
>> Date: Thu, 24 May 2018 18:53:16 +0200
>> Subject: [PATCH] lavc/hevcdec: Treat clean random access nals as keyframes
>>  for -skip_frame.
>>
>> Fixes ticket #7227.
>> ---
>>  libavcodec/hevcdec.c |2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
>> index c887762..dd7675a 100644
>> --- a/libavcodec/hevcdec.c
>> +++ b/libavcodec/hevcdec.c
>> @@ -2919,7 +2919,7 @@ static int decode_nal_unit(HEVCContext *s, const
>> H2645NAL *nal)
>>  if (
>>  (s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type
>> == HEVC_SLICE_B) ||
>>  (s->avctx->skip_frame >= AVDISCARD_NONINTRA &&
>> s->sh.slice_type != HEVC_SLICE_I) ||
>> -(s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IDR(s))) {
>> +(s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IDR(s) &&
>> s->nal_unit_type != HEVC_NAL_CRA_NUT)) {
>
> I think "!IS_IRAP(s)" would be simpler and perhaps more consistent?
> (Compared to what you have here it adds BLA NAL units as well,
> which will be equivalent to CRA for this purpose.)

Patch applied with this change.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavc/hevcdec: Treat clean random access nals as keyframes for -skip_frame

2018-05-26 Thread Mark Thompson
On 24/05/18 17:57, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes ticket #7227 here, -skip_frame nokey shows no
> warnings on decoding with this change and still decodes less frames
> than -skip_frame nointra (which shows many warnings).
> 
> Please comment, Carl Eugen
> 
> 
> From ea5cf5aab2a9360971f5291fce19e5daae833de0 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos 
> Date: Thu, 24 May 2018 18:53:16 +0200
> Subject: [PATCH] lavc/hevcdec: Treat clean random access nals as keyframes
>  for -skip_frame.
> 
> Fixes ticket #7227.
> ---
>  libavcodec/hevcdec.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index c887762..dd7675a 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -2919,7 +2919,7 @@ static int decode_nal_unit(HEVCContext *s, const 
> H2645NAL *nal)
>  if (
>  (s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type == 
> HEVC_SLICE_B) ||
>  (s->avctx->skip_frame >= AVDISCARD_NONINTRA && s->sh.slice_type 
> != HEVC_SLICE_I) ||
> -(s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IDR(s))) {
> +(s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IDR(s) && 
> s->nal_unit_type != HEVC_NAL_CRA_NUT)) {

I think "!IS_IRAP(s)" would be simpler and perhaps more consistent?  (Compared 
to what you have here it adds BLA NAL units as well, which will be equivalent 
to CRA for this purpose.)

>  break;
>  }
>  
> -- 
> 1.7.10.4
> 

Should be fine with or without that change.

Thanks,

- Mark
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH]lavc/hevcdec: Treat clean random access nals as keyframes for -skip_frame

2018-05-24 Thread Carl Eugen Hoyos
Hi!

Attached patch fixes ticket #7227 here, -skip_frame nokey shows no
warnings on decoding with this change and still decodes less frames
than -skip_frame nointra (which shows many warnings).

Please comment, Carl Eugen
From ea5cf5aab2a9360971f5291fce19e5daae833de0 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Thu, 24 May 2018 18:53:16 +0200
Subject: [PATCH] lavc/hevcdec: Treat clean random access nals as keyframes
 for -skip_frame.

Fixes ticket #7227.
---
 libavcodec/hevcdec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index c887762..dd7675a 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2919,7 +2919,7 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
 if (
 (s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type == HEVC_SLICE_B) ||
 (s->avctx->skip_frame >= AVDISCARD_NONINTRA && s->sh.slice_type != HEVC_SLICE_I) ||
-(s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IDR(s))) {
+(s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IDR(s) && s->nal_unit_type != HEVC_NAL_CRA_NUT)) {
 break;
 }
 
-- 
1.7.10.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel