Changeset 878 in 3DVCSoftware for branches/HTM-10.1-dev0/source/Lib/TLibEncoder
- Timestamp:
- 27 Mar 2014, 19:51:52 (11 years ago)
- Location:
- branches/HTM-10.1-dev0/source/Lib/TLibEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r877 r878 92 92 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 93 93 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 94 #if QC_GENERIC_SDC_G012295 94 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 96 #endif97 95 #if H_3D_DIM_DMM 98 96 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 170 168 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 171 169 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 172 #if QC_GENERIC_SDC_G0122173 170 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 174 #endif175 171 #if H_3D_DIM_DMM 176 172 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 258 254 curCost += m_cDdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_FLAG ); 259 255 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 260 #if QC_GENERIC_SDC_G0122261 256 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 262 #endif263 257 #if H_3D_DIM_DMM 264 258 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); … … 324 318 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 325 319 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 326 #if QC_GENERIC_SDC_G0122327 320 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 328 #endif329 321 #if H_3D_DIM_DMM 330 322 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 640 632 this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel ); 641 633 this->m_cDdcFlagSCModel .copyFrom( &pSrc->m_cDdcFlagSCModel ); 642 #if QC_GENERIC_SDC_G0122643 634 this->m_cAngleFlagSCModel .copyFrom( &pSrc->m_cAngleFlagSCModel ); 644 #endif645 635 } 646 636 #endif … … 1121 1111 } 1122 1112 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1123 #if H_3D_DIM_SDC 1124 #if QC_GENERIC_SDC_G0122 1125 if( 1 ) 1126 #else 1127 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1128 #endif 1129 #endif 1130 { 1131 #endif 1132 predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]); 1133 for(UInt i = 0; i < predNum[j]; i++) 1134 { 1135 if(dir[j] == preds[j][i]) 1136 { 1137 predIdx[j] = i; 1138 } 1139 } 1140 m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) ); 1113 { 1114 #endif 1115 predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]); 1116 for(UInt i = 0; i < predNum[j]; i++) 1117 { 1118 if(dir[j] == preds[j][i]) 1119 { 1120 predIdx[j] = i; 1121 } 1122 } 1123 m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) ); 1141 1124 #if H_MV_ENC_DEC_TRAC 1142 DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0);1125 DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0); 1143 1126 #endif 1144 1127 #if H_3D_DIM … … 1151 1134 #if H_3D_DIM 1152 1135 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1153 #if H_3D_DIM_SDC1154 #if QC_GENERIC_SDC_G01221155 if( 1 )1156 #else1157 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )1158 #endif1159 #endif1160 1136 { 1161 1137 #endif … … 1257 1233 } 1258 1234 1259 #if QC_GENERIC_SDC_G01221260 1235 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1261 1236 { … … 1280 1255 } 1281 1256 } 1282 #else1283 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )1284 {1285 UInt codeWordTable[3][7] = {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}};1286 UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3, 4, 4, 0, 0},{1, 1, 0, 0, 0, 0, 0}};1287 UInt dir = pcCU->getLumaIntraDir( absPartIdx );1288 UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );1289 UInt codeIdx = 0;1290 1291 if( dir < NUM_INTRA_MODE )1292 {1293 codeIdx = 1;1294 }1295 if( isDimMode( dir ) )1296 {1297 switch( getDimType( dir ) )1298 {1299 case DMM1_IDX: codeIdx = 3; break;1300 case DMM4_IDX: codeIdx = 4; break;1301 default: break;1302 }1303 }1304 1305 #if H_3D_DIM_SDC1306 if( pcCU->getSDCFlag( absPartIdx ) )1307 {1308 switch( dir )1309 {1310 case PLANAR_IDX: codeIdx = 0; break;1311 default: codeIdx = 2; break;1312 }1313 }1314 #endif1315 //mode coding1316 for( UInt i = 0; i < codeWordLenTable[puIdx][codeIdx]; i++ )1317 {1318 UInt bit = codeWordTable[puIdx][codeIdx] & ( 1<<(codeWordLenTable[puIdx][codeIdx] - i - 1) );1319 UInt ctxDepthMode = puIdx*3 + ( (i >= 2) ? 2 : i );1320 m_pcBinIf->encodeBin( bit!=0 , m_cDepthIntraModeSCModel.get(0, 0, ctxDepthMode) );1321 }1322 }1323 #endif1324 1257 #endif 1325 1258 -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.h
r877 r878 257 257 ContextModel3DBuffer m_cDdcFlagSCModel; 258 258 ContextModel3DBuffer m_cDdcDataSCModel; 259 #if QC_GENERIC_SDC_G0122260 259 ContextModel3DBuffer m_cAngleFlagSCModel; 261 #endif262 260 #if H_3D_DIM_DMM 263 261 ContextModel3DBuffer m_cDmm1DataSCModel; -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r877 r878 1862 1862 #if H_3D_DIM_SDC 1863 1863 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 1864 #if QC_GENERIC_SDC_G01221865 1864 Bool bZeroResidual, Int iSDCDeltaResi 1866 #else1867 Bool bResidual1868 #endif1869 1865 ) 1870 1866 { … … 1874 1870 #if QC_PKU_SDC_SPLIT_G0123 1875 1871 #if HS_TSINGHUA_SDC_SPLIT_G0111 1876 #if QC_GENERIC_SDC_G01221877 1872 TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight ); 1878 #endif1879 1873 #else 1880 #if QC_GENERIC_SDC_G01221881 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );1882 #endif1883 1874 #endif 1884 1875 #endif … … 1938 1929 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 1939 1930 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1940 #endif1941 #if !QC_GENERIC_SDC_G01221942 AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) );1943 AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || uiWidth < 64 );1944 1931 #endif 1945 1932 … … 1956 1943 #endif 1957 1944 #if !QC_PKU_SDC_SPLIT_G0123 1958 #if QC_GENERIC_SDC_G01221959 1945 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1960 1946 #endif 1961 #endif1962 1947 #if HS_TSINGHUA_SDC_SPLIT_G0111 1963 #if QC_GENERIC_SDC_G01221964 1948 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1965 #endif1966 1949 #endif 1967 1950 //===== get prediction signal ===== … … 1982 1965 #endif 1983 1966 predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true 1984 #if QC_GENERIC_SDC_G01221985 1967 , dmm4Segmentation 1986 #endif1987 1968 ); 1988 1969 #if HS_TSINGHUA_SDC_SPLIT_G0111 … … 2053 2034 uiMaskStride = pcWedgelet->getStride(); 2054 2035 } 2055 #if QC_GENERIC_SDC_G01222056 2036 if( getDimType( uiLumaPredMode ) == DMM4_IDX ) 2057 2037 { … … 2065 2045 #endif 2066 2046 } 2067 #endif2068 2047 2069 2048 // get DC prediction for each segment … … 2078 2057 { 2079 2058 // remap reconstructed value to valid depth values 2080 #if QC_GENERIC_SDC_G01222081 2059 Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment]; 2082 #else2083 Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment];2084 #endif2085 2060 // get residual (idx) 2086 2061 #if H_3D_DIM_DLT … … 2089 2064 Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment]; 2090 2065 #endif 2091 #if QC_GENERIC_SDC_G01222092 2066 if( !bZeroResidual ) 2093 2067 { … … 2099 2073 } 2100 2074 } 2101 #endif2102 2075 // save SDC DC offset 2103 2076 pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx); … … 2203 2176 #endif 2204 2177 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 2205 #if QC_GENERIC_SDC_G01222206 2178 #if HS_TSINGHUA_SDC_SPLIT_G0111 2207 2179 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 2208 2180 #else 2209 2181 dmm4Segmentation->destroy(); delete dmm4Segmentation; 2210 #endif2211 2182 #endif 2212 2183 } … … 3075 3046 case( DMM4_IDX ): 3076 3047 { 3077 #if !QC_GENERIC_SDC_G01223078 if( uiWidth > 4 )3079 #endif3080 3048 { 3081 3049 biSegmentation = new TComWedgelet( uiWidth, uiHeight ); … … 3133 3101 { 3134 3102 pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth ); 3135 #if QC_GENERIC_SDC_G01223136 3103 for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ ) 3137 3104 { … … 3140 3107 continue; 3141 3108 } 3142 #endif3143 3109 #endif 3144 3110 … … 3151 3117 bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset); 3152 3118 #endif 3153 #if QC_GENERIC_SDC_G01223154 3119 if( uiSDC != 0 && iSDCDeltaResi != 0 ) 3155 3120 { 3156 3121 bTestZeroResi = false; 3157 3122 } 3158 #endif3159 3123 #endif 3160 3124 … … 3187 3151 3188 3152 // start encoding with SDC 3189 #if QC_GENERIC_SDC_G01223190 3153 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi ); 3191 #else3192 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0));3193 #endif3194 3154 } 3195 3155 else … … 3264 3224 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3265 3225 } 3266 #endif3267 #if QC_GENERIC_SDC_G01223268 3226 } // SDC residual loop 3269 3227 #endif -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.h
r877 r878 353 353 #endif 354 354 #if H_3D_DIM_SDC 355 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 356 #if QC_GENERIC_SDC_G0122 357 Bool bZeroResidual, Int iSDCDeltaResi 358 #else 359 Bool bResidual 360 #endif 361 ); 355 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); 362 356 #endif 363 357 #endif
Note: See TracChangeset for help on using the changeset viewer.