Skip to content

Commit e0b981d

Browse files
Sherry-LingfxVPLsdm
authored andcommitted
Revert "[VPP] scene change detection minor refactor "
This reverts commit 8f1b7a1
1 parent 79ba6c8 commit e0b981d

File tree

7 files changed

+33
-44
lines changed

7 files changed

+33
-44
lines changed

_studio/mfx_lib/ext/asc/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ target_sources(asc_ext
3838
target_link_libraries(asc_ext
3939
PRIVATE
4040
cmrt_cross_platform_hw
41-
asc
4241
)
4342

4443
include(sources_ext.cmake OPTIONAL)

_studio/mfx_lib/ext/asc/include/asc_cm.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef struct ASCvideoBufferCm: public ASCVidSample
4949

5050
class ASC_Cm: public ASC
5151
{
52+
using ASC::Init;
5253
public:
5354
ASC_Cm();
5455
virtual ~ASC_Cm(){}
@@ -122,6 +123,7 @@ class ASC_Cm: public ASC
122123

123124
mfxStatus RunFrame(SurfaceIndex *idxFrom, mfxU32 parity);
124125
mfxStatus RunFrame(mfxHDLPair frameHDL, mfxU32 parity);
126+
mfxStatus RunFrame(mfxU8 *frame, mfxU32 parity);
125127

126128
mfxStatus CreateCmSurface2D(mfxHDLPair pSrcPair, CmSurface2D* & pCmSurface2D, SurfaceIndex* &pCmSrcIndex);
127129
mfxStatus CreateCmKernels();
@@ -152,13 +154,13 @@ class ASC_Cm: public ASC
152154
mfxStatus PutFrameProgressive(mfxHDLPair surface);
153155
mfxStatus PutFrameProgressive(mfxHDL surface);
154156
mfxStatus PutFrameProgressive(SurfaceIndex* idxSurf);
157+
mfxStatus PutFrameProgressive(mfxU8 *frame, mfxI32 Pitch);
158+
155159

156160
mfxStatus PutFrameInterlaced(mfxHDLPair surface);
157161
mfxStatus PutFrameInterlaced(mfxHDL surface);
158162
mfxStatus PutFrameInterlaced(SurfaceIndex* idxSurf);
159163
mfxStatus PutFrameInterlaced(mfxU8 *frame, mfxI32 Pitch);
160-
using ASC::RunFrame;
161-
using ASC::PutFrameProgressive;
162164

163165
virtual mfxStatus calc_RaCa_Surf(mfxHDLPair surface, mfxF64& rscs);
164166
//private:

_studio/mfx_lib/ext/asc/src/asc_cm.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,18 @@ mfxStatus ASC_Cm::RunFrame(mfxHDLPair frameHDL, mfxU32 parity)
411411
return MFX_ERR_NONE;
412412
}
413413

414+
mfxStatus ASC_Cm::RunFrame(mfxU8 *frame, mfxU32 parity) {
415+
if (!m_ASCinitialized)
416+
return MFX_ERR_NOT_INITIALIZED;
417+
m_videoData[ASCCurrent_Frame]->frame_number = m_videoData[ASCReference_Frame]->frame_number + 1;
418+
(this->*(resizeFunc))(frame, m_width, m_height, m_pitch, (ASCLayers)0, parity);
419+
RsCsCalc();
420+
DetectShotChangeFrame();
421+
Put_LTR_Hint();
422+
GeneralBufferRotation();
423+
return MFX_ERR_NONE;
424+
}
425+
414426
mfxStatus ASC_Cm::CreateCmSurface2D(mfxHDLPair pSrcPair, CmSurface2D* & pCmSurface2D, SurfaceIndex* &pCmSrcIndex)
415427
{
416428
INT cmSts = 0;
@@ -684,6 +696,19 @@ mfxStatus ASC_Cm::PutFrameProgressive(mfxHDL surface)
684696
return sts;
685697
}
686698

699+
mfxStatus ASC_Cm::PutFrameProgressive(mfxU8 *frame, mfxI32 Pitch) {
700+
mfxStatus sts;
701+
if (Pitch > 0) {
702+
sts = SetPitch(Pitch);
703+
SCD_CHECK_MFX_ERR(sts);
704+
}
705+
706+
sts = RunFrame(frame, ASCTopField);
707+
SCD_CHECK_MFX_ERR(sts);
708+
m_dataReady = (sts == MFX_ERR_NONE);
709+
return sts;
710+
}
711+
687712
mfxStatus ASC_Cm::PutFrameInterlaced(mfxU8 *frame, mfxI32 Pitch) {
688713
mfxStatus sts;
689714

_studio/shared/asc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ target_link_libraries(asc
6464
PRIVATE
6565
mfx_sdl_properties
6666
umc
67+
$<$<BOOL:${MFX_ENABLE_EXT}>:mfx_ext>
6768
)

_studio/shared/asc/include/asc.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ class ASC {
188188
void InitStruct();
189189
mfxStatus VidRead_Init();
190190
void VidSample_Init();
191-
virtual mfxStatus VidSample_Alloc();
192191
void SubSampleASC_ImagePro(mfxU8 *frame, mfxI32 srcWidth, mfxI32 srcHeight, mfxI32 inputPitch, ASCLayers dstIdx, mfxU32 parity);
193192
void SubSampleASC_ImageInt(mfxU8 *frame, mfxI32 srcWidth, mfxI32 srcHeight, mfxI32 inputPitch, ASCLayers dstIdx, mfxU32 parity);
194193
bool CompareStats(mfxU8 current, mfxU8 reference);
@@ -245,10 +244,6 @@ class ASC {
245244
static mfxI32 Get_CpuFeature_SSE41();
246245

247246
virtual mfxStatus calc_RaCa_Surf(mfxHDLPair surface, mfxF64& rscs);
248-
249-
mfxStatus RunFrame(mfxU8* frame, mfxU32 parity);
250-
mfxStatus PutFrameProgressive(mfxU8* frame, mfxI32 Pitch);
251-
252247
protected:
253248
ASCVidSample** m_videoData;
254249
};

_studio/shared/asc/include/asc_defs.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
// SOFTWARE.
2020

21-
#ifndef __ASC_DEFS_H__
22-
#define __ASC_DEFS_H__
23-
2421
#include <stdint.h>
2522

2623
#include "mfx_config.h"
2724

25+
#ifndef __ASC_DEFS_H__
26+
#define __ASC_DEFS_H__
27+
2828
#define ASCTUNEDATA 0
2929

3030
#undef NULL

_studio/shared/asc/src/asc.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,6 @@ void ASC::VidSample_Init() {
332332
}
333333
}
334334

335-
mfxStatus ASC::VidSample_Alloc()
336-
{
337-
for (mfxI32 i = 0; i < ASCVIDEOSTATSBUF; i++)
338-
SCD_CHECK_MFX_ERR(m_videoData[i]->layer.InitFrame(m_dataIn->layer));
339-
return MFX_ERR_NONE;
340-
}
341-
342335
void ASC::SetUltraFastDetection() {
343336
m_support->size = ASCSmall_Size;
344337
resizeFunc = &ASC::SubSampleASC_ImagePro;
@@ -461,7 +454,6 @@ mfxStatus ASC::Init(mfxI32 Width,
461454

462455
VidSample_Init();
463456
Setup_Environment();
464-
VidSample_Alloc();
465457

466458
sts = VidRead_Init();
467459
SCD_CHECK_MFX_ERR(sts);
@@ -1171,29 +1163,4 @@ void ASC::VidSample_dispose()
11711163
free(m_frameBkp);
11721164
}
11731165

1174-
mfxStatus ASC::RunFrame(mfxU8* frame, mfxU32 parity) {
1175-
if (!m_ASCinitialized)
1176-
return MFX_ERR_NOT_INITIALIZED;
1177-
m_videoData[ASCCurrent_Frame]->frame_number = m_videoData[ASCReference_Frame]->frame_number + 1;
1178-
(this->*(resizeFunc))(frame, m_width, m_height, m_pitch, (ASCLayers)0, parity);
1179-
RsCsCalc();
1180-
DetectShotChangeFrame();
1181-
Put_LTR_Hint();
1182-
GeneralBufferRotation();
1183-
return MFX_ERR_NONE;
1184-
}
1185-
1186-
mfxStatus ASC::PutFrameProgressive(mfxU8* frame, mfxI32 Pitch) {
1187-
mfxStatus sts;
1188-
if (Pitch > 0) {
1189-
sts = SetPitch(Pitch);
1190-
SCD_CHECK_MFX_ERR(sts);
1191-
}
1192-
1193-
sts = RunFrame(frame, ASCTopField);
1194-
SCD_CHECK_MFX_ERR(sts);
1195-
m_dataReady = (sts == MFX_ERR_NONE);
1196-
return sts;
1197-
}
1198-
11991166
}

0 commit comments

Comments
 (0)