From patchwork Sun Dec 3 19:58:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sfan5 X-Patchwork-Id: 6529 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp3625741jah; Sun, 3 Dec 2017 11:58:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMbgOF3Llx7QaVPJa03q48XYGKiky9UIVCwoVNaKqRsDn4Udj69rPM1J8yJAnVzl8vM3rTdM X-Received: by 10.223.151.212 with SMTP id t20mr11690839wrb.2.1512331106043; Sun, 03 Dec 2017 11:58:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512331106; cv=none; d=google.com; s=arc-20160816; b=vMGUZgG5oKhcDXdR7AJR4hbUfsiXlOB2GO47fA65eD9oXrR6ylc2wB8Z0CyXqf/4l7 jIROu9vXLVii2aaivixDwCNkDJOyBGJCe2n7i8KW2W2+qD8r34uScT5ZMmNJnpyIXl+l gAQXIjr/O3mdVwuNeS1ooIMQ4zcG0SrIsO+kWAYWpfUO0P1Y7HXLGqjnp4u590+oy3SV 4sCxbcqIQqUd/DcMejd/lYgE+RCu5oAJw8Fy3uEbq44QI7rx6RpinlV7rZ7+ncQeD5Rf q8C6Vi8hmRpfBzi25wV1+ic1X7Fx3OJi35JqAB/iMXTgxMBr1DA7bn6Kk4LxL/U3+l17 XxpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:to:from:delivered-to :arc-authentication-results; bh=qPr4Ly04AII8EIIQl898+GMfX3bONl9c8TsD5svhh0w=; b=eIFZSQ2zrHim0x8XpMWfJILVs56jBr7hJnu1jOUnKhAOBkLYPU3f6aN/sjGeXXHsD/ Jo9/1UAjvhE3fBEcdH6ZBzUaCOWCwEl4T+4X9Z+rqP0GImJdgdipJm0gjxfokkrOndXT TsXf++vHwZxhoaHl9MpncW0poDDIPw1SsoycuYq46l43F6/3y0jLd+IQWRt4Qixaqcnb U7phzKdnVhO/K61wj+F21M+Yxd2M6UA3TBZCIzD6Em/P64ly0OvYPG8oy5ALaAMefJMM gHrSkvl/fHkStjOm8eCOHo0yu1rboden3H0iiBp1Vmxga3nOV6gV6hPjfVlZdYV7EPQd Ek4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l34si8971079wre.522.2017.12.03.11.58.25; Sun, 03 Dec 2017 11:58:26 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7968D68A5B0; Sun, 3 Dec 2017 21:58:20 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071054.outbound.protection.outlook.com [40.92.71.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BF499680617 for ; Sun, 3 Dec 2017 21:58:14 +0200 (EET) Received: from VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com (10.152.18.54) by VE1EUR03HT035.eop-EUR03.prod.protection.outlook.com (10.152.19.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.239.4; Sun, 3 Dec 2017 19:58:18 +0000 Received: from DB3PR0202MB3452.eurprd02.prod.outlook.com (10.152.18.51) by VE1EUR03FT028.mail.protection.outlook.com (10.152.18.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.239.4 via Frontend Transport; Sun, 3 Dec 2017 19:58:18 +0000 Received: from DB3PR0202MB3452.eurprd02.prod.outlook.com ([fe80::f8c4:4dc5:8552:d274]) by DB3PR0202MB3452.eurprd02.prod.outlook.com ([fe80::f8c4:4dc5:8552:d274%13]) with mapi id 15.20.0260.007; Sun, 3 Dec 2017 19:58:18 +0000 From: Stefan _ To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [FFmpeg-devel] [PATCH v2] libavcodec/hevc_filter: support for all skip_loop_filter levels Thread-Index: AQHTbHEQtskK89eHO0SbVhB8WtfcZg== Date: Sun, 3 Dec 2017 19:58:18 +0000 Message-ID: References: <20171201164549.GE4636@nb4> In-Reply-To: <20171201164549.GE4636@nb4> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:A1D3990177BAC92C6E3A02FE75A7574A19F5FBA650F922F54D45C963E2B40D39; UpperCasedChecksum:38872D007C6050E2C5BEA90D43B74A833264F59FAFB72FCCE359F3EFC810D053; SizeAsReceived:7173; Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [aEWhz2YyQIh/z3ClKrnUBnjDIpDeIIUT] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VE1EUR03HT035; 6:6sEE75801WhtPWMrK3sTrVQUcT6V2pY7l9IVplWyJvk4JDRvJi7YaPmK18jGXIuQ/sz+zvzLR35CMA1p91t9E9tziDASj1xo2kdzIdS5ExWh2VCf7gjMofZKF3e4s0a1uS/8uduoRmDt52WlUvEUYgjf50o4inKljiXWWEIKBP2/lfg6t6CyQq3s1Ll8LXvcSLShok0H7n+3bHbn/cXRq2/jAAMNO7Xme/dfeUfb+xE2ppM00+PirtmMPpIONwOtNfLo1n6efxguGVBE6OmTe5MJ/Jqr/YKaA0fICms6h3SR9mMCALAxjlaj2NcqNQxwmqC/0MTiJWraV3tYrRXY5GPq11mVhaEJI1W3aIjy9/s=; 5:suW+0bkDMZkSUtno+Z/OXkhtn/pZcOIUmAGamHlAEqB57RAmoYoxcDssJa7rf7JtD95nzhnke3lMZFSPXrbWsmhOxEVjq2R8VZHFz5FXQbJXUt0SC8GVPSPaAJGBDwOu3Aqr/OQuOmsriLK2d58qSKdEBDvpscVDsBjhXq3MYvk=; 24:BeT0ko4MNvImL0015lQijA87EcKeie5gJ89vftC2jtFvxV5fC5zgXWos9T5PCJ5WSdMimHYMSnTLU6G9xbXg5YWFzEgOCICyoVNLoVCta0A=; 7:hxdDPNg6a3FD3k3nxe4mQDZ9C0apQRI9ZOgxV7QHrUrOBNIeVPp3RWCiOiWpEJ8ACvP3sbF2oEhH+tpzJdBr12eG0jmEeYRv5QeVNL9eAA7Z0BG7M5RCeRD75XDu+z0JC/wj7ADp4orRl3BCcHbjvVnkBmdL5W6y9dLWYGZVI3XUKlwmFxIPNdxdhdO8XBHGHArxnkszuoRH3o4FChhlTQQ+qNin0NUDa4KSV6yYGAvhwLowTw7/McM0Hq3+yge+ x-incomingheadercount: 46 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045); SRVR:VE1EUR03HT035; x-ms-traffictypediagnostic: VE1EUR03HT035: x-ms-office365-filtering-correlation-id: 7102f703-d578-4a73-29cb-08d53a883243 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:VE1EUR03HT035; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VE1EUR03HT035; x-forefront-prvs: 05102978A2 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:VE1EUR03HT035; H:DB3PR0202MB3452.eurprd02.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7102f703-d578-4a73-29cb-08d53a883243 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2017 19:58:18.1018 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT035 Subject: Re: [FFmpeg-devel] [PATCH v2] libavcodec/hevc_filter: support for all skip_loop_filter levels X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 01.12.2017 at 17:45 Michael Niedermayer wrote: > AVDISCARD_NONREF is about frames which are not referenced by any other > doesnt ff_hevc_frame_nb_refs() produce the number of references curently > aka the other end of the reference arrows ? Yes, that sounds right. I've revised the patch to check for *_N NAL unit types instead (which should be equivalent to H.264's nal_idc == 0) and to skip not only deblock, but also SAO. From a3ebeb4ca0849cfc3846de79b38ae5ca6c001718 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 30 Nov 2017 23:58:02 +0100 Subject: [PATCH] libavcodec/hevc_filter: support for all skip_loop_filter levels. Continues where commit 52c75d486ed5f75cbb79e5dbd07b7aef24f3071f left off. --- doc/decoders.texi | 7 ------- libavcodec/hevc_filter.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/doc/decoders.texi b/doc/decoders.texi index d149d2bea5..a9510bdf02 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -25,13 +25,6 @@ enabled decoders. A description of some of the currently available video decoders follows. -@section hevc - -HEVC / H.265 decoder. - -Note: the @option{skip_loop_filter} option has effect only at level -@code{all}. - @section rawvideo Raw video decoder. diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c index b53f4cc721..94fb7cd3d1 100644 --- a/libavcodec/hevc_filter.c +++ b/libavcodec/hevc_filter.c @@ -842,9 +842,34 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) { int x_end = x >= s->ps.sps->width - ctb_size; - if (s->avctx->skip_loop_filter < AVDISCARD_ALL) + int skip = 0, is_n = 0; + switch (s->nal_unit_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; + } + if (s->avctx->skip_loop_filter >= AVDISCARD_ALL || + (s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && !IS_IDR(s)) || + (s->avctx->skip_loop_filter >= AVDISCARD_NONINTRA && + s->sh.slice_type != HEVC_SLICE_I) || + (s->avctx->skip_loop_filter >= AVDISCARD_BIDIR && + s->sh.slice_type == HEVC_SLICE_B) || + (s->avctx->skip_loop_filter >= AVDISCARD_NONREF && is_n)) + skip = 1; + + if (!skip) deblocking_filter_CTB(s, x, y); - if (s->ps.sps->sao_enabled) { + if (s->ps.sps->sao_enabled && !skip) { int y_end = y >= s->ps.sps->height - ctb_size; if (y && x) sao_filter_CTB(s, x - ctb_size, y - ctb_size); -- 2.15.1