Changeset 753 in 3DVCSoftware


Ignore:
Timestamp:
22 Dec 2013, 20:21:39 (10 years ago)
Author:
rwth
Message:
  • finalize H_3D_DELTA_DLT implementation
Location:
branches/HTM-9.1-dev0-RWTH
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.1-dev0-RWTH/HTM.xcodeproj/project.xcworkspace/xcshareddata

    • Property svn:ignore set to
      *
  • branches/HTM-9.1-dev0-RWTH/HTM.xcodeproj/project.xcworkspace/xcuserdata

    • Property svn:ignore set to
      *
  • branches/HTM-9.1-dev0-RWTH/HTM.xcodeproj/xcuserdata

    • Property svn:ignore set to
      *
  • branches/HTM-9.1-dev0-RWTH/source/App/TAppEncoder/TAppEncTop.cpp

    r748 r753  
    20582058      xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod[layer], 24), &vps, &dlt);
    20592059      bDltPresentFlag = bDltPresentFlag || dlt.getUseDLTFlag(layer);
     2060#if H_3D_DELTA_DLT
     2061      dlt.setInterViewDltPredEnableFlag(layer, (dlt.getUseDLTFlag(layer) && (layer>1)));
     2062#endif
    20602063    }
    20612064  }
  • branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.cpp

    r751 r753  
    25812581}
    25822582
    2583 #if RWTH_DELTA_DLT
    2584 Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTOut, Int *piDeltaDLTOutNum )
     2583#if H_3D_DELTA_DLT
     2584Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum )
    25852585{
    25862586  Bool abBM0[ 256 ];
     
    25912591 
    25922592  // convert reference DLT to bit string
    2593   for( Int i = 0; i < iDLTInRefNum; i++ )
     2593  for( Int i = 0; i < uiDLTInRefNum; i++ )
    25942594  {
    25952595    abBM0[ piDLTInRef[ i ] ] = true;
     
    26012601  }
    26022602 
    2603   *piDeltaDLTOutNum = 0;
     2603  *puiDeltaDLTOutNum = 0;
    26042604  for( Int i = 0; i < 256; i++ )
    26052605  {
    26062606    if( abBM0[ i ] ^ abBM1[ i ] )
    26072607    {
    2608       piDeltaDLTOut[ *piDeltaDLTOutNum ] = i;
    2609       *piDeltaDLTOutNum = *piDeltaDLTOutNum + 1;
    2610     }
    2611   }
    2612 }
    2613 
    2614 Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTIn, Int piDeltaDLTInNum )
     2608      piDeltaDLTOut[ *puiDeltaDLTOutNum ] = i;
     2609      *puiDeltaDLTOutNum = *puiDeltaDLTOutNum + 1;
     2610    }
     2611  }
     2612}
     2613
     2614Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum )
    26152615{
    26162616  Bool abBM0[ 256 ];
     
    26212621 
    26222622  // convert reference DLT to bit string
    2623   for( Int i = 0; i < iDLTInRefNum; i++ )
     2623  for( Int i = 0; i < uiDLTInRefNum; i++ )
    26242624  {
    26252625    abBM0[ piDLTInRef[ i ] ] = true;
    26262626  }
    26272627  // convert delta DLT to bit string
    2628   for( Int i = 0; i < piDeltaDLTInNum; i++ )
     2628  for( Int i = 0; i < uiDeltaDLTInNum; i++ )
    26292629  {
    26302630    abBM1[ piDeltaDLTIn[ i ] ] = true;
  • branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.h

    r751 r753  
    12041204  Int         m_iNumDepthViews;
    12051205  UInt        m_uiDepthViewBitDepth;
    1206  
    1207 #if RWTH_DELTA_DLT
    1208   Bool        m_bUseDeltaDLTFlag         [ MAX_NUM_LAYERS ];
    1209 #endif
    12101206
    12111207public:
     
    12181214  Bool    getUseDLTFlag      ( Int layerIdInVps )         { return m_bUseDLTFlag[ layerIdInVps ]; }
    12191215  Void    setUseDLTFlag      ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ]  = b;   }
    1220 
    1221 #if RWTH_DELTA_DLT
    1222   Bool    getUseDeltaDLTFlag      ( Int layerIdInVps )         { return m_bUseDeltaDLTFlag[ layerIdInVps ]; }
    1223   Void    setUseDeltaDLTFlag      ( Int layerIdInVps, Bool b ) { m_bUseDeltaDLTFlag[ layerIdInVps ]  = b;   }
    1224 #endif
    12251216 
    12261217  Bool    getInterViewDltPredEnableFlag( Int layerIdInVps )         { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; }
    12271218  Void    setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b;    }
    1228 
    12291219
    12301220  Void    setNumDepthViews   ( Int n )                    { m_iNumDepthViews = n; }
     
    12391229  Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; }
    12401230  Void    setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );
    1241 #if RWTH_DELTA_DLT
    1242   Void    getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTOut, Int *piDeltaDLTOutNum );
    1243   Void    setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTIn, Int piDeltaDLTInNum );
     1231#if H_3D_DELTA_DLT
     1232  Int*    idx2DepthValue( Int layerIdInVps )  { return m_iIdx2DepthValue[layerIdInVps]; }
     1233  Void    getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum );
     1234  Void    setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum );
    12441235#endif
    12451236};
  • branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TypeDef.h

    r751 r753  
    222222#define Log2( n ) ( log((double)n) / log(2.0) )
    223223#endif
    224 #define RWTH_DELTA_DLT                    1
     224#define H_3D_DELTA_DLT                    1
    225225#endif
    226226
  • branches/HTM-9.1-dev0-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r749 r753  
    412412          if ( pcDLT->getUseDLTFlag( i ) )
    413413          {
    414             UInt uiNumDepthValues     = 0;
    415414            Bool bDltBitMapRepFlag    = false;
    416415            UInt uiMaxDiff            = 0xffffffff;
     
    430429              bDltBitMapRepFlag = false;
    431430            }
     431           
     432            UInt uiNumDepthValues = 0;
     433            Int  aiIdx2DepthValue[256];
    432434
    433435            // Bit map
    434436            if ( bDltBitMapRepFlag )
    435437            {
    436               UInt uiNumDepthValues = 0;
    437               Int  aiIdx2DepthValue[256];
    438 
    439438              for (UInt d=0; d<256; d++)
    440439              {
     
    446445                }
    447446              }
    448 
    449               pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
    450447            }
    451448            // Diff Coding
     
    454451              READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]");   // num_entry
    455452
     453#if !H_3D_DELTA_DLT
    456454              if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )       // Single-view DLT Diff Coding
     455#endif
    457456              {
    458457                // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.
    459 
    460                 Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));
    461458
    462459                if (uiNumDepthValues > 1)
     
    501498                }
    502499
    503                 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
    504 
    505                 free(aiIdx2DepthValue);
    506               }             
     500              }
    507501            }
     502           
     503#if H_3D_DELTA_DLT
     504            if( pcDLT->getInterViewDltPredEnableFlag( i ) )
     505            {
     506              // interpret decoded values as delta DLT
     507              AOF( pcVPS->getDepthId( 1 ) == 1 );
     508              AOF( i > 1 );
     509              // assumes ref layer id to be 1
     510              Int* piRefDLT = pcDLT->idx2DepthValue( 1 );
     511              UInt uiRefNum = pcDLT->getNumDepthValues( 1 );
     512              pcDLT->setDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues);
     513            }
     514            else
     515            {
     516              // store final DLT
     517              pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
     518            }
     519#else
     520            // store final DLT
     521            pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
     522#endif
    508523          }
    509524        }
  • branches/HTM-9.1-dev0-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp

    r748 r753  
    299299            WRITE_FLAG( pcDLT->getInterViewDltPredEnableFlag( i ) ? 1 : 0, "inter_view_dlt_pred_enable_flag[ i ]");
    300300
    301             // determine whether to use bit-map
     301            // ----------------------------- determine whether to use bit-map -----------------------------
    302302            Bool bDltBitMapRepFlag       = false;
    303303            UInt uiNumBitsNonBitMap      = 0;
     
    310310
    311311            UInt* puiDltDiffValues       = NULL;
    312 
    313             if ( NULL == (puiDltDiffValues = (UInt *)calloc(pcDLT->getNumDepthValues(i), sizeof(UInt))) )
     312           
     313            Int aiIdx2DepthValue_coded[256];
     314            UInt uiNumDepthValues_coded = 0;
     315           
     316            uiNumDepthValues_coded = pcDLT->getNumDepthValues(i);
     317            for( UInt ui = 0; ui<uiNumDepthValues_coded; ui++ )
     318            {
     319              aiIdx2DepthValue_coded[ui] = pcDLT->idx2DepthValue(i, ui);
     320            }
     321           
     322#if H_3D_DELTA_DLT
     323            if( pcDLT->getInterViewDltPredEnableFlag( i ) )
     324            {
     325              AOF( pcVPS->getDepthId( 1 ) == 1 );
     326              AOF( i > 1 );
     327              // assumes ref layer id to be 1
     328              Int* piRefDLT = pcDLT->idx2DepthValue( 1 );
     329              UInt uiRefNum = pcDLT->getNumDepthValues( 1 );
     330              pcDLT->getDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue_coded, &uiNumDepthValues_coded);
     331            }
     332#endif
     333
     334            if ( NULL == (puiDltDiffValues = (UInt *)calloc(uiNumDepthValues_coded, sizeof(UInt))) )
    314335            {
    315336              exit(-1);
    316337            }
    317338
    318             for (UInt d = 1; d < pcDLT->getNumDepthValues(i); d++)
     339            for (UInt d = 1; d < uiNumDepthValues_coded; d++)
    319340            {
    320               puiDltDiffValues[d] = pcDLT->idx2DepthValue(i, d) - pcDLT->idx2DepthValue(i, (d-1));
     341              puiDltDiffValues[d] = aiIdx2DepthValue_coded[d] - aiIdx2DepthValue_coded[d-1];
    321342
    322343              if ( uiMaxDiff < puiDltDiffValues[d] )
     
    335356            uiNumBitsNonBitMap += 8;                          // u(v) bits for num_depth_values_in_dlt[layerId] (i.e. num_entry[ layerId ])
    336357
    337             if ( pcDLT->getNumDepthValues(i) > 1 )
     358            if ( uiNumDepthValues_coded > 1 )
    338359            {
    339360              uiNumBitsNonBitMap += 8;                        // u(v) bits for max_diff[ layerId ]
    340361            }
    341362
    342             if ( pcDLT->getNumDepthValues(i) > 2 )
     363            if ( uiNumDepthValues_coded > 2 )
    343364            {
    344365              uiLengthMinDiff    = (UInt) ceil(Log2(uiMaxDiff + 1));
     
    351372            {
    352373              uiLengthDltDiffMinusMin = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1));
    353               uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (pcDLT->getNumDepthValues(i) - 1);  // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]
     374              uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (uiNumDepthValues_coded - 1);  // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]
    354375            }
    355376
     
    360381            bDltBitMapRepFlag = (uiNumBitsBitMap > uiNumBitsNonBitMap) ? false : true;
    361382
    362             // Actual coding
     383            // ----------------------------- Actual coding -----------------------------
    363384            if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )
    364385            {
     
    376397              for (UInt d=0; d < 256; d++)
    377398              {
    378                 if ( d == pcDLT->idx2DepthValue(i, uiDltArrayIndex) )
     399                if ( d == aiIdx2DepthValue_coded[uiDltArrayIndex] )
    379400                {                 
    380401                  WRITE_FLAG(1, "dlt_bit_map_flag[ layerId ][ j ]");
     
    390411            else
    391412            {
    392               WRITE_CODE(pcDLT->getNumDepthValues(i), 8, "num_depth_values_in_dlt[layerId]");    // num_entry
    393 
     413              WRITE_CODE(uiNumDepthValues_coded, 8, "num_depth_values_in_dlt[layerId]");    // num_entry
     414
     415#if !H_3D_DELTA_DLT
    394416              if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )   // Single-view DLT Diff Coding
     417#endif
    395418              {
    396                 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.
    397                 if ( pcDLT->getNumDepthValues(i) > 1 )
     419                // The condition if( uiNumDepthValues_coded > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.
     420                if ( uiNumDepthValues_coded > 1 )
    398421                {
    399422                  WRITE_CODE(uiMaxDiff, 8, "max_diff[ layerId ]");        // max_diff
    400423                }
    401424
    402                 if ( pcDLT->getNumDepthValues(i) > 2 )
     425                if ( uiNumDepthValues_coded > 2 )
    403426                {
    404427                  WRITE_CODE((uiMinDiff - 1), uiLengthMinDiff, "min_diff_minus1[ layerId ]");     // min_diff_minus1
    405428                }
    406429
    407                 WRITE_CODE(pcDLT->idx2DepthValue(i, 0), 8, "dlt_depth_value0[layerId]");          // entry0
     430                WRITE_CODE(aiIdx2DepthValue_coded[0], 8, "dlt_depth_value0[layerId]");          // entry0
    408431
    409432                if (uiMaxDiff > uiMinDiff)
    410433                {
    411                   for (UInt d=1; d < pcDLT->getNumDepthValues(i); d++)
     434                  for (UInt d=1; d < uiNumDepthValues_coded; d++)
    412435                  {
    413436                    WRITE_CODE( (puiDltDiffValues[d] - uiMinDiff), uiLengthDltDiffMinusMin, "dlt_depth_value_diff_minus_min[ layerId ][ j ]");    // entry_value_diff_minus_min[ k ]
Note: See TracChangeset for help on using the changeset viewer.