Changeset 916 in SHVCSoftware for branches/SHM-upgrade/source/Lib/TLibCommon/TComRom.cpp
- Timestamp:
- 12 Nov 2014, 08:09:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-upgrade/source/Lib/TLibCommon/TComRom.cpp
r815 r916 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2014, ITU/ISO/IEC … … 40 40 #include <stdlib.h> 41 41 #include <stdio.h> 42 #include <iomanip> 43 #include <assert.h> 44 #include "TComDataCU.h" 45 #include "Debug.h" 42 46 // ==================================================================================================================== 43 47 // Initialize / destroy functions … … 47 51 //! \{ 48 52 53 class ScanGenerator 54 { 55 private: 56 UInt m_line, m_column; 57 const UInt m_blockWidth, m_blockHeight; 58 const UInt m_stride; 59 const COEFF_SCAN_TYPE m_scanType; 60 61 public: 62 ScanGenerator(UInt blockWidth, UInt blockHeight, UInt stride, COEFF_SCAN_TYPE scanType) 63 : m_line(0), m_column(0), m_blockWidth(blockWidth), m_blockHeight(blockHeight), m_stride(stride), m_scanType(scanType) 64 { } 65 66 UInt GetCurrentX() const { return m_column; } 67 UInt GetCurrentY() const { return m_line; } 68 69 UInt GetNextIndex(UInt blockOffsetX, UInt blockOffsetY) 70 { 71 Int rtn=((m_line + blockOffsetY) * m_stride) + m_column + blockOffsetX; 72 73 //advance line and column to the next position 74 switch (m_scanType) 75 { 76 //------------------------------------------------ 77 78 case SCAN_DIAG: 79 { 80 if ((m_column == (m_blockWidth - 1)) || (m_line == 0)) //if we reach the end of a rank, go diagonally down to the next one 81 { 82 m_line += m_column + 1; 83 m_column = 0; 84 85 if (m_line >= m_blockHeight) //if that takes us outside the block, adjust so that we are back on the bottom row 86 { 87 m_column += m_line - (m_blockHeight - 1); 88 m_line = m_blockHeight - 1; 89 } 90 } 91 else 92 { 93 m_column++; 94 m_line--; 95 } 96 } 97 break; 98 99 //------------------------------------------------ 100 101 case SCAN_HOR: 102 { 103 if (m_column == (m_blockWidth - 1)) 104 { 105 m_line++; 106 m_column = 0; 107 } 108 else m_column++; 109 } 110 break; 111 112 //------------------------------------------------ 113 114 case SCAN_VER: 115 { 116 if (m_line == (m_blockHeight - 1)) 117 { 118 m_column++; 119 m_line = 0; 120 } 121 else m_line++; 122 } 123 break; 124 125 //------------------------------------------------ 126 127 default: 128 { 129 std::cerr << "ERROR: Unknown scan type \"" << m_scanType << "\"in ScanGenerator::GetNextIndex" << std::endl; 130 exit(1); 131 } 132 break; 133 } 134 135 return rtn; 136 } 137 }; 138 49 139 // initialize ROM variables 50 140 Void initROM() 51 141 { 52 142 Int i, c; 53 143 54 144 // g_aucConvertToBit[ x ]: log2(x/4), if x=4 -> 0, x=8 -> 1, x=16 -> 2, ... 55 145 ::memset( g_aucConvertToBit, -1, sizeof( g_aucConvertToBit ) ); … … 60 150 c++; 61 151 } 62 63 c=2; 64 for ( i=0; i<MAX_CU_DEPTH; i++ ) 65 { 66 g_auiSigLastScan[0][i] = new UInt[ c*c ]; 67 g_auiSigLastScan[1][i] = new UInt[ c*c ]; 68 g_auiSigLastScan[2][i] = new UInt[ c*c ]; 69 initSigLastScan( g_auiSigLastScan[0][i], g_auiSigLastScan[1][i], g_auiSigLastScan[2][i], c, c); 70 71 c <<= 1; 72 } 152 153 // initialise scan orders 154 for(UInt log2BlockHeight = 0; log2BlockHeight < MAX_CU_DEPTH; log2BlockHeight++) 155 { 156 for(UInt log2BlockWidth = 0; log2BlockWidth < MAX_CU_DEPTH; log2BlockWidth++) 157 { 158 const UInt blockWidth = 1 << log2BlockWidth; 159 const UInt blockHeight = 1 << log2BlockHeight; 160 const UInt totalValues = blockWidth * blockHeight; 161 162 //-------------------------------------------------------------------------------------------------- 163 164 //non-grouped scan orders 165 166 for (UInt scanTypeIndex = 0; scanTypeIndex < SCAN_NUMBER_OF_TYPES; scanTypeIndex++) 167 { 168 const COEFF_SCAN_TYPE scanType = COEFF_SCAN_TYPE(scanTypeIndex); 169 170 g_scanOrder[SCAN_UNGROUPED][scanType][log2BlockWidth][log2BlockHeight] = new UInt[totalValues]; 171 172 ScanGenerator fullBlockScan(blockWidth, blockHeight, blockWidth, scanType); 173 174 for (UInt scanPosition = 0; scanPosition < totalValues; scanPosition++) 175 { 176 g_scanOrder[SCAN_UNGROUPED][scanType][log2BlockWidth][log2BlockHeight][scanPosition] = fullBlockScan.GetNextIndex(0, 0); 177 } 178 } 179 180 //-------------------------------------------------------------------------------------------------- 181 182 //grouped scan orders 183 184 const UInt groupWidth = 1 << MLS_CG_LOG2_WIDTH; 185 const UInt groupHeight = 1 << MLS_CG_LOG2_HEIGHT; 186 const UInt widthInGroups = blockWidth >> MLS_CG_LOG2_WIDTH; 187 const UInt heightInGroups = blockHeight >> MLS_CG_LOG2_HEIGHT; 188 189 const UInt groupSize = groupWidth * groupHeight; 190 const UInt totalGroups = widthInGroups * heightInGroups; 191 192 for (UInt scanTypeIndex = 0; scanTypeIndex < SCAN_NUMBER_OF_TYPES; scanTypeIndex++) 193 { 194 const COEFF_SCAN_TYPE scanType = COEFF_SCAN_TYPE(scanTypeIndex); 195 196 g_scanOrder[SCAN_GROUPED_4x4][scanType][log2BlockWidth][log2BlockHeight] = new UInt[totalValues]; 197 198 ScanGenerator fullBlockScan(widthInGroups, heightInGroups, groupWidth, scanType); 199 200 for (UInt groupIndex = 0; groupIndex < totalGroups; groupIndex++) 201 { 202 const UInt groupPositionY = fullBlockScan.GetCurrentY(); 203 const UInt groupPositionX = fullBlockScan.GetCurrentX(); 204 const UInt groupOffsetX = groupPositionX * groupWidth; 205 const UInt groupOffsetY = groupPositionY * groupHeight; 206 const UInt groupOffsetScan = groupIndex * groupSize; 207 208 ScanGenerator groupScan(groupWidth, groupHeight, blockWidth, scanType); 209 210 for (UInt scanPosition = 0; scanPosition < groupSize; scanPosition++) 211 { 212 g_scanOrder[SCAN_GROUPED_4x4][scanType][log2BlockWidth][log2BlockHeight][groupOffsetScan + scanPosition] = groupScan.GetNextIndex(groupOffsetX, groupOffsetY); 213 } 214 215 fullBlockScan.GetNextIndex(0,0); 216 } 217 } 218 219 //-------------------------------------------------------------------------------------------------- 220 } 221 } 73 222 } 74 223 75 224 Void destroyROM() 76 225 { 77 for (Int i=0; i<MAX_CU_DEPTH; i++ ) 78 { 79 delete[] g_auiSigLastScan[0][i]; 80 delete[] g_auiSigLastScan[1][i]; 81 delete[] g_auiSigLastScan[2][i]; 226 for(UInt groupTypeIndex = 0; groupTypeIndex < SCAN_NUMBER_OF_GROUP_TYPES; groupTypeIndex++) 227 { 228 for (UInt scanOrderIndex = 0; scanOrderIndex < SCAN_NUMBER_OF_TYPES; scanOrderIndex++) 229 { 230 for (UInt log2BlockWidth = 0; log2BlockWidth < MAX_CU_DEPTH; log2BlockWidth++) 231 { 232 for (UInt log2BlockHeight = 0; log2BlockHeight < MAX_CU_DEPTH; log2BlockHeight++) 233 { 234 delete [] g_scanOrder[groupTypeIndex][scanOrderIndex][log2BlockWidth][log2BlockHeight]; 235 } 236 } 237 } 82 238 } 83 239 } … … 96 252 UInt g_auiRasterToPelY [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, }; 97 253 98 UInt g_auiPUOffset[ 8] = { 0, 8, 4, 4, 2, 10, 1, 5};254 UInt g_auiPUOffset[NUMBER_OF_PART_SIZES] = { 0, 8, 4, 4, 2, 10, 1, 5}; 99 255 100 256 Void initZscanToRaster ( Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt*& rpuiCurrIdx ) 101 257 { 102 258 Int iStride = 1 << ( iMaxDepth - 1 ); 103 259 104 260 if ( iDepth == iMaxDepth ) 105 261 { … … 121 277 UInt uiMinCUWidth = uiMaxCUWidth >> ( uiMaxDepth - 1 ); 122 278 UInt uiMinCUHeight = uiMaxCUHeight >> ( uiMaxDepth - 1 ); 123 279 124 280 UInt uiNumPartInWidth = (UInt)uiMaxCUWidth / uiMinCUWidth; 125 281 UInt uiNumPartInHeight = (UInt)uiMaxCUHeight / uiMinCUHeight; 126 282 127 283 for ( UInt i = 0; i < uiNumPartInWidth*uiNumPartInHeight; i++ ) 128 284 { … … 134 290 { 135 291 UInt i; 136 292 137 293 UInt* uiTempX = &g_auiRasterToPelX[0]; 138 294 UInt* uiTempY = &g_auiRasterToPelY[0]; 139 295 140 296 UInt uiMinCUWidth = uiMaxCUWidth >> ( uiMaxDepth - 1 ); 141 297 UInt uiMinCUHeight = uiMaxCUHeight >> ( uiMaxDepth - 1 ); 142 298 143 299 UInt uiNumPartInWidth = uiMaxCUWidth / uiMinCUWidth; 144 300 UInt uiNumPartInHeight = uiMaxCUHeight / uiMinCUHeight; 145 301 146 302 uiTempX[0] = 0; uiTempX++; 147 303 for ( i = 1; i < uiNumPartInWidth; i++ ) … … 154 310 uiTempX += uiNumPartInWidth; 155 311 } 156 312 157 313 for ( i = 1; i < uiNumPartInWidth*uiNumPartInHeight; i++ ) 158 314 { 159 315 uiTempY[i] = ( i / uiNumPartInWidth ) * uiMinCUWidth; 160 316 } 161 }; 162 163 164 Int g_quantScales[6] = 317 } 318 319 Int g_maxTrDynamicRange[MAX_NUM_CHANNEL_TYPE]; 320 321 Int g_quantScales[SCALING_LIST_REM_NUM] = 165 322 { 166 323 26214,23302,20560,18396,16384,14564 167 }; 168 169 Int g_invQuantScales[ 6] =324 }; 325 326 Int g_invQuantScales[SCALING_LIST_REM_NUM] = 170 327 { 171 328 40,45,51,57,64,72 172 329 }; 173 330 174 const Short g_aiT4[4][4] = 175 { 176 { 64, 64, 64, 64}, 177 { 83, 36,-36,-83}, 178 { 64,-64,-64, 64}, 179 { 36,-83, 83,-36} 180 }; 181 182 const Short g_aiT8[8][8] = 183 { 184 { 64, 64, 64, 64, 64, 64, 64, 64}, 185 { 89, 75, 50, 18,-18,-50,-75,-89}, 186 { 83, 36,-36,-83,-83,-36, 36, 83}, 187 { 75,-18,-89,-50, 50, 89, 18,-75}, 188 { 64,-64,-64, 64, 64,-64,-64, 64}, 189 { 50,-89, 18, 75,-75,-18, 89,-50}, 190 { 36,-83, 83,-36,-36, 83,-83, 36}, 191 { 18,-50, 75,-89, 89,-75, 50,-18} 192 }; 193 194 const Short g_aiT16[16][16] = 195 { 196 { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64}, 197 { 90, 87, 80, 70, 57, 43, 25, 9, -9,-25,-43,-57,-70,-80,-87,-90}, 198 { 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89}, 199 { 87, 57, 9,-43,-80,-90,-70,-25, 25, 70, 90, 80, 43, -9,-57,-87}, 200 { 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83}, 201 { 80, 9,-70,-87,-25, 57, 90, 43,-43,-90,-57, 25, 87, 70, -9,-80}, 202 { 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75}, 203 { 70,-43,-87, 9, 90, 25,-80,-57, 57, 80,-25,-90, -9, 87, 43,-70}, 204 { 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64}, 205 { 57,-80,-25, 90, -9,-87, 43, 70,-70,-43, 87, 9,-90, 25, 80,-57}, 206 { 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50}, 207 { 43,-90, 57, 25,-87, 70, 9,-80, 80, -9,-70, 87,-25,-57, 90,-43}, 208 { 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36}, 209 { 25,-70, 90,-80, 43, 9,-57, 87,-87, 57, -9,-43, 80,-90, 70,-25}, 210 { 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18}, 211 { 9,-25, 43,-57, 70,-80, 87,-90, 90,-87, 80,-70, 57,-43, 25, -9} 212 }; 213 214 const Short g_aiT32[32][32] = 215 { 216 { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64}, 217 { 90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13, 4, -4,-13,-22,-31,-38,-46,-54,-61,-67,-73,-78,-82,-85,-88,-90,-90}, 218 { 90, 87, 80, 70, 57, 43, 25, 9, -9,-25,-43,-57,-70,-80,-87,-90,-90,-87,-80,-70,-57,-43,-25, -9, 9, 25, 43, 57, 70, 80, 87, 90}, 219 { 90, 82, 67, 46, 22, -4,-31,-54,-73,-85,-90,-88,-78,-61,-38,-13, 13, 38, 61, 78, 88, 90, 85, 73, 54, 31, 4,-22,-46,-67,-82,-90}, 220 { 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89, 89, 75, 50, 18,-18,-50,-75,-89,-89,-75,-50,-18, 18, 50, 75, 89}, 221 { 88, 67, 31,-13,-54,-82,-90,-78,-46, -4, 38, 73, 90, 85, 61, 22,-22,-61,-85,-90,-73,-38, 4, 46, 78, 90, 82, 54, 13,-31,-67,-88}, 222 { 87, 57, 9,-43,-80,-90,-70,-25, 25, 70, 90, 80, 43, -9,-57,-87,-87,-57, -9, 43, 80, 90, 70, 25,-25,-70,-90,-80,-43, 9, 57, 87}, 223 { 85, 46,-13,-67,-90,-73,-22, 38, 82, 88, 54, -4,-61,-90,-78,-31, 31, 78, 90, 61, 4,-54,-88,-82,-38, 22, 73, 90, 67, 13,-46,-85}, 224 { 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83, 83, 36,-36,-83,-83,-36, 36, 83}, 225 { 82, 22,-54,-90,-61, 13, 78, 85, 31,-46,-90,-67, 4, 73, 88, 38,-38,-88,-73, -4, 67, 90, 46,-31,-85,-78,-13, 61, 90, 54,-22,-82}, 226 { 80, 9,-70,-87,-25, 57, 90, 43,-43,-90,-57, 25, 87, 70, -9,-80,-80, -9, 70, 87, 25,-57,-90,-43, 43, 90, 57,-25,-87,-70, 9, 80}, 227 { 78, -4,-82,-73, 13, 85, 67,-22,-88,-61, 31, 90, 54,-38,-90,-46, 46, 90, 38,-54,-90,-31, 61, 88, 22,-67,-85,-13, 73, 82, 4,-78}, 228 { 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75, 75,-18,-89,-50, 50, 89, 18,-75,-75, 18, 89, 50,-50,-89,-18, 75}, 229 { 73,-31,-90,-22, 78, 67,-38,-90,-13, 82, 61,-46,-88, -4, 85, 54,-54,-85, 4, 88, 46,-61,-82, 13, 90, 38,-67,-78, 22, 90, 31,-73}, 230 { 70,-43,-87, 9, 90, 25,-80,-57, 57, 80,-25,-90, -9, 87, 43,-70,-70, 43, 87, -9,-90,-25, 80, 57,-57,-80, 25, 90, 9,-87,-43, 70}, 231 { 67,-54,-78, 38, 85,-22,-90, 4, 90, 13,-88,-31, 82, 46,-73,-61, 61, 73,-46,-82, 31, 88,-13,-90, -4, 90, 22,-85,-38, 78, 54,-67}, 232 { 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64, 64,-64,-64, 64}, 233 { 61,-73,-46, 82, 31,-88,-13, 90, -4,-90, 22, 85,-38,-78, 54, 67,-67,-54, 78, 38,-85,-22, 90, 4,-90, 13, 88,-31,-82, 46, 73,-61}, 234 { 57,-80,-25, 90, -9,-87, 43, 70,-70,-43, 87, 9,-90, 25, 80,-57,-57, 80, 25,-90, 9, 87,-43,-70, 70, 43,-87, -9, 90,-25,-80, 57}, 235 { 54,-85, -4, 88,-46,-61, 82, 13,-90, 38, 67,-78,-22, 90,-31,-73, 73, 31,-90, 22, 78,-67,-38, 90,-13,-82, 61, 46,-88, 4, 85,-54}, 236 { 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50, 50,-89, 18, 75,-75,-18, 89,-50,-50, 89,-18,-75, 75, 18,-89, 50}, 237 { 46,-90, 38, 54,-90, 31, 61,-88, 22, 67,-85, 13, 73,-82, 4, 78,-78, -4, 82,-73,-13, 85,-67,-22, 88,-61,-31, 90,-54,-38, 90,-46}, 238 { 43,-90, 57, 25,-87, 70, 9,-80, 80, -9,-70, 87,-25,-57, 90,-43,-43, 90,-57,-25, 87,-70, -9, 80,-80, 9, 70,-87, 25, 57,-90, 43}, 239 { 38,-88, 73, -4,-67, 90,-46,-31, 85,-78, 13, 61,-90, 54, 22,-82, 82,-22,-54, 90,-61,-13, 78,-85, 31, 46,-90, 67, 4,-73, 88,-38}, 240 { 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36, 36,-83, 83,-36,-36, 83,-83, 36}, 241 { 31,-78, 90,-61, 4, 54,-88, 82,-38,-22, 73,-90, 67,-13,-46, 85,-85, 46, 13,-67, 90,-73, 22, 38,-82, 88,-54, -4, 61,-90, 78,-31}, 242 { 25,-70, 90,-80, 43, 9,-57, 87,-87, 57, -9,-43, 80,-90, 70,-25,-25, 70,-90, 80,-43, -9, 57,-87, 87,-57, 9, 43,-80, 90,-70, 25}, 243 { 22,-61, 85,-90, 73,-38, -4, 46,-78, 90,-82, 54,-13,-31, 67,-88, 88,-67, 31, 13,-54, 82,-90, 78,-46, 4, 38,-73, 90,-85, 61,-22}, 244 { 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18, 18,-50, 75,-89, 89,-75, 50,-18,-18, 50,-75, 89,-89, 75,-50, 18}, 245 { 13,-38, 61,-78, 88,-90, 85,-73, 54,-31, 4, 22,-46, 67,-82, 90,-90, 82,-67, 46,-22, -4, 31,-54, 73,-85, 90,-88, 78,-61, 38,-13}, 246 { 9,-25, 43,-57, 70,-80, 87,-90, 90,-87, 80,-70, 57,-43, 25, -9, -9, 25,-43, 57,-70, 80,-87, 90,-90, 87,-80, 70,-57, 43,-25, 9}, 247 { 4,-13, 22,-31, 38,-46, 54,-61, 67,-73, 78,-82, 85,-88, 90,-90, 90,-90, 88,-85, 82,-78, 73,-67, 61,-54, 46,-38, 31,-22, 13, -4} 248 }; 249 250 const UChar g_aucChromaScale[58]= 251 { 252 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16, 253 17,18,19,20,21,22,23,24,25,26,27,28,29,29,30,31,32, 254 33,33,34,34,35,35,36,36,37,37,38,39,40,41,42,43,44, 255 45,46,47,48,49,50,51 256 }; 257 258 259 // Mode-Dependent DCT/DST 260 const Short g_as_DST_MAT_4 [4][4]= 261 { 262 {29, 55, 74, 84}, 263 {74, 74, 0 , -74}, 264 {84, -29, -74, 55}, 265 {55, -84, 74, -29}, 266 }; 267 331 //-------------------------------------------------------------------------------------------------- 332 333 //structures 334 335 #define DEFINE_DST4x4_MATRIX(a,b,c,d) \ 336 { \ 337 { a, b, c, d }, \ 338 { c, c, 0, -c }, \ 339 { d, -a, -c, b }, \ 340 { b, -d, c, -a }, \ 341 } 342 343 #define DEFINE_DCT4x4_MATRIX(a,b,c) \ 344 { \ 345 { a, a, a, a}, \ 346 { b, c, -c, -b}, \ 347 { a, -a, -a, a}, \ 348 { c, -b, b, -c} \ 349 } 350 351 #define DEFINE_DCT8x8_MATRIX(a,b,c,d,e,f,g) \ 352 { \ 353 { a, a, a, a, a, a, a, a}, \ 354 { d, e, f, g, -g, -f, -e, -d}, \ 355 { b, c, -c, -b, -b, -c, c, b}, \ 356 { e, -g, -d, -f, f, d, g, -e}, \ 357 { a, -a, -a, a, a, -a, -a, a}, \ 358 { f, -d, g, e, -e, -g, d, -f}, \ 359 { c, -b, b, -c, -c, b, -b, c}, \ 360 { g, -f, e, -d, d, -e, f, -g} \ 361 } 362 363 #define DEFINE_DCT16x16_MATRIX(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) \ 364 { \ 365 { a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a}, \ 366 { h, i, j, k, l, m, n, o, -o, -n, -m, -l, -k, -j, -i, -h}, \ 367 { d, e, f, g, -g, -f, -e, -d, -d, -e, -f, -g, g, f, e, d}, \ 368 { i, l, o, -m, -j, -h, -k, -n, n, k, h, j, m, -o, -l, -i}, \ 369 { b, c, -c, -b, -b, -c, c, b, b, c, -c, -b, -b, -c, c, b}, \ 370 { j, o, -k, -i, -n, l, h, m, -m, -h, -l, n, i, k, -o, -j}, \ 371 { e, -g, -d, -f, f, d, g, -e, -e, g, d, f, -f, -d, -g, e}, \ 372 { k, -m, -i, o, h, n, -j, -l, l, j, -n, -h, -o, i, m, -k}, \ 373 { a, -a, -a, a, a, -a, -a, a, a, -a, -a, a, a, -a, -a, a}, \ 374 { l, -j, -n, h, -o, -i, m, k, -k, -m, i, o, -h, n, j, -l}, \ 375 { f, -d, g, e, -e, -g, d, -f, -f, d, -g, -e, e, g, -d, f}, \ 376 { m, -h, l, n, -i, k, o, -j, j, -o, -k, i, -n, -l, h, -m}, \ 377 { c, -b, b, -c, -c, b, -b, c, c, -b, b, -c, -c, b, -b, c}, \ 378 { n, -k, h, -j, m, o, -l, i, -i, l, -o, -m, j, -h, k, -n}, \ 379 { g, -f, e, -d, d, -e, f, -g, -g, f, -e, d, -d, e, -f, g}, \ 380 { o, -n, m, -l, k, -j, i, -h, h, -i, j, -k, l, -m, n, -o} \ 381 } 382 383 #define DEFINE_DCT32x32_MATRIX(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ 384 { \ 385 { a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a}, \ 386 { p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, -E, -D, -C, -B, -A, -z, -y, -x, -w, -v, -u, -t, -s, -r, -q, -p}, \ 387 { h, i, j, k, l, m, n, o, -o, -n, -m, -l, -k, -j, -i, -h, -h, -i, -j, -k, -l, -m, -n, -o, o, n, m, l, k, j, i, h}, \ 388 { q, t, w, z, C, -E, -B, -y, -v, -s, -p, -r, -u, -x, -A, -D, D, A, x, u, r, p, s, v, y, B, E, -C, -z, -w, -t, -q}, \ 389 { d, e, f, g, -g, -f, -e, -d, -d, -e, -f, -g, g, f, e, d, d, e, f, g, -g, -f, -e, -d, -d, -e, -f, -g, g, f, e, d}, \ 390 { r, w, B, -D, -y, -t, -p, -u, -z, -E, A, v, q, s, x, C, -C, -x, -s, -q, -v, -A, E, z, u, p, t, y, D, -B, -w, -r}, \ 391 { i, l, o, -m, -j, -h, -k, -n, n, k, h, j, m, -o, -l, -i, -i, -l, -o, m, j, h, k, n, -n, -k, -h, -j, -m, o, l, i}, \ 392 { s, z, -D, -w, -p, -v, -C, A, t, r, y, -E, -x, -q, -u, -B, B, u, q, x, E, -y, -r, -t, -A, C, v, p, w, D, -z, -s}, \ 393 { b, c, -c, -b, -b, -c, c, b, b, c, -c, -b, -b, -c, c, b, b, c, -c, -b, -b, -c, c, b, b, c, -c, -b, -b, -c, c, b}, \ 394 { t, C, -y, -p, -x, D, u, s, B, -z, -q, -w, E, v, r, A, -A, -r, -v, -E, w, q, z, -B, -s, -u, -D, x, p, y, -C, -t}, \ 395 { j, o, -k, -i, -n, l, h, m, -m, -h, -l, n, i, k, -o, -j, -j, -o, k, i, n, -l, -h, -m, m, h, l, -n, -i, -k, o, j}, \ 396 { u, -E, -t, -v, D, s, w, -C, -r, -x, B, q, y, -A, -p, -z, z, p, A, -y, -q, -B, x, r, C, -w, -s, -D, v, t, E, -u}, \ 397 { e, -g, -d, -f, f, d, g, -e, -e, g, d, f, -f, -d, -g, e, e, -g, -d, -f, f, d, g, -e, -e, g, d, f, -f, -d, -g, e}, \ 398 { v, -B, -p, -C, u, w, -A, -q, -D, t, x, -z, -r, -E, s, y, -y, -s, E, r, z, -x, -t, D, q, A, -w, -u, C, p, B, -v}, \ 399 { k, -m, -i, o, h, n, -j, -l, l, j, -n, -h, -o, i, m, -k, -k, m, i, -o, -h, -n, j, l, -l, -j, n, h, o, -i, -m, k}, \ 400 { w, -y, -u, A, s, -C, -q, E, p, D, -r, -B, t, z, -v, -x, x, v, -z, -t, B, r, -D, -p, -E, q, C, -s, -A, u, y, -w}, \ 401 { a, -a, -a, a, a, -a, -a, a, a, -a, -a, a, a, -a, -a, a, a, -a, -a, a, a, -a, -a, a, a, -a, -a, a, a, -a, -a, a}, \ 402 { x, -v, -z, t, B, -r, -D, p, -E, -q, C, s, -A, -u, y, w, -w, -y, u, A, -s, -C, q, E, -p, D, r, -B, -t, z, v, -x}, \ 403 { l, -j, -n, h, -o, -i, m, k, -k, -m, i, o, -h, n, j, -l, -l, j, n, -h, o, i, -m, -k, k, m, -i, -o, h, -n, -j, l}, \ 404 { y, -s, -E, r, -z, -x, t, D, -q, A, w, -u, -C, p, -B, -v, v, B, -p, C, u, -w, -A, q, -D, -t, x, z, -r, E, s, -y}, \ 405 { f, -d, g, e, -e, -g, d, -f, -f, d, -g, -e, e, g, -d, f, f, -d, g, e, -e, -g, d, -f, -f, d, -g, -e, e, g, -d, f}, \ 406 { z, -p, A, y, -q, B, x, -r, C, w, -s, D, v, -t, E, u, -u, -E, t, -v, -D, s, -w, -C, r, -x, -B, q, -y, -A, p, -z}, \ 407 { m, -h, l, n, -i, k, o, -j, j, -o, -k, i, -n, -l, h, -m, -m, h, -l, -n, i, -k, -o, j, -j, o, k, -i, n, l, -h, m}, \ 408 { A, -r, v, -E, -w, q, -z, -B, s, -u, D, x, -p, y, C, -t, t, -C, -y, p, -x, -D, u, -s, B, z, -q, w, E, -v, r, -A}, \ 409 { c, -b, b, -c, -c, b, -b, c, c, -b, b, -c, -c, b, -b, c, c, -b, b, -c, -c, b, -b, c, c, -b, b, -c, -c, b, -b, c}, \ 410 { B, -u, q, -x, E, y, -r, t, -A, -C, v, -p, w, -D, -z, s, -s, z, D, -w, p, -v, C, A, -t, r, -y, -E, x, -q, u, -B}, \ 411 { n, -k, h, -j, m, o, -l, i, -i, l, -o, -m, j, -h, k, -n, -n, k, -h, j, -m, -o, l, -i, i, -l, o, m, -j, h, -k, n}, \ 412 { C, -x, s, -q, v, -A, -E, z, -u, p, -t, y, -D, -B, w, -r, r, -w, B, D, -y, t, -p, u, -z, E, A, -v, q, -s, x, -C}, \ 413 { g, -f, e, -d, d, -e, f, -g, -g, f, -e, d, -d, e, -f, g, g, -f, e, -d, d, -e, f, -g, -g, f, -e, d, -d, e, -f, g}, \ 414 { D, -A, x, -u, r, -p, s, -v, y, -B, E, C, -z, w, -t, q, -q, t, -w, z, -C, -E, B, -y, v, -s, p, -r, u, -x, A, -D}, \ 415 { o, -n, m, -l, k, -j, i, -h, h, -i, j, -k, l, -m, n, -o, -o, n, -m, l, -k, j, -i, h, -h, i, -j, k, -l, m, -n, o}, \ 416 { E, -D, C, -B, A, -z, y, -x, w, -v, u, -t, s, -r, q, -p, p, -q, r, -s, t, -u, v, -w, x, -y, z, -A, B, -C, D, -E} \ 417 } 418 419 //-------------------------------------------------------------------------------------------------- 420 421 //coefficients 422 423 #if RExt__HIGH_PRECISION_FORWARD_TRANSFORM 424 const TMatrixCoeff g_aiT4 [TRANSFORM_NUMBER_OF_DIRECTIONS][4][4] = 425 { 426 DEFINE_DCT4x4_MATRIX (16384, 21266, 9224), 427 DEFINE_DCT4x4_MATRIX ( 64, 83, 36) 428 }; 429 430 const TMatrixCoeff g_aiT8 [TRANSFORM_NUMBER_OF_DIRECTIONS][8][8] = 431 { 432 DEFINE_DCT8x8_MATRIX (16384, 21266, 9224, 22813, 19244, 12769, 4563), 433 DEFINE_DCT8x8_MATRIX ( 64, 83, 36, 89, 75, 50, 18) 434 }; 435 436 const TMatrixCoeff g_aiT16[TRANSFORM_NUMBER_OF_DIRECTIONS][16][16] = 437 { 438 DEFINE_DCT16x16_MATRIX(16384, 21266, 9224, 22813, 19244, 12769, 4563, 23120, 22063, 20450, 17972, 14642, 11109, 6446, 2316), 439 DEFINE_DCT16x16_MATRIX( 64, 83, 36, 89, 75, 50, 18, 90, 87, 80, 70, 57, 43, 25, 9) 440 }; 441 442 const TMatrixCoeff g_aiT32[TRANSFORM_NUMBER_OF_DIRECTIONS][32][32] = 443 { 444 DEFINE_DCT32x32_MATRIX(16384, 21266, 9224, 22813, 19244, 12769, 4563, 23120, 22063, 20450, 17972, 14642, 11109, 6446, 2316, 23106, 22852, 22445, 21848, 20995, 19810, 18601, 17143, 15718, 13853, 11749, 9846, 7908, 5573, 3281, 946), 445 DEFINE_DCT32x32_MATRIX( 64, 83, 36, 89, 75, 50, 18, 90, 87, 80, 70, 57, 43, 25, 9, 90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13, 4) 446 }; 447 448 const TMatrixCoeff g_as_DST_MAT_4[TRANSFORM_NUMBER_OF_DIRECTIONS][4][4] = 449 { 450 DEFINE_DST4x4_MATRIX( 7424, 14081, 18893, 21505), 451 DEFINE_DST4x4_MATRIX( 29, 55, 74, 84) 452 }; 453 454 #else 455 456 const TMatrixCoeff g_aiT4 [TRANSFORM_NUMBER_OF_DIRECTIONS][4][4] = 457 { 458 DEFINE_DCT4x4_MATRIX ( 64, 83, 36), 459 DEFINE_DCT4x4_MATRIX ( 64, 83, 36) 460 }; 461 462 const TMatrixCoeff g_aiT8 [TRANSFORM_NUMBER_OF_DIRECTIONS][8][8] = 463 { 464 DEFINE_DCT8x8_MATRIX ( 64, 83, 36, 89, 75, 50, 18), 465 DEFINE_DCT8x8_MATRIX ( 64, 83, 36, 89, 75, 50, 18) 466 }; 467 468 const TMatrixCoeff g_aiT16[TRANSFORM_NUMBER_OF_DIRECTIONS][16][16] = 469 { 470 DEFINE_DCT16x16_MATRIX( 64, 83, 36, 89, 75, 50, 18, 90, 87, 80, 70, 57, 43, 25, 9), 471 DEFINE_DCT16x16_MATRIX( 64, 83, 36, 89, 75, 50, 18, 90, 87, 80, 70, 57, 43, 25, 9) 472 }; 473 474 const TMatrixCoeff g_aiT32[TRANSFORM_NUMBER_OF_DIRECTIONS][32][32] = 475 { 476 DEFINE_DCT32x32_MATRIX( 64, 83, 36, 89, 75, 50, 18, 90, 87, 80, 70, 57, 43, 25, 9, 90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13, 4), 477 DEFINE_DCT32x32_MATRIX( 64, 83, 36, 89, 75, 50, 18, 90, 87, 80, 70, 57, 43, 25, 9, 90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13, 4) 478 }; 479 480 const TMatrixCoeff g_as_DST_MAT_4[TRANSFORM_NUMBER_OF_DIRECTIONS][4][4] = 481 { 482 DEFINE_DST4x4_MATRIX( 29, 55, 74, 84), 483 DEFINE_DST4x4_MATRIX( 29, 55, 74, 84) 484 }; 485 #endif 486 487 488 //-------------------------------------------------------------------------------------------------- 489 490 #undef DEFINE_DST4x4_MATRIX 491 #undef DEFINE_DCT4x4_MATRIX 492 #undef DEFINE_DCT8x8_MATRIX 493 #undef DEFINE_DCT16x16_MATRIX 494 #undef DEFINE_DCT32x32_MATRIX 495 496 //-------------------------------------------------------------------------------------------------- 497 498 499 const UChar g_aucChromaScale[NUM_CHROMA_FORMAT][chromaQPMappingTableSize]= 500 { 501 //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57 502 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 503 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,29,30,31,32,33,33,34,34,35,35,36,36,37,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51 }, 504 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,51,51,51,51,51,51 }, 505 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,51,51,51,51,51,51 } 506 }; 268 507 269 508 // ==================================================================================================================== … … 277 516 8, // 4x4 278 517 8, // 8x8 279 3, // 16x16 280 3, // 32x32 281 3 // 64x64 518 3, // 16x16 519 3, // 32x32 520 3 // 64x64 282 521 }; 283 522 #else // FAST_UDI_USE_MPM … … 293 532 #endif // FAST_UDI_USE_MPM 294 533 295 // chroma 296 297 const UChar g_aucConvertTxtTypeToIdx[4] = { 0, 1, 1, 2 }; 298 534 const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE] = 535 //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, DM 536 { 0, 1, 2, 2, 2, 2, 3, 5, 7, 8, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31, DM_CHROMA_IDX}; 299 537 300 538 // ==================================================================================================================== … … 302 540 // ==================================================================================================================== 303 541 304 Int g_bitDepthY = 8;305 Int g_bitDepthC = 8; 306 307 UInt g_uiPCMBitDepthLuma = 8; // PCM bit-depth 308 UInt g_uiPCMBitDepthChroma = 8; // PCM bit-depth542 Int g_bitDepth [MAX_NUM_CHANNEL_TYPE] = {8, 8}; 543 #if O0043_BEST_EFFORT_DECODING 544 Int g_bitDepthInStream [MAX_NUM_CHANNEL_TYPE] = {8, 8}; // In the encoder, this is the same as g_bitDepth. In the decoder, this can vary from g_bitDepth if the decoder is forced to use 'best-effort decoding' at a particular bit-depth. 545 #endif 546 Int g_PCMBitDepth[MAX_NUM_CHANNEL_TYPE] = {8, 8}; // PCM bit-depth 309 547 310 548 // ==================================================================================================================== … … 315 553 316 554 #if ENC_DEC_TRACE 317 FILE* g_hTrace = NULL; 555 FILE* g_hTrace = NULL; // Set to NULL to open up a file. Set to stdout to use the current output 318 556 const Bool g_bEncDecTraceEnable = true; 319 557 const Bool g_bEncDecTraceDisable = false; … … 327 565 328 566 // scanning order table 329 UInt* g_auiSigLastScan[ 3 ][ MAX_CU_DEPTH ]; 330 331 const UInt g_sigLastScan8x8[ 3 ][ 4 ] = 332 { 333 {0, 2, 1, 3}, 334 {0, 1, 2, 3}, 335 {0, 2, 1, 3} 336 }; 337 UInt g_sigLastScanCG32x32[ 64 ]; 338 339 const UInt g_uiMinInGroup[ 10 ] = {0,1,2,3,4,6,8,12,16,24}; 340 const UInt g_uiGroupIdx[ 32 ] = {0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9}; 341 342 Void initSigLastScan(UInt* pBuffD, UInt* pBuffH, UInt* pBuffV, Int iWidth, Int iHeight) 343 { 344 const UInt uiNumScanPos = UInt( iWidth * iWidth ); 345 UInt uiNextScanPos = 0; 346 347 if( iWidth < 16 ) 348 { 349 UInt* pBuffTemp = pBuffD; 350 if( iWidth == 8 ) 351 { 352 pBuffTemp = g_sigLastScanCG32x32; 353 } 354 for( UInt uiScanLine = 0; uiNextScanPos < uiNumScanPos; uiScanLine++ ) 355 { 356 Int iPrimDim = Int( uiScanLine ); 357 Int iScndDim = 0; 358 while( iPrimDim >= iWidth ) 359 { 360 iScndDim++; 361 iPrimDim--; 362 } 363 while( iPrimDim >= 0 && iScndDim < iWidth ) 364 { 365 pBuffTemp[ uiNextScanPos ] = iPrimDim * iWidth + iScndDim ; 366 uiNextScanPos++; 367 iScndDim++; 368 iPrimDim--; 369 } 370 } 371 } 372 if( iWidth > 4 ) 373 { 374 UInt uiNumBlkSide = iWidth >> 2; 375 UInt uiNumBlks = uiNumBlkSide * uiNumBlkSide; 376 UInt log2Blk = g_aucConvertToBit[ uiNumBlkSide ] + 1; 377 378 for( UInt uiBlk = 0; uiBlk < uiNumBlks; uiBlk++ ) 379 { 380 uiNextScanPos = 0; 381 UInt initBlkPos = g_auiSigLastScan[ SCAN_DIAG ][ log2Blk ][ uiBlk ]; 382 if( iWidth == 32 ) 383 { 384 initBlkPos = g_sigLastScanCG32x32[ uiBlk ]; 385 } 386 UInt offsetY = initBlkPos / uiNumBlkSide; 387 UInt offsetX = initBlkPos - offsetY * uiNumBlkSide; 388 UInt offsetD = 4 * ( offsetX + offsetY * iWidth ); 389 UInt offsetScan = 16 * uiBlk; 390 for( UInt uiScanLine = 0; uiNextScanPos < 16; uiScanLine++ ) 391 { 392 Int iPrimDim = Int( uiScanLine ); 393 Int iScndDim = 0; 394 while( iPrimDim >= 4 ) 395 { 396 iScndDim++; 397 iPrimDim--; 398 } 399 while( iPrimDim >= 0 && iScndDim < 4 ) 400 { 401 pBuffD[ uiNextScanPos + offsetScan ] = iPrimDim * iWidth + iScndDim + offsetD; 402 uiNextScanPos++; 403 iScndDim++; 404 iPrimDim--; 405 } 406 } 407 } 408 } 409 410 UInt uiCnt = 0; 411 if( iWidth > 2 ) 412 { 413 UInt numBlkSide = iWidth >> 2; 414 for(Int blkY=0; blkY < numBlkSide; blkY++) 415 { 416 for(Int blkX=0; blkX < numBlkSide; blkX++) 417 { 418 UInt offset = blkY * 4 * iWidth + blkX * 4; 419 for(Int y=0; y < 4; y++) 420 { 421 for(Int x=0; x < 4; x++) 422 { 423 pBuffH[uiCnt] = y*iWidth + x + offset; 424 uiCnt ++; 425 } 426 } 427 } 428 } 429 430 uiCnt = 0; 431 for(Int blkX=0; blkX < numBlkSide; blkX++) 432 { 433 for(Int blkY=0; blkY < numBlkSide; blkY++) 434 { 435 UInt offset = blkY * 4 * iWidth + blkX * 4; 436 for(Int x=0; x < 4; x++) 437 { 438 for(Int y=0; y < 4; y++) 439 { 440 pBuffV[uiCnt] = y*iWidth + x + offset; 441 uiCnt ++; 442 } 443 } 444 } 445 } 446 } 447 else 448 { 449 for(Int iY=0; iY < iHeight; iY++) 450 { 451 for(Int iX=0; iX < iWidth; iX++) 452 { 453 pBuffH[uiCnt] = iY*iWidth + iX; 454 uiCnt ++; 455 } 456 } 457 458 uiCnt = 0; 459 for(Int iX=0; iX < iWidth; iX++) 460 { 461 for(Int iY=0; iY < iHeight; iY++) 462 { 463 pBuffV[uiCnt] = iY*iWidth + iX; 464 uiCnt ++; 465 } 466 } 467 } 468 } 469 470 Int g_quantTSDefault4x4[16] = 567 UInt* g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][ MAX_CU_DEPTH ][ MAX_CU_DEPTH ]; 568 569 const UInt ctxIndMap4x4[4*4] = 570 { 571 0, 1, 4, 5, 572 2, 3, 4, 5, 573 6, 6, 8, 8, 574 7, 7, 8, 8 575 }; 576 577 const UInt g_uiMinInGroup[ LAST_SIGNIFICANT_GROUPS ] = {0,1,2,3,4,6,8,12,16,24}; 578 const UInt g_uiGroupIdx[ MAX_TU_SIZE ] = {0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9}; 579 580 const Char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] = 581 { 582 { 583 "INTRA4X4_LUMA", 584 "INTRA4X4_CHROMAU", 585 "INTRA4X4_CHROMAV", 586 "INTER4X4_LUMA", 587 "INTER4X4_CHROMAU", 588 "INTER4X4_CHROMAV" 589 }, 590 { 591 "INTRA8X8_LUMA", 592 "INTRA8X8_CHROMAU", 593 "INTRA8X8_CHROMAV", 594 "INTER8X8_LUMA", 595 "INTER8X8_CHROMAU", 596 "INTER8X8_CHROMAV" 597 }, 598 { 599 "INTRA16X16_LUMA", 600 "INTRA16X16_CHROMAU", 601 "INTRA16X16_CHROMAV", 602 "INTER16X16_LUMA", 603 "INTER16X16_CHROMAU", 604 "INTER16X16_CHROMAV" 605 }, 606 { 607 "INTRA32X32_LUMA", 608 "INTRA32X32_CHROMAU_FROM16x16_CHROMAU", 609 "INTRA32X32_CHROMAV_FROM16x16_CHROMAV", 610 "INTER32X32_LUMA", 611 "INTER32X32_CHROMAU_FROM16x16_CHROMAU", 612 "INTER32X32_CHROMAV_FROM16x16_CHROMAV" 613 }, 614 }; 615 616 const Char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] = 617 { 618 { 619 }, 620 { 621 }, 622 { 623 "INTRA16X16_LUMA_DC", 624 "INTRA16X16_CHROMAU_DC", 625 "INTRA16X16_CHROMAV_DC", 626 "INTER16X16_LUMA_DC", 627 "INTER16X16_CHROMAU_DC", 628 "INTER16X16_CHROMAV_DC" 629 }, 630 { 631 "INTRA32X32_LUMA_DC", 632 "INTRA32X32_CHROMAU_DC_FROM16x16_CHROMAU", 633 "INTRA32X32_CHROMAV_DC_FROM16x16_CHROMAV", 634 "INTER32X32_LUMA_DC", 635 "INTER32X32_CHROMAU_DC_FROM16x16_CHROMAU", 636 "INTER32X32_CHROMAV_DC_FROM16x16_CHROMAV" 637 }, 638 }; 639 640 Int g_quantTSDefault4x4[4*4] = 471 641 { 472 642 16,16,16,16, … … 476 646 }; 477 647 478 Int g_quantIntraDefault8x8[ 64] =648 Int g_quantIntraDefault8x8[8*8] = 479 649 { 480 650 16,16,16,16,17,18,21,24, … … 488 658 }; 489 659 490 Int g_quantInterDefault8x8[ 64] =660 Int g_quantInterDefault8x8[8*8] = 491 661 { 492 662 16,16,16,16,17,18,20,24, … … 499 669 24,25,28,33,41,54,71,91 500 670 }; 501 UInt g_scalingListSize [4] = {16,64,256,1024}; 502 UInt g_scalingListSizeX [4] = { 4, 8, 16, 32}; 503 UInt g_scalingListNum[SCALING_LIST_SIZE_NUM]={6,6,6,2}; 504 Int g_eTTable[4] = {0,3,1,2}; 671 672 UInt g_scalingListSize [SCALING_LIST_SIZE_NUM] = {16,64,256,1024}; 673 UInt g_scalingListSizeX [SCALING_LIST_SIZE_NUM] = { 4, 8, 16, 32}; 505 674 506 675 #if SVC_EXTENSION … … 510 679 #endif 511 680 #if O0194_DIFFERENT_BITDEPTH_EL_BL 512 Int g_bitDepthYLayer[MAX_LAYERS]; 513 Int g_bitDepthCLayer[MAX_LAYERS]; 514 515 UInt g_uiPCMBitDepthLumaDec[MAX_LAYERS]; // PCM bit-depth 516 UInt g_uiPCMBitDepthChromaDec[MAX_LAYERS]; // PCM bit-depth 681 Int g_bitDepthLayer[MAX_NUM_CHANNEL_TYPE][MAX_LAYERS]; 517 682 #endif 518 683 #if O0194_WEIGHTED_PREDICTION_CGS
Note: See TracChangeset for help on using the changeset viewer.