Changeset 5 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.cpp


Ignore:
Timestamp:
12 Dec 2011, 18:35:44 (12 years ago)
Author:
hhi
Message:

Clean version with cfg-files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
     34
     35
    136/** \file     TComSlice.cpp
    237    \brief    slice header and SPS class
     
    1752  m_aiNumRefIdx[1]      = 0;
    1853  m_bLoopFilterDisable  = false;
    19 
     54 
    2055  m_iSliceQpDelta       = 0;
    21 
     56 
    2257  m_iDepth              = 0;
    23 
     58 
    2459  m_pcPic               = NULL;
    2560  m_bRefenced           = false;
     
    2863#endif
    2964  m_uiColDir = 0;
    30 
     65 
    3166  m_iViewIdx = 0 ;
    3267
     
    3671  m_bRefIdxCombineCoding = false;
    3772#endif
    38 #if DCM_COMB_LIST
     73#if DCM_COMB_LIST 
    3974  m_bRefPicListCombinationFlag = false;
    4075  m_bRefPicListModificationFlagLC = false;
     
    6196  m_aiNumRefIdx[0]      = 0;
    6297  m_aiNumRefIdx[1]      = 0;
    63 
     98 
    6499  m_uiColDir = 0;
    65100
     
    67102  ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    68103  m_pcTexturePic = NULL;
    69 
     104 
    70105  initEqualRef();
    71106  m_bNoBackPredFlag = false;
     
    73108  m_bRefIdxCombineCoding = false;
    74109#endif
    75 #if DCM_COMB_LIST
     110#if DCM_COMB_LIST 
    76111  m_bRefPicListCombinationFlag = false;
    77112  m_bRefPicListModificationFlagLC = false;
     
    83118  TComPic*    pcPicExtract;
    84119  TComPic*    pcPicInsert;
    85 
     120 
    86121  TComList<TComPic*>::iterator    iterPicExtract;
    87122  TComList<TComPic*>::iterator    iterPicExtract_1;
    88123  TComList<TComPic*>::iterator    iterPicInsert;
    89 
     124 
    90125  for (Int i = 1; i < (Int)(rcListPic.size()); i++)
    91126  {
     
    94129    pcPicExtract = *(iterPicExtract);
    95130    pcPicExtract->setCurrSliceIdx(0);
    96 
     131   
    97132    iterPicInsert = rcListPic.begin();
    98133    while (iterPicInsert != iterPicExtract)
     
    104139        break;
    105140      }
    106 
     141     
    107142      iterPicInsert++;
    108143    }
    109 
     144   
    110145    iterPicExtract_1 = iterPicExtract;    iterPicExtract_1++;
    111 
     146   
    112147    //  swap iterPicExtract and iterPicInsert, iterPicExtract = curr. / iterPicInsert = insertion position
    113148    rcListPic.insert (iterPicInsert, iterPicExtract, iterPicExtract_1);
     
    128163}
    129164
    130 #if DCM_COMB_LIST
     165#if DCM_COMB_LIST 
    131166Void TComSlice::generateCombinedList()
    132167{
     
    162197
    163198        if(bTempRefIdxInL2 == true)
    164         {
     199        { 
    165200          m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_0;
    166201          m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;
     
    346381 * \param rcListPic reference to the reference picture list
    347382 * This function marks the reference pictures as "unused for reference" in the following conditions.
    348  * If the nal_unit_type is IDR all pictures in the reference picture list
    349  * is marked as "unused for reference"
     383 * If the nal_unit_type is IDR all pictures in the reference picture list 
     384 * is marked as "unused for reference" 
    350385 * Otherwise do for the CDR case (non CDR case has no effect since both if conditions below will not be true)
    351  *    If the bRefreshPending flag is true (a deferred decoding refresh is pending) and the current
    352  *    temporal reference is greater than the temporal reference of the latest CDR picture (uiPOCCDR),
    353  *    mark all reference pictures except the latest CDR picture as "unused for reference" and set
     386 *    If the bRefreshPending flag is true (a deferred decoding refresh is pending) and the current 
     387 *    temporal reference is greater than the temporal reference of the latest CDR picture (uiPOCCDR), 
     388 *    mark all reference pictures except the latest CDR picture as "unused for reference" and set 
    354389 *    the bRefreshPending flag to false.
    355  *    If the nal_unit_type is CDR, set the bRefreshPending flag to true and iPOCCDR to the temporal
     390 *    If the nal_unit_type is CDR, set the bRefreshPending flag to true and iPOCCDR to the temporal 
    356391 *    reference of the current picture.
    357392 * Note that the current picture is already placed in the reference list and its marking is not changed.
     
    361396{
    362397  TComPic*                 rpcPic;
    363   UInt uiPOCCurr = getPOC();
     398  UInt uiPOCCurr = getPOC(); 
    364399
    365400  if (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR)  // IDR
     
    377412  else // CDR or No DR
    378413  {
    379     if (bRefreshPending==true && uiPOCCurr > uiPOCCDR) // CDR reference marking pending
     414    if (bRefreshPending==true && uiPOCCurr > uiPOCCDR) // CDR reference marking pending 
    380415    {
    381416      TComList<TComPic*>::iterator        iterPic       = rcListPic.begin();
     
    386421        iterPic++;
    387422      }
    388       bRefreshPending = false;
     423      bRefreshPending = false; 
    389424    }
    390425    if (getNalUnitType() == NAL_UNIT_CODED_SLICE_CDR) // CDR picture found
    391426    {
    392       bRefreshPending = true;
     427      bRefreshPending = true; 
    393428      uiPOCCDR = uiPOCCurr;
    394429    }
     
    407442#if DCM_DECODING_REFRESH
    408443  m_eNalUnitType         = pSrc->m_eNalUnitType;
    409 #endif
     444#endif 
    410445  m_eSliceType           = pSrc->m_eSliceType;
    411446  m_iSliceQp             = pSrc->m_iSliceQp;
    412447  m_iSymbolMode          = pSrc->m_iSymbolMode;
    413448  m_bLoopFilterDisable   = pSrc->m_bLoopFilterDisable;
    414 
    415 #if DCM_COMB_LIST
     449 
     450#if DCM_COMB_LIST 
    416451  for (i = 0; i < 3; i++)
    417452  {
     
    440475    m_aiNumRefIdx[i]     = pSrc->m_aiNumRefIdx[i];
    441476  }
    442 #endif
     477#endif 
    443478
    444479  m_iSliceQpDelta        = pSrc->m_iSliceQpDelta;
     
    451486      m_aiRefViewList[i][j]  = pSrc->m_aiRefViewList[i][j];
    452487    }
    453   }
     488  } 
    454489  m_iDepth               = pSrc->m_iDepth;
    455490
     
    489524  m_uiSliceIdx                    = pSrc->m_uiSliceIdx;
    490525  m_uiEntropySliceMode            = pSrc->m_uiEntropySliceMode;
    491   m_uiEntropySliceArgument        = pSrc->m_uiEntropySliceArgument;
     526  m_uiEntropySliceArgument        = pSrc->m_uiEntropySliceArgument; 
    492527  m_uiEntropySliceCurStartCUAddr  = pSrc->m_uiEntropySliceCurStartCUAddr;
    493528  m_uiEntropySliceCurEndCUAddr    = pSrc->m_uiEntropySliceCurEndCUAddr;
     
    534569}
    535570
    536 // Default WP values settings : no weight.
     571// Default WP values settings : no weight. 
    537572Void  TComSlice::resetWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
    538573{
     
    608643  m_uiMaxTrDepth  = 1;
    609644  m_uiMaxTrSize   = 32;
    610 
     645 
    611646  // Tool list
    612647  m_bUseALF       = false;
    613648  m_bUseDQP       = false;
    614 
     649 
    615650  m_bUseMRG      = false; // SOPH:
     651#if HHI_MPI
    616652  m_bUseMVI = false;
    617 
     653#endif
     654 
    618655  m_uiViewId              = 0;
    619656  m_iViewOrderIdx         = 0;
     
    624661  ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
    625662
     663#if DEPTH_MAP_GENERATION
    626664  m_uiPredDepthMapGeneration = 0;
    627   m_uiMultiviewMvPredMode    = 0;
    628665  m_uiPdmPrecision           = 0;
    629666  ::memset( m_aiPdmScaleNomDelta, 0x00, sizeof( m_aiPdmScaleNomDelta  ) );
    630667  ::memset( m_aiPdmOffset,        0x00, sizeof( m_aiPdmOffset         ) );
     668#endif
     669#if HHI_INTER_VIEW_MOTION_PRED
     670  m_uiMultiviewMvPredMode    = 0;
     671#endif
     672#if HHI_INTER_VIEW_RESIDUAL_PRED
    631673  m_uiMultiviewResPredMode   = 0;
     674#endif
    632675
    633676  // AMVP parameter
    634677  ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) );
    635 #if SB_MEM_FIX
    636   m_bUseDepthModelModes = false;
    637 #endif
     678  m_bUseDMM = false;
    638679}
    639680
     
    697738
    698739
     740#if DEPTH_MAP_GENERATION
    699741Void
    700742TComSPS::setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode, UInt uiPdmMvPredMode, UInt uiPdmPrec, Int** aaiPdmScaleNomDelta, Int** aaiPdmOffset )
    701 {
     743{ 
    702744  AOF( m_uiViewId == uiViewId );
    703745  AOF( m_bDepth   == bIsDepth );
     
    705747  AOT( uiPdmGenMode && ( aaiPdmScaleNomDelta == 0 || aaiPdmOffset == 0 ) );
    706748  AOT( uiPdmMvPredMode && uiPdmGenMode == 0 );
    707 
     749 
    708750  m_uiPredDepthMapGeneration = uiPdmGenMode;
     751#if HHI_INTER_VIEW_MOTION_PRED
    709752  m_uiMultiviewMvPredMode    = uiPdmMvPredMode;
     753#endif
    710754  m_uiPdmPrecision           = ( m_uiPredDepthMapGeneration ? uiPdmPrec : 0 );
    711755  ::memset( m_aiPdmScaleNomDelta, 0x00, sizeof( m_aiPdmScaleNomDelta  ) );
     
    720764  }
    721765}
    722 
     766#endif
Note: See TracChangeset for help on using the changeset viewer.