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


Ignore:
Timestamp:
1 Jul 2015, 00:53:31 (11 years ago)
Author:
seregin
Message:

cleanup macros: Q0120_PHASE_CALCULATION, P0312_VERT_PHASE_ADJ, Q0200_CONFORMANCE_BL_SIZE, R0220_REMOVE_EL_CLIP, MOVE_SCALED_OFFSET_TO_PPS, R0209_GENERIC_PHASE, REF_REGION_OFFSET, O0215_PHASE_ALIGNMENT_REMOVAL, O0215_PHASE_ALIGNMENT, RESAMPLING_FIX

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1086 r1090  
    411411#endif
    412412
    413 #if REF_REGION_OFFSET
    414413            READ_UVLC( uiCode,      "num_ref_loc_offsets" ); pcPPS->setNumRefLayerLocationOffsets(uiCode);
    415414            for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++)
     
    424423                READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
    425424                READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
    426 #if P0312_VERT_PHASE_ADJ
    427                 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode);
    428 #endif
    429425              }
    430426              READ_FLAG( uiCode, "ref_region_offset_present_flag" );   pcPPS->setRefRegionOffsetPresentFlag( k, uiCode );
     
    437433                READ_SVLC( iCode, "ref_region_bottom_offset" );  refWindow.setWindowBottomOffset(iCode << 1);
    438434              }
    439 #if R0209_GENERIC_PHASE
    440435              READ_FLAG( uiCode, "resample_phase_set_present_flag" );   pcPPS->setResamplePhaseSetPresentFlag( k, uiCode );
    441436              if (uiCode)
     
    446441                READ_UVLC( uiCode, "phase_ver_chroma_plus8" );  pcPPS->setPhaseVerChroma (k, uiCode - 8);
    447442              }
    448 #endif
    449443            }
    450 #else
    451 #if MOVE_SCALED_OFFSET_TO_PPS
    452             READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode);
    453             for(Int k = 0; k < pcPPS->getNumScaledRefLayerOffsets(); k++)
    454             {
    455               Window& scaledWindow = pcPPS->getScaledRefLayerWindow(k);
    456 #if O0098_SCALED_REF_LAYER_ID
    457               READ_CODE( 6,  uiCode,  "scaled_ref_layer_id" );       pcPPS->setScaledRefLayerId( k, uiCode );
    458 #endif
    459               READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
    460               READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
    461               READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
    462               READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
    463 #if P0312_VERT_PHASE_ADJ
    464               READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(k), uiCode);
    465 #endif
    466             }
    467 #endif
    468 #endif
    469444#if Q0048_CGS_3D_ASYMLUT
    470445            READ_FLAG( uiCode , "colour_mapping_enabled_flag" );
     
    16981673#endif
    16991674    }
    1700 #if P0312_VERT_PHASE_ADJ
    1701     for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    1702     {
    1703       UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    1704 #if !MOVE_SCALED_OFFSET_TO_PPS
    1705       if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
    1706 #else
    1707       if( pcSlice->getPPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
    1708 #endif
    1709       {
    1710         READ_FLAG( uiCode, "vert_phase_position_flag" ); pcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc );
    1711       }
    1712     }
    1713 #endif
    17141675#endif //SVC_EXTENSION
    17151676
     
    35393500  }
    35403501#endif
    3541 #if O0215_PHASE_ALIGNMENT
    3542   READ_FLAG( uiCode, "cross_layer_phase_alignment_flag"); vps->setPhaseAlignFlag( uiCode == 1 ? true : false );
    3543 #endif
    35443502
    35453503#if !IRAP_ALIGN_FLAG_IN_VPS_VUI
     
    42754233  }
    42764234#endif
    4277 #endif
    4278 #if P0312_VERT_PHASE_ADJ
    4279   READ_FLAG( uiCode, "vps_vui_vert_phase_in_use_flag" ); vps->setVpsVuiVertPhaseInUseFlag(uiCode);
    42804235#endif
    42814236#if N0160_VUI_EXT_ILP_REF
     
    44654420  // Vertical MV component restriction is not used in SHVC CTC
    44664421  assert( uiCode == 0 );
    4467 
    4468 #if !MOVE_SCALED_OFFSET_TO_PPS
    4469   if( pcSPS->getLayerId() > 0 )
    4470   {
    4471     Int iCode;
    4472     READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets(uiCode);
    4473     for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++)
    4474     {
    4475       Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i);
    4476 #if O0098_SCALED_REF_LAYER_ID
    4477       READ_CODE( 6,  uiCode,  "scaled_ref_layer_id" );       pcSPS->setScaledRefLayerId( i, uiCode );
    4478 #endif
    4479       READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
    4480       READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
    4481       READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
    4482       READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
    4483 #if P0312_VERT_PHASE_ADJ
    4484       READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcSPS->setVertPhasePositionEnableFlag( pcSPS->getScaledRefLayerId(i), uiCode);   
    4485 #endif
    4486     }
    4487   }
    4488 #endif
    44894422}
    44904423#endif
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1086 r1090  
    615615#endif
    616616
    617 #if P0312_VERT_PHASE_ADJ
    618 #if MOVE_SCALED_OFFSET_TO_PPS
    619   if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 )
    620   {   
    621     for(Int i = 0; i < activePPS->getNumScaledRefLayerOffsets(); i++)
    622     {
    623       UInt scaledRefLayerId = activePPS->getScaledRefLayerId(i);
    624       if( activePPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) )
    625       {
    626         printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId );
    627         break;
    628       }
    629     }
    630   }
    631 #else
    632   if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 )
    633   {   
    634     for(Int i = 0; i < activeSPS->getNumScaledRefLayerOffsets(); i++)
    635     {
    636       UInt scaledRefLayerId = activeSPS->getScaledRefLayerId(i);
    637       if( activeSPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) )
    638       {
    639         printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId );
    640         break;
    641       }
    642     }
    643   }
    644 #endif
    645 #endif
    646 
    647617#if SPS_DPB_PARAMS
    648618  if( m_layerId > 0 )
     
    19121882#endif
    19131883
    1914 #if MOVE_SCALED_OFFSET_TO_PPS
    19151884#if O0098_SCALED_REF_LAYER_ID
    19161885        const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
     
    19181887        const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc);
    19191888#endif
    1920 #else
    1921 #if O0098_SCALED_REF_LAYER_ID
    1922         const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
    1923 #else
    1924         const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
    1925 #endif
    1926 #endif
    1927 
    1928 #if REF_REGION_OFFSET
     1889
    19291890        const Window &windowRL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
    19301891        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y) - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset();
    19311892        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y) - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset();
    1932 #else
    1933         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y);
    1934         Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y);
    1935 #if Q0200_CONFORMANCE_BL_SIZE
    1936         Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
    1937         const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
    1938         widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc );
    1939         heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc );
    1940 #endif
    1941 #endif
    19421893        Int widthEL   = m_pcPic->getPicYuvRec()->getWidth(COMPONENT_Y)  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    19431894        Int heightEL  = m_pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    19441895
    1945 #if RESAMPLING_FIX
    1946 #if REF_REGION_OFFSET
    19471896        // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0
    19481897        assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0);
     
    19511900        assert(widthEL >= widthBL && heightEL >= heightBL);
    19521901
    1953 #if R0209_GENERIC_PHASE
    19541902        // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0.
    19551903        Bool phaseSetPresentFlag;
     
    19591907        assert( ( (widthEL  != widthBL)  || (phaseHorLuma == 0 && phaseHorChroma == 0) )
    19601908             && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) );
    1961 #endif
    1962 #endif
    1963 #endif
    19641909
    19651910        g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     
    19911936        }
    19921937#endif
    1993 #if SVC_EXTENSION
    19941938        if( m_pcPic->isSpatialEnhLayer(refLayerIdc) )
    19951939        {
     
    19971941          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    19981942          {
    1999 #if O0215_PHASE_ALIGNMENT_REMOVAL
    20001943            m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec());
    2001 #else
    2002 #if O0215_PHASE_ALIGNMENT
    2003 #if O0194_JOINT_US_BITSHIFT
    2004 #if Q0048_CGS_3D_ASYMLUT
    2005             m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
    2006 #else
    2007             m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
    2008 #endif
    2009 #else
    2010 #if Q0048_CGS_3D_ASYMLUT
    2011 #if MOVE_SCALED_OFFSET_TO_PPS
    2012           m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
    2013 #else
    2014           m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
    2015 #endif
    2016 #else
    2017           m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
    2018 #endif
    2019 #endif
    2020 #else
    2021 #if O0194_JOINT_US_BITSHIFT
    2022 #if Q0048_CGS_3D_ASYMLUT
    2023 #if REF_REGION_OFFSET
    2024           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL, altRL );
    2025 #else
    2026           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );
    2027 #endif
    2028 #else
    2029           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );
    2030 #endif
    2031 #else
    2032 #if Q0048_CGS_3D_ASYMLUT
    2033             m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );
    2034 #else
    2035             m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );
    2036 #endif
    2037 #endif
    2038 #endif
    2039 #endif
    20401944          }
    20411945        }
     
    20451949        }
    20461950        pcSlice->setFullPelBaseRec ( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc) );
    2047 #endif //SVC_EXTENSION
    20481951      }
    20491952    }
Note: See TracChangeset for help on using the changeset viewer.