|
1 |
| -// Copyright (c) 2008-2020 Intel Corporation |
| 1 | +// Copyright (c) 2008-2021 Intel Corporation |
2 | 2 | //
|
3 | 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 | 4 | // of this software and associated documentation files (the "Software"), to deal
|
@@ -148,6 +148,7 @@ static void MemSetZero4mfxExecuteParams (mfxExecuteParams *pMfxExecuteParams )
|
148 | 148 | #endif
|
149 | 149 | pMfxExecuteParams->bEOS = false;
|
150 | 150 | pMfxExecuteParams->scene = VPP_NO_SCENE_CHANGE;
|
| 151 | + pMfxExecuteParams->lut3DInfo = {}; |
151 | 152 | } /*void MemSetZero4mfxExecuteParams (mfxExecuteParams *pMfxExecuteParams )*/
|
152 | 153 |
|
153 | 154 |
|
@@ -2036,6 +2037,19 @@ mfxStatus VideoVPPHW::GetVideoParams(mfxVideoParam *par) const
|
2036 | 2037 | bufSc->InterpolationMethod = m_executeParams.interpolationMethod;
|
2037 | 2038 | #endif
|
2038 | 2039 | }
|
| 2040 | + else if (MFX_EXTBUFF_VPP_3DLUT == bufferId) |
| 2041 | + { |
| 2042 | + mfxExtVPP3DLut *bufSc = reinterpret_cast<mfxExtVPP3DLut *>(par->ExtParam[i]); |
| 2043 | + MFX_CHECK_NULL_PTR1(bufSc); |
| 2044 | + bufSc->ChannelMapping = m_executeParams.lut3DInfo.ChannelMapping; |
| 2045 | + bufSc->BufferType = m_executeParams.lut3DInfo.BufferType; |
| 2046 | + if (bufSc->BufferType == MFX_RESOURCE_VA_SURFACE) |
| 2047 | + { |
| 2048 | + bufSc->VideoBuffer.DataType = m_executeParams.lut3DInfo.DataType; |
| 2049 | + bufSc->VideoBuffer.MemLayout = m_executeParams.lut3DInfo.MemLayout; |
| 2050 | + bufSc->VideoBuffer.MemId = m_executeParams.lut3DInfo.MemId; |
| 2051 | + } |
| 2052 | + } |
2039 | 2053 | #if (MFX_VERSION >= 1025)
|
2040 | 2054 | else if (MFX_EXTBUFF_VPP_COLOR_CONVERSION == bufferId)
|
2041 | 2055 | {
|
@@ -3733,7 +3747,7 @@ mfxStatus VideoVPPHW::MergeRuntimeParams(const DdiTask *pTask, MfxHwVideoProcess
|
3733 | 3747 | /* Params look good */
|
3734 | 3748 | execParams->VideoSignalInfo[i].enabled = true;
|
3735 | 3749 | execParams->VideoSignalInfo[i].NominalRange = vsi->NominalRange;
|
3736 |
| - execParams->VideoSignalInfo[i].TransferMatrix = vsi->TransferMatrix; |
| 3750 | + execParams->VideoSignalInfo[i].TransferMatrix = GetTransferCharacteristic(vsi->TransferMatrix); |
3737 | 3751 | }
|
3738 | 3752 | }
|
3739 | 3753 |
|
@@ -3866,10 +3880,9 @@ mfxStatus VideoVPPHW::SyncTaskSubmission(DdiTask* pTask)
|
3866 | 3880 | if (m_executeParams.iFieldProcessingMode != 0)
|
3867 | 3881 | {
|
3868 | 3882 | mfxFrameSurface1 * pInputSurface = m_IOPattern & MFX_IOPATTERN_IN_OPAQUE_MEMORY ?
|
3869 |
| - m_pCore->GetOpaqSurface(surfQueue[0].pSurf->Data.MemId): |
3870 |
| - surfQueue[0].pSurf; |
| 3883 | + m_pCore->GetOpaqSurface(surfQueue[0].pSurf->Data.MemId): |
| 3884 | + surfQueue[0].pSurf; |
3871 | 3885 | MFX_CHECK(pInputSurface, MFX_ERR_NULL_PTR);
|
3872 |
| - |
3873 | 3886 | /* Mean filter was configured as DOUSE, but no ExtBuf in VPP Init()
|
3874 | 3887 | * And ... no any parameters in runtime. This is an error! */
|
3875 | 3888 | if (((m_executeParams.iFieldProcessingMode -1) == FROM_RUNTIME_EXTBUFF_FIELD_PROC) && (pInputSurface->Data.NumExtParam == 0))
|
@@ -3961,6 +3974,52 @@ mfxStatus VideoVPPHW::SyncTaskSubmission(DdiTask* pTask)
|
3961 | 3974 | }
|
3962 | 3975 | }
|
3963 | 3976 |
|
| 3977 | + mfxFrameSurface1 * pInputSurface = pTask->input.pSurf; |
| 3978 | + if (pTask->input.pSurf ) |
| 3979 | + { |
| 3980 | + for ( mfxU32 jj = 0; jj < pInputSurface->Data.NumExtParam; jj++ ) |
| 3981 | + { |
| 3982 | + if (pInputSurface->Data.ExtParam[jj]) |
| 3983 | + { |
| 3984 | + if ( (pInputSurface->Data.ExtParam[jj]->BufferId == MFX_EXTBUFF_VIDEO_SIGNAL_INFO) && |
| 3985 | + (pInputSurface->Data.ExtParam[jj]->BufferSz == sizeof(mfxExtVideoSignalInfo)) ) |
| 3986 | + { |
| 3987 | + mfxExtVideoSignalInfo* videoSignallInfo = (mfxExtVideoSignalInfo *)(pInputSurface->Data.ExtParam[jj]); |
| 3988 | + if (videoSignallInfo) |
| 3989 | + { |
| 3990 | + m_executeParams.VideoSignalInfoIn.enabled = TRUE; |
| 3991 | + m_executeParams.VideoSignalInfoIn.ColourPrimary = videoSignallInfo->ColourPrimaries; |
| 3992 | + m_executeParams.VideoSignalInfoIn.TransferMatrix = videoSignallInfo->TransferCharacteristics; |
| 3993 | + m_executeParams.VideoSignalInfoIn.MatrixCoeffs = videoSignallInfo->MatrixCoefficients; |
| 3994 | + m_executeParams.VideoSignalInfoIn.NominalRange = videoSignallInfo->VideoFullRange ? MFX_NOMINALRANGE_0_255 : MFX_NOMINALRANGE_16_235; |
| 3995 | + } |
| 3996 | + } |
| 3997 | + } |
| 3998 | + } |
| 3999 | + } |
| 4000 | + |
| 4001 | + mfxFrameSurface1 * pOutputSurface = pTask->output.pSurf; |
| 4002 | + MFX_CHECK(pOutputSurface, MFX_ERR_NULL_PTR); |
| 4003 | + for ( mfxU32 jj = 0; jj < pOutputSurface->Data.NumExtParam; jj++ ) |
| 4004 | + { |
| 4005 | + if (pOutputSurface->Data.ExtParam[jj]) |
| 4006 | + { |
| 4007 | + if ( (pOutputSurface->Data.ExtParam[jj]->BufferId == MFX_EXTBUFF_VIDEO_SIGNAL_INFO) && |
| 4008 | + (pOutputSurface->Data.ExtParam[jj]->BufferSz == sizeof(mfxExtVideoSignalInfo)) ) |
| 4009 | + { |
| 4010 | + mfxExtVideoSignalInfo* videoSignallInfo = (mfxExtVideoSignalInfo *)(pOutputSurface->Data.ExtParam[jj]); |
| 4011 | + if (videoSignallInfo) |
| 4012 | + { |
| 4013 | + m_executeParams.VideoSignalInfoOut.enabled = TRUE; |
| 4014 | + m_executeParams.VideoSignalInfoOut.ColourPrimary = videoSignallInfo->ColourPrimaries; |
| 4015 | + m_executeParams.VideoSignalInfoOut.TransferMatrix = videoSignallInfo->TransferCharacteristics; |
| 4016 | + m_executeParams.VideoSignalInfoOut.MatrixCoeffs = videoSignallInfo->MatrixCoefficients; |
| 4017 | + m_executeParams.VideoSignalInfoOut.NominalRange = videoSignallInfo->VideoFullRange ? MFX_NOMINALRANGE_0_255 : MFX_NOMINALRANGE_16_235; |
| 4018 | + } |
| 4019 | + } |
| 4020 | + } |
| 4021 | + } |
| 4022 | + |
3964 | 4023 | if ((m_executeParams.iFieldProcessingMode != 0) && /* If Mode is enabled*/
|
3965 | 4024 | ((imfxFPMode - 1) != (mfxU32)FRAME2FRAME)) /* And we don't do copy frame to frame lets call our FieldCopy*/
|
3966 | 4025 | /* And remember our previous line imfxFPMode++;*/
|
@@ -5664,6 +5723,41 @@ mfxStatus ConfigureExecuteParams(
|
5664 | 5723 | bIsFilterSkipped = true;
|
5665 | 5724 | }
|
5666 | 5725 |
|
| 5726 | + break; |
| 5727 | + } |
| 5728 | + case MFX_EXTBUFF_VPP_3DLUT: |
| 5729 | + { |
| 5730 | + if (caps.u3DLut) |
| 5731 | + { |
| 5732 | + for (mfxU32 i = 0; i < videoParam.NumExtParam; i++) |
| 5733 | + { |
| 5734 | + if (videoParam.ExtParam[i]->BufferId == MFX_EXTBUFF_VPP_3DLUT) |
| 5735 | + { |
| 5736 | + mfxExtVPP3DLut *ext3DLUT = (mfxExtVPP3DLut*) videoParam.ExtParam[i]; |
| 5737 | + if (ext3DLUT) |
| 5738 | + { |
| 5739 | + executeParams.lut3DInfo.Enabled = true; |
| 5740 | + executeParams.lut3DInfo.ChannelMapping = ext3DLUT->ChannelMapping; |
| 5741 | + executeParams.lut3DInfo.BufferType = ext3DLUT->BufferType; |
| 5742 | + if (ext3DLUT->BufferType == MFX_RESOURCE_VA_SURFACE) |
| 5743 | + { |
| 5744 | + executeParams.lut3DInfo.DataType = ext3DLUT->VideoBuffer.DataType; |
| 5745 | + executeParams.lut3DInfo.MemLayout = ext3DLUT->VideoBuffer.MemLayout; |
| 5746 | + executeParams.lut3DInfo.MemId = ext3DLUT->VideoBuffer.MemId; |
| 5747 | + } |
| 5748 | + else |
| 5749 | + { |
| 5750 | + return MFX_ERR_UNSUPPORTED; |
| 5751 | + } |
| 5752 | + } |
| 5753 | + } |
| 5754 | + } |
| 5755 | + } |
| 5756 | + else |
| 5757 | + { |
| 5758 | + bIsFilterSkipped = true; |
| 5759 | + } |
| 5760 | + |
5667 | 5761 | break;
|
5668 | 5762 | }
|
5669 | 5763 | #if (MFX_VERSION >= 1025)
|
@@ -6252,6 +6346,10 @@ mfxStatus ConfigureExecuteParams(
|
6252 | 6346 | {
|
6253 | 6347 | executeParams.scalingMode = MFX_SCALING_MODE_DEFAULT;
|
6254 | 6348 | }
|
| 6349 | + else if (MFX_EXTBUFF_VPP_3DLUT == bufferId) |
| 6350 | + { |
| 6351 | + executeParams.lut3DInfo.Enabled = false; |
| 6352 | + } |
6255 | 6353 | #if (MFX_VERSION >= 1025)
|
6256 | 6354 | else if (MFX_EXTBUFF_VPP_COLOR_CONVERSION == bufferId)
|
6257 | 6355 | {
|
|
0 commit comments