Changeset 767 in 3DVCSoftware for branches/HTM-9.2-dev0/source/Lib/TLibCommon
- Timestamp:
- 12 Jan 2014, 04:39:11 (11 years ago)
- Location:
- branches/HTM-9.2-dev0/source/Lib/TLibCommon
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.cpp
r766 r767 769 769 Void TComSlice::setCamparaSlice( Int** aaiScale, Int** aaiOffset ) 770 770 { 771 #if CAM_HLS_F0136_F0045_F0082772 771 if( m_pcVPS->hasCamParInSliceHeader( m_viewIndex ) ) 773 #else774 if( m_pcSPS->hasCamParInSliceHeader() )775 #endif776 772 { 777 773 for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < m_viewIndex; uiBaseViewIndex++ ) … … 1789 1785 m_viewIndex [i] = -1; 1790 1786 m_vpsDepthModesFlag [i] = false; 1791 #if H_3D_DIM_DLT1792 #if !DLT_DIFF_CODING_IN_PPS1793 m_bUseDLTFlag [i] = false;1794 1795 // allocate some memory and initialize with default mapping1796 m_iNumDepthmapValues[i] = ((1 << g_bitDepthY)-1)+1;1797 m_iBitsPerDepthValue[i] = numBitsForValue(m_iNumDepthmapValues[i]);1798 1799 m_iDepthValue2Idx[i] = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);1800 m_iIdx2DepthValue[i] = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);1801 1802 //default mapping1803 for (Int d=0; d<m_iNumDepthmapValues[i]; d++)1804 {1805 m_iDepthValue2Idx[i][d] = d;1806 m_iIdx2DepthValue[i][d] = d;1807 }1808 #endif1809 #endif1810 #if H_3D1811 1787 m_ivMvScalingFlag = true; 1812 1788 #endif … … 1856 1832 } 1857 1833 #endif 1858 #endif1859 1834 } 1860 1835 1861 1836 TComVPS::~TComVPS() 1862 1837 { 1863 if( m_hrdParameters != NULL ) delete[] m_hrdParameters;1838 if( m_hrdParameters != NULL ) delete[] m_hrdParameters; 1864 1839 if( m_hrdOpSetIdx != NULL ) delete[] m_hrdOpSetIdx; 1865 1840 if( m_cprmsPresentFlag != NULL ) delete[] m_cprmsPresentFlag; … … 1871 1846 { 1872 1847 if (m_repFormat[ i ] != NULL ) delete m_repFormat[ i ]; 1873 #if H_3D_DIM_DLT 1874 #if !DLT_DIFF_CODING_IN_PPS 1875 if ( m_iDepthValue2Idx[i] != 0 ) 1876 { 1877 xFree( m_iDepthValue2Idx[i] ); 1878 m_iDepthValue2Idx[i] = 0; 1879 } 1880 1881 if ( m_iIdx2DepthValue[i] != 0 ) 1882 { 1883 xFree( m_iIdx2DepthValue[i] ); 1884 m_iIdx2DepthValue[i] = 0; 1885 } 1886 #endif 1887 #endif 1888 } 1889 #endif 1890 #if CAM_HLS_F0136_F0045_F0082 1848 } 1849 #endif 1850 #if H_3D 1891 1851 deleteCamPars(); 1892 1852 #endif 1893 1853 } 1894 1895 #if H_3D_DIM_DLT1896 #if !DLT_DIFF_CODING_IN_PPS1897 Void TComVPS::setDepthLUTs(Int layerIdInVps, Int* idxToDepthValueTable, Int iNumDepthValues)1898 {1899 if( idxToDepthValueTable == NULL || iNumDepthValues == 0 ) // default mapping only1900 return;1901 1902 // copy idx2DepthValue to internal array1903 memcpy(m_iIdx2DepthValue[layerIdInVps], idxToDepthValueTable, iNumDepthValues*sizeof(UInt));1904 1905 UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);1906 for(Int p=0; p<=uiMaxDepthValue; p++)1907 {1908 Int iIdxDown = 0;1909 Int iIdxUp = iNumDepthValues-1;1910 Bool bFound = false;1911 1912 // iterate over indices to find lower closest depth1913 Int i = 1;1914 while(!bFound && i<iNumDepthValues)1915 {1916 if( m_iIdx2DepthValue[layerIdInVps][i] > p )1917 {1918 iIdxDown = i-1;1919 bFound = true;1920 }1921 1922 i++;1923 }1924 // iterate over indices to find upper closest depth1925 i = iNumDepthValues-2;1926 bFound = false;1927 while(!bFound && i>=0)1928 {1929 if( m_iIdx2DepthValue[layerIdInVps][i] < p )1930 {1931 iIdxUp = i+1;1932 bFound = true;1933 }1934 1935 i--;1936 }1937 1938 // assert monotony1939 assert(iIdxDown<=iIdxUp);1940 1941 // assign closer depth value/idx1942 if( abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxDown]) < abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxUp]) )1943 {1944 m_iDepthValue2Idx[layerIdInVps][p] = iIdxDown;1945 }1946 else1947 {1948 m_iDepthValue2Idx[layerIdInVps][p] = iIdxUp;1949 }1950 1951 }1952 1953 // update DLT variables1954 m_iNumDepthmapValues[layerIdInVps] = iNumDepthValues;1955 m_iBitsPerDepthValue[layerIdInVps] = numBitsForValue(m_iNumDepthmapValues[layerIdInVps]);1956 }1957 #endif1958 #endif1959 1854 1960 1855 #if H_MV … … 2043 1938 return foundLayerIdinNuh; 2044 1939 } 2045 #if CAM_HLS_F0136_F0045_F0082 1940 2046 1941 Void TComVPS::createCamPars(Int iNumViews) 2047 1942 { … … 2132 2027 } 2133 2028 } 2134 #endif // CAM_HLS_F0136_F0045_F00822135 2029 2136 2030 #endif // H_3D … … 2491 2385 , m_ppsInferScalingListFlag(false) 2492 2386 , m_ppsScalingListRefLayerId(0) 2493 #if DLT_DIFF_CODING_IN_PPS2387 #if H_3D 2494 2388 , m_pcDLT(NULL) 2495 2389 #endif … … 2514 2408 } 2515 2409 2516 #if DLT_DIFF_CODING_IN_PPS2410 #if H_3D 2517 2411 TComDLT::TComDLT() 2518 2412 : m_bDltPresentFlag(false) … … 2740 2634 } 2741 2635 #endif 2742 #if H_3D 2743 #if !CAM_HLS_F0136_F0045_F0082 2744 Void 2745 TComSPS::initCamParaSPS( UInt uiViewIndex, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset ) 2746 { 2747 AOT( uiViewIndex != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) ); 2748 2749 m_uiCamParPrecision = ( uiViewIndex ? uiCamParPrecision : 0 ); 2750 m_bCamParInSliceHeader = ( uiViewIndex ? bCamParSlice : false ); 2751 ::memset( m_aaiCodedScale, 0x00, sizeof( m_aaiCodedScale ) ); 2752 ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); 2753 2754 if( !m_bCamParInSliceHeader ) 2755 { 2756 for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < uiViewIndex; uiBaseViewIndex++ ) 2757 { 2758 m_aaiCodedScale [ 0 ][ uiBaseViewIndex ] = aaiScale [ uiBaseViewIndex ][ uiViewIndex ]; 2759 m_aaiCodedScale [ 1 ][ uiBaseViewIndex ] = aaiScale [ uiViewIndex ][ uiBaseViewIndex ]; 2760 m_aaiCodedOffset[ 0 ][ uiBaseViewIndex ] = aaiOffset[ uiBaseViewIndex ][ uiViewIndex ]; 2761 m_aaiCodedOffset[ 1 ][ uiBaseViewIndex ] = aaiOffset[ uiViewIndex ][ uiBaseViewIndex ]; 2762 } 2763 } 2764 } 2765 #endif 2766 #endif 2636 2767 2637 TComReferencePictureSet::TComReferencePictureSet() 2768 2638 : m_numberOfPictures (0) … … 3423 3293 assert( m_depthToDisparityF != NULL ); 3424 3294 3425 #if CAM_HLS_F0136_F0045_F00823426 3295 TComVPS* vps = getVPS(); 3427 #else 3428 TComSPS* sps = getSPS(); 3429 #endif 3430 3431 #if CAM_HLS_F0136_F0045_F0082 3296 3432 3297 Int log2Div = g_bitDepthY - 1 + vps->getCamParPrecision(); 3433 3298 Int viewIndex = getViewIndex(); … … 3439 3304 Int* invCodScale = camParaSH ? m_aaiCodedScale [ 1 ] : vps->getInvCodedScale ( viewIndex ); 3440 3305 Int* invCodOffset = camParaSH ? m_aaiCodedOffset[ 1 ] : vps->getInvCodedOffset( viewIndex ); 3441 #else3442 Int log2Div = g_bitDepthY - 1 + sps->getCamParPrecision();3443 3444 Bool camParaSH = m_pcSPS->hasCamParInSliceHeader();3445 3446 Int* codScale = camParaSH ? m_aaiCodedScale [ 0 ] : sps->getCodedScale ();3447 Int* codOffset = camParaSH ? m_aaiCodedOffset[ 0 ] : sps->getCodedOffset ();3448 Int* invCodScale = camParaSH ? m_aaiCodedScale [ 1 ] : sps->getInvCodedScale ();3449 Int* invCodOffset = camParaSH ? m_aaiCodedOffset[ 1 ] : sps->getInvCodedOffset();3450 #endif3451 3306 3452 3307 for (Int i = 0; i <= ( getViewIndex() - 1); i++) -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComSlice.h
r766 r767 791 791 Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; 792 792 793 #if H_3D_DIM_DLT794 #if !DLT_DIFF_CODING_IN_PPS795 Bool m_bUseDLTFlag [MAX_NUM_LAYERS ];796 797 Int m_iBitsPerDepthValue [MAX_NUM_LAYERS ];798 Int m_iNumDepthmapValues [MAX_NUM_LAYERS ];799 Int* m_iDepthValue2Idx [MAX_NUM_LAYERS ];800 Int* m_iIdx2DepthValue [MAX_NUM_LAYERS ];801 #endif802 #endif803 804 793 #if H_3D 805 #if CAM_HLS_F0136_F0045_F0082806 794 UInt m_uiCamParPrecision; 807 795 Bool* m_bCamParInSliceHeader; … … 809 797 Int ***m_aaaiCodedScale ; 810 798 Int ***m_aaaiCodedOffset; 811 #endif812 799 Bool m_ivMvScalingFlag; 813 800 #endif … … 1048 1035 Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } 1049 1036 #endif 1050 #if CAM_HLS_F0136_F0045_F0082 1037 1051 1038 Void createCamPars(Int iNumViews); 1052 1039 Void deleteCamPars(); … … 1060 1047 Int* getInvCodedScale ( Int viewIndex ) { return m_aaaiCodedScale [viewIndex][1]; } 1061 1048 Int* getInvCodedOffset ( Int viewIndex ) { return m_aaaiCodedOffset[viewIndex][1]; } 1062 #endif1063 1049 1064 1050 #if H_3D_IV_MERGE … … 1081 1067 Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } 1082 1068 1083 #if H_3D_DIM_DLT1084 #if !DLT_DIFF_CODING_IN_PPS1085 Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; }1086 Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; }1087 1088 Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; }1089 Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); }1090 Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; }1091 Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; }1092 Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );1093 #endif1094 #endif1095 1096 1069 Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } 1097 1070 Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } … … 1108 1081 }; 1109 1082 1110 #if DLT_DIFF_CODING_IN_PPS1083 #if H_3D 1111 1084 class TComDLT 1112 1085 { … … 1684 1657 Bool getUsePC () { return m_bUsePC; } 1685 1658 #endif 1686 #if H_3D1687 #if !CAM_HLS_F0136_F0045_F00821688 Void initCamParaSPS ( UInt uiViewIndex, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );1689 UInt getCamParPrecision () { return m_uiCamParPrecision; }1690 Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; }1691 Void setHasCamParInSliceHeader( Bool b ) { m_bCamParInSliceHeader = b; }1692 Int* getCodedScale () { return m_aaiCodedScale [0]; }1693 Int* getCodedOffset () { return m_aaiCodedOffset[0]; }1694 Int* getInvCodedScale () { return m_aaiCodedScale [1]; }1695 Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; }1696 #endif1697 #endif1698 1659 #if H_MV 1699 1660 Int getLayerId () { return m_layerId; } … … 1801 1762 #endif 1802 1763 1803 #if DLT_DIFF_CODING_IN_PPS1764 #if H_3D 1804 1765 TComDLT* m_pcDLT; 1805 1766 #endif … … 1830 1791 UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } 1831 1792 1832 #if DLT_DIFF_CODING_IN_PPS1793 #if H_3D 1833 1794 Void setDLT ( TComDLT* pcDLT ) { m_pcDLT = pcDLT; } 1834 1795 TComDLT* getDLT () { return m_pcDLT; } -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h
r766 r767 145 145 // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate 146 146 // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode 147 148 149 150 151 147 #define H_3D_TMVP 1 // QC_TMVP_C0047 152 148 // Sony_M23639 … … 195 191 #endif 196 192 197 #define CAM_HLS_F0136_F0045_F0082 1 // JCT3V-F0136/F0045: view order index based camera parameter signaling198 // JCT3V-F0082: the cp_in_slice_segment_layer_flag to be view specific and used as a condition of the presence of slice header level camera parameters199 #define CAM_HLS_F0044 1 // JCT3V-F0044: move camera parameter from slice header extension to slice header200 201 202 193 // Rate Control 203 194 #define KWU_FIX_URQ 1 … … 242 233 243 234 #if H_3D_DIM_DLT 244 #define DLT_DIFF_CODING_IN_PPS 1 // moving DLT syntax elements from VPS to PPS and differential coding of DLT values 245 // JCT3V-F0131, JCT3V-F0139 246 #if DLT_DIFF_CODING_IN_PPS 247 #define Log2( n ) ( log((double)n) / log(2.0) ) 248 #endif 235 #define Log2( n ) ( log((double)n) / log(2.0) ) // Ed.(GT): This is very very bad and should be fixed to used integer arithmetics ( see gCeilLog2 ) moreover it should not be defined in the tool macro section! 249 236 #define H_3D_DELTA_DLT 1 250 237 #endif
Note: See TracChangeset for help on using the changeset viewer.