Changeset 133 in SHVCSoftware for branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp
- Timestamp:
- 28 Apr 2013, 08:49:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r125 r133 400 400 rpcSlice->setNumRefIdx(REF_PIC_LIST_1,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); 401 401 402 #if L0386_DB_METRIC 403 if ( m_pcCfg->getDeblockingFilterMetric() ) 404 { 405 rpcSlice->setDeblockingFilterOverrideFlag(true); 406 rpcSlice->setDeblockingFilterDisable(false); 407 rpcSlice->setDeblockingFilterBetaOffsetDiv2( 0 ); 408 rpcSlice->setDeblockingFilterTcOffsetDiv2( 0 ); 409 } else 410 #endif 402 411 if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag()) 403 412 { … … 1182 1191 \retval rpcBitstream bitstream class 1183 1192 */ 1184 Void TEncSlice::encodeSlice ( TComPic*& rpcPic, TComOutputBitstream* pc Bitstream, TComOutputBitstream* pcSubstreams )1193 Void TEncSlice::encodeSlice ( TComPic*& rpcPic, TComOutputBitstream* pcSubstreams ) 1185 1194 { 1186 1195 UInt uiCUAddr; … … 1362 1371 } 1363 1372 { 1364 UInt uiCounter = 0; 1365 vector<uint8_t>& rbsp = pcSubstreams[uiSubStrm].getFIFO(); 1366 for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();) 1367 { 1368 /* 1) find the next emulated 00 00 {00,01,02,03} 1369 * 2a) if not found, write all remaining bytes out, stop. 1370 * 2b) otherwise, write all non-emulated bytes out 1371 * 3) insert emulation_prevention_three_byte 1372 */ 1373 vector<uint8_t>::iterator found = it; 1374 do 1375 { 1376 /* NB, end()-1, prevents finding a trailing two byte sequence */ 1377 found = search_n(found, rbsp.end()-1, 2, 0); 1378 found++; 1379 /* if not found, found == end, otherwise found = second zero byte */ 1380 if (found == rbsp.end()) 1381 { 1382 break; 1383 } 1384 if (*(++found) <= 3) 1385 { 1386 break; 1387 } 1388 } while (true); 1389 it = found; 1390 if (found != rbsp.end()) 1391 { 1392 it++; 1393 uiCounter++; 1394 } 1395 } 1396 1373 UInt numStartCodeEmulations = pcSubstreams[uiSubStrm].countStartCodeEmulations(); 1397 1374 UInt uiAccumulatedSubstreamLength = 0; 1398 1375 for (Int iSubstrmIdx=0; iSubstrmIdx < iNumSubstreams; iSubstrmIdx++) … … 1402 1379 // add bits coded in previous dependent slices + bits coded so far 1403 1380 // add number of emulation prevention byte count in the tile 1404 pcSlice->addTileLocation( ((pcSlice->getTileOffstForMultES() + uiAccumulatedSubstreamLength - uiBitsOriginallyInSubstreams) >> 3) + uiCounter);1381 pcSlice->addTileLocation( ((pcSlice->getTileOffstForMultES() + uiAccumulatedSubstreamLength - uiBitsOriginallyInSubstreams) >> 3) + numStartCodeEmulations ); 1405 1382 } 1406 1383 }
Note: See TracChangeset for help on using the changeset viewer.