Changeset 1292 in SHVCSoftware for branches/SHM-dev/source/App


Ignore:
Timestamp:
18 Jul 2015, 04:14:13 (10 years ago)
Author:
seregin
Message:

port rev 4326

Location:
branches/SHM-dev/source/App
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r1290 r1292  
    6666#endif
    6767{
     68  memset( m_apcTDecTop, NULL, sizeof(m_apcTDecTop) );
     69
    6870  for(UInt layer=0; layer < MAX_LAYERS; layer++)
    6971  {
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h

    r1289 r1292  
    9595  Void  destroy           (); ///< destroy internal members
    9696  Void  decode            (); ///< main decoding function
     97#if SVC_EXTENSION
     98  UInt  getNumberOfChecksumErrorsDetected() const
     99  {
     100    UInt sum = 0;
     101
     102    for( UInt layerId = 0; layerId < MAX_NUM_LAYER_IDS; layerId++ )
     103    {
     104      if( m_apcTDecTop[layerId] )
     105      {
     106        sum += m_apcTDecTop[layerId]->getNumberOfChecksumErrorsDetected();
     107      }
     108    }
     109
     110    return sum;
     111  }
     112#else
     113  UInt  getNumberOfChecksumErrorsDetected() const { return m_cTDecTop.getNumberOfChecksumErrorsDetected(); }
     114#endif
    97115
    98116protected:
  • branches/SHM-dev/source/App/TAppDecoder/decmain.cpp

    r1259 r1292  
    4444//! \{
    4545
    46 Bool g_md5_mismatch = false; ///< top level flag that indicates if there has been a decoding mismatch
    47 
    4846// ====================================================================================================================
    4947// Main function
     
    5250int main(int argc, char* argv[])
    5351{
     52  Int returnCode = EXIT_SUCCESS;
    5453  TAppDecTop  cTAppDecTop;
    5554
     
    7372  {
    7473    cTAppDecTop.destroy();
    75     return 1;
     74    returnCode = EXIT_FAILURE;
     75    return returnCode;
    7676  }
    7777
     
    8383  cTAppDecTop.decode();
    8484
    85   if (g_md5_mismatch)
     85  if (cTAppDecTop.getNumberOfChecksumErrorsDetected() != 0)
    8686  {
    8787    printf("\n\n***ERROR*** A decoding mismatch occured: signalled md5sum does not match\n");
     88    returnCode = EXIT_FAILURE;
    8889  }
    8990
     
    9596  cTAppDecTop.destroy();
    9697
    97   return g_md5_mismatch ? EXIT_FAILURE : EXIT_SUCCESS;
     98  return returnCode;
    9899}
    99100
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1290 r1292  
    10921092  {
    10931093    //2
    1094 #if LAYER_CTB
    1095     g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    1096     g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    1097     g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    1098     g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    1099 #endif
    11001094    // Video I/O
    11011095    m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(),  false, m_acLayerCfg[layer].m_inputBitDepth, m_acLayerCfg[layer].m_MSBExtendedBitDepth, m_acLayerCfg[layer].m_internalBitDepth );  // read  mode
     
    11871181    //3
    11881182#if LAYER_CTB
    1189     g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    1190     g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    1191     g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    1192     g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    1193 
    11941183    memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) );
    11951184    memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) );
     
    17891778        //7
    17901779#if LAYER_CTB
    1791         g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
    1792         g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];
    1793         g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    1794         g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    1795 
    17961780        memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) );
    17971781        memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) );
     
    19151899{
    19161900  UInt layer;
     1901  const TComVPS *vps = m_apcTEncTop[0]->getVPS();
     1902  const Int rateMultiplier = isField ? 2 : 1;
    19171903
    19181904  // set frame rate
    19191905  for(layer = 0; layer < m_numLayers; layer++)
    19201906  {
    1921     if(isField)
    1922     {
    1923       m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2);
    1924       m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 );
    1925       m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 );
    1926       m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 );
    1927     }
    1928     else
    1929     {
    1930       m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate());
    1931       m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() );
    1932       m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() );
    1933       m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() );
    1934     }
     1907    UInt layerId = vps->getLayerIdInNuh(layer);
     1908    m_apcTEncTop[layerId]->getAnalyzeAll()->setFrmRate( m_acLayerCfg[layer].getFrameRate() * rateMultiplier );
     1909    m_apcTEncTop[layerId]->getAnalyzeI()->setFrmRate( m_acLayerCfg[layer].getFrameRate() * rateMultiplier );
     1910    m_apcTEncTop[layerId]->getAnalyzeP()->setFrmRate( m_acLayerCfg[layer].getFrameRate() * rateMultiplier );
     1911    m_apcTEncTop[layerId]->getAnalyzeB()->setFrmRate( m_acLayerCfg[layer].getFrameRate() * rateMultiplier );
    19351912  }
    19361913
     
    19391916  for(layer = 0; layer < m_numLayers; layer++)
    19401917  {
    1941     const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
    1942 
    1943     m_gcAnalyzeAll[layer].printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
     1918    const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);   
     1919    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeAll()->printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
    19441920  }
    19451921
     
    19481924  {
    19491925    const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
    1950 
    1951     m_gcAnalyzeI[layer].printOut('i', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
     1926    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeI()->printOut('i', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
    19521927  }
    19531928
     
    19561931  {
    19571932    const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
    1958 
    1959     m_gcAnalyzeP[layer].printOut('p', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
     1933    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeP()->printOut('p', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
    19601934  }
    19611935
     
    19641938  {
    19651939    const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
    1966 
    1967     m_gcAnalyzeB[layer].printOut('b', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
    1968   }
     1940    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeB()->printOut('b', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
     1941  }
     1942
     1943#if _SUMMARY_OUT_
     1944  for( layer = 0; layer < m_numLayers; layer++ )
     1945  {
     1946    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeAll()->printSummary(chFmt, printSequenceMSE);
     1947  }
     1948#endif
     1949#if _SUMMARY_PIC_
     1950  for( layer = 0; layer < m_numLayers; layer++ )
     1951  {
     1952    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeI()->printSummary(chFmt, printSequenceMSE,'I');
     1953    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeP()->printSummary(chFmt, printSequenceMSE,'P');
     1954    m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeB()->printSummary(chFmt, printSequenceMSE,'B');
     1955  }
     1956#endif
    19691957
    19701958  if(isField)
     
    19731961    {
    19741962      const BitDepths bitDepths(m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
     1963      TEncAnalyze *analyze = m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeAllin();
    19751964
    19761965      //-- interlaced summary
    1977       m_gcAnalyzeAll_in.setFrmRate( m_acLayerCfg[layer].getFrameRate());
    1978       m_gcAnalyzeAll_in.setBits(m_gcAnalyzeB[layer].getBits());
     1966      analyze->setFrmRate( m_acLayerCfg[layer].getFrameRate());
     1967      analyze->setBits(m_apcTEncTop[vps->getLayerIdInNuh(layer)]->getAnalyzeB()->getBits());
    19791968      // prior to the above statement, the interlace analyser does not contain the correct total number of bits.
    19801969
    19811970      printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" );
    1982       m_gcAnalyzeAll_in.printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
     1971      analyze->printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, bitDepths, layer);
    19831972
    19841973#if _SUMMARY_OUT_
    1985       m_gcAnalyzeAll_in.printSummaryOutInterlaced();
    1986 #endif
    1987     }
    1988   }
     1974      analyze->printSummary(chFmt, printSequenceMSE);
     1975#endif
     1976    }
     1977  }   
    19891978
    19901979  printf("\n");
    1991   //printf("\nRVM: %.3lf\n" , xCalculateRVM());
     1980  for( layer = 0; layer < m_numLayers; layer++ )
     1981  {
     1982    printf("RVM[L%d]: %.3lf\n", layer, m_apcTEncTop[vps->getLayerIdInNuh(layer)]->calculateRVM());
     1983  }
     1984  printf("\n");
    19921985}
    1993 
    19941986#else
    19951987// ====================================================================================================================
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.h

    r1259 r1292  
    100100  Void xWriteRecon(UInt layer, Int iNumEncoded);
    101101  Void xWriteStream(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits);
    102   Void printOutSummary(Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE);
     102  Void printOutSummary(Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE); 
    103103#else
    104104  Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits); ///< write bitstream to file
Note: See TracChangeset for help on using the changeset viewer.