Changeset 1246 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
14 Jul 2015, 00:26:07 (10 years ago)
Author:
seregin
Message:

port rev 4240

Location:
branches/SHM-dev/source/Lib/TLibDecoder
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibDecoder/AnnexBread.h

    r1029 r1246  
    8989    assert(n <= 4);
    9090    if (m_NumFutureBytes >= n)
     91    {
    9192      return false;
     93    }
    9294
    9395    n -= m_NumFutureBytes;
     
    153155    uint32_t val = 0;
    154156    for (UInt i = 0; i < n; i++)
     157    {
    155158      val = (val << 8) | readByte();
     159    }
    156160    return val;
    157161  }
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r1235 r1246  
    6666{
    6767  READ_CODE(uiLength, ruiCode, pSymbolName);
    68   if (pOS)      (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n";
     68  if (pOS)
     69  {
     70    (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n";
     71  }
    6972}
    7073
     
    7275{
    7376  READ_UVLC(ruiCode, pSymbolName);
    74   if (pOS)      (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n";
     77  if (pOS)
     78  {
     79    (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n";
     80  }
    7581}
    7682
     
    7884{
    7985  READ_SVLC(ruiCode, pSymbolName);
    80   if (pOS)      (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n";
     86  if (pOS)
     87  {
     88    (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n";
     89  }
    8190}
    8291
     
    8493{
    8594  READ_FLAG(ruiCode, pSymbolName);
    86   if (pOS)      (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << (ruiCode?1:0) << "\n";
     95  if (pOS)
     96  {
     97    (*pOS) << "  " << std::setw(55) << pSymbolName << ": " << (ruiCode?1:0) << "\n";
     98  }
    8799}
    88100
     
    124136    * in the parsing if bitstream not byte-aligned */
    125137    assert(!m_pcBitstream->getNumBitsUntilByteAligned());
    126   } while (m_pcBitstream->getNumBitsLeft() > 8);
     138  }
     139  while (m_pcBitstream->getNumBitsLeft() > 8);
    127140
    128141  UInt rbspTrailingBits;
     
    490503  for (UInt i = 0; i < sei.userDataLength; i++)
    491504  {
    492     sei_read_code( pDecodedMessageOutputStream, 8, val, "user_data" );
     505    sei_read_code( NULL, 8, val, "user_data_payload_byte" );
    493506    sei.userData[i] = val;
     507  }
     508  if (pDecodedMessageOutputStream)
     509  {
     510    (*pDecodedMessageOutputStream) << "  User data payload size: " << sei.userDataLength << "\n";
    494511  }
    495512}
     
    517534  }
    518535
    519   if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << "  " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0');
     536  if (pDecodedMessageOutputStream)
     537  {
     538    (*pDecodedMessageOutputStream) << "  " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0');
     539  }
    520540
    521541  sei.m_digest.hash.clear();
     
    524544    sei_read_code( NULL, 8, val, traceString);
    525545    sei.m_digest.hash.push_back((UChar)val);
    526     if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << std::setw(2) << val;
    527   }
    528 
    529   if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n";
     546    if (pDecodedMessageOutputStream)
     547    {
     548      (*pDecodedMessageOutputStream) << std::setw(2) << val;
     549    }
     550  }
     551
     552  if (pDecodedMessageOutputStream)
     553  {
     554    (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n";
     555  }
    530556}
    531557
     
    11061132
    11071133  // read nested SEI messages
    1108   do {
     1134  do
     1135  {
    11091136#if O0164_MULTI_LAYER_HRD
    11101137#if LAYERS_NOT_PRESENT_SEI
     
    11221149  } while (m_pcBitstream->getNumBitsLeft() > 8);
    11231150
    1124   if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << "End of scalable nesting SEI message\n";
     1151  if (pDecodedMessageOutputStream)
     1152  {
     1153    (*pDecodedMessageOutputStream) << "End of scalable nesting SEI message\n";
     1154  }
    11251155}
    11261156
     
    12161246            sei_read_flag( pDecodedMessageOutputStream, code, "hours_flag"); currentTimeSet.hoursFlag = code;
    12171247            if(currentTimeSet.hoursFlag)
     1248            {
    12181249              sei_read_code( pDecodedMessageOutputStream, 5, code, "hours_value"); currentTimeSet.hoursValue = code;
     1250            }
    12191251          }
    12201252        }
  • branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp

    r1042 r1246  
    6363  else
    6464  {
    65     fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 
     65    fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue );
    6666  }
    6767  fflush ( g_hTrace );
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp

    r1029 r1246  
    163163#ifdef DEBUG_CABAC_BINS
    164164  if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine)
     165  {
    165166    std::cout << g_debugCounter << ": coding bin value " << ruiBin << ", range = [" << startingRange << "->" << m_uiRange << "]\n";
     167  }
    166168
    167169  if (g_debugCounter >= debugCabacBinTargetLine)
     
    170172    breakPointThis = 7;
    171173  }
    172   if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) exit(0);
     174  if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow))
     175  {
     176    exit(0);
     177  }
    173178  g_debugCounter++;
    174179#endif
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1237 r1246  
    18251825      READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0);
    18261826    }
    1827     else pcSlice->setUseChromaQpAdj(false);
     1827    else
     1828    {
     1829      pcSlice->setUseChromaQpAdj(false);
     1830    }
    18281831
    18291832    if (pps->getDeblockingFilterControlPresentFlag())
     
    25342537
    25352538          if (sizeId==SCALING_LIST_32x32)
     2539          {
    25362540            code*=(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES); // Adjust the decoded code for this size, to cope with the missing 32x32 chroma entries.
     2541          }
    25372542
    25382543          scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1235 r1246  
    485485#ifdef DEBUG_STRING
    486486  const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTER);
    487   if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth]));
     487  if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask)
     488  {
     489    printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth]));
     490  }
    488491#endif
    489492
     
    492495
    493496#ifdef DEBUG_STRING
    494   if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth]));
     497  if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask)
     498  {
     499    printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth]));
     500  }
    495501#endif
    496502
     
    505511  }
    506512#ifdef DEBUG_STRING
    507   if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth]));
     513  if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask)
     514  {
     515    printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth]));
     516  }
    508517#endif
    509518
     
    518527                            TComTU     &rTu)
    519528{
    520   if (!rTu.ProcessComponentSection(compID)) return;
     529  if (!rTu.ProcessComponentSection(compID))
     530  {
     531    return;
     532  }
    521533  const Bool       bIsLuma = isLuma(compID);
    522534
     
    544556    {
    545557      xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse);
    546     }
    547     while (subTURecurse.nextSection(rTu));
     558    } while (subTURecurse.nextSection(rTu));
    548559
    549560    //------------------------------------------------
     
    598609  {
    599610    for (UInt y = 0; y < uiHeight; y++)
     611    {
    600612      for (UInt x = 0; x < uiWidth; x++)
    601613      {
    602614        piResi[(y * uiStride) + x] = 0;
    603615      }
     616    }
    604617  }
    605618
    606619#ifdef DEBUG_STRING
    607620  if (psDebug)
     621  {
    608622    ss << (*psDebug);
     623  }
    609624#endif
    610625
     
    627642  const Bool bDebugReco=((DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
    628643  if (bDebugPred || bDebugResi || bDebugReco)
     644  {
    629645    ss << "###: " << "CompID: " << compID << " pred mode (ch/fin): " << uiChPredMode << "/" << uiChFinalMode << " absPartIdx: " << rTu.GetAbsPartIdxTU() << std::endl;
     646  }
    630647#endif
    631648
     
    643660  {
    644661#ifdef DEBUG_STRING
    645     if (bDebugPred || bDebugResi || bDebugReco) ss << "###: ";
     662    if (bDebugPred || bDebugResi || bDebugReco)
     663    {
     664      ss << "###: ";
     665    }
    646666
    647667    if (bDebugPred)
     
    653673      }
    654674    }
    655     if (bDebugResi) ss << " - resi: ";
     675    if (bDebugResi)
     676    {
     677      ss << " - resi: ";
     678    }
    656679#endif
    657680
     
    660683#ifdef DEBUG_STRING
    661684      if (bDebugResi)
     685      {
    662686        ss << pResi[ uiX ] << ", ";
     687      }
    663688#endif
    664689#if O0043_BEST_EFFORT_DECODING
     
    680705
    681706    if (bDebugPred || bDebugResi || bDebugReco)
     707    {
    682708      ss << "\n";
     709    }
    683710#endif
    684711    pPred     += uiStride;
     
    742769  {
    743770    if (isLuma(chType))
     771    {
    744772      xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, COMPONENT_Y,  rTu );
     773    }
    745774    else
    746775    {
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.cpp

    r1029 r1246  
    165165  {
    166166    UInt cdir=pcCU->getIntraDir(CHANNEL_TYPE_CHROMA, uiAbsPartIdx);
    167     if (cdir==36) cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx);
     167    if (cdir==36)
     168    {
     169      cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx);
     170    }
    168171    printf("coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx));
    169172  }
     
    451454        uiYUVCbf[ch] |= pcCU->getCbf(childTUAbsPartIdx , ComponentID(ch),  uiTrDepth+1 );
    452455      }
    453 
    454456    } while (tuRecurseChild.nextSection(rTu) );
    455457
     
    508510      {
    509511        validCbf = true;
    510         if (isChroma(compID)) validChromaCbf = true;
     512        if (isChroma(compID))
     513        {
     514          validChromaCbf = true;
     515        }
    511516      }
    512517    }
     
    544549        {
    545550#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    546           if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1);
     551          if (bDebugRQT)
     552          {
     553            printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1);
     554          }
    547555#endif
    548556
     
    559567              {
    560568#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    561                 if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1);
     569                if (bDebugRQT)
     570                {
     571                  printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1);
     572                }
    562573#endif
    563574                m_pcEntropyDecoderIf->parseCoeffNxN( subTUIterator, compID );
    564575              }
    565             }
    566             while (subTUIterator.nextSection(rTu));
     576            } while (subTUIterator.nextSection(rTu));
    567577          }
    568578          else
     
    636646#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    637647  if (bDebugRQT)
     648  {
    638649    printf("..codeCoeff: uiAbsPartIdx=%d, PU format=%d, 2Nx2N=%d, NxN=%d\n", uiAbsPartIdx, pcCU->getPartitionSize(uiAbsPartIdx), SIZE_2Nx2N, SIZE_NxN);
     650  }
    639651#endif
    640652
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp

    r1230 r1246  
    182182  pcPic->compressMotion();
    183183  Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
    184   if (!pcSlice->isReferenced()) c += 32;
     184  if (!pcSlice->isReferenced())
     185  {
     186    c += 32;
     187  }
    185188
    186189  //-- For time output for each slice
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r1244 r1246  
    230230    m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) );
    231231    uiSymbol++;
    232   }
    233   while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) );
     232  } while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) );
    234233
    235234  if( uiCont && ( uiSymbol == uiMaxSymbol - 1 ) )
     
    286285    m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat));
    287286    uiSymbol++;
    288   }
    289   while( uiCont );
     287  } while( uiCont );
    290288
    291289  ruiSymbol = uiSymbol;
     
    315313      prefix++;
    316314      m_pcTDecBinIf->decodeBinEP( codeWord RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) );
    317     }
    318     while((codeWord != 0) && (prefix < longestPossiblePrefix));
     315    } while((codeWord != 0) && (prefix < longestPossiblePrefix));
    319316  }
    320317  else
     
    324321      prefix++;
    325322      m_pcTDecBinIf->decodeBinEP( codeWord RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) );
    326     }
    327     while( codeWord);
     323    } while( codeWord);
    328324  }
    329325
     
    848844  TComDataCU *pcCU = rTu.getCU();
    849845
    850   if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) return;
     846  if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() )
     847  {
     848    return;
     849  }
    851850
    852851  const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU();
     
    982981  m_pcTDecBinIf->decodeBin( symbol, m_ChromaQpAdjFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
    983982
    984   if (symbol && tableSize > 1) {
     983  if (symbol && tableSize > 1)
     984  {
    985985    /* cu_chroma_qp_adjustment_idc */
    986986    xReadUnaryMaxSymbol( symbol,  &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, tableSize - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
     
    12941294    beValid = false;
    12951295    if((!pcCU->isIntra(uiAbsPartIdx)) && pcCU->isRDPCMEnabled(uiAbsPartIdx))
     1296    {
    12961297      parseExplicitRdpcmMode(rTu, compID);
     1298    }
    12971299  }
    12981300  else
     
    14631465      Int absCoeff[1 << MLS_CG_SIZE];
    14641466
    1465       for ( Int i = 0; i < numNonZero; i++) absCoeff[i] = 1;
     1467      for ( Int i = 0; i < numNonZero; i++)
     1468      {
     1469        absCoeff[i] = 1;
     1470      }
    14661471      Int numC1Flag = min(numNonZero, C1FLAG_NUMBER);
    14671472      Int firstC2FlagIdx = -1;
     
    15821587        {
    15831588          // Infer sign of 1st element.
    1584           if (absSum&0x1) pcCoef[ blkPos ] = -pcCoef[ blkPos ];
     1589          if (absSum&0x1)
     1590          {
     1591            pcCoef[ blkPos ] = -pcCoef[ blkPos ];
     1592          }
    15851593        }
    15861594        else
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp

    r1245 r1246  
    187187        ComponentID compId=ComponentID(comp);
    188188        sliceEnabled[compId] = pcSlice->getSaoEnabledFlag(toChannelType(compId)) && (comp < pcPic->getNumberValidComponents());
    189         if (sliceEnabled[compId]) bIsSAOSliceEnabled=true;
     189        if (sliceEnabled[compId])
     190        {
     191          bIsSAOSliceEnabled=true;
     192        }
    190193        saoblkParam[compId].modeIdc = SAO_MODE_OFF;
    191194      }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1241 r1246  
    342342Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>* pcListPic)
    343343{
    344   if (!pcListPic || !m_isNoOutputPriorPics) return;
     344  if (!pcListPic || !m_isNoOutputPriorPics)
     345  {
     346    return;
     347  }
    345348
    346349  TComList<TComPic*>::iterator  iterPic   = pcListPic->begin();
Note: See TracChangeset for help on using the changeset viewer.