[FFmpeg-devel] [PATCH] libavcodec/hevc_filter: implement skip_frame
Michael Niedermayer
michael at niedermayer.cc
Wed Dec 6 19:32:07 EET 2017
On Tue, Dec 05, 2017 at 10:35:50PM +0000, Stefan _ wrote:
> On 04.12.2017 at 21:06 Carl Eugen Hoyos wrote:
> > 2017-12-01 0:22 GMT+01:00 Stefan _ <sfan5 at live.de>:
> >
> >> Attached patch adds full support for skip_loop_filter
> >> (all levels) to the hevc decoder.
> > Will you also work on -skip_frame for hevc?
> >
> > Carl Eugen
>
> I gave it a try. The different levels should all work correctly, since I
> compared the "effects" to a H.264 sample.
>
> 'make fate-hevc' passes.
>
> hevcdec.c | 31 ++++++++++++++++++++++++++++++-
> 1 file changed, 30 insertions(+), 1 deletion(-)
> 79234a40e0eb99673a032351e021d9d375c43ad6 0001-libavcodec-hevc_filter-implement-skip_frame.patch
> From 8ee08adebd9994c3517c692cc99f0839d3d8f7ca Mon Sep 17 00:00:00 2001
> From: sfan5 <sfan5 at live.de>
> Date: Tue, 5 Dec 2017 23:26:14 +0100
> Subject: [PATCH] libavcodec/hevc_filter: implement skip_frame
>
> ---
> libavcodec/hevcdec.c | 31 ++++++++++++++++++++++++++++++-
> 1 file changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 433a7056ea..37f2ad76eb 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -2905,6 +2905,13 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
> if (ret < 0)
> return ret;
>
> + 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))) {
> + break;
> + }
> +
> if (s->sh.first_slice_in_pic_flag) {
> if (s->max_ra == INT_MAX) {
> if (s->nal_unit_type == HEVC_NAL_CRA_NUT || IS_BLA(s)) {
> @@ -3028,7 +3035,29 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
>
> /* decode the NAL units */
> for (i = 0; i < s->pkt.nb_nals; i++) {
> - ret = decode_nal_unit(s, &s->pkt.nals[i]);
> + H2645NAL *nal = &s->pkt.nals[i];
> + int is_n = 0;
> +
> + switch (nal->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:
> + is_n = 1;
> + break;
> + default: break;
> + }
This is duplicated, it should be moved into a seperate function
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Elect your leaders based on what they did after the last election, not
based on what they say before an election.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171206/835bde33/attachment.sig>
More information about the ffmpeg-devel
mailing list