diff mbox

[FFmpeg-devel] avcodec/hevcdec: fix non-ref frame judgement

Message ID 20181023044908.12998-1-wfwf1997@gmail.com
State Accepted
Commit 10bc4c3a7df7bb26303067b97311b7eeedfd453e
Headers show

Commit Message

Mark Wu Oct. 23, 2018, 4:49 a.m. UTC
After inspecting the source code of x265, mpv and ffmpeg, I've found that 
ffmpeg mistakenly regards EVC_NAL_BLA_N_LP and HEVC_NAL_IDR_N_LP as non-
reference frames, which are acutally reference frames according to the 
specification in x265, and drops them.

This patch should address the problem. I have tested it with mpv.

Signed-off-by: Mark Wu <wfwf1997@gmail.com>
---
 libavcodec/hevcdec.h | 2 --
 1 file changed, 2 deletions(-)

Comments

James Almer Nov. 10, 2018, 5:39 p.m. UTC | #1
On 10/23/2018 1:49 AM, Mark Wu wrote:
> After inspecting the source code of x265, mpv and ffmpeg, I've found that 
> ffmpeg mistakenly regards EVC_NAL_BLA_N_LP and HEVC_NAL_IDR_N_LP as non-
> reference frames, which are acutally reference frames according to the 
> specification in x265, and drops them.
> 
> This patch should address the problem. I have tested it with mpv.
> 
> Signed-off-by: Mark Wu <wfwf1997@gmail.com>
> ---
>  libavcodec/hevcdec.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h
> index f0f588f2b8..dd951aae06 100644
> --- a/libavcodec/hevcdec.h
> +++ b/libavcodec/hevcdec.h
> @@ -559,8 +559,6 @@ static av_always_inline int ff_hevc_nal_is_nonref(enum HEVCNALUnitType type)
>      case HEVC_NAL_VCL_N10:
>      case HEVC_NAL_VCL_N12:
>      case HEVC_NAL_VCL_N14:
> -    case HEVC_NAL_BLA_N_LP:
> -    case HEVC_NAL_IDR_N_LP:
>          return 1;
>          break;
>      default: break;

Pushed, thanks.
diff mbox

Patch

diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h
index f0f588f2b8..dd951aae06 100644
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@ -559,8 +559,6 @@  static av_always_inline int ff_hevc_nal_is_nonref(enum HEVCNALUnitType type)
     case HEVC_NAL_VCL_N10:
     case HEVC_NAL_VCL_N12:
     case HEVC_NAL_VCL_N14:
-    case HEVC_NAL_BLA_N_LP:
-    case HEVC_NAL_IDR_N_LP:
         return 1;
         break;
     default: break;