Changeset 840 in 3DVCSoftware for branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder
- Timestamp:
- 8 Feb 2014, 15:29:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.0rc1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r838 r840 2173 2173 xCopyContextsFrom(pScr); 2174 2174 } 2175 2176 #if H_3D_ARP 2177 Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2178 { 2179 UInt uiMaxW = pcCU->getSlice()->getARPStepNum() - 1; 2180 UInt uiW = 0; 2181 UInt uiOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx); 2182 UInt uiCode = 0; 2183 2184 assert ( uiMaxW > 0 ); 2185 2186 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 0 + uiOffset ) ); 2187 2188 uiW = uiCode; 2189 if( 1 == uiW ) 2190 { 2191 #if MTK_ARP_FLAG_CABAC_SIMP_G0061 2192 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) ); 2193 #else 2194 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 3 ) ); 2195 #endif 2196 uiW += ( 1 == uiCode ? 1 : 0 ); 2197 } 2198 #if H_MV_ENC_DEC_TRAC 2199 DTRACE_CU("iv_res_pred_weight_idx", uiW ) 2200 #endif 2201 pcCU->setARPWSubParts( ( UChar )( uiW ) , uiAbsPartIdx, uiDepth ); 2202 } 2203 #endif 2204 2205 #if H_3D_IC 2206 /** parse illumination compensation flag 2207 * \param pcCU 2208 * \param uiAbsPartIdx 2209 * \param uiDepth 2210 * \returns Void 2211 */ 2212 Void TDecSbac::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2213 { 2214 UInt uiSymbol = 0; 2215 #if MTK_IC_FLAG_CABAC_SIMP_G0061 2216 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) ); 2217 #else 2218 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ); 2219 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 2220 #endif 2221 #if !H_MV_ENC_DEC_TRAC 2222 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 2223 DTRACE_CABAC_T( "\tICFlag" ); 2224 DTRACE_CABAC_T( "\tuiCtxIC: "); 2225 DTRACE_CABAC_V( uiCtxIC ); 2226 DTRACE_CABAC_T( "\tuiSymbol: "); 2227 DTRACE_CABAC_V( uiSymbol ); 2228 DTRACE_CABAC_T( "\n"); 2229 #else 2230 DTRACE_CU("ic_flag", uiSymbol) 2231 #endif 2232 2233 pcCU->setICFlagSubParts( uiSymbol ? true : false , uiAbsPartIdx, 0, uiDepth ); 2234 } 2235 #endif 2236 2237 #if H_3D_INTER_SDC 2238 #if QC_SDC_UNIFY_G0130 2239 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2240 { 2241 if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2242 { 2243 assert( 0 ); 2244 } 2245 2246 UInt symbol = 0; 2247 UInt uiNumSegments = 0; 2248 2249 if( pcCU->isIntra( absPartIdx ) ) 2250 { 2251 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2252 uiNumSegments = isDimMode( dir ) ? 2 : 1; 2253 2254 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) ); 2255 2256 if( pcCU->getSDCFlag( absPartIdx ) ) 2257 { 2258 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ); 2259 pcCU->setTrIdxSubParts( 0, absPartIdx, depth ); 2260 pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth ); 2261 } 2262 else 2263 { 2264 pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth ); 2265 } 2266 } 2267 else 2268 { 2269 #if SEC_INTER_SDC_G0101 2270 uiNumSegments = 1; 2271 #else 2272 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx ); 2273 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 ); 2274 #endif 2275 symbol = 1; 2276 } 2277 2278 2279 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2280 { 2281 Pel valDeltaDC = 0; 2282 if( symbol ) 2283 { 2284 xParseDimDeltaDC( valDeltaDC, uiNumSegments ); 2285 } 2286 2287 if( pcCU->isIntra( absPartIdx ) ) 2288 { 2289 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2290 2291 if( pcCU->getSDCFlag( absPartIdx ) ) 2292 { 2293 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2294 } 2295 else 2296 { 2297 pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC ); 2298 } 2299 } 2300 else 2301 { 2302 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2303 } 2304 } 2305 } 2306 2307 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2308 { 2309 UInt uiSymbol = 0; 2310 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2311 2312 m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2313 2314 if( uiSymbol ) 2315 { 2316 pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth ); 2317 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 2318 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth ); 2319 } 2320 else 2321 { 2322 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 2323 } 2324 } 2325 #else 2326 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2327 { 2328 UInt uiSymbol = 0; 2329 UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx ); 2330 2331 m_pcTDecBinIf->decodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) ); 2332 2333 if( uiSymbol ) 2334 { 2335 pcCU->setInterSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth ); 2336 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 2337 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth ); 2338 } 2339 else 2340 { 2341 pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth); 2342 } 2343 } 2344 2345 Void TDecSbac::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) 2346 { 2347 UInt uiAbsIdx = 0; 2348 UInt uiSign = 0; 2349 Int iIdx = 0; 2350 2351 xReadExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) ); 2352 2353 uiAbsIdx++; 2354 m_pcTDecBinIf->decodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) ); 2355 iIdx = (Int)( uiSign ? -1 : 1 ) * uiAbsIdx; 2356 2357 pcCU->setInterSDCSegmentDCOffset( iIdx, uiSegment, uiAbsPartIdx ); 2358 } 2359 #endif 2360 #endif 2361 2362 #if H_3D_DBBP 2363 Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2364 { 2365 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 2366 AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) ); 2367 AOF( !pcCU->getSlice()->getIsDepth() ); 2368 AOF( ePartSize == RWTH_DBBP_PACK_MODE ); 2369 2370 UInt uiSymbol = 0; 2371 2372 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) ); 2373 2374 if( uiSymbol ) 2375 { 2376 pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth); 2377 } 2378 } 2379 #endif 2380 2381 2382 2175 2383 //! \}
Note: See TracChangeset for help on using the changeset viewer.