From a378b1c24d89cd958306468c2886669182ff74f8 Mon Sep 17 00:00:00 2001 From: rigaya Date: Sun, 4 Aug 2024 09:40:55 +0900 Subject: [PATCH] =?UTF-8?q?--vpp-resize=20ngx-vsr=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E3=81=99=E3=82=8B=E3=81=A8=E3=80=81=E3=81=9D=E3=81=AE?= =?UTF-8?q?=E5=BE=8C=E3=81=AE=E5=87=A6=E7=90=86=E3=81=8C=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E3=81=AB=E5=8B=95=E4=BD=9C=E3=81=97=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82(=20#608=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NVEncCore/NVEncFilterResize.cu | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/NVEncCore/NVEncFilterResize.cu b/NVEncCore/NVEncFilterResize.cu index f4b9b361..b0871b0b 100644 --- a/NVEncCore/NVEncFilterResize.cu +++ b/NVEncCore/NVEncFilterResize.cu @@ -831,15 +831,6 @@ RGY_ERR NVEncFilterResize::init(shared_ptr pParam, shared_ptr< return RGY_ERR_INVALID_PARAM; } - sts = AllocFrameBuf(pResizeParam->frameOut, 1); - if (sts != RGY_ERR_NONE) { - AddMessage(RGY_LOG_ERROR, _T("failed to allocate memory: %s.\n"), get_err_mes(sts)); - return sts; - } - for (int i = 0; i < RGY_CSP_PLANES[pParam->frameOut.csp]; i++) { - pResizeParam->frameOut.pitch[i] = m_frameBuf[0]->frame.pitch[i]; - } - auto resizeInterp = pResizeParam->interp; if (isNvvfxResizeFiter(pResizeParam->interp)) { if (!pResizeParam->nvvfxSuperRes) { @@ -873,6 +864,15 @@ RGY_ERR NVEncFilterResize::init(shared_ptr pParam, shared_ptr< pResizeParam->ngxvsr.reset(); } + sts = AllocFrameBuf(pResizeParam->frameOut, 1); + if (sts != RGY_ERR_NONE) { + AddMessage(RGY_LOG_ERROR, _T("failed to allocate memory: %s.\n"), get_err_mes(sts)); + return sts; + } + for (int i = 0; i < RGY_CSP_PLANES[pParam->frameOut.csp]; i++) { + pResizeParam->frameOut.pitch[i] = m_frameBuf[0]->frame.pitch[i]; + } + if ((!m_weightSpline || m_weightSplineAlgo != resizeInterp) && (resizeInterp == RGY_VPP_RESIZE_SPLINE16 || resizeInterp == RGY_VPP_RESIZE_SPLINE36 || resizeInterp == RGY_VPP_RESIZE_SPLINE64)) { static const auto SPLINE16_WEIGHT = std::vector{