Changeset 1443 in SHVCSoftware
- Timestamp:
- 13 Aug 2015, 19:17:31 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp
r1343 r1443 166 166 clearSliceBuffer(); 167 167 168 for (Int i = 0; i < m_numCtusInFrame; i++) 169 { 170 m_pictureCtuArray[i]->destroy(); 171 delete m_pictureCtuArray[i]; 172 m_pictureCtuArray[i] = NULL; 173 } 174 delete [] m_pictureCtuArray; 175 m_pictureCtuArray = NULL; 168 if (m_pictureCtuArray) 169 { 170 for (Int i = 0; i < m_numCtusInFrame; i++) 171 { 172 if (m_pictureCtuArray[i]) 173 { 174 m_pictureCtuArray[i]->destroy(); 175 delete m_pictureCtuArray[i]; 176 m_pictureCtuArray[i] = NULL; 177 } 178 } 179 delete [] m_pictureCtuArray; 180 m_pictureCtuArray = NULL; 181 } 176 182 177 183 delete [] m_ctuTsToRsAddrMap; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPreanalyzer.cpp
r1259 r1443 87 87 UInt64 uiSum[4] = {0, 0, 0, 0}; 88 88 UInt64 uiSumSq[4] = {0, 0, 0, 0}; 89 UInt uiNumPixInAQPart = 0;90 89 UInt by = 0; 91 90 for ( ; by < uiCurrAQPartHeight>>1; by++ ) 92 91 { 93 92 UInt bx = 0; 94 for ( ; bx < uiCurrAQPartWidth>>1; bx++ , uiNumPixInAQPart++)93 for ( ; bx < uiCurrAQPartWidth>>1; bx++ ) 95 94 { 96 95 uiSum [0] += pBlkY[bx]; 97 96 uiSumSq[0] += pBlkY[bx] * pBlkY[bx]; 98 97 } 99 for ( ; bx < uiCurrAQPartWidth; bx++ , uiNumPixInAQPart++)98 for ( ; bx < uiCurrAQPartWidth; bx++ ) 100 99 { 101 100 uiSum [1] += pBlkY[bx]; … … 107 106 { 108 107 UInt bx = 0; 109 for ( ; bx < uiCurrAQPartWidth>>1; bx++ , uiNumPixInAQPart++)108 for ( ; bx < uiCurrAQPartWidth>>1; bx++ ) 110 109 { 111 110 uiSum [2] += pBlkY[bx]; 112 111 uiSumSq[2] += pBlkY[bx] * pBlkY[bx]; 113 112 } 114 for ( ; bx < uiCurrAQPartWidth; bx++ , uiNumPixInAQPart++)113 for ( ; bx < uiCurrAQPartWidth; bx++ ) 115 114 { 116 115 uiSum [3] += pBlkY[bx]; … … 120 119 } 121 120 121 assert ((uiCurrAQPartWidth&1)==0); 122 assert ((uiCurrAQPartHeight&1)==0); 123 const UInt pixelWidthOfQuadrants = uiCurrAQPartWidth >>1; 124 const UInt pixelHeightOfQuadrants = uiCurrAQPartHeight>>1; 125 const UInt numPixInAQPart = pixelWidthOfQuadrants * pixelHeightOfQuadrants; 126 122 127 Double dMinVar = DBL_MAX; 123 for ( Int i=0; i<4; i++)128 if (numPixInAQPart!=0) 124 129 { 125 const Double dAverage = Double(uiSum[i]) / uiNumPixInAQPart; 126 const Double dVariance = Double(uiSumSq[i]) / uiNumPixInAQPart - dAverage * dAverage; 127 dMinVar = min(dMinVar, dVariance); 130 for ( Int i=0; i<4; i++) 131 { 132 const Double dAverage = Double(uiSum[i]) / numPixInAQPart; 133 const Double dVariance = Double(uiSumSq[i]) / numPixInAQPart - dAverage * dAverage; 134 dMinVar = min(dMinVar, dVariance); 135 } 136 } 137 else 138 { 139 dMinVar = 0.0; 128 140 } 129 141 const Double dActivity = 1.0 + dMinVar;
Note: See TracChangeset for help on using the changeset viewer.