Changeset 630 in SHVCSoftware for branches/SHM-5.1-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
15 Mar 2014, 06:28:53 (12 years ago)
Author:
qualcomm
Message:

JCTVC-P0041: Include signalling of POC related syntax elements (Macro: POC_RESET_IDC_SIGNALLING)

Signalling and parsing of POC-related syntax elements. Decoding process and encoder assignment to be included in a subsequent patch.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-5.1-dev/source/Lib/TLibEncoder
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r628 r630  
    20562056    }
    20572057  }
     2058
     2059#if !POC_RESET_IDC_SIGNALlING   // Wrong place to put slice header extension
    20582060  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
    20592061  {
    20602062    WRITE_UVLC(0,"slice_header_extension_length");
    20612063  }
     2064#endif
    20622065}
    20632066
     
    21952198}
    21962199
     2200#if POC_RESET_IDC_SIGNALlING
     2201Void  TEncCavlc::codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow )
     2202{
     2203  Int tmpBitsBeforeWriting = getNumberOfWrittenBits();
     2204  if(slice->getPPS()->getSliceHeaderExtensionPresentFlag())
     2205  {
     2206    // Derive the value of PocMsbValRequiredFlag
     2207    slice->setPocMsbValRequiredFlag( slice->getCraPicFlag() || slice->getBlaPicFlag()
     2208                                          /* || related to vps_poc_lsb_aligned_flag */
     2209                                          );
     2210
     2211    // Determine value of SH extension length.
     2212    Int shExtnLengthInBit = 0;
     2213    if (slice->getPPS()->getPocResetInfoPresentFlag())
     2214    {
     2215      shExtnLengthInBit += 2;
     2216      if (slice->getPocResetIdc() > 0)
     2217      {
     2218        shExtnLengthInBit += 6;
     2219        if (slice->getPocResetIdc() == 3)
     2220        {
     2221          shExtnLengthInBit += (slice->getSPS()->getBitsForPOC() + 1);
     2222        }
     2223      }
     2224    }
     2225
     2226
     2227    if ( slice->getPocMsbValRequiredFlag() )
     2228    {
     2229      Int iMaxPOClsb = 1<< slice->getSPS()->getBitsForPOC();
     2230
     2231      UInt lengthVal = 1;
     2232      UInt tempVal = slice->getPocMsbVal() + 1;
     2233      assert ( tempVal );
     2234      while( 1 != tempVal )
     2235      {
     2236        tempVal >>= 1;
     2237        lengthVal += 2;
     2238      }
     2239      shExtnLengthInBit += lengthVal;
     2240    }
     2241    Int shExtnAdditionalBits = 0;
     2242    if(shExtnLengthInBit % 8 != 0)
     2243    {
     2244      shExtnAdditionalBits = 8 - (shExtnLengthInBit % 8);
     2245    }
     2246    Int shExtnLength = (shExtnLengthInBit + shExtnAdditionalBits) / 8;
     2247    WRITE_UVLC( shExtnLength, "slice_header_extension_length" );
     2248
     2249    if(slice->getPPS()->getPocResetInfoPresentFlag())
     2250    {
     2251      WRITE_CODE( slice->getPocResetIdc(), 2,                                 "poc_reset_idc");
     2252    }
     2253    if(slice->getPocResetIdc() > 0)
     2254    {
     2255      WRITE_CODE( slice->getPocResetPeriodId(), 6,                            "poc_reset_period_id");
     2256    }
     2257    if(slice->getPocResetIdc() == 3)
     2258    {
     2259      WRITE_FLAG( slice->getFullPocResetFlag() ? 1 : 0,                       "full_poc_reset_flag");
     2260      WRITE_CODE( slice->getPocLsbVal(), slice->getSPS()->getBitsForPOC(),  "poc_lsb_val");
     2261    }
     2262
     2263    if( slice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */ )
     2264    {
     2265      WRITE_FLAG( slice->getPocMsbValPresentFlag(),                           "poc_msb_val_present_flag" );
     2266    }
     2267    if( slice->getPocMsbValPresentFlag() )
     2268    {
     2269      WRITE_UVLC( slice->getPocMsbVal(),                                      "poc_msb_val" );
     2270    }
     2271    for (Int i = 0; i < shExtnAdditionalBits; i++)
     2272    {
     2273      WRITE_FLAG( 1, "slice_segment_header_extension_reserved_bit");
     2274    }
     2275  }
     2276  shBitsWrittenTillNow += ( getNumberOfWrittenBits() - tmpBitsBeforeWriting );
     2277 
     2278  // Slice header byte_alignment() included in xAttachSliceDataToNalUnit
     2279}
     2280#endif
     2281
    21972282Void TEncCavlc::codeTerminatingBit      ( UInt uilsLast )
    21982283{
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.h

    r609 r630  
    9696  Void  codeHrdParameters       ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
    9797  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
     98#if POC_RESET_IDC_SIGNALlING
     99  Void  codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow );
     100#endif
    98101  Void  codeTerminatingBit      ( UInt uilsLast );
    99102  Void  codeSliceFinish         ();
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncEntropy.cpp

    r595 r630  
    6060}
    6161
     62#if POC_RESET_IDC_SIGNALlING
     63Void  TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow )
     64{
     65  m_pcEntropyCoderIf->codeSliceHeaderExtn( pSlice, shBitsWrittenTillNow );
     66}
     67#endif
     68
    6269Void TEncEntropy::encodeTerminatingBit      ( UInt uiIsLast )
    6370{
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncEntropy.h

    r609 r630  
    7474
    7575  virtual Void  codeTilesWPPEntryPoint  ( TComSlice* pSlice )     = 0;
     76#if POC_RESET_IDC_SIGNALlING
     77  virtual Void  codeSliceHeaderExtn     ( TComSlice* pSlice, Int shBitsWrittenTillNow )     = 0;
     78#endif
    7679  virtual Void  codeTerminatingBit      ( UInt uilsLast )                                       = 0;
    7780  virtual Void  codeSliceFinish         ()                                                      = 0;
     
    142145  Void    encodeSliceHeader         ( TComSlice* pcSlice );
    143146  Void    encodeTilesWPPEntryPoint( TComSlice* pSlice );
     147#if POC_RESET_IDC_SIGNALlING
     148Void      encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow );
     149#endif
    144150  Void    encodeTerminatingBit      ( UInt uiIsLast );
    145151  Void    encodeSliceFinish         ();
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r628 r630  
    22152215            m_pcEntropyCoder->setEntropyCoder   ( m_pcCavlcCoder, pcSlice );
    22162216            m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     2217#if !POC_RESET_IDC_SIGNALlING
    22172218            m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice );
     2219#else
     2220            tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits();
     2221            m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice );
     2222            actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting );
     2223            m_pcEntropyCoder->encodeSliceHeaderExtn( pcSlice, actualHeadBits );
     2224#endif
    22182225
    22192226            // Substreams...
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncSbac.cpp

    r609 r630  
    266266}
    267267
     268#if POC_RESET_IDC_SIGNALlING
     269Void  TEncSbac::codeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow )
     270{
     271  assert (0);
     272  return;
     273}
     274#endif
    268275Void TEncSbac::codeTerminatingBit( UInt uilsLast )
    269276{
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncSbac.h

    r609 r630  
    9595  Void  codeSliceHeader         ( TComSlice* pcSlice );
    9696  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
     97#if POC_RESET_IDC_SIGNALlING
     98  Void  codeSliceHeaderExtn     ( TComSlice* pSlice, Int shBitsWrittenTillNow );
     99#endif
    97100  Void  codeTerminatingBit      ( UInt uilsLast      );
    98101  Void  codeSliceFinish         ();
Note: See TracChangeset for help on using the changeset viewer.