Encoder Parameter m_mfxEncParams.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12; m_mfxEncParams.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420; m_mfxEncParams.mfx.FrameInfo.PicStruct = pInParams->nPicStruct; m_mfxEncParams.mfx.FrameInfo.AspectRatioW = pInParams->nAspectRatioW * pInParams->nDstHeight; m_mfxEncParams.mfx.FrameInfo.AspectRatioH = pInParams->nAspectRatioH * pInParams->nDstWidth; // set frame size and crops // width must be a multiple of 16 // height must be a multiple of 16 in case of frame picture and a multiple of 32 in case of field picture m_mfxEncParams.mfx.FrameInfo.Width = MSDK_ALIGN16(pInParams->nDstWidth);//1920/2 m_mfxEncParams.mfx.FrameInfo.Height = (MFX_PICSTRUCT_PROGRESSIVE == m_mfxEncParams.mfx.FrameInfo.PicStruct)? MSDK_ALIGN16(pInParams->nDstHeight) : MSDK_ALIGN32(pInParams->nDstHeight);//1080/2 m_mfxEncParams.mfx.FrameInfo.CropX = 0; m_mfxEncParams.mfx.FrameInfo.CropY = 0; m_mfxEncParams.mfx.FrameInfo.CropW = pInParams->nDstWidth;//1920/2 m_mfxEncParams.mfx.FrameInfo.CropH = pInParams->nDstHeight;//1080/2 -------------------------------------------------------------------------------------------------------------- VPP Parameter // specify memory type if (pInParams->bd3dAlloc) { m_mfxVppParams.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY | MFX_IOPATTERN_OUT_VIDEO_MEMORY; } else { m_mfxVppParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY | MFX_IOPATTERN_OUT_SYSTEM_MEMORY; } // input frame info m_mfxVppParams.vpp.In.FourCC = MFX_FOURCC_NV12; m_mfxVppParams.vpp.In.PicStruct = pInParams->nPicStruct; ConvertFrameRate(pInParams->dFrameRate, &m_mfxVppParams.vpp.In.FrameRateExtN, &m_mfxVppParams.vpp.In.FrameRateExtD); // width must be a multiple of 16 // height must be a multiple of 16 in case of frame picture and a multiple of 32 in case of field picture m_mfxVppParams.vpp.In.Width = MSDK_ALIGN16(pInParams->nWidth); //1920 m_mfxVppParams.vpp.In.Height = (MFX_PICSTRUCT_PROGRESSIVE == m_mfxVppParams.vpp.In.PicStruct)? MSDK_ALIGN16(pInParams->nHeight) : MSDK_ALIGN32(pInParams->nHeight); //1080 // set crops in input mfxFrameInfo for correct work of file reader // VPP itself ignores crops at initialization m_mfxVppParams.vpp.In.CropW = pInParams->nWidth;//1920 m_mfxVppParams.vpp.In.CropH = pInParams->nHeight;//1080 // fill output frame info memcpy(&m_mfxVppParams.vpp.Out, &m_mfxVppParams.vpp.In, sizeof(mfxFrameInfo)); // only resizing is supported m_mfxVppParams.vpp.Out.Width = MSDK_ALIGN16(pInParams->nDstWidth);//1920/2 m_mfxVppParams.vpp.Out.Height = (MFX_PICSTRUCT_PROGRESSIVE == m_mfxVppParams.vpp.Out.PicStruct)? MSDK_ALIGN16(pInParams->nDstHeight) : MSDK_ALIGN32(pInParams->nDstHeight); //1080/2