From a428f2fcd95906cdfca1eff574369fb32169317e Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 7 Dec 2017 20:37:48 +0100 Subject: libavcodec/hevc_filter: move AVDISCARD_NONREF switch-case into function In preparation for implementation of skip_frame. Signed-off-by: Michael Niedermayer --- libavcodec/hevcdec.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libavcodec/hevcdec.h') diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index ef918f4fb2..b311edc8ae 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -548,6 +548,26 @@ int ff_hevc_frame_nb_refs(HEVCContext *s); int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc); +static av_always_inline int ff_hevc_nal_is_nonref(enum HEVCNALUnitType type) +{ + switch (type) { + case HEVC_NAL_TRAIL_N: + case HEVC_NAL_TSA_N: + case HEVC_NAL_STSA_N: + case HEVC_NAL_RADL_N: + case HEVC_NAL_RASL_N: + 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; + } + return 0; +} + /** * Find next frame in output order and put a reference to it in frame. * @return 1 if a frame was output, 0 otherwise -- cgit v1.2.3