Changeset 1246 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 14 Jul 2015, 00:26:07 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/AccessUnit.h
r1029 r1246 32 32 */ 33 33 34 /** 34 /** 35 35 \file AccessUnit.h 36 36 \brief Access Unit class (header) -
branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h
r1201 r1246 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 … … 224 224 225 225 // TODO: Existing names used for the different NAL unit types can be altered to better reflect the names in the spec. 226 // However, the names in the spec are not yet stable at this point. Once the names are stable, a cleanup 226 // However, the names in the spec are not yet stable at this point. Once the names are stable, a cleanup 227 227 // effort can be done without use of macros to alter the names used to indicate the different NAL unit types. 228 228 enum NalUnitType 229 229 { 230 NAL_UNIT_CODED_SLICE_TRAIL_N = 0, 231 NAL_UNIT_CODED_SLICE_TRAIL_R, // 1232 233 NAL_UNIT_CODED_SLICE_TSA_N, // 2230 NAL_UNIT_CODED_SLICE_TRAIL_N = 0, // 0 231 NAL_UNIT_CODED_SLICE_TRAIL_R, // 1 232 233 NAL_UNIT_CODED_SLICE_TSA_N, // 2 234 234 NAL_UNIT_CODED_SLICE_TSA_R, // 3 235 236 NAL_UNIT_CODED_SLICE_STSA_N, // 4237 NAL_UNIT_CODED_SLICE_STSA_R, // 5238 239 NAL_UNIT_CODED_SLICE_RADL_N, // 6235 236 NAL_UNIT_CODED_SLICE_STSA_N, // 4 237 NAL_UNIT_CODED_SLICE_STSA_R, // 5 238 239 NAL_UNIT_CODED_SLICE_RADL_N, // 6 240 240 NAL_UNIT_CODED_SLICE_RADL_R, // 7 241 242 NAL_UNIT_CODED_SLICE_RASL_N, // 8241 242 NAL_UNIT_CODED_SLICE_RASL_N, // 8 243 243 NAL_UNIT_CODED_SLICE_RASL_R, // 9 244 244 … … 252 252 NAL_UNIT_CODED_SLICE_BLA_W_LP, // 16 253 253 NAL_UNIT_CODED_SLICE_BLA_W_RADL, // 17 254 NAL_UNIT_CODED_SLICE_BLA_N_LP, // 18254 NAL_UNIT_CODED_SLICE_BLA_N_LP, // 18 255 255 NAL_UNIT_CODED_SLICE_IDR_W_RADL, // 19 256 NAL_UNIT_CODED_SLICE_IDR_N_LP, // 20257 NAL_UNIT_CODED_SLICE_CRA, // 21256 NAL_UNIT_CODED_SLICE_IDR_N_LP, // 20 257 NAL_UNIT_CODED_SLICE_CRA, // 21 258 258 NAL_UNIT_RESERVED_IRAP_VCL22, 259 259 NAL_UNIT_RESERVED_IRAP_VCL23, … … 268 268 NAL_UNIT_RESERVED_VCL31, 269 269 270 NAL_UNIT_VPS, // 32271 NAL_UNIT_SPS, // 33272 NAL_UNIT_PPS, // 34273 NAL_UNIT_ACCESS_UNIT_DELIMITER, // 35274 NAL_UNIT_EOS, // 36275 NAL_UNIT_EOB, // 37276 NAL_UNIT_FILLER_DATA, // 38270 NAL_UNIT_VPS, // 32 271 NAL_UNIT_SPS, // 33 272 NAL_UNIT_PPS, // 34 273 NAL_UNIT_ACCESS_UNIT_DELIMITER, // 35 274 NAL_UNIT_EOS, // 36 275 NAL_UNIT_EOB, // 37 276 NAL_UNIT_FILLER_DATA, // 38 277 277 NAL_UNIT_PREFIX_SEI, // 39 278 278 NAL_UNIT_SUFFIX_SEI, // 40 -
branches/SHM-dev/source/Lib/TLibCommon/ContextModel.cpp
r1029 r1246 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 -
branches/SHM-dev/source/Lib/TLibCommon/ContextModel.h
r1029 r1246 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 … … 60 60 ContextModel () { m_ucState = 0; m_binsCoded = 0; } 61 61 ~ContextModel () {} 62 62 63 63 UChar getState () { return ( m_ucState >> 1 ); } ///< get current state 64 64 UChar getMps () { return ( m_ucState & 1 ); } ///< get curret MPS 65 65 Void setStateAndMps( UChar ucState, UChar ucMPS) { m_ucState = (ucState << 1) + ucMPS; } ///< set state and MPS 66 66 67 67 Void init ( Int qp, Int initValue ); ///< initialize state with initial probability 68 68 69 69 Void updateLPS () 70 70 { 71 71 m_ucState = m_aucNextStateLPS[ m_ucState ]; 72 72 } 73 73 74 74 Void updateMPS () 75 75 { 76 76 m_ucState = m_aucNextStateMPS[ m_ucState ]; 77 77 } 78 78 79 79 Int getEntropyBits(Short val) { return m_entropyBits[m_ucState ^ val]; } 80 80 81 81 #if FAST_BIT_EST 82 82 Void update( Int binVal ) … … 89 89 Void setBinsCoded(UInt val) { m_binsCoded = val; } 90 90 UInt getBinsCoded() { return m_binsCoded; } 91 91 92 92 private: 93 93 UChar m_ucState; ///< internal state variable -
branches/SHM-dev/source/Lib/TLibCommon/ContextModel3DBuffer.cpp
r595 r1246 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 … … 69 69 { 70 70 ctxModel += sliceType * m_sizeXYZ; 71 71 72 72 for ( Int n = 0; n < m_sizeXYZ; n++ ) 73 73 { -
branches/SHM-dev/source/Lib/TLibCommon/ContextModel3DBuffer.h
r1029 r1246 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 … … 61 61 const UInt m_sizeXY; ///< X times Y size of 3D buffer 62 62 const UInt m_sizeXYZ; ///< total size of 3D buffer 63 63 64 64 public: 65 65 ContextModel3DBuffer ( UInt uiSizeZ, UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, Int &count ); 66 66 ~ContextModel3DBuffer () {} 67 67 68 68 // access functions 69 69 ContextModel& get( UInt uiZ, UInt uiY, UInt uiX ) … … 79 79 return &m_contextModel[ uiZ * m_sizeXY ]; 80 80 } 81 81 82 82 // initialization & copy functions 83 83 Void initBuffer( SliceType eSliceType, Int iQp, UChar* ctxModel ); ///< initialize 3D buffer by slice type & QP 84 84 85 85 UInt calcCost( SliceType sliceType, Int qp, UChar* ctxModel ); ///< determine cost of choosing a probability table based on current probabilities 86 86 /** copy from another buffer -
branches/SHM-dev/source/Lib/TLibCommon/ContextTables.h
r1029 r1246 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 … … 155 155 #define NUM_SAO_TYPE_IDX_CTX 1 ///< number of context models for SAO type index 156 156 157 #define NUM_TRANSFORMSKIP_FLAG_CTX 1 ///< number of context models for transform skipping 158 159 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX 1 157 #define NUM_TRANSFORMSKIP_FLAG_CTX 1 ///< number of context models for transform skipping 158 159 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX 1 160 160 161 161 #define NUM_CROSS_COMPONENT_PREDICTION_CTX 10 … … 172 172 INIT_CU_TRANSQUANT_BYPASS_FLAG[NUMBER_OF_SLICE_TYPES][NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX] = 173 173 { 174 { 154 }, 175 { 154 }, 176 { 154 }, 174 { 154 }, 175 { 154 }, 176 { 154 }, 177 177 }; 178 178 179 179 // initial probability for split flag 180 static const UChar 180 static const UChar 181 181 INIT_SPLIT_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SPLIT_FLAG_CTX] = 182 182 { 183 183 { 107, 139, 126, }, 184 { 107, 139, 126, }, 185 { 139, 141, 157, }, 186 }; 187 188 static const UChar 184 { 107, 139, 126, }, 185 { 139, 141, 157, }, 186 }; 187 188 static const UChar 189 189 INIT_SKIP_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SKIP_FLAG_CTX] = 190 190 { 191 { 197, 185, 201, }, 192 { 197, 185, 201, }, 193 { CNU, CNU, CNU, }, 191 { 197, 185, 201, }, 192 { 197, 185, 201, }, 193 { CNU, CNU, CNU, }, 194 194 }; 195 195 … … 197 197 INIT_MERGE_FLAG_EXT[NUMBER_OF_SLICE_TYPES][NUM_MERGE_FLAG_EXT_CTX] = 198 198 { 199 { 154, }, 200 { 110, }, 201 { CNU, }, 202 }; 203 204 static const UChar 199 { 154, }, 200 { 110, }, 201 { CNU, }, 202 }; 203 204 static const UChar 205 205 INIT_MERGE_IDX_EXT[NUMBER_OF_SLICE_TYPES][NUM_MERGE_IDX_EXT_CTX] = 206 206 { 207 { 137, }, 208 { 122, }, 209 { CNU, }, 210 }; 211 212 static const UChar 207 { 137, }, 208 { 122, }, 209 { CNU, }, 210 }; 211 212 static const UChar 213 213 INIT_PART_SIZE[NUMBER_OF_SLICE_TYPES][NUM_PART_SIZE_CTX] = 214 214 { 215 { 154, 139, 154, 216 { 154, 139, 154, 217 { 184, CNU, CNU, 218 }; 219 220 static const UChar 215 { 154, 139, 154, 154 }, 216 { 154, 139, 154, 154 }, 217 { 184, CNU, CNU, CNU }, 218 }; 219 220 static const UChar 221 221 INIT_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_PRED_MODE_CTX] = 222 222 { 223 { 134, }, 224 { 149, }, 225 { CNU, }, 226 }; 227 228 static const UChar 223 { 134, }, 224 { 149, }, 225 { CNU, }, 226 }; 227 228 static const UChar 229 229 INIT_INTRA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_ADI_CTX] = 230 230 { 231 { 183, }, 232 { 154, }, 233 { 184, }, 234 }; 235 236 static const UChar 231 { 183, }, 232 { 154, }, 233 { 184, }, 234 }; 235 236 static const UChar 237 237 INIT_CHROMA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_CHROMA_PRED_CTX] = 238 238 { 239 { 152, 139, }, 240 { 152, 139, }, 241 { 63, 139, }, 242 }; 243 244 static const UChar 239 { 152, 139, }, 240 { 152, 139, }, 241 { 63, 139, }, 242 }; 243 244 static const UChar 245 245 INIT_INTER_DIR[NUMBER_OF_SLICE_TYPES][NUM_INTER_DIR_CTX] = 246 246 { 247 { 95, 79, 63, 31, 31, }, 248 { 95, 79, 63, 31, 31, }, 249 { CNU, CNU, CNU, CNU, CNU, }, 250 }; 251 252 static const UChar 247 { 95, 79, 63, 31, 31, }, 248 { 95, 79, 63, 31, 31, }, 249 { CNU, CNU, CNU, CNU, CNU, }, 250 }; 251 252 static const UChar 253 253 INIT_MVD[NUMBER_OF_SLICE_TYPES][NUM_MV_RES_CTX] = 254 254 { 255 { 169, 198, }, 256 { 140, 198, }, 257 { CNU, CNU, }, 258 }; 259 260 static const UChar 255 { 169, 198, }, 256 { 140, 198, }, 257 { CNU, CNU, }, 258 }; 259 260 static const UChar 261 261 INIT_REF_PIC[NUMBER_OF_SLICE_TYPES][NUM_REF_NO_CTX] = 262 262 { 263 { 153, 153 }, 264 { 153, 153 }, 265 { CNU, CNU }, 266 }; 267 268 static const UChar 263 { 153, 153 }, 264 { 153, 153 }, 265 { CNU, CNU }, 266 }; 267 268 static const UChar 269 269 INIT_DQP[NUMBER_OF_SLICE_TYPES][NUM_DELTA_QP_CTX] = 270 270 { 271 { 154, 154, 154, }, 272 { 154, 154, 154, }, 273 { 154, 154, 154, }, 274 }; 275 276 static const UChar 271 { 154, 154, 154, }, 272 { 154, 154, 154, }, 273 { 154, 154, 154, }, 274 }; 275 276 static const UChar 277 277 INIT_CHROMA_QP_ADJ_FLAG[NUMBER_OF_SLICE_TYPES][NUM_CHROMA_QP_ADJ_FLAG_CTX] = 278 278 { … … 304 304 305 305 306 static const UChar 306 static const UChar 307 307 INIT_QT_CBF[NUMBER_OF_SLICE_TYPES][NUM_QT_CBF_CTX_SETS * NUM_QT_CBF_CTX_PER_SET] = 308 308 { … … 318 318 INIT_QT_ROOT_CBF[NUMBER_OF_SLICE_TYPES][NUM_QT_ROOT_CBF_CTX] = 319 319 { 320 { 79, }, 321 { 79, }, 322 { CNU, }, 320 { 79, }, 321 { 79, }, 322 { CNU, }, 323 323 }; 324 324 … … 338 338 339 339 340 static const UChar 340 static const UChar 341 341 INIT_LAST[NUMBER_OF_SLICE_TYPES][NUM_CTX_LAST_FLAG_SETS * NUM_CTX_LAST_FLAG_XY] = 342 342 { … … 349 349 //-------------------------------------------------------------------------------------------------- 350 350 351 static const UChar 351 static const UChar 352 352 INIT_SIG_CG_FLAG[NUMBER_OF_SLICE_TYPES][2 * NUM_SIG_CG_FLAG_CTX] = 353 353 { 354 { 121, 140, 355 61, 154, 356 }, 357 { 121, 140, 358 61, 154, 359 }, 360 { 91, 171, 361 134, 141, 362 }, 354 { 121, 140, 355 61, 154, 356 }, 357 { 121, 140, 358 61, 154, 359 }, 360 { 91, 171, 361 134, 141, 362 }, 363 363 }; 364 364 … … 381 381 //------------------------------------------------ 382 382 383 static const UChar 383 static const UChar 384 384 INIT_SIG_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SIG_FLAG_CTX] = 385 385 { … … 415 415 //------------------------------------------------ 416 416 417 static const UChar 417 static const UChar 418 418 INIT_ONE_FLAG[NUMBER_OF_SLICE_TYPES][NUM_ONE_FLAG_CTX] = 419 419 { … … 423 423 }; 424 424 425 static const UChar 425 static const UChar 426 426 INIT_ABS_FLAG[NUMBER_OF_SLICE_TYPES][NUM_ABS_FLAG_CTX] = 427 427 { … … 434 434 //-------------------------------------------------------------------------------------------------- 435 435 436 static const UChar 436 static const UChar 437 437 INIT_MVP_IDX[NUMBER_OF_SLICE_TYPES][NUM_MVP_IDX_CTX] = 438 438 { … … 442 442 }; 443 443 444 static const UChar 444 static const UChar 445 445 INIT_SAO_MERGE_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SAO_MERGE_FLAG_CTX] = 446 446 { 447 { 153, }, 448 { 153, }, 449 { 153, }, 450 }; 451 452 static const UChar 447 { 153, }, 448 { 153, }, 449 { 153, }, 450 }; 451 452 static const UChar 453 453 INIT_SAO_TYPE_IDX[NUMBER_OF_SLICE_TYPES][NUM_SAO_TYPE_IDX_CTX] = 454 454 { … … 469 469 INIT_TRANSFORMSKIP_FLAG[NUMBER_OF_SLICE_TYPES][2*NUM_TRANSFORMSKIP_FLAG_CTX] = 470 470 { 471 { 139, 139}, 472 { 139, 139}, 473 { 139, 139}, 471 { 139, 139}, 472 { 139, 139}, 473 { 139, 139}, 474 474 }; 475 475 -
branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp
r1029 r1246 129 129 getEnvVarInUse().push_back(this); 130 130 } 131 else m_sVal = sDefault; 131 else 132 { 133 m_sVal = sDefault; 134 } 132 135 133 136 m_dVal = strtod(m_sVal.c_str(), 0); … … 215 218 if (DebugOptionList::DebugSBAC.getInt()!=0 && finalEncode) 216 219 { 217 std::cout << "Size: " << width << "x" << height << ", Last X/Y: (" << lastX << ", " << lastY << "), absPartIdx: " << absPart << ", scanIdx: " << scanIdx << ", chan: " << chan << std::endl;220 std::cout << "Size: " << width << "x" << height << ", Last X/Y: (" << lastX << ", " << lastY << "), absPartIdx: " << absPart << ", scanIdx: " << scanIdx << ", chan: " << chan << "\n"; 218 221 for (Int i=0; i<width*height; i++) 219 222 { 220 223 std::cout << std::setw(3) << pCoeff[i];// + dcVal; 221 if (i%width == width-1) std::cout << std::endl; 222 else std::cout << ","; 224 if (i%width == width-1) 225 { 226 std::cout << "\n"; 227 } 228 else 229 { 230 std::cout << ","; 231 } 223 232 } 224 233 std::cout << std::endl; … … 286 295 std::string::size_type equalsPosition = result.find(" = ", searchFromPosition); 287 296 288 if (equalsPosition == std::string::npos) break; 297 if (equalsPosition == std::string::npos) 298 { 299 break; 300 } 289 301 290 302 //then find the end of the numeric characters … … 292 304 293 305 //then find the last space before the first numeric character... 294 if (splitPosition != std::string::npos) splitPosition = result.find_last_of(' ', splitPosition); 306 if (splitPosition != std::string::npos) 307 { 308 splitPosition = result.find_last_of(' ', splitPosition); 309 } 295 310 296 311 //...and replace it with a new line 297 if (splitPosition != std::string::npos) result.replace(splitPosition, 1, 1, '\n'); 312 if (splitPosition != std::string::npos) 313 { 314 result.replace(splitPosition, 1, 1, '\n'); 315 } 298 316 299 317 //start the next search from the end of the " = " string … … 307 325 std::string lineWrap(const std::string &input, const UInt maximumLineLength) 308 326 { 309 if (maximumLineLength == 0) return input; 327 if (maximumLineLength == 0) 328 { 329 return input; 330 } 310 331 std::string result = input; 311 332 … … 318 339 const std::string::size_type searchFromPosition = lineStartPosition + maximumLineLength; 319 340 320 if (searchFromPosition >= result.length()) break; 341 if (searchFromPosition >= result.length()) 342 { 343 break; 344 } 321 345 322 346 //------------------------------------------------ … … 327 351 for (std::string::size_type currentPosition = lineStartPosition; currentPosition <= searchFromPosition; currentPosition++) 328 352 { 329 if (result[currentPosition] == '\n') { nextLineStartPosition = currentPosition + 1; break; } 353 if (result[currentPosition] == '\n') 354 { 355 nextLineStartPosition = currentPosition + 1; 356 break; 357 } 330 358 } 331 359 … … 333 361 334 362 //if there ia another new line character before the maximum line length, we need to start this loop again from that position 335 if (nextLineStartPosition != std::string::npos) lineStartPosition = nextLineStartPosition; 363 if (nextLineStartPosition != std::string::npos) 364 { 365 lineStartPosition = nextLineStartPosition; 366 } 336 367 else 337 368 { … … 341 372 for (Int currentPosition = Int(searchFromPosition); currentPosition >= Int(lineStartPosition); currentPosition--) 342 373 { 343 if (result[currentPosition] == ' ') { spacePosition = currentPosition; break; } 374 if (result[currentPosition] == ' ') 375 { 376 spacePosition = currentPosition; 377 break; 378 } 344 379 } 345 380 … … 373 408 while ((offset = result.find('\n', offset)) != std::string::npos) 374 409 { 375 if ((++offset) >= result.length()) break; //increment offset so we don't find the same \n again and do no indentation at the end 410 if ((++offset) >= result.length()) 411 { 412 break; //increment offset so we don't find the same \n again and do no indentation at the end 413 } 376 414 result.insert(offset, indentString); 377 415 } … … 402 440 { 403 441 if ((y%subBlockHeight)==0 && y!=0) 442 { 404 443 ss << pLinePrefix << '\n'; 444 } 405 445 406 446 ss << pLinePrefix; … … 408 448 { 409 449 if ((x%subBlockWidth)==0 && x!=0) 450 { 410 451 ss << std::setw(defWidth+2) << ""; 452 } 411 453 412 454 ss << std::setw(defWidth) << blkSrc[y*stride + x] << ' '; -
branches/SHM-dev/source/Lib/TLibCommon/Debug.h
r1029 r1246 179 179 180 180 for (UInt y = 0; y < height; y++) 181 { 181 182 for (UInt x = 0; x < width; x++) 182 183 { … … 188 189 } 189 190 190 if (value < minimumValue) minimumValue = value; 191 else if (value > maximumValue) maximumValue = value; 191 if (value < minimumValue) 192 { 193 minimumValue = value; 194 } 195 else if (value > maximumValue) 196 { 197 maximumValue = value; 198 } 192 199 } 200 } 193 201 194 202 outputWidth = std::max<UInt>(getDecimalWidth(Double(minimumValue)), getDecimalWidth(Double(maximumValue))) + 1; //+1 so the numbers don't run into each other … … 218 226 219 227 const Int valueCount = onlyPrintEdges ? Int((width + height) - 1) : Int(width * height); 220 if (printAverage) stream << "Average: " << (valueSum / valueCount) << "\n"; 228 if (printAverage) 229 { 230 stream << "Average: " << (valueSum / valueCount) << "\n"; 231 } 221 232 stream << "\n"; 222 233 } … … 229 240 { 230 241 if (subBlockHeight!=0 && (y%subBlockHeight)==0 && y!=0) 242 { 231 243 ss << pLinePrefix << '\n'; 244 } 232 245 233 246 ss << pLinePrefix; … … 235 248 { 236 249 if (subBlockWidth!=0 && (x%subBlockWidth)==0 && x!=0) 250 { 237 251 ss << std::setw(defWidth+2) << ""; 252 } 238 253 239 254 ss << std::setw(defWidth) << blkSrc[y*stride + x] << ' '; -
branches/SHM-dev/source/Lib/TLibCommon/NAL.h
r1237 r1246 53 53 54 54 /** construct an NALunit structure with given header values. */ 55 NALUnit(55 NALUnit( 56 56 NalUnitType nalUnitType, 57 57 Int temporalId = 0, … … 87 87 Bool isSei() 88 88 { 89 return m_nalUnitType == NAL_UNIT_PREFIX_SEI 89 return m_nalUnitType == NAL_UNIT_PREFIX_SEI 90 90 || m_nalUnitType == NAL_UNIT_SUFFIX_SEI; 91 91 } -
branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp
r1099 r1246 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 … … 73 73 SEIMessages result; 74 74 75 SEIMessages::iterator it=seiList.begin(); 76 while ( it!=seiList.end() ) 75 SEIMessages::iterator it=seiList.begin(); 76 while ( it!=seiList.end() ) 77 77 { 78 78 if ((*it)->payloadType() == seiType) -
branches/SHM-dev/source/Lib/TLibCommon/SEI.h
r1230 r1246 120 120 #endif 121 121 }; 122 122 123 123 SEI() {} 124 124 virtual ~SEI() {} 125 125 126 126 static const Char *getSEIMessageString(SEI::PayloadType payloadType); 127 127 … … 146 146 147 147 UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN]; 148 UInt userDataLength;148 UInt userDataLength; 149 149 UChar *userData; 150 150 }; … … 157 157 SEIDecodedPictureHash() {} 158 158 virtual ~SEIDecodedPictureHash() {} 159 159 160 160 enum Method 161 161 { … … 169 169 }; 170 170 171 class SEIActiveParameterSets : public SEI 171 class SEIActiveParameterSets : public SEI 172 172 { 173 173 public: 174 174 PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; } 175 175 176 SEIActiveParameterSets() 176 SEIActiveParameterSets() 177 177 : activeVPSId (0) 178 178 , m_selfContainedCvsFlag (false) … … 182 182 virtual ~SEIActiveParameterSets() {} 183 183 184 Int activeVPSId; 184 Int activeVPSId; 185 185 Bool m_selfContainedCvsFlag; 186 186 Bool m_noParameterSetUpdateFlag; … … 527 527 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); 528 528 529 /// remove a selection of SEI messages by payload type from the original list and return them in a new list. 529 /// remove a selection of SEI messages by payload type from the original list and return them in a new list. 530 530 SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType); 531 531 … … 538 538 PayloadType payloadType() const { return SCALABLE_NESTING; } 539 539 540 SEIScalableNesting() 541 : m_callerOwnsSEIs(false) 542 {} 540 SEIScalableNesting() {} 543 541 virtual ~SEIScalableNesting() 544 542 { -
branches/SHM-dev/source/Lib/TLibCommon/TComBitCounter.h
r1029 r1246 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 … … 57 57 protected: 58 58 UInt m_uiBitCounter; 59 59 60 60 public: 61 61 TComBitCounter() {} 62 62 virtual ~TComBitCounter() {} 63 63 64 64 Void write ( UInt /*uiBits*/, UInt uiNumberOfBits ) { m_uiBitCounter += uiNumberOfBits; } 65 65 Void resetBits () { m_uiBitCounter = 0; } -
branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.cpp
r1029 r1246 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 … … 247 247 { 248 248 assert( uiNumberOfBits <= 32 ); 249 249 250 250 m_numBitsRead += uiNumberOfBits; 251 251 -
branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h
r1235 r1246 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 … … 197 197 byte = (*m_fifo)[m_fifo_idx - 1]; 198 198 } 199 199 200 200 UInt readOutTrailingBits (); 201 201 UChar getHeldBits () { return m_held_bits; } -
branches/SHM-dev/source/Lib/TLibCommon/TComCABACTables.cpp
r1029 r1246 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 -
branches/SHM-dev/source/Lib/TLibCommon/TComCABACTables.h
r1029 r1246 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 -
branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.cpp
r1029 r1246 46 46 InputColourSpaceConversion stringToInputColourSpaceConvert(const std::string &value, const Bool bIsForward) 47 47 { 48 if (value.empty() || value=="UNCHANGED") return IPCOLOURSPACE_UNCHANGED; 48 if (value.empty() || value=="UNCHANGED") 49 { 50 return IPCOLOURSPACE_UNCHANGED; 51 } 49 52 if (bIsForward) 50 53 { 51 if (value=="YCbCrtoYYY") return IPCOLOURSPACE_YCbCrtoYYY; 52 if (value=="YCbCrtoYCrCb") return IPCOLOURSPACE_YCbCrtoYCrCb; 53 if (value=="RGBtoGBR") return IPCOLOURSPACE_RGBtoGBR; 54 if (value=="YCbCrtoYYY") 55 { 56 return IPCOLOURSPACE_YCbCrtoYYY; 57 } 58 if (value=="YCbCrtoYCrCb") 59 { 60 return IPCOLOURSPACE_YCbCrtoYCrCb; 61 } 62 if (value=="RGBtoGBR") 63 { 64 return IPCOLOURSPACE_RGBtoGBR; 65 } 54 66 } 55 67 else 56 68 { 57 if (value=="YCrCbtoYCbCr") return IPCOLOURSPACE_YCbCrtoYCrCb; 58 if (value=="GBRtoRGB") return IPCOLOURSPACE_RGBtoGBR; 69 if (value=="YCrCbtoYCbCr") 70 { 71 return IPCOLOURSPACE_YCbCrtoYCrCb; 72 } 73 if (value=="GBRtoRGB") 74 { 75 return IPCOLOURSPACE_RGBtoGBR; 76 } 59 77 } 60 78 return NUMBER_INPUT_COLOUR_SPACE_CONVERSIONS; … … 128 146 { 129 147 result.firstSignificanceMapContext = significanceMapContextSetStart[channelType][CONTEXT_TYPE_8x8]; 130 if (result.scanType != SCAN_DIAG) result.firstSignificanceMapContext += nonDiagonalScan8x8ContextOffset[channelType]; 148 if (result.scanType != SCAN_DIAG) 149 { 150 result.firstSignificanceMapContext += nonDiagonalScan8x8ContextOffset[channelType]; 151 } 131 152 } 132 153 else -
branches/SHM-dev/source/Lib/TLibCommon/TComCodingStatistics.h
r1029 r1246 246 246 { 247 247 if (width==0) 248 { 248 249 OutputLine(pName, sep, "-", pSubClassStr, sCABAC, sEP); 250 } 249 251 else 252 { 250 253 printf("%c%-45s%c %6d %6s %12lld %12lld %12lld %12lld %12lld %12lld %12lld (%12lld)%c\n", 251 254 sep=='~'?'[':' ', pName, sep, 1<<width, pSubClassStr, 252 255 sCABAC.count, sCABAC.sum, sCABAC.bits, sEP.count, sEP.sum, sEP.bits, sCABAC.bits+sEP.bits, (sCABAC.bits+sEP.bits)/8, sep=='~'?']':' '); 256 } 253 257 } 254 258 static Void OutputLine(const Char *pName, const Char sep, const Char *pWidthString, const Char *pSubClassStr, const SStat &sCABAC, const SStat &sEP) … … 270 274 UInt tot=0; 271 275 for(;pText[tot]!=0; tot++); 276 272 277 tot+=2; 273 278 for (; tot<168; tot++) … … 316 321 SStat &sEP=data.statistics_ep[i][c]; 317 322 318 if (sCABACorig.bits==0 && sEP.bits==0) continue; 323 if (sCABACorig.bits==0 && sEP.bits==0) 324 { 325 continue; 326 } 319 327 320 328 SStat sCABAC; 321 329 { 322 Int64 thisCABACbits=sCABACorig.bits/es; if (i==STATS__CABAC_INITIALISATION && sCABACorig.bits!=0) { thisCABACbits+=cr; cr=0; } 323 sCABAC.bits=thisCABACbits; sCABAC.count=sCABACorig.count; sCABAC.sum=sCABACorig.sum; 330 Int64 thisCABACbits=sCABACorig.bits/es; 331 if (i==STATS__CABAC_INITIALISATION && sCABACorig.bits!=0) 332 { 333 thisCABACbits+=cr; 334 cr=0; 335 } 336 sCABAC.bits=thisCABACbits; 337 sCABAC.count=sCABACorig.count; 338 sCABAC.sum=sCABACorig.sum; 324 339 } 325 340 UInt width=TComCodingStatisticsClassType::GetSubClassWidth(c); -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1244 r1246 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 … … 175 175 { 176 176 #if LAYER_CTB 177 if (m_pcGlbArlCoeff[compID] == NULL) m_pcGlbArlCoeff[compID] = (TCoeff*)xMalloc(TCoeff, MAX_CU_SIZE * MAX_CU_SIZE); 177 if (m_pcGlbArlCoeff[compID] == NULL) 178 { 179 m_pcGlbArlCoeff[compID] = (TCoeff*)xMalloc(TCoeff, MAX_CU_SIZE * MAX_CU_SIZE); 180 } 178 181 #else 179 if (m_pcGlbArlCoeff[compID] == NULL) m_pcGlbArlCoeff[compID] = (TCoeff*)xMalloc(TCoeff, totalSize); 182 if (m_pcGlbArlCoeff[compID] == NULL) 183 { 184 m_pcGlbArlCoeff[compID] = (TCoeff*)xMalloc(TCoeff, totalSize); 185 } 180 186 #endif 181 187 … … 185 191 else 186 192 { 187 193 m_pcArlCoeff[compID] = (TCoeff*)xMalloc(TCoeff, totalSize); 188 194 } 189 195 #endif … … 225 231 if ( !m_bDecSubCu ) 226 232 { 227 if ( m_phQP ) { xFree(m_phQP); m_phQP = NULL; } 228 if ( m_puhDepth ) { xFree(m_puhDepth); m_puhDepth = NULL; } 229 if ( m_puhWidth ) { xFree(m_puhWidth); m_puhWidth = NULL; } 230 if ( m_puhHeight ) { xFree(m_puhHeight); m_puhHeight = NULL; } 231 232 if ( m_skipFlag ) { delete[] m_skipFlag; m_skipFlag = NULL; } 233 234 if ( m_pePartSize ) { delete[] m_pePartSize; m_pePartSize = NULL; } 235 if ( m_pePredMode ) { delete[] m_pePredMode; m_pePredMode = NULL; } 236 if ( m_ChromaQpAdj ) { delete[] m_ChromaQpAdj; m_ChromaQpAdj = NULL; } 237 if ( m_CUTransquantBypass ) { delete[] m_CUTransquantBypass;m_CUTransquantBypass = NULL; } 238 if ( m_puhInterDir ) { xFree(m_puhInterDir); m_puhInterDir = NULL; } 239 if ( m_pbMergeFlag ) { xFree(m_pbMergeFlag); m_pbMergeFlag = NULL; } 240 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } 233 if ( m_phQP ) 234 { 235 xFree(m_phQP); 236 m_phQP = NULL; 237 } 238 if ( m_puhDepth ) 239 { 240 xFree(m_puhDepth); 241 m_puhDepth = NULL; 242 } 243 if ( m_puhWidth ) 244 { 245 xFree(m_puhWidth); 246 m_puhWidth = NULL; 247 } 248 if ( m_puhHeight ) 249 { 250 xFree(m_puhHeight); 251 m_puhHeight = NULL; 252 } 253 254 if ( m_skipFlag ) 255 { 256 delete[] m_skipFlag; 257 m_skipFlag = NULL; 258 } 259 260 if ( m_pePartSize ) 261 { 262 delete[] m_pePartSize; 263 m_pePartSize = NULL; 264 } 265 if ( m_pePredMode ) 266 { 267 delete[] m_pePredMode; 268 m_pePredMode = NULL; 269 } 270 if ( m_ChromaQpAdj ) 271 { 272 delete[] m_ChromaQpAdj; 273 m_ChromaQpAdj = NULL; 274 } 275 if ( m_CUTransquantBypass ) 276 { 277 delete[] m_CUTransquantBypass; 278 m_CUTransquantBypass = NULL; 279 } 280 if ( m_puhInterDir ) 281 { 282 xFree(m_puhInterDir); 283 m_puhInterDir = NULL; 284 } 285 if ( m_pbMergeFlag ) 286 { 287 xFree(m_pbMergeFlag); 288 m_pbMergeFlag = NULL; 289 } 290 if ( m_puhMergeIndex ) 291 { 292 xFree(m_puhMergeIndex); 293 m_puhMergeIndex = NULL; 294 } 241 295 242 296 for (UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) … … 246 300 } 247 301 248 if ( m_puhTrIdx ) { xFree(m_puhTrIdx); m_puhTrIdx = NULL; } 302 if ( m_puhTrIdx ) 303 { 304 xFree(m_puhTrIdx); 305 m_puhTrIdx = NULL; 306 } 249 307 250 308 for (UInt comp=0; comp<MAX_NUM_COMPONENT; comp++) 251 309 { 252 if ( m_crossComponentPredictionAlpha[comp] ) { xFree(m_crossComponentPredictionAlpha[comp]); m_crossComponentPredictionAlpha[comp] = NULL; } 253 if ( m_puhTransformSkip[comp] ) { xFree(m_puhTransformSkip[comp]); m_puhTransformSkip[comp] = NULL; } 254 if ( m_puhCbf[comp] ) { xFree(m_puhCbf[comp]); m_puhCbf[comp] = NULL; } 255 if ( m_pcTrCoeff[comp] ) { xFree(m_pcTrCoeff[comp]); m_pcTrCoeff[comp] = NULL; } 256 if ( m_explicitRdpcmMode[comp] ) { xFree(m_explicitRdpcmMode[comp]); m_explicitRdpcmMode[comp] = NULL; } 310 if ( m_crossComponentPredictionAlpha[comp] ) 311 { 312 xFree(m_crossComponentPredictionAlpha[comp]); 313 m_crossComponentPredictionAlpha[comp] = NULL; 314 } 315 if ( m_puhTransformSkip[comp] ) 316 { 317 xFree(m_puhTransformSkip[comp]); 318 m_puhTransformSkip[comp] = NULL; 319 } 320 if ( m_puhCbf[comp] ) 321 { 322 xFree(m_puhCbf[comp]); 323 m_puhCbf[comp] = NULL; 324 } 325 if ( m_pcTrCoeff[comp] ) 326 { 327 xFree(m_pcTrCoeff[comp]); 328 m_pcTrCoeff[comp] = NULL; 329 } 330 if ( m_explicitRdpcmMode[comp] ) 331 { 332 xFree(m_explicitRdpcmMode[comp]); 333 m_explicitRdpcmMode[comp] = NULL; 334 } 257 335 258 336 #if ADAPTIVE_QP_SELECTION 259 337 if (!m_ArlCoeffIsAliasedAllocation) 260 338 { 261 if ( m_pcArlCoeff[comp] ) { xFree(m_pcArlCoeff[comp]); m_pcArlCoeff[comp] = NULL; } 262 } 263 264 if ( m_pcGlbArlCoeff[comp] ) { xFree(m_pcGlbArlCoeff[comp]); m_pcGlbArlCoeff[comp] = NULL; } 339 if ( m_pcArlCoeff[comp] ) 340 { 341 xFree(m_pcArlCoeff[comp]); 342 m_pcArlCoeff[comp] = NULL; 343 } 344 } 345 346 if ( m_pcGlbArlCoeff[comp] ) 347 { 348 xFree(m_pcGlbArlCoeff[comp]); 349 m_pcGlbArlCoeff[comp] = NULL; 350 } 265 351 #endif 266 352 267 if ( m_pcIPCMSample[comp] ) { xFree(m_pcIPCMSample[comp]); m_pcIPCMSample[comp] = NULL; } 268 } 269 if ( m_pbIPCMFlag ) { xFree(m_pbIPCMFlag ); m_pbIPCMFlag = NULL; } 353 if ( m_pcIPCMSample[comp] ) 354 { 355 xFree(m_pcIPCMSample[comp]); 356 m_pcIPCMSample[comp] = NULL; 357 } 358 } 359 if ( m_pbIPCMFlag ) 360 { 361 xFree(m_pbIPCMFlag ); 362 m_pbIPCMFlag = NULL; 363 } 270 364 271 365 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 272 366 { 273 367 const RefPicList rpl=RefPicList(i); 274 if ( m_apiMVPIdx[rpl] ) { delete[] m_apiMVPIdx[rpl]; m_apiMVPIdx[rpl] = NULL; } 275 if ( m_apiMVPNum[rpl] ) { delete[] m_apiMVPNum[rpl]; m_apiMVPNum[rpl] = NULL; } 368 if ( m_apiMVPIdx[rpl] ) 369 { 370 delete[] m_apiMVPIdx[rpl]; 371 m_apiMVPIdx[rpl] = NULL; 372 } 373 if ( m_apiMVPNum[rpl] ) 374 { 375 delete[] m_apiMVPNum[rpl]; 376 m_apiMVPNum[rpl] = NULL; 377 } 276 378 } 277 379 … … 1446 1548 pcCULeft = getPULeft( LeftPartIdx, m_absZIdxInCtu + uiAbsPartIdx ); 1447 1549 1448 if (isChroma(compID)) LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm); 1550 if (isChroma(compID)) 1551 { 1552 LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm); 1553 } 1449 1554 iLeftIntraDir = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX; 1450 1555 … … 1452 1557 pcCUAbove = getPUAbove( AbovePartIdx, m_absZIdxInCtu + uiAbsPartIdx, true, true ); 1453 1558 1454 if (isChroma(compID)) AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm); 1559 if (isChroma(compID)) 1560 { 1561 AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm); 1562 } 1455 1563 iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX; 1456 1564 1457 1565 if (isChroma(chType)) 1458 1566 { 1459 if (iLeftIntraDir == DM_CHROMA_IDX) iLeftIntraDir = pcCULeft-> getIntraDir( CHANNEL_TYPE_LUMA, LeftPartIdx ); 1460 if (iAboveIntraDir == DM_CHROMA_IDX) iAboveIntraDir = pcCUAbove->getIntraDir( CHANNEL_TYPE_LUMA, AbovePartIdx ); 1567 if (iLeftIntraDir == DM_CHROMA_IDX) 1568 { 1569 iLeftIntraDir = pcCULeft-> getIntraDir( CHANNEL_TYPE_LUMA, LeftPartIdx ); 1570 } 1571 if (iAboveIntraDir == DM_CHROMA_IDX) 1572 { 1573 iAboveIntraDir = pcCUAbove->getIntraDir( CHANNEL_TYPE_LUMA, AbovePartIdx ); 1574 } 1461 1575 } 1462 1576 … … 1501 1615 } 1502 1616 for (UInt i=0; i<NUM_MOST_PROBABLE_MODES; i++) 1617 { 1503 1618 assert(uiIntraDirPred[i] < 35); 1619 } 1504 1620 } 1505 1621 … … 3283 3399 //this mechanism is available for intra only 3284 3400 3285 if (!isIntra(uiAbsPartIdx)) return SCAN_DIAG; 3401 if (!isIntra(uiAbsPartIdx)) 3402 { 3403 return SCAN_DIAG; 3404 } 3286 3405 3287 3406 //------------------------------------------------ … … 3294 3413 const UInt maximumHeight = MDCS_MAXIMUM_HEIGHT >> getComponentScaleY(compID, format); 3295 3414 3296 if ((uiWidth > maximumWidth) || (uiHeight > maximumHeight)) return SCAN_DIAG; 3415 if ((uiWidth > maximumWidth) || (uiHeight > maximumHeight)) 3416 { 3417 return SCAN_DIAG; 3418 } 3297 3419 3298 3420 //------------------------------------------------ … … 3314 3436 //------------------ 3315 3437 3316 if (abs((Int)uiDirMode - VER_IDX) <= MDCS_ANGLE_LIMIT) return SCAN_HOR; 3317 else if (abs((Int)uiDirMode - HOR_IDX) <= MDCS_ANGLE_LIMIT) return SCAN_VER; 3318 else return SCAN_DIAG; 3438 if (abs((Int)uiDirMode - VER_IDX) <= MDCS_ANGLE_LIMIT) 3439 { 3440 return SCAN_HOR; 3441 } 3442 else if (abs((Int)uiDirMode - HOR_IDX) <= MDCS_ANGLE_LIMIT) 3443 { 3444 return SCAN_VER; 3445 } 3446 else 3447 { 3448 return SCAN_DIAG; 3449 } 3319 3450 } 3320 3451 -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
r1244 r1246 202 202 203 203 Void copyToPic ( UChar uiDepth ); 204 204 205 205 // ------------------------------------------------------------------------------------------------------------------- 206 206 // member functions for CU description -
branches/SHM-dev/source/Lib/TLibCommon/TComInterpolationFilter.cpp
r1029 r1246 137 137 Pel val = src[ col ]; 138 138 val = rightShift_round((val + IF_INTERNAL_OFFS), shift); 139 if (val < minVal) val = minVal; 140 if (val > maxVal) val = maxVal; 139 if (val < minVal) 140 { 141 val = minVal; 142 } 143 if (val > maxVal) 144 { 145 val = maxVal; 146 } 141 147 dst[col] = val; 142 148 } -
branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r1203 r1246 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 … … 476 476 TComMv pcMvQ1 = pcCUQ->getCUMvField(REF_PIC_LIST_1)->getMv(uiPartQ); 477 477 478 if (piRefP0 == NULL) pcMvP0.setZero(); 479 if (piRefP1 == NULL) pcMvP1.setZero(); 480 if (piRefQ0 == NULL) pcMvQ0.setZero(); 481 if (piRefQ1 == NULL) pcMvQ1.setZero(); 478 if (piRefP0 == NULL) 479 { 480 pcMvP0.setZero(); 481 } 482 if (piRefP1 == NULL) 483 { 484 pcMvP1.setZero(); 485 } 486 if (piRefQ0 == NULL) 487 { 488 pcMvQ0.setZero(); 489 } 490 if (piRefQ1 == NULL) 491 { 492 pcMvQ1.setZero(); 493 } 482 494 483 495 if ( ((piRefP0==piRefQ0)&&(piRefP1==piRefQ1)) || ((piRefP0==piRefQ1)&&(piRefP1==piRefQ0)) ) … … 528 540 TComMv pcMvQ0 = pcCUQ->getCUMvField(REF_PIC_LIST_0)->getMv(uiPartQ); 529 541 530 if (piRefP0 == NULL) pcMvP0.setZero(); 531 if (piRefQ0 == NULL) pcMvQ0.setZero(); 542 if (piRefP0 == NULL) 543 { 544 pcMvP0.setZero(); 545 } 546 if (piRefQ0 == NULL) 547 { 548 pcMvQ0.setZero(); 549 } 532 550 533 551 uiBs = ((piRefP0 != piRefQ0) || … … 767 785 if (iQP >= chromaQPMappingTableSize) 768 786 { 769 if (pcPicYuvRec->getChromaFormat()==CHROMA_420) iQP -=6; 770 else if (iQP>51) iQP=51; 787 if (pcPicYuvRec->getChromaFormat()==CHROMA_420) 788 { 789 iQP -=6; 790 } 791 else if (iQP>51) 792 { 793 iQP=51; 794 } 771 795 } 772 796 else if (iQP >= 0 ) -
branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp
r1029 r1246 176 176 { 177 177 if (x==0 || y==0) 178 { 178 179 ss << piAdiTemp[y*uiROIWidth + x] << ", "; 179 180 // if (x%16==15) ss << "\nPart size: ~ "; 181 } 180 182 } 181 183 ss << "\n"; … … 210 212 const Bool bilinearAbove = abs((topLeft + topRight) - (2 * piAdiTemp[ uiTuWidth ])) < threshold; //ends and the middle 211 213 if ((uiTuWidth < 32) || (!bilinearLeft) || (!bilinearAbove)) 214 { 212 215 useStrongIntraSmoothing = false; 216 } 213 217 } 214 218 … … 292 296 { 293 297 if (x==0 || y==0) 298 { 294 299 ss << m_piYuvExt[compID][PRED_BUF_FILTERED][y*uiROIWidth + x] << ", "; 295 300 // if (x%16==15) ss << "\nPart size: ~ "; 301 } 296 302 } 297 303 ss << "\n"; -
branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp
r1235 r1246 148 148 m_saoBlkParams = new SAOBlkParam[m_numCtusInFrame]; 149 149 150 150 151 xInitTiles(); 151 152 xInitCtuTsRsAddrMaps(); 153 152 154 } 153 155 -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r1235 r1246 133 133 134 134 for (Int cuRow = 0; cuRow < numCuInHeight; cuRow++) 135 { 135 136 for (Int cuCol = 0; cuCol < numCuInWidth; cuCol++) 137 { 136 138 m_ctuOffsetInBuffer[chan][cuRow * numCuInWidth + cuCol] = stride * cuRow * ctuHeight + cuCol * ctuWidth; 139 } 140 } 137 141 138 142 m_subCuOffsetInBuffer[chan] = new Int[(size_t)1 << (2 * uiMaxCUDepth)]; … … 143 147 144 148 for (Int buRow = 0; buRow < numSubBlockPartitions; buRow++) 149 { 145 150 for (Int buCol = 0; buCol < numSubBlockPartitions; buCol++) 151 { 146 152 m_subCuOffsetInBuffer[chan][(buRow << uiMaxCUDepth) + buCol] = stride * buRow * minSubBlockHeight + buCol * minSubBlockWidth; 153 } 154 } 147 155 } 148 156 return; … … 157 165 m_piPicOrg[chan] = NULL; 158 166 159 if( m_apiPicBuf[chan] ){ xFree( m_apiPicBuf[chan] ); m_apiPicBuf[chan] = NULL; } 167 if( m_apiPicBuf[chan] ) 168 { 169 xFree( m_apiPicBuf[chan] ); 170 m_apiPicBuf[chan] = NULL; 171 } 160 172 } 161 173 162 174 for(UInt chan=0; chan<MAX_NUM_CHANNEL_TYPE; chan++) 163 175 { 164 if (m_ctuOffsetInBuffer[chan]) delete[] m_ctuOffsetInBuffer[chan]; m_ctuOffsetInBuffer[chan] = NULL; 165 if (m_subCuOffsetInBuffer[chan]) delete[] m_subCuOffsetInBuffer[chan]; m_subCuOffsetInBuffer[chan] = NULL; 176 if (m_ctuOffsetInBuffer[chan]) 177 { 178 delete[] m_ctuOffsetInBuffer[chan]; 179 m_ctuOffsetInBuffer[chan] = NULL; 180 } 181 if (m_subCuOffsetInBuffer[chan]) 182 { 183 delete[] m_subCuOffsetInBuffer[chan]; 184 m_subCuOffsetInBuffer[chan] = NULL; 185 } 166 186 } 167 187 } … … 186 206 Void TComPicYuv::extendPicBorder () 187 207 { 188 if ( m_bIsBorderExtended ) return; 208 if ( m_bIsBorderExtended ) 209 { 210 return; 211 } 189 212 190 213 for(Int chan=0; chan<getNumberValidComponents(); chan++) -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuvMD5.cpp
r1029 r1246 77 77 * NB, for 8bit data, data is truncated to 8bits. */ 78 78 for (UInt x = 0; x < width_less_modN; x += N) 79 { 79 80 md5_block<OUTPUT_BITDEPTH_DIV8>(md5, &plane[y*stride + x], N); 81 } 80 82 81 83 /* mop up any of the remaining line */ … … 212 214 for(Int pos=0; pos<Int(digest.hash.size()); pos++) 213 215 { 214 if ((pos % numChar) == 0 && pos!=0 ) result += ','; 216 if ((pos % numChar) == 0 && pos!=0 ) 217 { 218 result += ','; 219 } 215 220 result += hex[digest.hash[pos] >> 4]; 216 221 result += hex[digest.hash[pos] & 0xf]; -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp
r1238 r1246 611 611 612 612 for (UInt ch=COMPONENT_Y; ch<pcYuvPred->getNumberValidComponents(); ch++) 613 { 613 614 xPredInterBlk (ComponentID(ch), pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi ); 615 } 614 616 } 615 617 -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1201 r1246 106 106 m_column = 0; 107 107 } 108 else m_column++; 108 else 109 { 110 m_column++; 111 } 109 112 } 110 113 break; … … 119 122 m_line = 0; 120 123 } 121 else m_line++; 124 else 125 { 126 m_line++; 127 } 122 128 } 123 129 break; -
branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r1203 r1246 118 118 destroy(); 119 119 120 if (m_signLineBuf1) delete[] m_signLineBuf1; m_signLineBuf1 = NULL; 121 if (m_signLineBuf2) delete[] m_signLineBuf2; m_signLineBuf2 = NULL; 120 if (m_signLineBuf1) 121 { 122 delete[] m_signLineBuf1; 123 m_signLineBuf1 = NULL; 124 } 125 if (m_signLineBuf2) 126 { 127 delete[] m_signLineBuf2; 128 m_signLineBuf2 = NULL; 129 } 122 130 } 123 131 … … 320 328 m_lineBufWidth = m_maxCUWidth; 321 329 322 if (m_signLineBuf1) delete[] m_signLineBuf1; m_signLineBuf1 = NULL; 330 if (m_signLineBuf1) 331 { 332 delete[] m_signLineBuf1; 333 m_signLineBuf1 = NULL; 334 } 323 335 m_signLineBuf1 = new Char[m_lineBufWidth+1]; 324 336 325 if (m_signLineBuf2) delete[] m_signLineBuf2; m_signLineBuf2 = NULL; 337 if (m_signLineBuf2) 338 { 339 delete[] m_signLineBuf2; 340 m_signLineBuf2 = NULL; 341 } 326 342 m_signLineBuf2 = new Char[m_lineBufWidth+1]; 327 343 } … … 553 569 for(Int compIdx = 0; compIdx < numberOfComponents; compIdx++) 554 570 { 555 if (saoblkParam[compIdx].modeIdc != SAO_MODE_OFF) bAllOff=false; 556 } 557 if (bAllOff) return; 571 if (saoblkParam[compIdx].modeIdc != SAO_MODE_OFF) 572 { 573 bAllOff=false; 574 } 575 } 576 if (bAllOff) 577 { 578 return; 579 } 558 580 559 581 //block boundary availability … … 605 627 for(Int compIdx = 0; compIdx < numberOfComponents; compIdx++) 606 628 { 607 if (m_picSAOEnabled[compIdx]) bAllDisabled=false; 608 } 609 if (bAllDisabled) return; 629 if (m_picSAOEnabled[compIdx]) 630 { 631 bAllDisabled=false; 632 } 633 } 634 if (bAllDisabled) 635 { 636 return; 637 } 610 638 611 639 TComPicYuv* resYuv = pDecPic->getPicYuvRec(); … … 673 701 if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 674 702 #endif 703 { 675 704 xPCMCURestoration( pcCU, uiAbsZorderIdx, uiDepth+1 ); 705 } 676 706 } 677 707 return; -
branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r1029 r1246 56 56 // ==================================================================================================================== 57 57 #if !SVC_EXTENSION 58 extern UInt g_saoMaxOffsetQVal[MAX_NUM_COMPONENT]; 58 extern UInt g_saoMaxOffsetQVal[MAX_NUM_COMPONENT]; 59 59 #endif 60 60 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1235 r1246 218 218 m_bCheckLDC = false; 219 219 220 for (UInt component = 0; component < MAX_NUM_COMPONENT; component++) m_iSliceChromaQpDelta[component] = 0; 220 for (UInt component = 0; component < MAX_NUM_COMPONENT; component++) 221 { 222 m_iSliceChromaQpDelta[component] = 0; 223 } 221 224 222 225 m_maxNumMergeCand = MRG_MAX_NUM_CANDS; … … 252 255 { 253 256 iterPicExtract = rcListPic.begin(); 254 for (Int j = 0; j < i; j++) iterPicExtract++; 257 for (Int j = 0; j < i; j++) 258 { 259 iterPicExtract++; 260 } 255 261 pcPicExtract = *(iterPicExtract); 256 262 pcPicExtract->setCurrSliceIdx(0); … … 330 336 picPoc = picPoc & (pocCycle - 1); 331 337 } 332 338 333 339 if (poc == picPoc) 334 340 { … … 603 609 #endif //SVC_EXTENSION 604 610 605 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 606 { 607 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 608 } 609 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 610 { 611 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 612 } 613 611 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 612 { 613 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 614 } 615 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 616 { 617 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 618 } 614 619 assert(cIdx == numPocTotalCurr); 615 620 … … 893 898 } 894 899 #else 895 if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false); 900 if (rpcPic->getPOC() != pocCurr) 901 { 902 rpcPic->getSlice(0)->setReferenced(false); 903 } 896 904 #endif 897 905 iterPic++; … … 991 999 m_bCheckLDC = pSrc->m_bCheckLDC; 992 1000 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; 993 for (UInt component = 0; component < MAX_NUM_COMPONENT; component++) m_iSliceChromaQpDelta[component] = pSrc->m_iSliceChromaQpDelta[component]; 1001 for (UInt component = 0; component < MAX_NUM_COMPONENT; component++) 1002 { 1003 m_iSliceChromaQpDelta[component] = pSrc->m_iSliceChromaQpDelta[component]; 1004 } 994 1005 for (i = 0; i < NUM_REF_PIC_LIST_01; i++) 995 1006 { … … 2734 2745 } 2735 2746 2747 2736 2748 /** get default address of quantization matrix 2737 2749 * \param sizeId size index -
branches/SHM-dev/source/Lib/TLibCommon/TComTU.cpp
r1235 r1246 169 169 170 170 mOrigWidth[i]=mRect[i].width; 171 if (!mCodeAll[i] && mbProcessLastOfLevel) mRect[i].width=0; 171 if (!mCodeAll[i] && mbProcessLastOfLevel) 172 { 173 mRect[i].width=0; 174 } 172 175 } 173 176 } … … 185 188 { 186 189 mOffsets[i]+=mRect[i].width*mRect[i].height; 187 if (mbProcessLastOfLevel) mRect[i].width=mOrigWidth[i]; 190 if (mbProcessLastOfLevel) 191 { 192 mRect[i].width=mOrigWidth[i]; 193 } 188 194 mRect[i].x0+=mRect[i].width; 189 195 const TComRectangle &parentRect=parent.getRect(ComponentID(i)); … … 195 201 if (!mCodeAll[i]) 196 202 { 197 if (!mbProcessLastOfLevel || mSection!=2) mRect[i].width=0; 203 if (!mbProcessLastOfLevel || mSection!=2) 204 { 205 mRect[i].width=0; 206 } 198 207 } 199 208 } -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r1240 r1246 436 436 TCoeff result = 0; 437 437 for (Int column = 0; column < 4; column++) 438 { 438 439 result += c[column] * g_as_DST_MAT_4[TRANSFORM_FORWARD][row][column]; // use the defined matrix, rather than hard-wired numbers 440 } 439 441 440 442 coeff[(row * 4) + i] = rightShift((result + rnd_factor), shift); … … 462 464 result = 0; 463 465 for (Int row = 0; row < 4; row++) 466 { 464 467 result += c[row] * g_as_DST_MAT_4[TRANSFORM_INVERSE][row][column]; // use the defined matrix, rather than hard-wired numbers 468 } 465 469 466 470 result = Clip3( outputMinimum, outputMaximum, rightShift((result + rnd_factor), shift)); … … 862 866 fastForwardDst( block, tmp, shift_1st ); 863 867 } 864 else partialButterfly4 ( block, tmp, shift_1st, iHeight ); 868 else 869 { 870 partialButterfly4 ( block, tmp, shift_1st, iHeight ); 871 } 865 872 } 866 873 break; … … 881 888 fastForwardDst( tmp, coeff, shift_2nd ); 882 889 } 883 else partialButterfly4 ( tmp, coeff, shift_2nd, iWidth ); 890 else 891 { 892 partialButterfly4 ( tmp, coeff, shift_2nd, iWidth ); 893 } 884 894 } 885 895 break; … … 922 932 fastInverseDst( coeff, tmp, shift_1st, clipMinimum, clipMaximum); 923 933 } 924 else partialButterflyInverse4 ( coeff, tmp, shift_1st, iWidth, clipMinimum, clipMaximum); 934 else 935 { 936 partialButterflyInverse4 ( coeff, tmp, shift_1st, iWidth, clipMinimum, clipMaximum); 937 } 925 938 } 926 939 break; … … 943 956 fastInverseDst( tmp, block, shift_2nd, std::numeric_limits<Pel>::min(), std::numeric_limits<Pel>::max() ); 944 957 } 945 else partialButterflyInverse4 ( tmp, block, shift_2nd, iHeight, std::numeric_limits<Pel>::min(), std::numeric_limits<Pel>::max()); 958 else 959 { 960 partialButterflyInverse4 ( tmp, block, shift_2nd, iHeight, std::numeric_limits<Pel>::min(), std::numeric_limits<Pel>::max()); 961 } 946 962 } 947 963 break; … … 1464 1480 //------------------ 1465 1481 1466 } 1467 while (subTURecurse.nextSection(rTu)); 1482 } while (subTURecurse.nextSection(rTu)); 1468 1483 1469 1484 //------------------------------------------------ … … 1560 1575 TComTU &rTu) 1561 1576 { 1562 if (!rTu.ProcessComponentSection(compID)) return; 1577 if (!rTu.ProcessComponentSection(compID)) 1578 { 1579 return; 1580 } 1563 1581 1564 1582 TComDataCU* pcCU = rTu.getCU(); … … 1592 1610 #ifdef DEBUG_STRING 1593 1611 if (psDebug != 0) 1612 { 1594 1613 std::cout << (*psDebug); 1614 } 1595 1615 #endif 1596 1616 } … … 1618 1638 { 1619 1639 invRecurTransformNxN( compID, pResidual, tuRecurseChild ); 1620 } 1621 while (tuRecurseChild.nextSection(rTu)); 1640 } while (tuRecurseChild.nextSection(rTu)); 1622 1641 } 1623 1642 } … … 1709 1728 applyForwardRDPCM( rTu, compID, pcResidual, uiStride, cQP, pcCoeff, uiAbsSum, rdpcmMode ); 1710 1729 } 1711 else rdpcmMode = RDPCM_OFF; 1730 else 1731 { 1732 rdpcmMode = RDPCM_OFF; 1733 } 1712 1734 } 1713 1735 else // not intra, need to select the best mode … … 1839 1861 1840 1862 for (Int y = 0; y < iHeight; y++) 1863 { 1841 1864 for (Int x = 0; x < iWidth; x++) 1842 1865 { 1843 1866 block[(y * iWidth) + x] = piBlkResi[(y * uiStride) + x]; 1844 1867 } 1868 } 1845 1869 1846 1870 xTrMxN( g_bitDepth[toChannelType(compID)], block, coeff, iWidth, iHeight, useDST, g_maxTrDynamicRange[toChannelType(compID)] ); … … 1882 1906 1883 1907 for (Int y = 0; y < iHeight; y++) 1908 { 1884 1909 for (Int x = 0; x < iWidth; x++) 1885 1910 { 1886 1911 pResidual[(y * uiStride) + x] = Pel(block[(y * iWidth) + x]); 1887 1912 } 1913 } 1888 1914 } 1889 1915 … … 2348 2374 iScanPos = iCGScanPos*uiCGSize + iScanPosinCG; 2349 2375 2350 if (iScanPos > iLastScanPos) continue; 2376 if (iScanPos > iLastScanPos) 2377 { 2378 continue; 2379 } 2351 2380 UInt uiBlkPos = codingParameters.scan[iScanPos]; 2352 2381 … … 2544 2573 Int TComTrQuant::calcPatternSigCtx( const UInt* sigCoeffGroupFlag, UInt uiCGPosX, UInt uiCGPosY, UInt widthInGroups, UInt heightInGroups ) 2545 2574 { 2546 if ((widthInGroups <= 1) && (heightInGroups <= 1)) return 0; 2575 if ((widthInGroups <= 1) && (heightInGroups <= 1)) 2576 { 2577 return 0; 2578 } 2547 2579 2548 2580 const Bool rightAvailable = uiCGPosX < (widthInGroups - 1); … … 2552 2584 UInt sigLower = 0; 2553 2585 2554 if (rightAvailable) sigRight = ((sigCoeffGroupFlag[ (uiCGPosY * widthInGroups) + uiCGPosX + 1 ] != 0) ? 1 : 0); 2555 if (belowAvailable) sigLower = ((sigCoeffGroupFlag[ (uiCGPosY + 1) * widthInGroups + uiCGPosX ] != 0) ? 1 : 0); 2586 if (rightAvailable) 2587 { 2588 sigRight = ((sigCoeffGroupFlag[ (uiCGPosY * widthInGroups) + uiCGPosX + 1 ] != 0) ? 1 : 0); 2589 } 2590 if (belowAvailable) 2591 { 2592 sigLower = ((sigCoeffGroupFlag[ (uiCGPosY + 1) * widthInGroups + uiCGPosX ] != 0) ? 1 : 0); 2593 } 2556 2594 2557 2595 return sigRight + (sigLower << 1); … … 2585 2623 const UInt posX = rasterPosition - (posY << log2BlockWidth); 2586 2624 2587 if ((posX + posY) == 0) return 0; //special case for the DC context variable 2625 if ((posX + posY) == 0) 2626 { 2627 return 0; //special case for the DC context variable 2628 } 2588 2629 2589 2630 Int offset = MAX_INT; … … 2901 2942 UInt sigLower = 0; 2902 2943 2903 if (uiCGPosX < (widthInGroups - 1)) sigRight = ((uiSigCoeffGroupFlag[ (uiCGPosY * widthInGroups) + uiCGPosX + 1 ] != 0) ? 1 : 0); 2904 if (uiCGPosY < (heightInGroups - 1)) sigLower = ((uiSigCoeffGroupFlag[ (uiCGPosY + 1) * widthInGroups + uiCGPosX ] != 0) ? 1 : 0); 2944 if (uiCGPosX < (widthInGroups - 1)) 2945 { 2946 sigRight = ((uiSigCoeffGroupFlag[ (uiCGPosY * widthInGroups) + uiCGPosX + 1 ] != 0) ? 1 : 0); 2947 } 2948 if (uiCGPosY < (heightInGroups - 1)) 2949 { 2950 sigLower = ((uiSigCoeffGroupFlag[ (uiCGPosY + 1) * widthInGroups + uiCGPosX ] != 0) ? 1 : 0); 2951 } 2905 2952 2906 2953 return ((sigRight + sigLower) != 0) ? 1 : 0; … … 3152 3199 for(UInt qp = 0; qp < SCALING_LIST_REM_NUM; qp++) 3153 3200 { 3154 if(m_quantCoef [sizeId][listId][qp]) delete [] m_quantCoef [sizeId][listId][qp]; 3155 if(m_dequantCoef [sizeId][listId][qp]) delete [] m_dequantCoef [sizeId][listId][qp]; 3156 if(m_errScale [sizeId][listId][qp]) delete [] m_errScale [sizeId][listId][qp]; 3201 if(m_quantCoef[sizeId][listId][qp]) 3202 { 3203 delete [] m_quantCoef[sizeId][listId][qp]; 3204 } 3205 if(m_dequantCoef[sizeId][listId][qp]) 3206 { 3207 delete [] m_dequantCoef[sizeId][listId][qp]; 3208 } 3209 if(m_errScale[sizeId][listId][qp]) 3210 { 3211 delete [] m_errScale[sizeId][listId][qp]; 3212 } 3157 3213 } 3158 3214 } -
branches/SHM-dev/source/Lib/TLibCommon/TComYuv.cpp
r1029 r1246 80 80 for(Int ch=0; ch<MAX_NUM_COMPONENT; ch++) 81 81 { 82 if (m_apiBuf[ch]!=NULL) { xFree( m_apiBuf[ch] ); m_apiBuf[ch] = NULL; } 82 if (m_apiBuf[ch]!=NULL) 83 { 84 xFree( m_apiBuf[ch] ); 85 m_apiBuf[ch] = NULL; 86 } 83 87 } 84 88 } … … 89 93 { 90 94 if (m_apiBuf[ch]!=NULL) 95 { 91 96 ::memset( m_apiBuf[ch], 0, ( getWidth(ComponentID(ch)) * getHeight(ComponentID(ch)) )*sizeof(Pel) ); 97 } 92 98 } 93 99 } … … 99 105 { 100 106 for(Int ch=0; ch<getNumberValidComponents(); ch++) 107 { 101 108 copyToPicComponent ( ComponentID(ch), pcPicYuvDst, ctuRsAddr, uiAbsZorderIdx, uiPartDepth, uiPartIdx ); 109 } 102 110 } 103 111 … … 127 135 { 128 136 for(Int ch=0; ch<getNumberValidComponents(); ch++) 137 { 129 138 copyFromPicComponent ( ComponentID(ch), pcPicYuvSrc, ctuRsAddr, uiAbsZorderIdx ); 139 } 130 140 } 131 141 … … 154 164 { 155 165 for(Int ch=0; ch<getNumberValidComponents(); ch++) 166 { 156 167 copyToPartComponent ( ComponentID(ch), pcYuvDst, uiDstPartIdx ); 168 } 157 169 } 158 170 … … 181 193 { 182 194 for(Int ch=0; ch<getNumberValidComponents(); ch++) 195 { 183 196 copyPartToComponent ( ComponentID(ch), pcYuvDst, uiSrcPartIdx ); 197 } 184 198 } 185 199 … … 209 223 { 210 224 for(Int ch=0; ch<getNumberValidComponents(); ch++) 225 { 211 226 copyPartToPartComponent (ComponentID(ch), pcYuvDst, uiPartIdx, iWidth>>getComponentScaleX(ComponentID(ch)), iHeight>>getComponentScaleY(ComponentID(ch)) ); 227 } 212 228 } 213 229 -
branches/SHM-dev/source/Lib/TLibCommon/TComYuv.h
r1029 r1246 172 172 Int blkX = ( iTransUnitIdx * iBlkSizeForComponent ) & ( width - 1 ); 173 173 Int blkY = ( iTransUnitIdx * iBlkSizeForComponent ) &~ ( width - 1 ); 174 if (m_chromaFormatIDC==CHROMA_422 && id!=COMPONENT_Y) blkY<<=1; 175 // assert((blkX<getWidth(id) && blkY<getHeight(id))); 174 if (m_chromaFormatIDC==CHROMA_422 && id!=COMPONENT_Y) 175 { 176 blkY<<=1; 177 } 176 178 return m_apiBuf[id] + blkX + blkY * iBlkSizeForComponent; 177 179 } … … 182 184 Int blkX = ( iTransUnitIdx * iBlkSizeForComponent ) & ( width - 1 ); 183 185 Int blkY = ( iTransUnitIdx * iBlkSizeForComponent ) &~ ( width - 1 ); 184 if (m_chromaFormatIDC==CHROMA_422 && id!=COMPONENT_Y) blkY<<=1; 185 // UInt w=getWidth(id), h=getHeight(id); 186 // assert((blkX<w && blkY<h)); 186 if (m_chromaFormatIDC==CHROMA_422 && id!=COMPONENT_Y) 187 { 188 blkY<<=1; 189 } 187 190 return m_apiBuf[id] + blkX + blkY * iBlkSizeForComponent; 188 191 } -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1235 r1246 870 870 Bool operator==(const TComDigest &other) const 871 871 { 872 if (other.hash.size() != hash.size()) return false; 872 if (other.hash.size() != hash.size()) 873 { 874 return false; 875 } 873 876 for(UInt i=0; i<UInt(hash.size()); i++) 874 if (other.hash[i] != hash[i]) return false; 877 { 878 if (other.hash[i] != hash[i]) 879 { 880 return false; 881 } 882 } 875 883 return true; 876 884 }
Note: See TracChangeset for help on using the changeset viewer.