History

rephrase blockzero function complexity and remove useless functions

wayne liu committed 12 years ago

Commit 06c534d1 parent c247c5a7 files · +1 −280Browse files

Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 7 files). Show all

Unified · Split

codec/decoder/core/src/decode_slice.cpp+1−31
@@ -842,9 +842,7 @@ int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx) { · 841 unmodified lines
842 uiCbpL = pCurLayer->pCbp[iMbXy] & 15;842 uiCbpL = pCurLayer->pCbp[iMbXy] & 15;
843 }843 }
844 844
845 pCtx->sBlockFunc.pWelsBlockZero16x16Func (pCurLayer->pScaledTCoeff[iMbXy], 16);845 memset(pCurLayer->pScaledTCoeff[iMbXy], 0, MB_COEFF_LIST_SIZE * sizeof(int16_t));
846 pCtx->sBlockFunc.pWelsBlockZero8x8Func (pCurLayer->pScaledTCoeff[iMbXy] + 256, 8);
847 pCtx->sBlockFunc.pWelsBlockZero8x8Func (pCurLayer->pScaledTCoeff[iMbXy] + 256 + 64, 8);
848 846
849 ST32 (&pCurLayer->pNzc[iMbXy][0], 0);847 ST32 (&pCurLayer->pNzc[iMbXy][0], 0);
850 ST32 (&pCurLayer->pNzc[iMbXy][4], 0);848 ST32 (&pCurLayer->pNzc[iMbXy][4], 0);
@@ -1043,43 +1041,15 @@ int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur) { · 192 unmodified lines
1043 return 0;1041 return 0;
1044}1042}
1045 1043
1046void WelsBlockInit (int16_t* pBlock, int32_t iWidth, int32_t iHeight, int32_t iStride, uint8_t uiVal) {
1047 int32_t i;
1048 int16_t* pDst = pBlock;
1049
1050 for (i = 0; i < iHeight; i++) {
1051 memset (pDst, uiVal, iWidth * sizeof (int16_t));
1052 pDst += iStride;
1053 }
1054}
1055
1056void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {1044void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {
1057 pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c;
1058 pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c;
1059 pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_c;1045 pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_c;
1060 1046
1061#ifdef X86_ASM
1062 if (iCpu & WELS_CPU_SSE2) {
1063 pFunc->pWelsBlockZero16x16Func = WelsResBlockZero16x16_sse2;
1064 pFunc->pWelsBlockZero8x8Func = WelsResBlockZero8x8_sse2;
1065 }
1066#endif
1067
1068#ifdef HAVE_NEON1047#ifdef HAVE_NEON
1069 if ( iCpu & WELS_CPU_NEON ) {1048 if ( iCpu & WELS_CPU_NEON ) {
1070 pFunc->pWelsBlockZero16x16Func = WelsResBlockZero16x16_neon;
1071 pFunc->pWelsBlockZero8x8Func = WelsResBlockZero8x8_neon;
1072 pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_neon;1049 pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_neon;
1073 }1050 }
1074#endif1051#endif
1075}1052}
1076void WelsBlockZero16x16_c (int16_t* pBlock, int32_t iStride) {
1077 WelsBlockInit (pBlock, 16, 16, iStride, 0);
1078}
1079
1080void WelsBlockZero8x8_c (int16_t* pBlock, int32_t iStride) {
1081 WelsBlockInit (pBlock, 8, 8, iStride, 0);
1082}
1083 1053
1084void SetNonZeroCount_c (int16_t* pBlock, int8_t* pNonZeroCount) {1054void SetNonZeroCount_c (int16_t* pBlock, int8_t* pNonZeroCount) {
1085 int32_t i;1055 int32_t i;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t