From patchwork Fri Nov 2 03:08:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 10887 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 0A33744DB3F for ; Fri, 2 Nov 2018 05:09:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 76FE568A98A; Fri, 2 Nov 2018 05:08:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ot1-f99.google.com (mail-ot1-f99.google.com [209.85.210.99]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8389F68A90D for ; Fri, 2 Nov 2018 05:08:22 +0200 (EET) Received: by mail-ot1-f99.google.com with SMTP id g27so528078oth.6 for ; Thu, 01 Nov 2018 20:08:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5A1aOqm4paSaPt2S24pd9MoXggDl7ZphZF76/xbFMb0=; b=jNnh6SCrlIE4Dj3QY5TmWG8+UC1RO1q07NcdPqPZvsmnnrtpO5JVbtsz7T+H1cohKL hlR/uAgkGCLS74nK4VL0pLxlgukF9MTJ644hgPQQhEhGdmvERe7pAhvu2gOH55B0+tD1 u4wrkCBC2diTqjSQNJ+bgLIjorE68paWK0Hq5HqFGCnd8BXleU1qVWmqpa1tRStDOXV4 qM/waSg5ncZRMaXjf2C7aDd263XzNmHJK44LEY0EFjNlGDXbxEZR1Ysw4/lmarfFYIza jitKzGLsfLC4Ql6zZILNTu6cnSdT3okPsilNiyDrb1JuWrXkkYB193K7EYloQ8o9YbKi 9Hpg== X-Gm-Message-State: AGRZ1gIoWnetxkt81/QaVV2uQDto52x7ZErOFTdCkfEsLrA8Qi+Bc5it kPiR3958E38DeZQgJtZPrgSrLqcXAze8P52xk9tUxo6cVS6ATg== X-Google-Smtp-Source: AJdET5dcNjvs/XM11ZjYyzuR5ciNQkQ950QVj3/yICYgWmtld+KCBIuInaxzix+LzViyMRq1xHcgfyL58pYz X-Received: by 2002:a9d:42e1:: with SMTP id c30mr5769555otj.38.1541128133516; Thu, 01 Nov 2018 20:08:53 -0700 (PDT) Received: from mail.overt.org (155.208.178.107.bc.googleusercontent.com. [107.178.208.155]) by smtp-relay.gmail.com with ESMTPS id o11sm3012558otj.13.2018.11.01.20.08.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 20:08:53 -0700 (PDT) X-Relaying-Domain: gapps.overt.org Received: from authenticated-user (mail.overt.org [107.178.208.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 845FD60427; Fri, 2 Nov 2018 03:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1541128132; bh=rSEB4Ln1mBrDLFukrpn0ikoLxbu6NuhTIqj+c1pmvrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WRdn7R/I8mIGjNUV1Y1a9ODFl0MMVv+kKHf/hLpQce5qUoECL28Vn8XbEMeUIDbbQ REu4p4sZjfqc7ITMtwGfYD7lCKt5QQyDQq7e5ic2sko4NSRQis1UU3DVcfCykLTXb1 4IOM8vnuQDmyCJ4+pAOVmDG0vhQy8chsHLQgwbzfMKJzAF7WDj5r7w/s63A3+4jYuJ YduIT9zOP+TzTE78bERSUrpVyeu/t+TsgOQ5X/B4JRNIbdDIb9ddEqbTISMfGT+bLH koGGlSBZQ20OqzZCjAQ2NUEARMldWRT4zGTx/cdIMzEbGVkUsWgR56Mp7dY0BCTW76 XaavTnplg6YWQ== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Nov 2018 20:08:39 -0700 Message-Id: <20181102030839.8674-4-philipl@overt.org> In-Reply-To: <20181102030839.8674-1-philipl@overt.org> References: <20181102030839.8674-1-philipl@overt.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/nvdec: Increase frame pool size to help deinterlacing 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: Philip Langdale Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" With the cuda yadif filter in use, the number of mapped decoder frames could increase by two, as the filter holds on to additional frames. Signed-off-by: Philip Langdale --- libavcodec/nvdec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index 4dd6b1acf3..0426c9b319 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -601,7 +601,11 @@ int ff_nvdec_frame_params(AVCodecContext *avctx, frames_ctx->format = AV_PIX_FMT_CUDA; frames_ctx->width = (avctx->coded_width + 1) & ~1; frames_ctx->height = (avctx->coded_height + 1) & ~1; - frames_ctx->initial_pool_size = dpb_size; + /* + * We add two extra frames to the pool to account for deinterlacing filters + * holding onto their frames. + */ + frames_ctx->initial_pool_size = dpb_size + 2; frames_ctx->free = nvdec_free_dummy; frames_ctx->pool = av_buffer_pool_init(0, nvdec_alloc_dummy);