Changeset 475 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibCommon
- Timestamp:
- 15 Nov 2013, 14:55:37 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source/Lib/TLibCommon
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPic.cpp
r459 r475 79 79 } 80 80 #if SVC_UPSAMPLING 81 #if AUXILIARY_PICTURES 82 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 83 Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual) 84 #else 81 85 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 82 86 Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual) 83 87 #endif 84 88 { 85 89 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 86 90 if (!bIsVirtual) 87 91 { 92 #if AUXILIARY_PICTURES 93 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 94 #else 88 95 m_apcPicYuv[0] = new TComPicYuv; m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 89 } 96 #endif 97 } 98 #if AUXILIARY_PICTURES 99 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 100 #else 90 101 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 102 #endif 91 103 92 104 for( Int i = 0; i < MAX_LAYERS; i++ ) … … 94 106 if( m_bSpatialEnhLayer[i] ) 95 107 { 108 #if AUXILIARY_PICTURES 109 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 110 #else 96 111 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 112 #endif 97 113 } 98 114 } … … 407 423 { 408 424 m_pNDBFilterYuvTmp = new TComPicYuv(); 425 #if AUXILIARY_PICTURES 426 m_pNDBFilterYuvTmp->create(picWidth, picHeight, getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); 427 #else 409 428 m_pNDBFilterYuvTmp->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); 429 #endif 430 410 431 } 411 432 -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPic.h
r459 r475 102 102 virtual ~TComPic(); 103 103 104 #if AUXILIARY_PICTURES 105 #if SVC_UPSAMPLING 106 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 107 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 108 #else 109 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 110 Int *numReorderPics, Bool bIsVirtual = false ); 111 #endif 112 #else 104 113 #if SVC_UPSAMPLING 105 114 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 108 117 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 109 118 Int *numReorderPics, Bool bIsVirtual = false ); 119 #endif 110 120 #endif 111 121 virtual Void destroy(); … … 166 176 167 177 Int getStride() { return m_apcPicYuv[1]->getStride(); } 178 #if AUXILIARY_PICTURES 179 ChromaFormat getChromaFormat() const { return m_apcPicYuv[1]->getChromaFormat(); } 180 #endif 168 181 Int getCStride() { return m_apcPicYuv[1]->getCStride(); } 169 182 -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r467 r475 67 67 { 68 68 } 69 #if AUXILIARY_PICTURES 70 #if SVC_UPSAMPLING 71 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 72 #else 73 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 74 #endif 75 #else 69 76 #if SVC_UPSAMPLING 70 77 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 71 78 #else 72 79 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 80 #endif 73 81 #endif 74 82 { … … 86 94 m_iCuWidth = uiMaxCUWidth; 87 95 m_iCuHeight = uiMaxCUHeight; 96 #if AUXILIARY_PICTURES 97 m_chromaFormatIDC = chromaFormatIDC; 98 #endif 88 99 89 100 Int numCuInWidth = m_iPicWidth / m_iCuWidth + (m_iPicWidth % m_iCuWidth != 0); … … 239 250 } 240 251 252 #if AUXILIARY_PICTURES 253 Void TComPicYuv::convertToMonochrome() 254 { 255 Int numPix = ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1)); 256 Pel grayVal = (1 << (g_bitDepthC - 1)); 257 258 for (UInt i = 0; i < numPix; i++) 259 { 260 m_apiPicBufU[i] = grayVal; 261 m_apiPicBufV[i] = grayVal; 262 } 263 } 264 #endif 265 241 266 Void TComPicYuv::extendPicBorder () 242 267 { -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.h
r313 r475 75 75 Int m_iPicWidth; ///< Width of picture 76 76 Int m_iPicHeight; ///< Height of picture 77 #if AUXILIARY_PICTURES 78 ChromaFormat m_chromaFormatIDC; ////< Chroma Format 79 #endif 77 80 78 81 Int m_iCuWidth; ///< Width of Coding Unit (CU) … … 108 111 // Memory management 109 112 // ------------------------------------------------------------------------------------------------ 113 #if AUXILIARY_PICTURES 114 #if SVC_UPSAMPLING 115 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); 116 #else 117 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 118 #endif 119 #else 110 120 #if SVC_UPSAMPLING 111 121 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); … … 113 123 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 114 124 #endif 125 #endif 115 126 116 127 Void destroy (); … … 125 136 Int getWidth () { return m_iPicWidth; } 126 137 Int getHeight () { return m_iPicHeight; } 138 #if AUXILIARY_PICTURES 139 ChromaFormat getChromaFormat () const { return m_chromaFormatIDC; } 140 #endif 127 141 128 142 #if SVC_EXTENSION … … 184 198 #endif 185 199 200 #if AUXILIARY_PICTURES 201 Void convertToMonochrome(); 202 #endif 203 186 204 // Set border extension flag 187 205 Void setBorderExtension(Bool b) { m_bIsBorderExtended = b; } -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r470 r475 1840 1840 return retVal; 1841 1841 } 1842 #if AUXILIARY_PICTURES 1843 ChromaFormat TComSlice::getChromaFormatIdc() 1844 #else 1842 1845 UInt TComSlice::getChromaFormatIdc() 1846 #endif 1847 { 1848 TComSPS *sps = getSPS(); 1849 TComVPS *vps = getVPS(); 1850 #if AUXILIARY_PICTURES 1851 ChromaFormat retVal; 1852 UInt layerId = getLayerId(); 1853 #else 1854 UInt retVal, layerId = getLayerId(); 1855 #endif 1856 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1857 { 1858 retVal = sps->getChromaFormatIdc(); 1859 } 1860 else 1861 { 1862 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc(); 1863 } 1864 return retVal; 1865 } 1866 UInt TComSlice::getBitDepthY() 1843 1867 { 1844 1868 TComSPS *sps = getSPS(); … … 1847 1871 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1848 1872 { 1849 retVal = sps->get ChromaFormatIdc();1873 retVal = sps->getBitDepthY(); 1850 1874 } 1851 1875 else 1852 1876 { 1853 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->get ChromaFormatVpsIdc();1877 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma(); 1854 1878 } 1855 1879 return retVal; 1856 1880 } 1857 UInt TComSlice::getBitDepth Y()1881 UInt TComSlice::getBitDepthC() 1858 1882 { 1859 1883 TComSPS *sps = getSPS(); … … 1862 1886 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() ) 1863 1887 { 1864 retVal = sps->getBitDepth Y();1888 retVal = sps->getBitDepthC(); 1865 1889 } 1866 1890 else 1867 1891 { 1868 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVps Luma();1892 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma(); 1869 1893 } 1870 1894 return retVal; 1871 1895 } 1872 UInt TComSlice::getBitDepthC()1873 {1874 TComSPS *sps = getSPS();1875 TComVPS *vps = getVPS();1876 UInt retVal, layerId = getLayerId();1877 if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )1878 {1879 retVal = sps->getBitDepthC();1880 }1881 else1882 {1883 retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma();1884 }1885 return retVal;1886 }1887 1896 Int TComSlice::getQpBDOffsetY() 1888 1897 { … … 1895 1904 1896 1905 RepFormat::RepFormat() 1906 #if AUXILIARY_PICTURES 1907 : m_chromaFormatVpsIdc (CHROMA_420) 1908 #else 1897 1909 : m_chromaFormatVpsIdc (0) 1910 #endif 1898 1911 , m_separateColourPlaneVpsFlag (false) 1899 1912 , m_picWidthVpsInLumaSamples (0) -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.h
r466 r475 436 436 class RepFormat 437 437 { 438 #if AUXILIARY_PICTURES 439 ChromaFormat m_chromaFormatVpsIdc; 440 #else 438 441 Int m_chromaFormatVpsIdc; 442 #endif 439 443 Bool m_separateColourPlaneVpsFlag; 440 444 Int m_picWidthVpsInLumaSamples; … … 446 450 RepFormat(); 447 451 452 #if AUXILIARY_PICTURES 453 ChromaFormat getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 454 Void setChromaFormatVpsIdc(ChromaFormat x) { m_chromaFormatVpsIdc = x; } 455 #else 448 456 Int getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } 449 457 Void setChromaFormatVpsIdc(Int x) { m_chromaFormatVpsIdc = x; } 458 #endif 450 459 451 460 Bool getSeparateColourPlaneVpsFlag() { return m_separateColourPlaneVpsFlag; } … … 1072 1081 Int m_SPSId; 1073 1082 Int m_VPSId; 1083 #if AUXILIARY_PICTURES 1084 ChromaFormat m_chromaFormatIdc; 1085 #else 1074 1086 Int m_chromaFormatIdc; 1087 #endif 1075 1088 1076 1089 UInt m_uiMaxTLayers; // maximum number of temporal layers … … 1182 1195 Int getSPSId () { return m_SPSId; } 1183 1196 Void setSPSId (Int i) { m_SPSId = i; } 1197 #if AUXILIARY_PICTURES 1198 ChromaFormat getChromaFormatIdc () { return m_chromaFormatIdc; } 1199 #else 1184 1200 Int getChromaFormatIdc () { return m_chromaFormatIdc; } 1185 Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } 1186 1201 #endif 1202 Void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; } 1203 1204 #if AUXILIARY_PICTURES 1205 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } 1206 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } 1207 #else 1187 1208 static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } 1188 1209 static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } 1210 #endif 1189 1211 1190 1212 // structure … … 2069 2091 UInt getPicWidthInLumaSamples(); 2070 2092 UInt getPicHeightInLumaSamples(); 2093 #if AUXILIARY_PICTURES 2094 ChromaFormat getChromaFormatIdc(); 2095 #else 2071 2096 UInt getChromaFormatIdc(); 2097 #endif 2072 2098 UInt getBitDepthY(); 2073 2099 UInt getBitDepthC(); -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h
r470 r475 153 153 154 154 #define O0215_PHASE_ALIGNMENT 1 // JCTVC_O0215: signal a flag to specify phase alignment case, 0: zero-position-aligned, 1: central-position-aligned, 155 #define AUXILIARY_PICTURES 1 155 156 156 157 #else … … 464 465 CHROMA_422 = 2, 465 466 CHROMA_444 = 3 467 #if AUXILIARY_PICTURES 468 ,NUM_CHROMA_FORMAT = 4 469 #endif 466 470 }; 467 471
Note: See TracChangeset for help on using the changeset viewer.