Ignore:
Timestamp:
28 Apr 2013, 08:49:16 (12 years ago)
Author:
seregin
Message:

update to HM10.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r125 r133  
    400400  rpcSlice->setNumRefIdx(REF_PIC_LIST_1,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive);
    401401 
     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
    402411  if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag())
    403412  {
     
    11821191 \retval rpcBitstream  bitstream class
    11831192 */
    1184 Void TEncSlice::encodeSlice   ( TComPic*& rpcPic, TComOutputBitstream* pcBitstream, TComOutputBitstream* pcSubstreams )
     1193Void TEncSlice::encodeSlice   ( TComPic*& rpcPic, TComOutputBitstream* pcSubstreams )
    11851194{
    11861195  UInt       uiCUAddr;
     
    13621371      }
    13631372      {
    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();
    13971374        UInt uiAccumulatedSubstreamLength = 0;
    13981375        for (Int iSubstrmIdx=0; iSubstrmIdx < iNumSubstreams; iSubstrmIdx++)
     
    14021379        // add bits coded in previous dependent slices + bits coded so far
    14031380        // 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 );
    14051382      }
    14061383    }
Note: See TracChangeset for help on using the changeset viewer.