From patchwork Tue Oct 23 04:49:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wu X-Patchwork-Id: 10753 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9A8A244A398 for ; Tue, 23 Oct 2018 07:57:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E5FEC68A506; Tue, 23 Oct 2018 07:56:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 065F368A4D6 for ; Tue, 23 Oct 2018 07:56:35 +0300 (EEST) Received: by mail-pl1-f196.google.com with SMTP id p7-v6so50579plk.5 for ; Mon, 22 Oct 2018 21:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4UR96li5MKYA4aHAOarEtLjpMy8+/2c/FZyVmvYA9Y0=; b=FivGxW6CC4ztXtqnUYUlPUk/mqWtOLJhCkkv5DLrS9BHzNJ//H79Fkh7KYklLxjvDY 3UYjVN8iRH4J76/G345HkZqFUBTiCabjvhw7UrX6t52a7O/6a1wsSfC9+6nIBzyQs9t2 MXlOAGzfQ4tifKYjrYMvcLEA504+sYiklWoBCVysMURnAckRja7/8WWBfqm8WqyXuRrA 77ReH9qriM2nW5Ea2CuEwn6vCYFb2xEh7Q/hav1DZ7e6KYPnpTNIHMCS0jFIiTPT7XUW qTQiNV0wkP4JrzzEV1axobgsWVVmKwzEGMktmf8xe9NzRFPkTWmQnYLN/RwqY2941V3c iq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4UR96li5MKYA4aHAOarEtLjpMy8+/2c/FZyVmvYA9Y0=; b=KtHZCss+yQma0x6E2ey4iHJY+mOd2KRPyI5KQJplNXCPaDf7vTq1337oMFsXnFl/WB rx2GUcTcOxxkYgjY3897jL4hUeh46Mrn22koeIkihQh7o115QeyLKQ5uIOy2/Qgc0QPf v0E9/7zI2NusMxbZMJyb6yQyDjVKx25d8j07Gsy5ckqZNmn/lsUzddVLcUI58bY7o+dF aumQ/kwNOcA4WlLOoi/RFHRjSvGJNOB1CtZgynwfyix8p/C3vZU6ihq5I0iM+KlZsdca P3G3FiHbRiw5vbBGo7s4VvDeVuUaE5YXerMRc7roPYjGxs8/WXaCvySkFbLWDDl8z6kU B8rg== X-Gm-Message-State: ABuFfoj2TpEiUg0k6EdxzVMHvThVP42qZPwAMVbC8a0tRiaHD+8R5yxA lBOgqdUUWD4paCC+qLdmafVu3aevvAs= X-Google-Smtp-Source: ACcGV61vLg8dvZ4uuJaj2cvvIfzcsC0XhtWFv3jKpnXsotr6O7x1A506qz9qKCm/pgad9D88CNPx7A== X-Received: by 2002:a17:902:7c0b:: with SMTP id x11-v6mr46689869pll.60.1540270174963; Mon, 22 Oct 2018 21:49:34 -0700 (PDT) Received: from mark-pc.lan ([103.99.179.129]) by smtp.gmail.com with ESMTPSA id l16-v6sm345639pfb.75.2018.10.22.21.49.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 21:49:34 -0700 (PDT) From: Mark Wu To: ffmpeg-devel@ffmpeg.org Date: Tue, 23 Oct 2018 12:49:08 +0800 Message-Id: <20181023044908.12998-1-wfwf1997@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/hevcdec: fix non-ref frame judgement 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 Cc: Mark Wu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- 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;