Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 7 Apr 2015, 17:05:30 (10 years ago)
- Location:
- trunk/source/Lib/TLibEncoder
- Files:
-
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/AnnexBwrite.h
r964 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/NALwrite.cpp
r964 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/NALwrite.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r964 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r884 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 49 49 if( g_HLSTraceEnable ) 50 50 { 51 #if H_MV_ENC_DEC_TRAC 52 if ( !g_disableNumbering ) 53 { 54 #endif 51 55 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 56 #if H_MV_ENC_DEC_TRAC 57 } 58 #endif 59 52 60 if( length<10 ) 53 61 { … … 66 74 if( g_HLSTraceEnable ) 67 75 { 76 #if H_MV_ENC_DEC_TRAC 77 if ( !g_disableNumbering ) 78 { 79 #endif 68 80 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 81 #if H_MV_ENC_DEC_TRAC 82 } 83 #endif 84 69 85 fprintf( g_hTrace, "%-50s ue(v) : %d\n", pSymbolName, value ); 70 86 } … … 76 92 if( g_HLSTraceEnable ) 77 93 { 94 #if H_MV_ENC_DEC_TRAC 95 if ( !g_disableNumbering ) 96 { 97 #endif 78 98 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 99 #if H_MV_ENC_DEC_TRAC 100 } 101 #endif 102 79 103 fprintf( g_hTrace, "%-50s se(v) : %d\n", pSymbolName, value ); 80 104 } … … 86 110 if( g_HLSTraceEnable ) 87 111 { 112 #if H_MV_ENC_DEC_TRAC 113 if ( !g_disableNumbering ) 114 { 115 #endif 88 116 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 117 #if H_MV_ENC_DEC_TRAC 118 } 119 #endif 89 120 fprintf( g_hTrace, "%-50s u(1) : %d\n", pSymbolName, value ); 90 121 } -
trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncAnalyze.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncAnalyze.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncBinCoder.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 40 40 #include "SEIwrite.h" 41 41 #include "../TLibCommon/TypeDef.h" 42 42 #if H_3D_ANNEX_SELECTION_FIX 43 #include "TEncTop.h" 44 #endif 43 45 //! \ingroup TLibEncoder 44 46 //! \{ 47 45 48 46 49 #if ENC_DEC_TRACE … … 678 681 #endif 679 682 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); 683 #if !H_3D_DISABLE_CHROMA 680 684 assert(pcSPS->getChromaFormatIdc () == 1); 685 #endif 681 686 // in the first version chroma_format_idc can only be equal to 1 (4:2:0) 682 687 if( pcSPS->getChromaFormatIdc () == 3 ) … … 857 862 WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" ); 858 863 WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" ); 864 #if FIX_TICKET_95 865 if (pcPPS->getPpsInferScalingListFlag()) 866 { 867 WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" ); 868 } 869 #else 859 870 WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" ); 871 #endif 860 872 WRITE_UVLC( 0, "num_ref_loc_offsets" ); 861 873 WRITE_FLAG( 0 , "colour_mapping_enabled_flag" ); … … 889 901 WRITE_FLAG( sps3dExt->getQtPredFlag( d ) ? 1 : 0 , "qt_pred_flag" ); 890 902 WRITE_FLAG( sps3dExt->getInterSdcFlag( d ) ? 1 : 0 , "inter_sdc_flag" ); 903 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 904 WRITE_FLAG( sps3dExt->getDepthIntraSkipFlag( d ) ? 1 : 0 , "intra_skip_flag" ); 905 #else 891 906 WRITE_FLAG( sps3dExt->getIntraSingleFlag( d ) ? 1 : 0 , "intra_single_flag" ); 907 #endif 892 908 } 893 909 } … … 1365 1381 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1366 1382 { 1367 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );1368 1369 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )1370 {1371 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );1372 }1373 WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ), 4, "bit_depth_vps_luma_minus8" );1374 WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ), 4, "bit_depth_vps_chroma_minus8" );1383 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 1384 1385 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 1386 { 1387 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 1388 } 1389 WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ), 4, "bit_depth_vps_luma_minus8" ); 1390 WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ), 4, "bit_depth_vps_chroma_minus8" ); 1375 1391 } 1376 1392 else … … 1598 1614 Void TEncCavlc::codeVPS3dExtension( TComVPS* pcVPS ) 1599 1615 { 1616 #if HHI_CAM_PARA_K0052 1617 WRITE_UVLC( pcVPS->getCpPrecision( ), "cp_precision" ); 1618 for (Int n = 1; n < pcVPS->getNumViews(); n++) 1619 { 1620 Int i = pcVPS->getViewOIdxList( n ); 1621 Int iInVps = pcVPS->getVoiInVps( i ); 1622 WRITE_CODE( pcVPS->getNumCp( iInVps ), 6, "num_cp" ); 1623 1624 if( pcVPS->getNumCp( iInVps ) > 0 ) 1625 { 1626 WRITE_FLAG( pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) ? 1 : 0 , "cp_in_slice_segment_header_flag" ); 1627 for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ ) 1628 { 1629 WRITE_UVLC( pcVPS->getCpRefVoi( iInVps, m ), "cp_ref_voi" ); 1630 if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) ) 1631 { 1632 Int j = pcVPS->getCpRefVoi( iInVps, m ); 1633 Int jInVps = pcVPS->getVoiInVps( j ); 1634 WRITE_SVLC( pcVPS->getVpsCpScale ( iInVps, jInVps ), "vps_cp_scale" ); 1635 WRITE_SVLC( pcVPS->getVpsCpOff ( iInVps, jInVps ), "vps_cp_off" ); 1636 WRITE_SVLC( pcVPS->getVpsCpInvScale( iInVps, jInVps ) + pcVPS->getVpsCpScale( iInVps, jInVps ), "vps_cp_inv_scale_plus_scale" ); 1637 WRITE_SVLC( pcVPS->getVpsCpInvOff ( iInVps, jInVps ) + pcVPS->getVpsCpOff ( iInVps, jInVps ), "vps_cp_inv_off_plus_off" ); 1638 } 1639 } 1640 } 1641 } 1642 #else 1600 1643 WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" ); 1601 1644 for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++) … … 1617 1660 } 1618 1661 } 1662 #endif 1619 1663 } 1620 1664 #endif … … 1721 1765 1722 1766 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present 1767 #if H_3D_DISABLE_CHROMA 1768 assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 || pcSlice->getIsDepth() ); 1769 assert (pcSlice->getSPS()->getChromaFormatIdc() == 0 || !pcSlice->getIsDepth() ); 1770 #else 1723 1771 assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 ); 1772 #endif 1724 1773 // if( separate_colour_plane_flag == 1 ) 1725 1774 // colour_plane_id u(2) … … 1895 1944 } 1896 1945 #endif 1946 1947 #if HHI_INTER_COMP_PRED_K0052 1948 #if H_3D 1949 if( getEncTop()->decProcAnnexI() ) 1950 { 1951 if ( pcSlice->getInCmpPredAvailFlag() ) 1952 { 1953 WRITE_FLAG( pcSlice->getInCompPredFlag(), "in_comp_pred_flag" ); 1954 } 1955 } 1956 #endif 1957 #endif 1897 1958 if(pcSlice->getSPS()->getUseSAO()) 1898 1959 { … … 1900 1961 { 1901 1962 WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" ); 1963 #if H_3D_DISABLE_CHROMA 1964 if ( !pcSlice->getIsDepth() ) 1965 { 1902 1966 WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" ); 1967 } 1968 #else 1969 WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" ); 1970 #endif 1903 1971 } 1904 1972 } … … 2018 2086 } 2019 2087 #if H_3D_IC 2088 #if H_3D_ANNEX_SELECTION_FIX 2089 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) 2090 && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 2091 && getEncTop()->decProcAnnexI() 2092 ) 2093 #else 2020 2094 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 ) 2095 #endif 2021 2096 { 2022 2097 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" ); … … 2073 2148 WRITE_FLAG(pcSlice->getLFCrossSliceBoundaryFlag()?1:0, "slice_loop_filter_across_slices_enabled_flag"); 2074 2149 } 2075 } 2150 #if HHI_CAM_PARA_K0052 2151 #if H_3D 2152 if (getEncTop()->decProcAnnexI() ) 2153 { 2154 Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() ); 2155 if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !pcSlice->getIsDepth() ) 2156 { 2157 for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ ) 2158 { 2159 Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m )); 2160 WRITE_SVLC( pcSlice->getCpScale ( jInVps ) , "cp_scale" ); 2161 WRITE_SVLC( pcSlice->getCpOff ( jInVps ) , "cp_off" ); 2162 WRITE_SVLC( pcSlice->getCpInvScale( jInVps ) + pcSlice->getCpScale( jInVps ) , "cp_inv_scale_plus_scale" ); 2163 WRITE_SVLC( pcSlice->getCpInvOff ( jInVps ) + pcSlice->getCpOff ( jInVps ) , "cp_inv_off_plus_off" ); 2164 } 2165 } 2166 } 2167 #endif 2168 #endif 2169 } 2170 2171 #if !HHI_CAM_PARA_K0052 2076 2172 #if H_3D 2077 2173 #if H_3D_FCO … … 2089 2185 } 2090 2186 } 2187 #endif 2091 2188 #endif 2092 2189 … … 2435 2532 assert(0); 2436 2533 } 2534 2535 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2536 Void TEncCavlc::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2537 { 2538 assert(0); 2539 } 2540 #else 2437 2541 #if H_3D_SINGLE_DEPTH 2438 2542 Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) … … 2441 2545 } 2442 2546 #endif 2547 #endif 2548 2443 2549 Void TEncCavlc::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2444 2550 { … … 2544 2650 { 2545 2651 wpScalingParam *wp; 2652 #if H_3D_DISABLE_CHROMA 2653 Bool bChroma = !pcSlice->getIsDepth(); // color always present in HEVC ? 2654 #else 2546 2655 Bool bChroma = true; // color always present in HEVC ? 2656 #endif 2547 2657 Int iNbRef = (pcSlice->getSliceType() == B_SLICE ) ? (2) : (1); 2548 2658 Bool bDenomCoded = false; -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 68 68 TComSlice* m_pcSlice; 69 69 UInt m_uiCoeffCost; 70 70 #if H_3D_ANNEX_SELECTION_FIX 71 TEncTop* m_encTop; 72 #endif 71 73 Void codeShortTermRefPicSet ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx ); 72 74 Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag ); … … 127 129 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 128 130 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 131 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 132 Void codeDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 133 #else 129 134 #if H_3D_SINGLE_DEPTH 130 135 Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ); 136 #endif 131 137 #endif 132 138 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 181 187 Void codeDFFlag ( UInt uiCode, const Char *pSymbolName ); 182 188 Void codeDFSvlc ( Int iCode, const Char *pSymbolName ); 183 189 #if H_3D_ANNEX_SELECTION_FIX 190 TEncTop* getEncTop() { return m_encTop; }; 191 Void setEncTop( TEncTop* et ) { m_encTop = et; }; 192 #endif 184 193 }; 185 194 -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 78 78 Int m_interViewRefPosL[2][MAX_NUM_REF_PICS]; 79 79 #endif 80 #if HHI_INTER_COMP_PRED_K0052 81 Bool m_interCompPredFlag; 82 #endif 80 83 GOPEntry() 81 84 : m_POC(-1) … … 95 98 , m_numActiveRefLayerPics(0) 96 99 #endif 100 #if HHI_INTER_COMP_PRED_K0052 101 #if H_3D 102 , m_interCompPredFlag(false) 103 #endif 104 #endif 97 105 { 98 106 ::memset( m_referencePics, 0, sizeof(m_referencePics) ); … … 180 188 Int m_iSearchRange; // 0:Full frame 181 189 Int m_bipredSearchRange; 182 190 #if SONY_MV_V_CONST_C0078 191 Bool m_bUseDisparitySearchRangeRestriction; 192 Int m_iVerticalDisparitySearchRange; 193 #endif 183 194 //====== Quality control ======== 184 195 Int m_iMaxDeltaQP; // Max. absolute delta QP (1:default) … … 369 380 370 381 //====== Camera Parameters ====== 382 #if !HHI_CAM_PARA_K0052 371 383 UInt m_uiCamParPrecision; 372 384 Bool m_bCamParInSliceHeader; 373 385 Int** m_aaiCodedScale; 374 386 Int** m_aaiCodedOffset; 387 #endif 375 388 TAppComCamPara* m_cameraParameters; 376 389 … … 405 418 Bool m_bUseQTL; 406 419 #endif 420 #if H_3D_ANNEX_SELECTION_FIX 421 Int m_profileIdc; 422 #endif 423 407 424 #endif 408 425 public: … … 418 435 , m_isDepth(false) 419 436 , m_bUseVSO(false) 437 #if H_3D_ANNEX_SELECTION_FIX 438 , m_profileIdc( -1 ) 439 #endif 420 440 #endif 421 441 #endif … … 502 522 Void setSearchRange ( Int i ) { m_iSearchRange = i; } 503 523 Void setBipredSearchRange ( Int i ) { m_bipredSearchRange = i; } 524 #if SONY_MV_V_CONST_C0078 525 Void setUseDisparitySearchRangeRestriction ( Bool b ) { m_bUseDisparitySearchRangeRestriction = b; } 526 Void setVerticalDisparitySearchRange ( Int i ) { m_iVerticalDisparitySearchRange = i; } 527 #endif 504 528 505 529 //====== Quality control ======== … … 554 578 Int getFastSearch () { return m_iFastSearch; } 555 579 Int getSearchRange () { return m_iSearchRange; } 580 #if SONY_MV_V_CONST_C0078 581 Bool getUseDisparitySearchRangeRestriction () { return m_bUseDisparitySearchRangeRestriction; } 582 Int getVerticalDisparitySearchRange () { return m_iVerticalDisparitySearchRange; } 583 #endif 556 584 557 585 //==== Quality control ======== … … 895 923 896 924 //==== CAMERA PARAMETERS ========== 925 #if !HHI_CAM_PARA_K0052 897 926 Void setCamParPrecision ( UInt u ) { m_uiCamParPrecision = u; } 898 927 Void setCamParInSliceHeader ( Bool b ) { m_bCamParInSliceHeader = b; } 899 928 Void setCodedScale ( Int** p ) { m_aaiCodedScale = p; } 900 929 Void setCodedOffset ( Int** p ) { m_aaiCodedOffset = p; } 930 #endif 901 931 Void setCameraParameters ( TAppComCamPara* c) { m_cameraParameters = c; } 902 932 … … 946 976 Bool getUseQTL () { return m_bUseQTL; } 947 977 #endif 978 #if H_3D_ANNEX_SELECTION_FIX 979 Void setProfileIdc( Int a ) { assert( a == 1 || a == 6 || a == 8 ); m_profileIdc = a; } 980 Bool decProcAnnexI() { assert( m_profileIdc != -1 ); return ( m_profileIdc == 8); } 981 #endif 982 948 983 #endif // H_3D 949 984 }; -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 275 275 m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 276 276 277 #if H_3D_DISABLE_CHROMA 278 m_ppcWeightedTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 279 #endif 280 277 281 #if KWU_RC_MADPRED_E0227 278 282 m_LCUPredictionSAD = 0; … … 437 441 #if H_3D_VSP 438 442 DisInfo DvInfo; 443 #if !SEC_ARP_REM_ENC_RESTRICT_K0035 439 444 DvInfo.bDV = false; 445 #endif 440 446 DvInfo.m_acNBDV.setZero(); 441 447 DvInfo.m_aVIdxCan = 0; … … 583 589 if (rpcTempCU->getSlice()->getIsDepth() ) 584 590 { 591 #if SEC_ARP_REM_ENC_RESTRICT_K0035 592 rpcTempCU->getDispforDepth(0, 0, &DvInfo); 593 #else 585 594 DvInfo.bDV = rpcTempCU->getDispforDepth(0, 0, &DvInfo); 595 #endif 586 596 } 587 597 else … … 590 600 #if H_3D_NBDV_REF 591 601 if( rpcTempCU->getSlice()->getDepthRefinementFlag() ) 602 #if SEC_ARP_REM_ENC_RESTRICT_K0035 603 rpcTempCU->getDisMvpCandNBDV(&DvInfo, true); 604 #else 592 605 DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo, true); 606 #endif 593 607 else 594 608 #endif 609 #if SEC_ARP_REM_ENC_RESTRICT_K0035 610 rpcTempCU->getDisMvpCandNBDV(&DvInfo); 611 #else 595 612 DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo); 613 #endif 596 614 597 615 #if H_3D_IV_MERGE … … 712 730 } 713 731 #endif 732 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 733 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 734 if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() ) 735 { 736 xCheckRDCostDIS( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 737 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 738 } 739 #else 714 740 #if H_3D_SINGLE_DEPTH 715 741 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); … … 719 745 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 720 746 } 747 #endif 721 748 #endif 722 749 if(!earlyDetectionSkipMode) … … 1226 1253 TComDataCU* pcSubTempPartCU = m_ppcTempCU[uhNextDepth]; 1227 1254 1255 #if H_3D_DISABLE_CHROMA 1256 m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice()); 1257 #endif 1228 1258 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) 1229 1259 { … … 1577 1607 return; 1578 1608 } 1609 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 1610 m_pcEntropyCoder->encodeDIS( pcCU, uiAbsPartIdx ); 1611 if(!pcCU->getDISFlag(uiAbsPartIdx)) 1612 { 1613 #else 1579 1614 #if H_3D_SINGLE_DEPTH 1580 1615 m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx ); … … 1582 1617 { 1583 1618 #endif 1619 #endif 1584 1620 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1585 1621 1586 1622 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1587 1623 1624 #if !HHI_MOVE_SYN_K0052 1588 1625 #if H_3D_DIM_SDC 1589 1626 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1590 1627 #endif 1628 #endif 1591 1629 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1592 1630 { 1593 1631 m_pcEntropyCoder->encodeIPCMInfo( pcCU, uiAbsPartIdx ); 1594 1595 1632 if(pcCU->getIPCMFlag(uiAbsPartIdx)) 1596 1633 { 1634 #if HHI_MOVE_SYN_K0052 1635 #if H_3D_DIM_SDC 1636 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1637 #endif 1638 #endif 1597 1639 // Encode slice finish 1598 1640 finishCU(pcCU,uiAbsPartIdx,uiDepth); … … 1603 1645 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1604 1646 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1605 1647 #if HHI_MOVE_SYN_K0052 1648 m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx ); 1649 #if H_3D_DIM_SDC 1650 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1651 #endif 1652 #endif 1606 1653 #if H_3D_ARP 1607 1654 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); … … 1612 1659 // Encode Coefficients 1613 1660 Bool bCodeDQP = getdQPFlag(); 1661 #if H_3D_DISABLE_CHROMA 1662 m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP, false ); 1663 #else 1614 1664 m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP ); 1665 #endif 1615 1666 setdQPFlag( bCodeDQP ); 1667 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 1668 } 1669 #else 1616 1670 #if H_3D_SINGLE_DEPTH 1617 1671 } 1672 #endif 1618 1673 #endif 1619 1674 // --- write terminating bit --- … … 1834 1889 #if H_3D_ARP 1835 1890 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1891 #if SEC_ARP_REM_ENC_RESTRICT_K0035 1892 if( nARPWMax < 0 || bICFlag ) 1893 #else 1836 1894 if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV || bICFlag ) 1895 #endif 1837 1896 { 1838 1897 nARPWMax = 0; … … 2000 2059 2001 2060 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 2061 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2062 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2063 #else 2002 2064 #if H_3D_SINGLE_DEPTH 2003 2065 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2066 #endif 2004 2067 #endif 2005 2068 #if H_3D_VSP // possible bug fix … … 2042 2105 } 2043 2106 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2107 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2108 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2109 #else 2044 2110 #if H_3D_SINGLE_DEPTH 2045 2111 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2112 #endif 2046 2113 #endif 2047 2114 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); … … 2166 2233 Bool bFirstTime = true; 2167 2234 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 2168 2235 #if SEC_ARP_REM_ENC_RESTRICT_K0035 2236 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) ) 2237 #else 2169 2238 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV || rpcTempCU->getICFlag(0) ) 2239 #endif 2170 2240 { 2171 2241 nARPWMax = 0; … … 2193 2263 2194 2264 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2265 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2266 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2267 #else 2195 2268 #if H_3D_SINGLE_DEPTH 2196 2269 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2270 #endif 2197 2271 #endif 2198 2272 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); … … 2303 2377 } 2304 2378 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2379 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2380 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2381 #else 2305 2382 #if H_3D_SINGLE_DEPTH 2306 2383 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2384 #endif 2307 2385 #endif 2308 2386 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); … … 2413 2491 } 2414 2492 } 2493 2494 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2495 Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) 2496 { 2497 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2498 if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N)) 2499 { 2500 return; 2501 } 2502 2503 #if H_3D_VSO // M5 2504 if( m_pcRdCost->getUseRenModel() ) 2505 { 2506 UInt uiWidth = m_ppcOrigYuv[uiDepth]->getWidth (); 2507 UInt uiHeight = m_ppcOrigYuv[uiDepth]->getHeight (); 2508 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr(); 2509 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride (); 2510 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2511 } 2512 #endif 2513 2514 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2515 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 2516 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); 2517 rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth ); 2518 2519 rpcTempCU->setTrIdxSubParts(0, 0, uiDepth); 2520 rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth); 2521 rpcTempCU->setDISFlagSubParts(true, 0, uiDepth); 2522 rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth); 2523 #if H_3D_DIM_SDC 2524 rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth); 2525 #endif 2526 2527 UInt uiPreCalcDistC; 2528 m_pcPredSearch ->estIntraPredDIS ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false ); 2529 2530 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 2531 Int oldTraceCopyBack = g_traceCopyBack; 2532 g_traceCopyBack = false; 2533 #endif 2534 m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() ); 2535 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 2536 g_traceCopyBack = oldTraceCopyBack; 2537 #endif 2538 2539 2540 m_pcEntropyCoder->resetBits(); 2541 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2542 { 2543 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 2544 } 2545 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2546 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2547 2548 2549 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2550 2551 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 2552 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 2553 2554 2555 #if H_3D_VSO // M6 2556 if( m_pcRdCost->getUseLambdaScaleVSO()) 2557 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2558 else 2559 #endif 2560 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2561 2562 2563 xCheckDQP( rpcTempCU ); 2564 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); 2565 } 2566 #else 2415 2567 #if H_3D_SINGLE_DEPTH 2416 2568 Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) … … 2480 2632 } 2481 2633 #endif 2634 #endif 2482 2635 2483 2636 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG ) … … 2522 2675 AOF( uiDepthStride != 0 ); 2523 2676 2677 #if HS_DBBP_CLEAN_K0048 2678 PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth, rpcTempCU); 2679 2524 2680 // derive partitioning from depth 2681 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 2682 Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask, rpcTempCU); 2683 #else 2525 2684 PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth); 2526 2685 … … 2528 2687 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 2529 2688 Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask); 2689 #endif 2530 2690 2531 2691 if( !bValidMask ) … … 2636 2796 2637 2797 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2798 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2799 rpcTempCU->setDISFlagSubParts( false, 0, uiDepth ); 2800 #else 2638 2801 #if H_3D_SINGLE_DEPTH 2639 2802 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2803 #endif 2640 2804 #endif 2641 2805 rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth ); … … 2656 2820 2657 2821 #if H_3D_DIM_SDC 2822 #if 0 // H_3D_DISABLE_CHROMA 2823 if( !rpcTempCU->getSDCFlag( 0 ) && !rpcTempCU->getSlice()->getIsDepth() ) 2824 #else 2658 2825 if( !rpcTempCU->getSDCFlag( 0 ) ) 2826 #endif 2659 2827 #endif 2660 2828 m_pcPredSearch ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC ); … … 2666 2834 } 2667 2835 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2836 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2837 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2838 if(!rpcTempCU->getDISFlag(0)) 2839 { 2840 #else 2668 2841 #if H_3D_SINGLE_DEPTH 2669 2842 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); … … 2671 2844 { 2672 2845 #endif 2846 #endif 2673 2847 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2674 2848 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2849 #if !HHI_MOVE_SYN_K0052 2675 2850 #if H_3D_DIM_SDC 2676 2851 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2677 2852 #endif 2853 #endif 2678 2854 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true ); 2679 2855 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); 2856 #if HHI_MOVE_SYN_K0052 2857 #if H_3D_DIM_SDC 2858 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2859 #endif 2860 #endif 2680 2861 2681 2862 // Encode Coefficients 2682 2863 Bool bCodeDQP = getdQPFlag(); 2864 #if H_3D_DISABLE_CHROMA 2865 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP, true ); 2866 #else 2683 2867 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 2868 #endif 2869 2870 2684 2871 setdQPFlag( bCodeDQP ); 2872 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2873 } 2874 #else 2685 2875 #if H_3D_SINGLE_DEPTH 2686 2876 } 2687 #endif 2877 #endif 2878 #endif 2688 2879 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2689 2880 … … 2713 2904 2714 2905 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2906 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2907 rpcTempCU->setDISFlagSubParts( false, 0, uiDepth ); 2908 #else 2715 2909 #if H_3D_SINGLE_DEPTH 2716 2910 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2911 #endif 2717 2912 #endif 2718 2913 rpcTempCU->setIPCMFlag(0, true); … … 2732 2927 } 2733 2928 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2929 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 2930 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2931 #else 2734 2932 #if H_3D_SINGLE_DEPTH 2735 2933 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2736 2934 #endif 2935 #endif 2737 2936 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2738 2937 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2938 #if !HHI_MOVE_SYN_K0052 2739 2939 #if H_3D_DIM_SDC 2740 2940 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2741 2941 #endif 2942 #endif 2742 2943 m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true ); 2743 2944 #if HHI_MOVE_SYN_K0052 2945 #if H_3D_DIM_SDC 2946 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2947 #endif 2948 #endif 2744 2949 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2745 2950 -
trunk/source/Lib/TLibEncoder/TEncCu.h
r1084 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 159 159 Void xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false ); 160 160 #endif 161 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 162 Void xCheckRDCostDIS ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 163 #else 161 164 #if H_3D_SINGLE_DEPTH 162 165 Void xCheckRDCostSingleDepth ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 166 #endif 163 167 #endif 164 168 #if H_3D_DIM -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 111 111 m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx ); 112 112 } 113 114 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 115 Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 116 { 117 if ( !pcCU->getSlice()->getIsDepth() ) 118 { 119 return; 120 } 121 if( bRD ) 122 { 123 uiAbsPartIdx = 0; 124 } 125 m_pcEntropyCoderIf->codeDIS( pcCU, uiAbsPartIdx ); 126 } 127 #else 113 128 #if H_3D_SINGLE_DEPTH 114 129 Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) … … 125 140 } 126 141 #endif 142 #endif 143 127 144 /** encode merge flag 128 145 * \param pcCU … … 254 271 m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth ); 255 272 273 #if !HHI_MOVE_SYN_K0052 256 274 #if H_3D_DBBP 257 275 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() ) … … 259 277 encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD); 260 278 } 279 #endif 261 280 #endif 262 281 } … … 285 304 } 286 305 306 #if H_3D_DISABLE_CHROMA 307 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd ) 308 #else 287 309 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP ) 288 { 310 #endif 311 { 312 313 #if H_MV_ENC_DEC_TRAC 314 #if ENC_DEC_TRACE 315 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 316 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 317 318 DTRACE_TU_S("=========== transform_tree ===========\n") 319 DTRACE_TU("x0", uiLPelX) 320 DTRACE_TU("x1", uiTPelY) 321 DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth) 322 DTRACE_TU("trafoDepth" , uiDepth) 323 #endif 324 #endif 325 289 326 const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth; 290 327 const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; … … 292 329 UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 293 330 UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 294 331 #if H_3D_DISABLE_CHROMA 332 if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ) 333 { 334 cbfU = 0; 335 cbfV = 0; 336 } 337 #endif 295 338 if(uiTrIdx==0) 296 339 { … … 309 352 cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 310 353 cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 354 #if H_3D_DISABLE_CHROMA 355 if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ) 356 { 357 cbfU = 0; 358 cbfV = 0; 359 } 360 #endif 311 361 } 312 362 } … … 349 399 if( bFirstCbfOfCU || uiLog2TrafoSize > 2 ) 350 400 { 401 #if H_3D_DISABLE_CHROMA 402 if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || rd) 403 { 404 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ) 405 { 406 m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ); 407 } 408 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ) 409 { 410 m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ); 411 } 412 } 413 #else 351 414 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ) 352 415 { … … 357 420 m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ); 358 421 } 422 #endif 359 423 } 360 424 else if( uiLog2TrafoSize == 2 ) 361 425 { 426 #if H_3D_DISABLE_CHROMA 427 if ( rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) 428 { 362 429 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ); 363 430 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ); 431 } 432 #else 433 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) ); 434 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) ); 435 #endif 364 436 } 365 437 … … 374 446 const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 375 447 448 #if H_3D_DISABLE_CHROMA 449 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd ); 450 451 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 452 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ,rd ); 453 454 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 455 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd ); 456 457 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 458 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd ); 459 #else 376 460 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ); 377 461 … … 384 468 uiAbsPartIdx += partNum; offsetLuma += size; offsetChroma += (size>>2); 385 469 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ); 470 #endif 386 471 } 387 472 else … … 400 485 #endif 401 486 487 #if H_3D_DISABLE_CHROMA 488 Bool notcbfUV = !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ? 1 : ( !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) ; 489 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && 490 uiDepth == pcCU->getDepth( uiAbsPartIdx ) && notcbfUV ) 491 #else 402 492 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 493 #endif 403 494 { 404 495 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, 0 ) ); … … 489 580 encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx,true ); 490 581 #if H_3D_DIM_SDC 582 #if H_3D_DISABLE_CHROMA 583 if(!pcCU->getSDCFlag(uiAbsPartIdx) && ( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || bRD ) ) 584 #else 491 585 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 586 #endif 492 587 #endif 493 588 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD ); … … 657 752 * \param uiHeight 658 753 */ 754 #if H_3D_DISABLE_CHROMA 755 Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd ) 756 #else 659 757 Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ) 758 #endif 660 759 { 661 760 UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight(); … … 668 767 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 669 768 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 769 #if H_3D_DISABLE_CHROMA 770 if (!pcCU->getSlice()->getIsDepth() ) 771 { 772 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 773 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 774 } 775 #else 670 776 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 671 777 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 672 } 778 #endif 779 } 780 673 781 674 782 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) … … 723 831 } 724 832 833 #if H_3D_DISABLE_CHROMA 834 xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, rd); 835 #else 725 836 xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP); 837 #endif 726 838 } 727 839 … … 792 904 Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 793 905 { 794 if( bRD ) 795 { 796 uiAbsPartIdx = 0; 797 } 798 m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx ); 906 #if HHI_MOVE_SYN_K0052 907 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && 908 ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || 909 pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && 910 pcCU->getWidth(uiAbsPartIdx) > 8 && 911 pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() ) 912 { 913 #endif 914 if( bRD ) 915 { 916 uiAbsPartIdx = 0; 917 } 918 m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx ); 919 #if HHI_MOVE_SYN_K0052 920 } 921 #endif 799 922 } 800 923 #endif -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 82 82 virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 83 83 virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 84 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 85 virtual Void codeDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 86 #else 84 87 #if H_3D_SINGLE_DEPTH 85 88 virtual Void codeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 89 #endif 86 90 #endif 87 91 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 147 151 Void resetBits () { m_pcEntropyCoderIf->resetBits(); } 148 152 Void resetCoeffCost () { m_pcEntropyCoderIf->resetCoeffCost(); } 149 UInt getNumberOfWrittenBits () { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); } 153 UInt getNumberOfWrittenBits () 154 { 155 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 156 Bool oldJustDoIt = g_bJustDoIt; 157 g_bJustDoIt = true; 158 writeToTraceFile( "NumberOfWrittenBits", m_pcEntropyCoderIf->getNumberOfWrittenBits(), g_encNumberOfWrittenBits ); 159 g_bJustDoIt = oldJustDoIt; 160 #endif 161 return m_pcEntropyCoderIf->getNumberOfWrittenBits(); 162 } 150 163 UInt getCoeffCost () { return m_pcEntropyCoderIf->getCoeffCost(); } 151 164 Void resetEntropy () { m_pcEntropyCoderIf->resetEntropy(); } … … 166 179 Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 167 180 Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 181 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 182 Void encodeDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false ); 183 #else 168 184 #if H_3D_SINGLE_DEPTH 169 185 Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false ); 186 #endif 170 187 #endif 171 188 Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); … … 209 226 210 227 private: 228 #if H_3D_DISABLE_CHROMA 229 Void xEncodeTransform ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd ); 230 public: 231 Void encodeCoeff ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd ); 232 #else 211 233 Void xEncodeTransform ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP ); 212 234 public: 213 235 Void encodeCoeff ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ); 236 #endif 214 237 215 238 Void encodeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoeff, UInt uiAbsPartIdx, UInt uiTrWidth, UInt uiTrHeight, UInt uiDepth, TextType eType ); -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 885 885 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 886 886 #endif 887 #if HHI_INTER_COMP_PRED_K0052 888 pcSlice->setIvPicLists( m_ivPicLists ); 889 890 Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid; 891 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 892 #else 887 893 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 894 #endif 888 895 889 896 Bool interLayerPredLayerIdcPresentFlag = false; … … 922 929 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 923 930 931 #if HHI_INTER_COMP_PRED_K0052 932 #if H_3D 933 if ( m_pcEncTop->decProcAnnexI() ) 934 { 935 pcSlice->deriveInCmpPredAndCpAvailFlag(); 936 if ( pcSlice->getInCmpPredAvailFlag() ) 937 { 938 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 939 } 940 else 941 { 942 if (gopEntry.m_interCompPredFlag ) 943 { 944 if ( gopNum == MAX_GOP) 945 { 946 printf( "\nError: FrameI_l%d cannot enable inter-component prediction.\n", pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) ); 947 } 948 else 949 { 950 printf( "\nError: Frame%d_l%d cannot enable inter-component prediction.\n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) ); 951 } 952 953 exit(EXIT_FAILURE); 954 } 955 } 956 pcSlice->init3dToolParameters(); 957 pcSlice->checkInCompPredRefLayers(); 958 } 959 960 961 // This needs to be done after initilizaiton of 3D tool parameters. 962 pcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ( ( pcSlice->getMpiFlag( ) || pcSlice->getIvMvPredFlag( ) || pcSlice->getViewSynthesisPredFlag( ) ) ? 1 : 0 )); 963 #endif 964 #endif 965 924 966 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 925 967 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); … … 968 1010 } 969 1011 #endif 1012 #if !HHI_INTER_COMP_PRED_K0052 970 1013 #if H_3D 971 1014 pcSlice->setIvPicLists( m_ivPicLists ); … … 973 1016 assert( !m_pcEncTop->getIsDepth() || ( pcSlice->getTexturePic() != 0 ) ); 974 1017 #endif 1018 #endif 975 1019 #endif 976 1020 #if H_3D_IC … … 1950 1994 m_pcSAO->PCMLFDisableProcess(pcPic); 1951 1995 1996 #if H_3D_DISABLE_CHROMA 1997 if (pcSlice->getIsDepth()) 1998 { 1999 sliceEnabled[SAO_Cb] = false; 2000 sliceEnabled[SAO_Cr] = false; 2001 } 2002 #endif 1952 2003 //assign SAO slice header 1953 2004 for(Int s=0; s< uiNumSlices; s++) -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r1084 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncPic.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncPic.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncPreanalyzer.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncPreanalyzer.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncRateCtrl.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r964 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 58 58 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 59 59 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 60 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 61 , m_cCUDISFlagSCModel ( 1, 1, NUM_DIS_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 62 , m_cCUDISTypeSCModel ( 1, 1, NUM_DIS_TYPE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 #else 60 64 #if H_3D_SINGLE_DEPTH 61 65 , m_cCUSingleDepthFlagSCModel ( 1, 1, NUM_SINGLEDEPTH_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 62 66 , m_cSingleDepthValueSCModel ( 1, 1, NUM_SINGLE_DEPTH_VALUE_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 67 #endif 63 68 #endif 64 69 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 134 139 135 140 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 141 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 142 m_cCUDISFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG ); 143 m_cCUDISTypeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE ); 144 #else 136 145 #if H_3D_SINGLE_DEPTH 137 146 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 138 147 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 148 #endif 139 149 #endif 140 150 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); … … 214 224 curCost = m_cCUSplitFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 215 225 curCost += m_cCUSkipFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG ); 226 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 227 curCost += m_cCUDISFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DIS_FLAG ); 228 curCost += m_cCUDISTypeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DIS_TYPE ); 229 #else 216 230 #if H_3D_SINGLE_DEPTH 217 231 curCost += m_cCUSingleDepthFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 218 232 curCost += m_cSingleDepthValueSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 233 #endif 219 234 #endif 220 235 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); … … 287 302 288 303 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 304 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 305 m_cCUDISFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG ); 306 m_cCUDISTypeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE ); 307 #else 289 308 #if H_3D_SINGLE_DEPTH 290 309 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 291 310 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 292 #endif 311 #endif 312 #endif 293 313 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 294 314 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); … … 446 466 m_pcBinIf->encodeBinsEP( bins, numBins ); 447 467 } 468 469 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 470 Void TEncSbac::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx ) 471 { 472 UInt uiSymbol = pcCU->getDISFlag(uiAbsPartIdx ) ? 1 : 0; 473 m_pcBinIf->encodeBin( uiSymbol, m_cCUDISFlagSCModel.get( 0, 0, 0 ) ); 474 if(uiSymbol) 475 { 476 UInt uiUnaryIdx = (UInt) pcCU->getDISType(uiAbsPartIdx); 477 UInt uiNumCand = 4; 478 479 if ( uiNumCand > 1 ) 480 { 481 for( UInt ui = 0; ui < uiNumCand - 1; ++ui ) 482 { 483 const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1; 484 if ( ui == 0 ) 485 { 486 m_pcBinIf->encodeBin( uiSymbol2, m_cCUDISTypeSCModel.get( 0, 0, 0 ) ); 487 } 488 else 489 { 490 m_pcBinIf->encodeBinEP( uiSymbol2 ); 491 } 492 if( uiSymbol2 == 0 ) 493 { 494 break; 495 } 496 } 497 } 498 } 499 } 500 #else 448 501 #if H_3D_SINGLE_DEPTH 449 502 Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) … … 477 530 } 478 531 #endif 532 #endif 533 479 534 /** Coding of coeff_abs_level_minus3 480 535 * \param uiSymbol value of coeff_abs_level_minus3 … … 1040 1095 DTRACE_CABAC_V( uiCtx ) 1041 1096 DTRACE_CABAC_T( "\n" ) 1042 #endif 1097 #else 1098 DTRACE_TU("split_transform_flag", uiSymbol ) 1099 #endif 1100 1043 1101 } 1044 1102 … … 1371 1429 DTRACE_CABAC_V( uiAbsPartIdx ) 1372 1430 DTRACE_CABAC_T( "\n" ) 1431 #else 1432 if ( eType == TEXT_CHROMA_U ) 1433 { 1434 DTRACE_TU("cbf_cb", uiCbf ) 1435 } 1436 else if ( eType == TEXT_CHROMA_V ) 1437 { 1438 DTRACE_TU("cbf_cr", uiCbf ) 1439 } 1440 else 1441 { 1442 DTRACE_TU("cbf_luma", uiCbf ) 1443 } 1373 1444 #endif 1374 1445 } … … 1446 1517 } 1447 1518 1519 #if H_3D_DISABLE_CHROMA 1520 if( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 ) 1521 { 1522 #endif 1448 1523 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset; 1449 1524 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2; … … 1477 1552 piPCMSample += uiWidth; 1478 1553 } 1554 #if H_3D_DISABLE_CHROMA 1555 } 1556 #endif 1479 1557 m_pcBinIf->resetBac(); 1480 1558 } … … 2289 2367 UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2290 2368 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2291 2369 DTRACE_CU("dc_only_flag", uiSymbol) 2292 2370 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2293 2371 } … … 2305 2383 UInt uiSymbol = pcCU->getDBBPFlag( uiAbsPartIdx ) ? 1 : 0; 2306 2384 m_pcBinIf->encodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) ); 2385 DTRACE_CU("dbbp_flag", uiSymbol) 2307 2386 } 2308 2387 #endif -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 146 146 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 147 147 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 148 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 149 Void codeDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 150 #else 148 151 #if H_3D_SINGLE_DEPTH 149 152 Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ); 153 #endif 150 154 #endif 151 155 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 215 219 ContextModel3DBuffer m_cCUSplitFlagSCModel; 216 220 ContextModel3DBuffer m_cCUSkipFlagSCModel; 221 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 222 ContextModel3DBuffer m_cCUDISFlagSCModel; 223 ContextModel3DBuffer m_cCUDISTypeSCModel; 224 #else 217 225 #if H_3D_SINGLE_DEPTH 218 226 ContextModel3DBuffer m_cCUSingleDepthFlagSCModel; 219 227 ContextModel3DBuffer m_cSingleDepthValueSCModel; 228 #endif 220 229 #endif 221 230 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 915 915 } 916 916 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 917 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 918 m_pcEntropyCoder->encodeDIS(pcCU, 0, true ); 919 if(!pcCU->getDISFlag(uiAbsPartIdx)) 920 #else 917 921 #if H_3D_SINGLE_DEPTH 918 922 m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true ); 919 923 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 920 924 #endif 921 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 922 } 925 #endif 926 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 927 } 928 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 929 else 930 { 931 m_pcEntropyCoder->encodeDIS(pcCU, 0, true ); 932 } 933 #else 923 934 #if H_3D_SINGLE_DEPTH 924 935 else … … 926 937 m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true ); 927 938 } 928 #endif 939 #endif 940 #endif 941 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 942 if(!pcCU->getDISFlag(uiAbsPartIdx)) 943 { 944 #else 929 945 #if H_3D_SINGLE_DEPTH 930 946 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 931 947 { 932 948 #endif 933 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 934 949 #endif 950 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 951 952 #if !HHI_MOVE_SYN_K0052 935 953 #if H_3D_DIM_SDC 936 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 937 #endif 938 if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N ) 939 { 940 m_pcEntropyCoder->encodeIPCMInfo( pcCU, 0, true ); 941 942 if ( pcCU->getIPCMFlag (0)) 943 { 944 return; 945 } 946 } 954 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 955 #endif 956 #endif 957 if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N ) 958 { 959 m_pcEntropyCoder->encodeIPCMInfo( pcCU, 0, true ); 960 if ( pcCU->getIPCMFlag (0)) 961 { 962 #if HHI_MOVE_SYN_K0052 963 #if H_3D_DIM_SDC 964 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 965 #endif 966 #endif 967 return; 968 } 969 } 970 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 971 } 972 #else 947 973 #if H_3D_SINGLE_DEPTH 948 } 949 #endif 950 } 974 } 975 #endif 976 #endif 977 } 978 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 979 if(!pcCU->getDISFlag(uiAbsPartIdx)) 980 { 981 #else 951 982 #if H_3D_SINGLE_DEPTH 952 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 953 { 954 #endif 955 // luma prediction mode 956 if( pcCU->getPartitionSize(0) == SIZE_2Nx2N ) 957 { 958 if( uiAbsPartIdx == 0 ) 959 { 960 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 983 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 984 { 985 #endif 986 #endif 987 // luma prediction mode 988 if( pcCU->getPartitionSize(0) == SIZE_2Nx2N ) 989 { 990 if( uiAbsPartIdx == 0 ) 991 { 992 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 961 993 #if H_3D_DIM_SDC 962 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 963 { 964 m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 ); 965 } 966 #endif 967 } 968 } 969 else 970 { 971 UInt uiQNumParts = pcCU->getTotalNumPart() >> 2; 972 if( uiTrDepth == 0 ) 973 { 974 assert( uiAbsPartIdx == 0 ); 975 for( UInt uiPart = 0; uiPart < 4; uiPart++ ) 976 { 977 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts ); 994 #if HHI_MOVE_SYN_K0052 978 995 #if H_3D_DIM_SDC 979 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 996 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 997 #endif 998 #endif 999 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 980 1000 { 981 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts);1001 m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 ); 982 1002 } 983 1003 #endif 984 1004 } 985 1005 } 986 else if( ( uiAbsPartIdx % uiQNumParts ) == 0 ) 987 { 988 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 1006 else 1007 { 1008 UInt uiQNumParts = pcCU->getTotalNumPart() >> 2; 1009 if( uiTrDepth == 0 ) 1010 { 1011 assert( uiAbsPartIdx == 0 ); 1012 for( UInt uiPart = 0; uiPart < 4; uiPart++ ) 1013 { 1014 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts ); 1015 1016 #if HHI_MOVE_SYN_K0052 1017 } 1018 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 1019 for( UInt uiPart = 0; uiPart < 4; uiPart++ ) 1020 { 1021 #endif 989 1022 #if H_3D_DIM_SDC 990 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 991 { 992 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx ); 993 } 994 #endif 995 } 996 } 1023 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 1024 { 1025 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts ); 1026 } 1027 #endif 1028 } 1029 } 1030 else if( ( uiAbsPartIdx % uiQNumParts ) == 0 ) 1031 { 1032 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 1033 #if H_3D_DIM_SDC 1034 #if HHI_MOVE_SYN_K0052 1035 if( uiAbsPartIdx == 0 ) 1036 { 1037 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 1038 } 1039 #endif 1040 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 1041 { 1042 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx ); 1043 } 1044 #endif 1045 } 1046 } 1047 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 1048 } 1049 #else 997 1050 #if H_3D_SINGLE_DEPTH 998 1051 } 1052 #endif 999 1053 #endif 1000 1054 } … … 1859 1913 dRDCost += dSingleCost; 1860 1914 } 1915 1916 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 1917 Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode ) 1918 { 1919 UInt uiWidth = pcCU ->getWidth ( 0 ); 1920 UInt uiHeight = pcCU ->getHeight ( 0 ); 1921 UInt uiStride = pcOrgYuv ->getStride (); 1922 Pel* piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 1923 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1924 1925 AOF( uiWidth == uiHeight ); 1926 AOF( uiAbsPartIdx == 0 ); 1927 pcCU->setDISTypeSubParts(uiPredMode, uiAbsPartIdx, 0, pcCU->getDepth(0)); 1928 //===== reconstruction ===== 1929 1930 Bool bAboveAvail = false; 1931 Bool bLeftAvail = false; 1932 pcCU->getPattern()->initPattern ( pcCU, 0, 0 ); 1933 pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1934 1935 if ( uiPredMode == 0 ) 1936 { 1937 predIntraLumaAng( pcCU->getPattern(), VER_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1938 } 1939 else if ( uiPredMode == 1 ) 1940 { 1941 predIntraLumaAng( pcCU->getPattern(), HOR_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1942 } 1943 else if ( uiPredMode == 2 ) 1944 { 1945 Pel pSingleDepth = 1 << ( g_bitDepthY - 1 ); 1946 pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 ); 1947 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1948 { 1949 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1950 { 1951 piPred[ uiX ] = pSingleDepth; 1952 } 1953 piPred+= uiStride; 1954 } 1955 } 1956 else if ( uiPredMode == 3 ) 1957 { 1958 Pel pSingleDepth = 1 << ( g_bitDepthY - 1 ); 1959 pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 ); 1960 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1961 { 1962 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1963 { 1964 piPred[ uiX ] = pSingleDepth; 1965 } 1966 piPred+= uiStride; 1967 } 1968 } 1969 1970 // clear UV 1971 UInt uiStrideC = pcPredYuv->getCStride(); 1972 Pel *pRecCb = pcPredYuv->getCbAddr(); 1973 Pel *pRecCr = pcPredYuv->getCrAddr(); 1974 1975 for (Int y=0; y<uiHeight/2; y++) 1976 { 1977 for (Int x=0; x<uiWidth/2; x++) 1978 { 1979 pRecCb[x] = 1<<(g_bitDepthC-1); 1980 pRecCr[x] = 1<<(g_bitDepthC-1); 1981 } 1982 1983 pRecCb += uiStrideC; 1984 pRecCr += uiStrideC; 1985 } 1986 1987 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1988 //===== determine distortion ===== 1989 #if H_3D_VSO 1990 if ( m_pcRdCost->getUseVSO() ) 1991 ruiDist = m_pcRdCost->getDistPartVSO ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false ); 1992 else 1993 #endif 1994 ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight ); 1995 1996 //===== determine rate and r-d cost ===== 1997 m_pcEntropyCoder->resetBits(); 1998 m_pcEntropyCoder->encodeDIS( pcCU, 0, true ); 1999 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 2000 2001 #if H_3D_VSO 2002 if ( m_pcRdCost->getUseLambdaScaleVSO()) 2003 dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist ); 2004 else 2005 #endif 2006 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 2007 } 2008 #else 1861 2009 #if H_3D_SINGLE_DEPTH 1862 2010 Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor ) … … 1921 2069 } 1922 2070 #endif 2071 #endif 2072 1923 2073 #if H_3D_DIM_SDC 1924 2074 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) … … 2168 2318 2169 2319 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth( 0 ), true ); 2320 #if !HHI_MOVE_SYN_K0052 2170 2321 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2322 #endif 2171 2323 2172 2324 // encode pred direction + DC residual data 2173 2325 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2326 #if HHI_MOVE_SYN_K0052 2327 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2328 #endif 2329 2174 2330 Bool bDummy = false; 2331 #if H_3D_DISABLE_CHROMA 2332 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy, true ); 2333 #else 2175 2334 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy ); 2335 #endif 2176 2336 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 2177 2337 … … 2861 3021 pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) ); 2862 3022 } 3023 3024 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 3025 Void TEncSearch::estIntraPredDIS( TComDataCU* pcCU, 3026 TComYuv* pcOrgYuv, 3027 TComYuv* pcPredYuv, 3028 TComYuv* pcResiYuv, 3029 TComYuv* pcRecoYuv, 3030 UInt& ruiDistC, 3031 Bool bLumaOnly ) 3032 { 3033 UInt uiDepth = pcCU->getDepth(0); 3034 UInt uiWidth = pcCU->getWidth (0); 3035 UInt uiHeight = pcCU->getHeight(0); 3036 3037 3038 Pel* piOrg = pcOrgYuv ->getLumaAddr( 0, uiWidth ); 3039 UInt uiStride = pcPredYuv->getStride(); 3040 3041 Dist uiDist = 0; 3042 Double dCost = 0.0; 3043 Dist uiBestDist = 0; 3044 Double dBestCost = MAX_DOUBLE; 3045 UInt uiBestDISType = 0; 3046 3047 for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ ) 3048 { 3049 // set context models 3050 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 3051 3052 // determine residual for partition 3053 uiDist = 0; 3054 dCost = 0.0; 3055 #if H_3D_VSO // M36 3056 if( m_pcRdCost->getUseRenModel() ) 3057 { 3058 m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight ); 3059 } 3060 #endif 3061 xIntraCodingDIS(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, uiPredMode); 3062 // check r-d cost 3063 if( dCost < dBestCost ) 3064 { 3065 uiBestDist = uiDist; 3066 dBestCost = dCost; 3067 uiBestDISType = pcCU->getDISType(0); 3068 // copy reconstruction 3069 pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight); 3070 } 3071 } 3072 3073 3074 pcCU->setDISTypeSubParts(uiBestDISType, 0, 0, uiDepth); 3075 assert(uiBestDISType >= 0); 3076 3077 //===== reset context models ===== 3078 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]); 3079 3080 //===== set distortion (rate and r-d costs are determined later) ===== 3081 pcCU->getTotalDistortion() = uiBestDist; 3082 } 3083 #else 2863 3084 #if H_3D_SINGLE_DEPTH 2864 3085 Void … … 2950 3171 2951 3172 #endif 3173 #endif 3174 2952 3175 Void 2953 3176 TEncSearch::estIntraPredQT( TComDataCU* pcCU, … … 5311 5534 TComMv cMvPred = *pcMvPred; 5312 5535 5536 #if SONY_MV_V_CONST_C0078 5537 Bool bMv_VRng_Restricted = false; 5538 if( m_pcEncCfg->getUseDisparitySearchRangeRestriction() 5539 && 5540 pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC() 5541 ) 5542 { 5543 bMv_VRng_Restricted = true; 5544 } 5545 if ( bBi ) xSetSearchRange ( pcCU, rcMv , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() ); 5546 else xSetSearchRange ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() ); 5547 #else 5313 5548 if ( bBi ) xSetSearchRange ( pcCU, rcMv , iSrchRng, cMvSrchRngLT, cMvSrchRngRB ); 5314 5549 else xSetSearchRange ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB ); 5550 #endif 5315 5551 5316 5552 m_pcRdCost->getMotionCost ( 1, 0 ); … … 5365 5601 5366 5602 5603 #if SONY_MV_V_CONST_C0078 5604 Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB, Bool bMv_VRng_Restricted, Int iVerDispSrchRng ) 5605 #else 5367 5606 Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB ) 5607 #endif 5368 5608 { 5369 5609 Int iMvShift = 2; … … 5380 5620 rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) ); 5381 5621 rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) ); 5622 5623 #if SONY_MV_V_CONST_C0078 5624 if ( bMv_VRng_Restricted ) { 5625 Int iRestrictMvVrange = ( iVerDispSrchRng - 1 ) << iMvShift ; // -1 to consider subpel search 5626 if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange ){ 5627 rcMvSrchRngRB.setVer( iRestrictMvVrange ); //only positive side is restricted 5628 } 5629 } 5630 #endif 5631 5382 5632 pcCU->clipMv ( rcMvSrchRngLT ); 5383 5633 pcCU->clipMv ( rcMvSrchRngRB ); … … 7119 7369 const UInt uiQTTempAccessLayer = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize; 7120 7370 7371 #if 0 //H_3D_DISABLE_CHROMA 7372 Bool bCodeChroma = !pcCU->getSlice()->getIsDepth(); 7373 #else 7121 7374 Bool bCodeChroma = true; 7375 #endif 7122 7376 UInt uiTrModeC = uiTrMode; 7123 7377 UInt uiLog2TrSizeC = uiLog2TrSize-1; … … 7261 7515 } 7262 7516 m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true ); 7517 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 7518 m_pcEntropyCoder->encodeDIS ( pcCU, 0, true ); 7519 #else 7263 7520 #if H_3D_SINGLE_DEPTH 7264 7521 m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true ); 7265 7522 #endif 7523 #endif 7266 7524 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 7267 7525 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 7526 #if !HHI_MOVE_SYN_K0052 7268 7527 #if H_3D_DIM_SDC 7269 7528 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 7270 7529 #endif 7530 #endif 7271 7531 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 7532 #if HHI_MOVE_SYN_K0052 7533 #if H_3D_DIM_SDC 7534 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 7535 #endif 7536 #endif 7272 7537 #if H_3D_ARP 7273 m_pcEntropyCoder->encodeARPW( pcCU , 0 );7538 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 7274 7539 #endif 7275 7540 #if H_3D_IC 7276 7541 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 7277 7542 #endif 7543 #if HHI_MOVE_SYN_K0052 7544 m_pcEntropyCoder->encodeDBBPFlag( pcCU, 0, true ); 7545 #endif 7278 7546 Bool bDummy = false; 7547 #if H_3D_DISABLE_CHROMA 7548 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy, true ); 7549 #else 7279 7550 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy ); 7551 #endif 7280 7552 7281 7553 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r1084 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 191 191 TComYuv* pcRecoYuv, 192 192 UInt uiPreCalcDistC ); 193 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 194 Void estIntraPredDIS ( TComDataCU* pcCU, 195 TComYuv* pcOrgYuv, 196 TComYuv* pcPredYuv, 197 TComYuv* pcResiYuv, 198 TComYuv* pcRecoYuv, 199 UInt& ruiDistC, 200 Bool bLumaOnly ); 201 #else 193 202 #if H_3D_SINGLE_DEPTH 194 203 Void estIntraPredSingleDepth ( TComDataCU* pcCU, … … 199 208 UInt& ruiDistC, 200 209 Bool bLumaOnly ); 201 #endif 210 #endif 211 #endif 202 212 203 213 /// encoder estimation - inter prediction (non-skip) … … 354 364 UInt uiAbsPartIdx, 355 365 UInt stateU0V1Both2 ); 366 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 367 Void xIntraCodingDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode ); 368 #else 356 369 #if H_3D_SINGLE_DEPTH 357 370 Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor ); 371 #endif 358 372 #endif 359 373 #if H_3D_DIM … … 466 480 UInt& ruiSAD ); 467 481 482 #if SONY_MV_V_CONST_C0078 483 Void xSetSearchRange ( TComDataCU* pcCU, 484 TComMv& cMvPred, 485 Int iSrchRng, 486 TComMv& rcMvSrchRngLT, 487 TComMv& rcMvSrchRngRB, 488 Bool bMv_VRng_Restricted, 489 Int iVerDispSrchRng ); 490 #else 468 491 Void xSetSearchRange ( TComDataCU* pcCU, 469 492 TComMv& cMvPred, … … 471 494 TComMv& rcMvSrchRngLT, 472 495 TComMv& rcMvSrchRngRB ); 496 #endif 473 497 474 498 Void xPatternSearchFast ( TComDataCU* pcCU, -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 215 215 rpcSlice->setPicOutputFlag( true ); 216 216 rpcSlice->setPOC( pocCurr ); 217 #if !HHI_INTER_COMP_PRED_K0052 217 218 #if H_3D 218 rpcSlice->init3dToolParameters(); 219 rpcSlice->init3dToolParameters(); 220 #endif 219 221 #endif 220 222 #if H_3D_IC … … 610 612 rpcSlice->setSliceSegmentMode ( m_pcCfg->getSliceSegmentMode() ); 611 613 rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() ); 614 #if !HHI_INTER_COMP_PRED_K0052 612 615 #if H_3D_IV_MERGE 613 616 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ( ( rpcSlice->getMpiFlag( ) || rpcSlice->getIvMvPredFlag( ) || rpcSlice->getViewSynthesisPredFlag( ) ) ? 1 : 0 )); 614 617 #else 615 618 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() ); 619 #endif 620 #else 621 #if !H_3D 622 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() ); 623 #endif 616 624 #endif 617 625 xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() ); -
trunk/source/Lib/TLibEncoder/TEncSlice.h
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 91 91 m_aICEnableNum = NULL; 92 92 #endif 93 #if H_3D_ANNEX_SELECTION_FIX 94 m_cCavlcCoder.setEncTop(this); 95 #endif 93 96 } 94 97 … … 364 367 } 365 368 #endif 369 366 370 // initialize processing unit classes 367 371 m_cGOPEncoder. init( this ); … … 413 417 #endif 414 418 #if H_3D 419 #if HHI_CAM_PARA_K0052 420 pcPicCurr->setScaleOffset( m_cameraParameters->getCodedScale(), m_cameraParameters->getCodedOffset() ); 421 #else 415 422 pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset ); 423 #endif 416 424 #endif 417 425 } … … 760 768 m_cSPS.setSpsInferScalingListFlag ( true ); 761 769 m_cSPS.setSpsScalingListRefLayerId( m_cVPS->getIdRefLayer( getLayerId(), 0 ) ); 762 } 770 #if SONY_MV_V_CONST_C0078 771 if ( m_bUseDisparitySearchRangeRestriction ) 772 { 773 m_cSPS.setInterViewMvVertConstraintFlag ( true ) ; 774 } 775 #endif 776 } 763 777 m_cSPS.setSpsExtensionPresentFlag ( true ); 764 778 m_cSPS.setSpsMultilayerExtensionFlag ( true ); … … 773 787 m_cSPS.setMaxCUHeight ( g_uiMaxCUHeight ); 774 788 m_cSPS.setMaxCUDepth ( g_uiMaxCUDepth ); 789 #if H_3D_DISABLE_CHROMA 790 m_cSPS.setChromaFormatIdc( getIsDepth() ? CHROMA_400 : CHROMA_420 ); 791 #endif 775 792 776 793 Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth ); -
trunk/source/Lib/TLibEncoder/TEncTop.h
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/WeightPredAnalysis.cpp
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * -
trunk/source/Lib/TLibEncoder/WeightPredAnalysis.h
r872 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 *
Note: See TracChangeset for help on using the changeset viewer.