diff --git a/_studio/mfx_lib/ext/asc/CMakeLists.txt b/_studio/mfx_lib/ext/asc/CMakeLists.txt index 7c0338fcec..0ee4537cfc 100644 --- a/_studio/mfx_lib/ext/asc/CMakeLists.txt +++ b/_studio/mfx_lib/ext/asc/CMakeLists.txt @@ -38,7 +38,6 @@ target_sources(asc_ext target_link_libraries(asc_ext PRIVATE cmrt_cross_platform_hw - asc ) include(sources_ext.cmake OPTIONAL) \ No newline at end of file diff --git a/_studio/mfx_lib/ext/asc/include/asc_cm.h b/_studio/mfx_lib/ext/asc/include/asc_cm.h index c5a9721773..4f44166a41 100644 --- a/_studio/mfx_lib/ext/asc/include/asc_cm.h +++ b/_studio/mfx_lib/ext/asc/include/asc_cm.h @@ -49,6 +49,7 @@ typedef struct ASCvideoBufferCm: public ASCVidSample class ASC_Cm: public ASC { +using ASC::Init; public: ASC_Cm(); virtual ~ASC_Cm(){} @@ -122,6 +123,7 @@ class ASC_Cm: public ASC mfxStatus RunFrame(SurfaceIndex *idxFrom, mfxU32 parity); mfxStatus RunFrame(mfxHDLPair frameHDL, mfxU32 parity); + mfxStatus RunFrame(mfxU8 *frame, mfxU32 parity); mfxStatus CreateCmSurface2D(mfxHDLPair pSrcPair, CmSurface2D* & pCmSurface2D, SurfaceIndex* &pCmSrcIndex); mfxStatus CreateCmKernels(); @@ -152,13 +154,13 @@ class ASC_Cm: public ASC mfxStatus PutFrameProgressive(mfxHDLPair surface); mfxStatus PutFrameProgressive(mfxHDL surface); mfxStatus PutFrameProgressive(SurfaceIndex* idxSurf); + mfxStatus PutFrameProgressive(mfxU8 *frame, mfxI32 Pitch); + mfxStatus PutFrameInterlaced(mfxHDLPair surface); mfxStatus PutFrameInterlaced(mfxHDL surface); mfxStatus PutFrameInterlaced(SurfaceIndex* idxSurf); mfxStatus PutFrameInterlaced(mfxU8 *frame, mfxI32 Pitch); - using ASC::RunFrame; - using ASC::PutFrameProgressive; virtual mfxStatus calc_RaCa_Surf(mfxHDLPair surface, mfxF64& rscs); //private: diff --git a/_studio/mfx_lib/ext/asc/src/asc_cm.cpp b/_studio/mfx_lib/ext/asc/src/asc_cm.cpp index b57c8f1a9f..5a4380cb5c 100644 --- a/_studio/mfx_lib/ext/asc/src/asc_cm.cpp +++ b/_studio/mfx_lib/ext/asc/src/asc_cm.cpp @@ -411,6 +411,18 @@ mfxStatus ASC_Cm::RunFrame(mfxHDLPair frameHDL, mfxU32 parity) return MFX_ERR_NONE; } +mfxStatus ASC_Cm::RunFrame(mfxU8 *frame, mfxU32 parity) { + if (!m_ASCinitialized) + return MFX_ERR_NOT_INITIALIZED; + m_videoData[ASCCurrent_Frame]->frame_number = m_videoData[ASCReference_Frame]->frame_number + 1; + (this->*(resizeFunc))(frame, m_width, m_height, m_pitch, (ASCLayers)0, parity); + RsCsCalc(); + DetectShotChangeFrame(); + Put_LTR_Hint(); + GeneralBufferRotation(); + return MFX_ERR_NONE; +} + mfxStatus ASC_Cm::CreateCmSurface2D(mfxHDLPair pSrcPair, CmSurface2D* & pCmSurface2D, SurfaceIndex* &pCmSrcIndex) { INT cmSts = 0; @@ -684,6 +696,19 @@ mfxStatus ASC_Cm::PutFrameProgressive(mfxHDL surface) return sts; } +mfxStatus ASC_Cm::PutFrameProgressive(mfxU8 *frame, mfxI32 Pitch) { + mfxStatus sts; + if (Pitch > 0) { + sts = SetPitch(Pitch); + SCD_CHECK_MFX_ERR(sts); + } + + sts = RunFrame(frame, ASCTopField); + SCD_CHECK_MFX_ERR(sts); + m_dataReady = (sts == MFX_ERR_NONE); + return sts; +} + mfxStatus ASC_Cm::PutFrameInterlaced(mfxU8 *frame, mfxI32 Pitch) { mfxStatus sts; diff --git a/_studio/shared/asc/CMakeLists.txt b/_studio/shared/asc/CMakeLists.txt index 9cbfb067df..6129e3795f 100644 --- a/_studio/shared/asc/CMakeLists.txt +++ b/_studio/shared/asc/CMakeLists.txt @@ -64,4 +64,5 @@ target_link_libraries(asc PRIVATE mfx_sdl_properties umc + $<$:mfx_ext> ) diff --git a/_studio/shared/asc/include/asc.h b/_studio/shared/asc/include/asc.h index cb64827d83..bc0e2b4815 100644 --- a/_studio/shared/asc/include/asc.h +++ b/_studio/shared/asc/include/asc.h @@ -188,7 +188,6 @@ class ASC { void InitStruct(); mfxStatus VidRead_Init(); void VidSample_Init(); - virtual mfxStatus VidSample_Alloc(); void SubSampleASC_ImagePro(mfxU8 *frame, mfxI32 srcWidth, mfxI32 srcHeight, mfxI32 inputPitch, ASCLayers dstIdx, mfxU32 parity); void SubSampleASC_ImageInt(mfxU8 *frame, mfxI32 srcWidth, mfxI32 srcHeight, mfxI32 inputPitch, ASCLayers dstIdx, mfxU32 parity); bool CompareStats(mfxU8 current, mfxU8 reference); @@ -245,10 +244,6 @@ class ASC { static mfxI32 Get_CpuFeature_SSE41(); virtual mfxStatus calc_RaCa_Surf(mfxHDLPair surface, mfxF64& rscs); - - mfxStatus RunFrame(mfxU8* frame, mfxU32 parity); - mfxStatus PutFrameProgressive(mfxU8* frame, mfxI32 Pitch); - protected: ASCVidSample** m_videoData; }; diff --git a/_studio/shared/asc/include/asc_defs.h b/_studio/shared/asc/include/asc_defs.h index bee2303533..543009bade 100644 --- a/_studio/shared/asc/include/asc_defs.h +++ b/_studio/shared/asc/include/asc_defs.h @@ -18,13 +18,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#ifndef __ASC_DEFS_H__ -#define __ASC_DEFS_H__ - #include #include "mfx_config.h" +#ifndef __ASC_DEFS_H__ +#define __ASC_DEFS_H__ + #define ASCTUNEDATA 0 #undef NULL diff --git a/_studio/shared/asc/src/asc.cpp b/_studio/shared/asc/src/asc.cpp index 25b2ca114d..97e8db29f9 100644 --- a/_studio/shared/asc/src/asc.cpp +++ b/_studio/shared/asc/src/asc.cpp @@ -332,13 +332,6 @@ void ASC::VidSample_Init() { } } -mfxStatus ASC::VidSample_Alloc() -{ - for (mfxI32 i = 0; i < ASCVIDEOSTATSBUF; i++) - SCD_CHECK_MFX_ERR(m_videoData[i]->layer.InitFrame(m_dataIn->layer)); - return MFX_ERR_NONE; -} - void ASC::SetUltraFastDetection() { m_support->size = ASCSmall_Size; resizeFunc = &ASC::SubSampleASC_ImagePro; @@ -461,7 +454,6 @@ mfxStatus ASC::Init(mfxI32 Width, VidSample_Init(); Setup_Environment(); - VidSample_Alloc(); sts = VidRead_Init(); SCD_CHECK_MFX_ERR(sts); @@ -1171,29 +1163,4 @@ void ASC::VidSample_dispose() free(m_frameBkp); } -mfxStatus ASC::RunFrame(mfxU8* frame, mfxU32 parity) { - if (!m_ASCinitialized) - return MFX_ERR_NOT_INITIALIZED; - m_videoData[ASCCurrent_Frame]->frame_number = m_videoData[ASCReference_Frame]->frame_number + 1; - (this->*(resizeFunc))(frame, m_width, m_height, m_pitch, (ASCLayers)0, parity); - RsCsCalc(); - DetectShotChangeFrame(); - Put_LTR_Hint(); - GeneralBufferRotation(); - return MFX_ERR_NONE; -} - -mfxStatus ASC::PutFrameProgressive(mfxU8* frame, mfxI32 Pitch) { - mfxStatus sts; - if (Pitch > 0) { - sts = SetPitch(Pitch); - SCD_CHECK_MFX_ERR(sts); - } - - sts = RunFrame(frame, ASCTopField); - SCD_CHECK_MFX_ERR(sts); - m_dataReady = (sts == MFX_ERR_NONE); - return sts; -} - }