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{