Changeset 1246 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 14 Jul 2015, 00:26:07 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 70 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TAppCommon/program_options_lite.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 … … 50 50 namespace program_options_lite 51 51 { 52 52 53 53 Options::~Options() 54 54 { … … 58 58 } 59 59 } 60 60 61 61 void Options::addOption(OptionBase *opt) 62 62 { … … 64 64 names->opt = opt; 65 65 string& opt_string = opt->opt_string; 66 66 67 67 size_t opt_start = 0; 68 68 for (size_t opt_end = 0; opt_end != string::npos;) … … 96 96 return OptionSpecific(*this); 97 97 } 98 98 99 99 static void setOptions(Options::NamesPtrList& opt_list, const string& value) 100 100 { … … 108 108 109 109 static const char spaces[41] = " "; 110 110 111 111 /* format help text for a single option: 112 112 * using the formatting: "-x, --long", … … 138 138 } 139 139 } 140 140 141 141 /* format the help text */ 142 142 void doHelp(ostream& out, Options& opts, unsigned columns) … … 154 154 unsigned opt_width = min(max_width+2, 28u + pad_short) + 2; 155 155 unsigned desc_width = columns - opt_width; 156 156 157 157 /* second pass: write out formatted option and help text. 158 158 * - align start of help text to start at opt_width … … 209 209 split_pos = opt_desc.find_last_not_of(' ', split_pos) + 1; 210 210 } 211 211 212 212 /* bad split if no suitable space to split at. fall back to width */ 213 213 bool bad_split = split_pos == string::npos || split_pos <= cur_pos; … … 217 217 } 218 218 line << opt_desc.substr(cur_pos, split_pos - cur_pos); 219 219 220 220 /* eat up any space for the start of the next line */ 221 221 if (!bad_split) … … 224 224 } 225 225 cur_pos = newline_pos = split_pos; 226 226 227 227 if (cur_pos >= opt_desc.size()) 228 228 { … … 235 235 } 236 236 } 237 237 238 238 bool storePair(Options& opts, bool allow_long, bool allow_short, const string& name, const string& value) 239 239 { … … 248 248 } 249 249 } 250 250 251 251 /* check for the short list */ 252 252 if (allow_short && !(found && allow_long)) … … 269 269 return true; 270 270 } 271 271 272 272 bool storePair(Options& opts, const string& name, const string& value) 273 273 { 274 274 return storePair(opts, true, true, name, value); 275 275 } 276 276 277 277 /** 278 278 * returns number of extra arguments consumed … … 288 288 size_t arg_opt_sep = arg.find_first_of('='); 289 289 string option = arg.substr(arg_opt_start, arg_opt_sep - arg_opt_start); 290 290 291 291 unsigned extra_argc_consumed = 0; 292 292 if (arg_opt_sep == string::npos) … … 299 299 * booleans */ 300 300 if (argc == 1) 301 { 301 302 return 0; /* run out of argv for argument */ 303 } 302 304 extra_argc_consumed = 1; 303 305 #endif … … 339 341 return 1; 340 342 } 341 343 342 344 list<const char*> 343 345 scanArgv(Options& opts, unsigned argc, const char* argv[]) … … 376 378 /* a lone double dash ends option processing */ 377 379 while (++i < argc) 380 { 378 381 non_option_arguments.push_back(argv[i]); 382 } 379 383 break; 380 384 } … … 386 390 return non_option_arguments; 387 391 } 388 392 389 393 void scanLine(Options& opts, string& line) 390 394 { … … 441 445 * any trailing whitespace will be removed shortly */ 442 446 value_end = line.find_first_not_of(" \t\n\r", value_end); 443 } 444 while (value_end != string::npos); 447 } while (value_end != string::npos); 445 448 /* strip any trailing space from value*/ 446 449 value_end = line.find_last_not_of(" \t\n\r", value_end); … … 468 471 getline(in, line); 469 472 scanLine(opts, line); 470 } 471 while(!!in); 473 } while(!!in); 472 474 } 473 475 -
branches/SHM-dev/source/Lib/TAppCommon/program_options_lite.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 … … 49 49 { 50 50 struct Options; 51 51 52 52 struct ParseFailure : public std::exception 53 53 { … … 73 73 void parseConfigFile(Options& opts, const std::string& filename); 74 74 bool storePair(Options& opts, const std::string& name, const std::string& value); 75 75 76 76 /** OptionBase: Virtual base class for storing information relating to a 77 77 * specific option This base class describes common elements. Type specific … … 82 82 : opt_string(name), opt_desc(desc) 83 83 {}; 84 84 85 85 virtual ~OptionBase() {} 86 86 87 87 /* parse argument arg, to obtain a value for the option */ 88 88 virtual void parse(const std::string& arg) = 0; 89 89 /* set the argument to the default value */ 90 90 virtual void setDefault() = 0; 91 91 92 92 std::string opt_string; 93 93 std::string opt_desc; 94 94 }; 95 95 96 96 /** Type specific option storage */ 97 97 template<typename T> … … 101 101 : OptionBase(name, desc), opt_storage(storage), opt_default_val(default_val) 102 102 {} 103 103 104 104 void parse(const std::string& arg); 105 105 106 106 void setDefault() 107 107 { 108 108 opt_storage = opt_default_val; 109 109 } 110 110 111 111 T& opt_storage; 112 112 T opt_default_val; 113 113 }; 114 114 115 115 /* Generic parsing */ 116 116 template<typename T> … … 129 129 } 130 130 } 131 131 132 132 /* string parsing is specialized -- copy the whole string, not just the 133 133 * first word */ … … 138 138 opt_storage = arg; 139 139 } 140 140 141 141 /** Option class for argument handling using a user provided function */ 142 142 struct OptionFunc : public OptionBase 143 143 { 144 144 typedef void (Func)(Options&, const std::string&); 145 145 146 146 OptionFunc(const std::string& name, Options& parent_, Func *func_, const std::string& desc) 147 147 : OptionBase(name, desc), parent(parent_), func(func_) 148 148 {} 149 149 150 150 void parse(const std::string& arg) 151 151 { 152 152 func(parent, arg); 153 153 } 154 154 155 155 void setDefault() 156 156 { 157 157 return; 158 158 } 159 159 160 160 private: 161 161 Options& parent; 162 162 void (*func)(Options&, const std::string&); 163 163 }; 164 164 165 165 class OptionSpecific; 166 166 struct Options 167 167 { 168 168 ~Options(); 169 169 170 170 OptionSpecific addOptions(); 171 171 172 172 struct Names 173 173 { … … 176 176 { 177 177 if (opt) 178 { 178 179 delete opt; 180 } 179 181 } 180 182 std::list<std::string> opt_long; … … 184 186 185 187 void addOption(OptionBase *opt); 186 188 187 189 typedef std::list<Names*> NamesPtrList; 188 190 NamesPtrList opt_list; 189 191 190 192 typedef std::map<std::string, NamesPtrList> NamesMap; 191 193 NamesMap opt_long_map; 192 194 NamesMap opt_short_map; 193 195 }; 194 196 195 197 /* Class with templated overloaded operator(), for use by Options::addOptions() */ 196 198 class OptionSpecific … … 198 200 public: 199 201 OptionSpecific(Options& parent_) : parent(parent_) {} 200 202 201 203 /** 202 204 * Add option described by name to the parent Options list, … … 281 283 Options& parent; 282 284 }; 283 285 284 286 } /* namespace: program_options_lite */ 285 287 } /* namespace: df */ -
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 } -
branches/SHM-dev/source/Lib/TLibDecoder/AnnexBread.h
r1029 r1246 89 89 assert(n <= 4); 90 90 if (m_NumFutureBytes >= n) 91 { 91 92 return false; 93 } 92 94 93 95 n -= m_NumFutureBytes; … … 153 155 uint32_t val = 0; 154 156 for (UInt i = 0; i < n; i++) 157 { 155 158 val = (val << 8) | readByte(); 159 } 156 160 return val; 157 161 } -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r1235 r1246 66 66 { 67 67 READ_CODE(uiLength, ruiCode, pSymbolName); 68 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 68 if (pOS) 69 { 70 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 71 } 69 72 } 70 73 … … 72 75 { 73 76 READ_UVLC(ruiCode, pSymbolName); 74 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 77 if (pOS) 78 { 79 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 80 } 75 81 } 76 82 … … 78 84 { 79 85 READ_SVLC(ruiCode, pSymbolName); 80 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 86 if (pOS) 87 { 88 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 89 } 81 90 } 82 91 … … 84 93 { 85 94 READ_FLAG(ruiCode, pSymbolName); 86 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << (ruiCode?1:0) << "\n"; 95 if (pOS) 96 { 97 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << (ruiCode?1:0) << "\n"; 98 } 87 99 } 88 100 … … 124 136 * in the parsing if bitstream not byte-aligned */ 125 137 assert(!m_pcBitstream->getNumBitsUntilByteAligned()); 126 } while (m_pcBitstream->getNumBitsLeft() > 8); 138 } 139 while (m_pcBitstream->getNumBitsLeft() > 8); 127 140 128 141 UInt rbspTrailingBits; … … 490 503 for (UInt i = 0; i < sei.userDataLength; i++) 491 504 { 492 sei_read_code( pDecodedMessageOutputStream, 8, val, "user_data" );505 sei_read_code( NULL, 8, val, "user_data_payload_byte" ); 493 506 sei.userData[i] = val; 507 } 508 if (pDecodedMessageOutputStream) 509 { 510 (*pDecodedMessageOutputStream) << " User data payload size: " << sei.userDataLength << "\n"; 494 511 } 495 512 } … … 517 534 } 518 535 519 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << " " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0'); 536 if (pDecodedMessageOutputStream) 537 { 538 (*pDecodedMessageOutputStream) << " " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0'); 539 } 520 540 521 541 sei.m_digest.hash.clear(); … … 524 544 sei_read_code( NULL, 8, val, traceString); 525 545 sei.m_digest.hash.push_back((UChar)val); 526 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << std::setw(2) << val; 527 } 528 529 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n"; 546 if (pDecodedMessageOutputStream) 547 { 548 (*pDecodedMessageOutputStream) << std::setw(2) << val; 549 } 550 } 551 552 if (pDecodedMessageOutputStream) 553 { 554 (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n"; 555 } 530 556 } 531 557 … … 1106 1132 1107 1133 // read nested SEI messages 1108 do { 1134 do 1135 { 1109 1136 #if O0164_MULTI_LAYER_HRD 1110 1137 #if LAYERS_NOT_PRESENT_SEI … … 1122 1149 } while (m_pcBitstream->getNumBitsLeft() > 8); 1123 1150 1124 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << "End of scalable nesting SEI message\n"; 1151 if (pDecodedMessageOutputStream) 1152 { 1153 (*pDecodedMessageOutputStream) << "End of scalable nesting SEI message\n"; 1154 } 1125 1155 } 1126 1156 … … 1216 1246 sei_read_flag( pDecodedMessageOutputStream, code, "hours_flag"); currentTimeSet.hoursFlag = code; 1217 1247 if(currentTimeSet.hoursFlag) 1248 { 1218 1249 sei_read_code( pDecodedMessageOutputStream, 5, code, "hours_value"); currentTimeSet.hoursValue = code; 1250 } 1219 1251 } 1220 1252 } -
branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r1042 r1246 63 63 else 64 64 { 65 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 65 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 66 66 } 67 67 fflush ( g_hTrace ); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r1029 r1246 163 163 #ifdef DEBUG_CABAC_BINS 164 164 if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine) 165 { 165 166 std::cout << g_debugCounter << ": coding bin value " << ruiBin << ", range = [" << startingRange << "->" << m_uiRange << "]\n"; 167 } 166 168 167 169 if (g_debugCounter >= debugCabacBinTargetLine) … … 170 172 breakPointThis = 7; 171 173 } 172 if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) exit(0); 174 if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) 175 { 176 exit(0); 177 } 173 178 g_debugCounter++; 174 179 #endif -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1237 r1246 1825 1825 READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0); 1826 1826 } 1827 else pcSlice->setUseChromaQpAdj(false); 1827 else 1828 { 1829 pcSlice->setUseChromaQpAdj(false); 1830 } 1828 1831 1829 1832 if (pps->getDeblockingFilterControlPresentFlag()) … … 2534 2537 2535 2538 if (sizeId==SCALING_LIST_32x32) 2539 { 2536 2540 code*=(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES); // Adjust the decoded code for this size, to cope with the missing 32x32 chroma entries. 2541 } 2537 2542 2538 2543 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1235 r1246 485 485 #ifdef DEBUG_STRING 486 486 const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTER); 487 if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth])); 487 if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) 488 { 489 printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth])); 490 } 488 491 #endif 489 492 … … 492 495 493 496 #ifdef DEBUG_STRING 494 if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth])); 497 if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) 498 { 499 printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth])); 500 } 495 501 #endif 496 502 … … 505 511 } 506 512 #ifdef DEBUG_STRING 507 if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth])); 513 if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) 514 { 515 printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth])); 516 } 508 517 #endif 509 518 … … 518 527 TComTU &rTu) 519 528 { 520 if (!rTu.ProcessComponentSection(compID)) return; 529 if (!rTu.ProcessComponentSection(compID)) 530 { 531 return; 532 } 521 533 const Bool bIsLuma = isLuma(compID); 522 534 … … 544 556 { 545 557 xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse); 546 } 547 while (subTURecurse.nextSection(rTu)); 558 } while (subTURecurse.nextSection(rTu)); 548 559 549 560 //------------------------------------------------ … … 598 609 { 599 610 for (UInt y = 0; y < uiHeight; y++) 611 { 600 612 for (UInt x = 0; x < uiWidth; x++) 601 613 { 602 614 piResi[(y * uiStride) + x] = 0; 603 615 } 616 } 604 617 } 605 618 606 619 #ifdef DEBUG_STRING 607 620 if (psDebug) 621 { 608 622 ss << (*psDebug); 623 } 609 624 #endif 610 625 … … 627 642 const Bool bDebugReco=((DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); 628 643 if (bDebugPred || bDebugResi || bDebugReco) 644 { 629 645 ss << "###: " << "CompID: " << compID << " pred mode (ch/fin): " << uiChPredMode << "/" << uiChFinalMode << " absPartIdx: " << rTu.GetAbsPartIdxTU() << std::endl; 646 } 630 647 #endif 631 648 … … 643 660 { 644 661 #ifdef DEBUG_STRING 645 if (bDebugPred || bDebugResi || bDebugReco) ss << "###: "; 662 if (bDebugPred || bDebugResi || bDebugReco) 663 { 664 ss << "###: "; 665 } 646 666 647 667 if (bDebugPred) … … 653 673 } 654 674 } 655 if (bDebugResi) ss << " - resi: "; 675 if (bDebugResi) 676 { 677 ss << " - resi: "; 678 } 656 679 #endif 657 680 … … 660 683 #ifdef DEBUG_STRING 661 684 if (bDebugResi) 685 { 662 686 ss << pResi[ uiX ] << ", "; 687 } 663 688 #endif 664 689 #if O0043_BEST_EFFORT_DECODING … … 680 705 681 706 if (bDebugPred || bDebugResi || bDebugReco) 707 { 682 708 ss << "\n"; 709 } 683 710 #endif 684 711 pPred += uiStride; … … 742 769 { 743 770 if (isLuma(chType)) 771 { 744 772 xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, COMPONENT_Y, rTu ); 773 } 745 774 else 746 775 { -
branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.cpp
r1029 r1246 165 165 { 166 166 UInt cdir=pcCU->getIntraDir(CHANNEL_TYPE_CHROMA, uiAbsPartIdx); 167 if (cdir==36) cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx); 167 if (cdir==36) 168 { 169 cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx); 170 } 168 171 printf("coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx)); 169 172 } … … 451 454 uiYUVCbf[ch] |= pcCU->getCbf(childTUAbsPartIdx , ComponentID(ch), uiTrDepth+1 ); 452 455 } 453 454 456 } while (tuRecurseChild.nextSection(rTu) ); 455 457 … … 508 510 { 509 511 validCbf = true; 510 if (isChroma(compID)) validChromaCbf = true; 512 if (isChroma(compID)) 513 { 514 validChromaCbf = true; 515 } 511 516 } 512 517 } … … 544 549 { 545 550 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 546 if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1); 551 if (bDebugRQT) 552 { 553 printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1); 554 } 547 555 #endif 548 556 … … 559 567 { 560 568 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 561 if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1); 569 if (bDebugRQT) 570 { 571 printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1); 572 } 562 573 #endif 563 574 m_pcEntropyDecoderIf->parseCoeffNxN( subTUIterator, compID ); 564 575 } 565 } 566 while (subTUIterator.nextSection(rTu)); 576 } while (subTUIterator.nextSection(rTu)); 567 577 } 568 578 else … … 636 646 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 637 647 if (bDebugRQT) 648 { 638 649 printf("..codeCoeff: uiAbsPartIdx=%d, PU format=%d, 2Nx2N=%d, NxN=%d\n", uiAbsPartIdx, pcCU->getPartitionSize(uiAbsPartIdx), SIZE_2Nx2N, SIZE_NxN); 650 } 639 651 #endif 640 652 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp
r1230 r1246 182 182 pcPic->compressMotion(); 183 183 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); 184 if (!pcSlice->isReferenced()) c += 32; 184 if (!pcSlice->isReferenced()) 185 { 186 c += 32; 187 } 185 188 186 189 //-- For time output for each slice -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1244 r1246 230 230 m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) ); 231 231 uiSymbol++; 232 } 233 while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) ); 232 } while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) ); 234 233 235 234 if( uiCont && ( uiSymbol == uiMaxSymbol - 1 ) ) … … 286 285 m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat)); 287 286 uiSymbol++; 288 } 289 while( uiCont ); 287 } while( uiCont ); 290 288 291 289 ruiSymbol = uiSymbol; … … 315 313 prefix++; 316 314 m_pcTDecBinIf->decodeBinEP( codeWord RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) ); 317 } 318 while((codeWord != 0) && (prefix < longestPossiblePrefix)); 315 } while((codeWord != 0) && (prefix < longestPossiblePrefix)); 319 316 } 320 317 else … … 324 321 prefix++; 325 322 m_pcTDecBinIf->decodeBinEP( codeWord RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) ); 326 } 327 while( codeWord); 323 } while( codeWord); 328 324 } 329 325 … … 848 844 TComDataCU *pcCU = rTu.getCU(); 849 845 850 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) return; 846 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) 847 { 848 return; 849 } 851 850 852 851 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); … … 982 981 m_pcTDecBinIf->decodeBin( symbol, m_ChromaQpAdjFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 983 982 984 if (symbol && tableSize > 1) { 983 if (symbol && tableSize > 1) 984 { 985 985 /* cu_chroma_qp_adjustment_idc */ 986 986 xReadUnaryMaxSymbol( symbol, &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, tableSize - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); … … 1294 1294 beValid = false; 1295 1295 if((!pcCU->isIntra(uiAbsPartIdx)) && pcCU->isRDPCMEnabled(uiAbsPartIdx)) 1296 { 1296 1297 parseExplicitRdpcmMode(rTu, compID); 1298 } 1297 1299 } 1298 1300 else … … 1463 1465 Int absCoeff[1 << MLS_CG_SIZE]; 1464 1466 1465 for ( Int i = 0; i < numNonZero; i++) absCoeff[i] = 1; 1467 for ( Int i = 0; i < numNonZero; i++) 1468 { 1469 absCoeff[i] = 1; 1470 } 1466 1471 Int numC1Flag = min(numNonZero, C1FLAG_NUMBER); 1467 1472 Int firstC2FlagIdx = -1; … … 1582 1587 { 1583 1588 // Infer sign of 1st element. 1584 if (absSum&0x1) pcCoef[ blkPos ] = -pcCoef[ blkPos ]; 1589 if (absSum&0x1) 1590 { 1591 pcCoef[ blkPos ] = -pcCoef[ blkPos ]; 1592 } 1585 1593 } 1586 1594 else -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r1245 r1246 187 187 ComponentID compId=ComponentID(comp); 188 188 sliceEnabled[compId] = pcSlice->getSaoEnabledFlag(toChannelType(compId)) && (comp < pcPic->getNumberValidComponents()); 189 if (sliceEnabled[compId]) bIsSAOSliceEnabled=true; 189 if (sliceEnabled[compId]) 190 { 191 bIsSAOSliceEnabled=true; 192 } 190 193 saoblkParam[compId].modeIdc = SAO_MODE_OFF; 191 194 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1241 r1246 342 342 Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>* pcListPic) 343 343 { 344 if (!pcListPic || !m_isNoOutputPriorPics) return; 344 if (!pcListPic || !m_isNoOutputPriorPics) 345 { 346 return; 347 } 345 348 346 349 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); -
branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp
r1237 r1246 99 99 zeroCount=0; 100 100 } 101 if (v==0) zeroCount++; else zeroCount=0; 101 102 if (v==0) 103 { 104 zeroCount++; 105 } 106 else 107 { 108 zeroCount=0; 109 } 102 110 outputBuffer[outputAmount++]=v; 103 111 } … … 108 116 * to 0x03 is appended to the end of the data. 109 117 */ 110 if (zeroCount>0) outputBuffer[outputAmount++]=emulation_prevention_three_byte[0]; 118 if (zeroCount>0) 119 { 120 outputBuffer[outputAmount++]=emulation_prevention_three_byte[0]; 121 } 111 122 out.write((Char*)&(*outputBuffer.begin()), outputAmount); 112 123 } -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r1235 r1246 247 247 #if ENC_DEC_TRACE 248 248 if (g_HLSTraceEnable) 249 xTraceSEIHeader(); 249 { 250 xTraceSEIHeader(); 251 } 250 252 #endif 251 253 … … 267 269 #if ENC_DEC_TRACE 268 270 if (g_HLSTraceEnable) 269 xTraceSEIMessageType(sei.payloadType()); 271 { 272 xTraceSEIMessageType(sei.payloadType()); 273 } 270 274 #endif 271 275 … … 592 596 WRITE_FLAG( sei.m_arrangementCancelFlag, "frame_packing_arrangement_cancel_flag" ); 593 597 594 if( sei.m_arrangementCancelFlag == 0 ) { 598 if( sei.m_arrangementCancelFlag == 0 ) 599 { 595 600 WRITE_CODE( sei.m_arrangementType, 7, "frame_packing_arrangement_type" ); 596 601 … … 890 895 WRITE_FLAG(currentTimeSet.hoursFlag, "hours_flag"); 891 896 if(currentTimeSet.hoursFlag) 897 { 892 898 WRITE_CODE(currentTimeSet.hoursValue, 5, "hours_value"); 899 } 893 900 } 894 901 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h
r1029 r1246 108 108 Int maximumBitDepth = g_bitDepth[0]; 109 109 for (UInt channelTypeIndex = 1; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) 110 { 110 111 if (g_bitDepth[channelTypeIndex] > maximumBitDepth) 112 { 111 113 maximumBitDepth = g_bitDepth[channelTypeIndex]; 114 } 115 } 112 116 113 117 const UInt maxval = 255 << (maximumBitDepth - 8); … … 148 152 const ComponentID compID = ComponentID(componentIndex); 149 153 150 if (getNumPic() == 0) MSEBasedSNR[compID] = 0 * dScale; // this is the same calculation that will be evaluated for any other statistic when there are no frames (it should result in NaN). We use it here so all the output is consistent. 154 if (getNumPic() == 0) 155 { 156 MSEBasedSNR[compID] = 0 * dScale; // this is the same calculation that will be evaluated for any other statistic when there are no frames (it should result in NaN). We use it here so all the output is consistent. 157 } 151 158 else 152 159 { … … 171 178 printf( " \tTotal Frames | " "Bitrate " "Y-PSNR" ); 172 179 173 if (printSequenceMSE) printf( " Y-MSE\n" ); 174 else printf("\n"); 180 if (printSequenceMSE) 181 { 182 printf( " Y-MSE\n" ); 183 } 184 else 185 { 186 printf("\n"); 187 } 175 188 176 189 //printf( "\t------------ " " ----------" " -------- " " -------- " " --------\n" ); … … 192 205 printf( " %8.4lf\n", m_MSEyuvframe[COMPONENT_Y ] / (Double)getNumPic() ); 193 206 } 194 else printf("\n"); 207 else 208 { 209 printf("\n"); 210 } 195 211 196 212 #if SVC_EXTENSION … … 208 224 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR" ); 209 225 210 if (printSequenceMSE) printf( " Y-MSE\n" ); 211 else printf("\n"); 226 if (printSequenceMSE) 227 { 228 printf( " Y-MSE\n" ); 229 } 230 else 231 { 232 printf("\n"); 233 } 212 234 213 235 //printf( "\t------------ " " ----------" " -------- " " -------- " " --------\n" ); … … 226 248 printf( " %8.4lf\n", m_MSEyuvframe[COMPONENT_Y ] / (Double)getNumPic() ); 227 249 } 228 else printf("\n"); 250 else 251 { 252 printf("\n"); 253 } 229 254 } 230 255 break; … … 246 271 printf( " \tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR " "YUV-PSNR " ); 247 272 248 if (printSequenceMSE) printf( " Y-MSE " "U-MSE " "V-MSE " "YUV-MSE \n" ); 249 else printf("\n"); 273 if (printSequenceMSE) 274 { 275 printf( " Y-MSE " "U-MSE " "V-MSE " "YUV-MSE \n" ); 276 } 277 else 278 { 279 printf("\n"); 280 } 250 281 251 282 //printf( "\t------------ " " ----------" " -------- " " -------- " " --------\n" ); … … 272 303 MSEyuv ); 273 304 } 274 else printf("\n"); 305 else 306 { 307 printf("\n"); 308 } 275 309 276 310 #if SVC_EXTENSION … … 295 329 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR " "YUV-PSNR " ); 296 330 297 if (printSequenceMSE) printf( " Y-MSE " "U-MSE " "V-MSE " "YUV-MSE \n" ); 298 else printf("\n"); 331 if (printSequenceMSE) 332 { 333 printf( " Y-MSE " "U-MSE " "V-MSE " "YUV-MSE \n" ); 334 } 335 else 336 { 337 printf("\n"); 338 } 299 339 300 340 //printf( "\t------------ " " ----------" " -------- " " -------- " " --------\n" ); … … 321 361 MSEyuv ); 322 362 } 323 else printf("\n"); 363 else 364 { 365 printf("\n"); 366 } 324 367 } 325 368 } … … 390 433 MSEyuv ); 391 434 } 392 else fprintf(pFile, "\n"); 435 else 436 { 437 fprintf(pFile, "\n"); 438 } 393 439 394 440 break; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
r1029 r1246 230 230 #ifdef DEBUG_CABAC_BINS 231 231 if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine) 232 { 232 233 std::cout << g_debugCounter << ": coding bin value " << binValue << ", range = [" << startingRange << "->" << m_uiRange << "]\n"; 234 } 233 235 234 236 if (g_debugCounter >= debugCabacBinTargetLine) … … 237 239 breakPointThis = 7; 238 240 } 239 if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) exit(0); 241 if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) 242 { 243 exit(0); 244 } 245 240 246 g_debugCounter++; 241 247 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp
r1029 r1246 84 84 #ifdef DEBUG_ENCODER_SEARCH_BINS 85 85 if ((g_debugCounter + debugEncoderSearchBinWindow) >= debugEncoderSearchBinTargetLine) 86 { 86 87 std::cout << g_debugCounter << ": coding bin value " << binValue << ", fracBits = [" << startingFracBits << "->" << m_fracBits << "]\n"; 88 } 87 89 88 90 if (g_debugCounter >= debugEncoderSearchBinTargetLine) … … 91 93 breakPointThis = 7; 92 94 } 93 if (g_debugCounter >= (debugEncoderSearchBinTargetLine + debugEncoderSearchBinWindow)) exit(0); 95 if (g_debugCounter >= (debugEncoderSearchBinTargetLine + debugEncoderSearchBinWindow)) 96 { 97 exit(0); 98 } 94 99 g_debugCounter++; 95 100 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1237 r1246 1155 1155 { 1156 1156 WRITE_FLAG( pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA), "slice_sao_luma_flag" ); 1157 if (chromaEnabled) WRITE_FLAG( pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA), "slice_sao_chroma_flag" ); 1157 if (chromaEnabled) 1158 { 1159 WRITE_FLAG( pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA), "slice_sao_chroma_flag" ); 1160 } 1158 1161 } 1159 1162 … … 1274 1277 if (pcSlice->getPPS()->getSliceChromaQpFlag()) 1275 1278 { 1276 if (numberValidComponents > COMPONENT_Cb) { WRITE_SVLC( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb), "slice_qp_delta_cb" ); } 1277 if (numberValidComponents > COMPONENT_Cr) { WRITE_SVLC( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr), "slice_qp_delta_cr" ); } 1279 if (numberValidComponents > COMPONENT_Cb) 1280 { 1281 WRITE_SVLC( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb), "slice_qp_delta_cb" ); 1282 } 1283 if (numberValidComponents > COMPONENT_Cr) 1284 { 1285 WRITE_SVLC( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr), "slice_qp_delta_cr" ); 1286 } 1278 1287 assert(numberValidComponents <= COMPONENT_Cr+1); 1279 1288 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1235 r1246 239 239 240 240 Int m_iWaveFrontSynchro; 241 Int m_iWaveFrontSubstreams;242 241 243 242 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp
r1243 r1246 955 955 { 956 956 if (m_pcEncCfg->getCostMode()==COST_MIXED_LOSSLESS_LOSSY_CODING) 957 { 957 958 rpcBestCU->getTotalCost()=rpcTempCU->getTotalCost() + (1.0 / m_pcRdCost->getLambda()); 959 } 958 960 else 961 { 959 962 rpcBestCU->getTotalCost()=rpcTempCU->getTotalCost()+1; 963 } 960 964 } 961 965 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp
r1235 r1246 240 240 const Bool bDebugRQT=g_bFinalEncode && DebugOptionList::DebugRQT.getInt()!=0; 241 241 if (bDebugRQT) 242 { 242 243 printf("x..codeTransform: offsetLuma=%d offsetChroma=%d absPartIdx=%d, uiDepth=%d\n width=%d, height=%d, uiTrIdx=%d, uiInnerQuadIdx=%d\n", 243 244 rTu.getCoefficientOffset(COMPONENT_Y), rTu.getCoefficientOffset(COMPONENT_Cb), uiAbsPartIdx, uiDepth, rTu.getRect(COMPONENT_Y).width, rTu.getRect(COMPONENT_Y).height, rTu.GetTransformDepthRel(), rTu.GetSectionNumber()); 245 } 244 246 #endif 245 247 const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) > uiTrIdx;// + pcCU->getDepth( uiAbsPartIdx ) > uiDepth; … … 260 262 { 261 263 bHaveACodedBlock = true; 262 if (isChroma(compID)) bHaveACodedChromaBlock = true; 264 if (isChroma(compID)) 265 { 266 bHaveACodedChromaBlock = true; 267 } 263 268 } 264 269 } … … 322 327 { 323 328 xEncodeTransform( bCodeDQP, codeChromaQpAdj, tuRecurseChild ); 324 } 325 while (tuRecurseChild.nextSection(rTu)); 329 } while (tuRecurseChild.nextSection(rTu)); 326 330 } 327 331 else … … 378 382 { 379 383 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 380 if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1); 384 if (bDebugRQT) 385 { 386 printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1); 387 } 381 388 #endif 382 389 … … 393 400 { 394 401 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 395 if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1); 402 if (bDebugRQT) 403 { 404 printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1); 405 } 396 406 #endif 397 407 m_pcEntropyCoderIf->codeCoeffNxN( subTUIterator, (pcCU->getCoeff(compID) + subTUIterator.getCoefficientOffset(compID)), compID ); … … 435 445 { 436 446 UInt cdir=pcCU->getIntraDir(CHANNEL_TYPE_CHROMA, uiAbsPartIdx); 437 if (cdir==36) cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx); 447 if (cdir==36) 448 { 449 cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx); 450 } 438 451 printf("coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx)); 439 452 } … … 683 696 TComTURecurse tuRecurse(pcCU, uiAbsPartIdx, uiDepth); 684 697 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 685 if (bDebugRQT) printf("..codeCoeff: uiAbsPartIdx=%d, PU format=%d, 2Nx2N=%d, NxN=%d\n", uiAbsPartIdx, pcCU->getPartitionSize(uiAbsPartIdx), SIZE_2Nx2N, SIZE_NxN); 698 if (bDebugRQT) 699 { 700 printf("..codeCoeff: uiAbsPartIdx=%d, PU format=%d, 2Nx2N=%d, NxN=%d\n", uiAbsPartIdx, pcCU->getPartitionSize(uiAbsPartIdx), SIZE_2Nx2N, SIZE_NxN); 701 } 686 702 #endif 687 703 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1237 r1246 598 598 sei_time_code.numClockTs = m_pcCfg->getNumberOfTimesets(); 599 599 for(Int i = 0; i < sei_time_code.numClockTs; i++) 600 { 600 601 sei_time_code.timeSetArray[i] = m_pcCfg->getTimeSet(i); 602 } 601 603 602 604 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); … … 1542 1544 { 1543 1545 if(m_pcCfg->getGOPEntry(kk).m_POC==tPoc) 1546 { 1544 1547 break; 1548 } 1545 1549 } 1546 1550 Int tTid=m_pcCfg->getGOPEntry(kk).m_temporalId; … … 3040 3044 flag = 1; 3041 3045 } 3042 else ui64Tmp = maxDiff - tmp + 1; 3046 else 3047 { 3048 ui64Tmp = maxDiff - tmp + 1; 3049 } 3043 3050 } 3044 3051 pCRD[ i ] = (UInt)ui64Tmp - uiPrev - 1; … … 3245 3252 delete pcBitstreamRedirect; 3246 3253 3247 if( accumBitsDU != NULL) delete accumBitsDU; 3248 if( accumNalsDU != NULL) delete accumNalsDU; 3254 if( accumBitsDU != NULL) 3255 { 3256 delete accumBitsDU; 3257 } 3258 if( accumNalsDU != NULL) 3259 { 3260 delete accumNalsDU; 3261 } 3249 3262 3250 3263 #if SVC_EXTENSION … … 3317 3330 3318 3331 if (!bCalcDist) 3332 { 3319 3333 ruiDist = xFindDistortionFrame(pcPic->getPicYuvOrg(), pcPic->getPicYuvRec()); 3334 } 3320 3335 } 3321 3336 … … 3556 3571 3557 3572 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); 3558 if (!pcSlice->isReferenced()) c += 32; 3573 if (!pcSlice->isReferenced()) 3574 { 3575 c += 32; 3576 } 3559 3577 3560 3578 #if SVC_EXTENSION … … 3824 3842 vRL[i] = 0; 3825 3843 for( Int j = i - RVM_VCEGAM10_M ; j <= i + RVM_VCEGAM10_M - 1 ; j++ ) 3844 { 3826 3845 vRL[i] += m_vRVM_RP[j]; 3846 } 3827 3847 vRL[i] /= ( 2 * RVM_VCEGAM10_M ); 3828 3848 vB[i] = vB[i-1] + m_vRVM_RP[i] - vRL[i]; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPreanalyzer.h
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 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r1029 r1246 519 519 for(Int classIdx=0; classIdx<NUM_SAO_EO_CLASSES; classIdx++) 520 520 { 521 if(classIdx==SAO_CLASS_EO_FULL_VALLEY && quantOffsets[classIdx] < 0) quantOffsets[classIdx] =0; 522 if(classIdx==SAO_CLASS_EO_HALF_VALLEY && quantOffsets[classIdx] < 0) quantOffsets[classIdx] =0; 523 if(classIdx==SAO_CLASS_EO_HALF_PEAK && quantOffsets[classIdx] > 0) quantOffsets[classIdx] =0; 524 if(classIdx==SAO_CLASS_EO_FULL_PEAK && quantOffsets[classIdx] > 0) quantOffsets[classIdx] =0; 521 if(classIdx==SAO_CLASS_EO_FULL_VALLEY && quantOffsets[classIdx] < 0) 522 { 523 quantOffsets[classIdx] =0; 524 } 525 if(classIdx==SAO_CLASS_EO_HALF_VALLEY && quantOffsets[classIdx] < 0) 526 { 527 quantOffsets[classIdx] =0; 528 } 529 if(classIdx==SAO_CLASS_EO_HALF_PEAK && quantOffsets[classIdx] > 0) 530 { 531 quantOffsets[classIdx] =0; 532 } 533 if(classIdx==SAO_CLASS_EO_FULL_PEAK && quantOffsets[classIdx] > 0) 534 { 535 quantOffsets[classIdx] =0; 536 } 525 537 526 538 if( quantOffsets[classIdx] != 0 ) //iterative adjustment only when derived offset is not zero … … 818 830 { 819 831 if (sliceEnabled[compId]) 832 { 820 833 allBlksDisabled = false; 834 } 821 835 } 822 836 … … 953 967 m_lineBufWidth = m_maxCUWidth; 954 968 955 if (m_signLineBuf1) delete[] m_signLineBuf1; m_signLineBuf1 = NULL; 969 if (m_signLineBuf1) 970 { 971 delete[] m_signLineBuf1; 972 m_signLineBuf1 = NULL; 973 } 956 974 m_signLineBuf1 = new Char[m_lineBufWidth+1]; 957 975 958 if (m_signLineBuf2) delete[] m_signLineBuf2; m_signLineBuf2 = NULL; 976 if (m_signLineBuf2) 977 { 978 delete[] m_signLineBuf2; 979 m_signLineBuf2 = NULL; 980 } 959 981 m_signLineBuf2 = new Char[m_lineBufWidth+1]; 960 982 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r1244 r1246 109 109 SliceType eSliceType = m_pcSlice->getSliceType(); 110 110 111 SliceType encCABACTableIdx = m_pcSlice->getEncCABACTableIdx(); ;111 SliceType encCABACTableIdx = m_pcSlice->getEncCABACTableIdx(); 112 112 if (!m_pcSlice->isIntra() && (encCABACTableIdx==B_SLICE || encCABACTableIdx==P_SLICE) && m_pcSlice->getPPS()->getCabacInitPresentFlag()) 113 113 { … … 407 407 m_pcBinIf->copyState( pSrc->m_pcBinIf ); 408 408 if (isLuma(chType)) 409 { 409 410 this->m_cCUIntraPredSCModel .copyFrom( &pSrc->m_cCUIntraPredSCModel ); 411 } 410 412 else 413 { 411 414 this->m_cCUChromaPredSCModel .copyFrom( &pSrc->m_cCUChromaPredSCModel ); 415 } 412 416 } 413 417 … … 613 617 { 614 618 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 619 { 615 620 return; 621 } 616 622 617 623 UInt uiCtx = pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ); … … 832 838 TComDataCU *pcCU = rTu.getCU(); 833 839 834 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) return; 840 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) 841 { 842 return; 843 } 835 844 836 845 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); … … 1266 1275 beValid = false; 1267 1276 if ( (!pcCU->isIntra(uiAbsPartIdx)) && pcCU->isRDPCMEnabled(uiAbsPartIdx)) 1277 { 1268 1278 codeExplicitRdpcmMode( rTu, compID); 1279 } 1269 1280 } 1270 1281 else … … 1326 1337 uiNumSig--; 1327 1338 } 1328 } 1329 while ( uiNumSig > 0 ); 1339 } while ( uiNumSig > 0 ); 1330 1340 1331 1341 // Code position of last coefficient -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r1244 r1246 239 239 { 240 240 if (iIdx < iNum) 241 { 241 242 m_auiMVPIdxCost[iIdx][iNum] = xGetMvpIdxBits(iIdx, iNum); 243 } 242 244 else 245 { 243 246 m_auiMVPIdxCost[iIdx][iNum] = MAX_INT; 247 } 244 248 } 245 249 } … … 365 369 366 370 if ( m_cDistParam.iRows > 32 ) 371 { 367 372 m_cDistParam.iSubShift = 4; 373 } 368 374 else if ( m_cDistParam.iRows > 16 ) 375 { 369 376 m_cDistParam.iSubShift = 3; 377 } 370 378 else if ( m_cDistParam.iRows > 8 ) 379 { 371 380 m_cDistParam.iSubShift = 2; 381 } 372 382 else 383 { 373 384 m_cDistParam.iSubShift = 1; 385 } 374 386 375 387 Distortion uiTempSad = m_cDistParam.DistFunc( &m_cDistParam ); … … 385 397 uiSad += uiTempSad >> m_cDistParam.iSubShift; 386 398 if(((uiSad << isubShift) + uiBitCost) > rcStruct.uiBestSad) 399 { 387 400 break; 401 } 388 402 389 403 m_cDistParam.iSubShift--; … … 898 912 const ComponentID compID=ComponentID(ch); 899 913 if( rTu.ProcessingAllQuadrants(compID) && (uiTrDepth==0 || pcCU->getCbf( uiAbsPartIdx, compID, uiTrDepth-1 ) )) 914 { 900 915 m_pcEntropyCoder->encodeQtCbf(rTu, compID, (uiSubdiv == 0)); 916 } 901 917 } 902 918 } … … 1007 1023 { 1008 1024 UInt uiQNumParts = pcCU->getTotalNumPart() >> 2; 1009 if (uiTrDepth>0 && (uiAbsPartIdx%uiQNumParts)==0) m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 1025 if (uiTrDepth>0 && (uiAbsPartIdx%uiQNumParts)==0) 1026 { 1027 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 1028 } 1010 1029 } 1011 1030 } … … 1084 1103 ) 1085 1104 { 1086 if (!rTu.ProcessComponentSection(compID)) return; 1105 if (!rTu.ProcessComponentSection(compID)) 1106 { 1107 return; 1108 } 1087 1109 const Bool bIsLuma = isLuma(compID); 1088 1110 const TComRectangle &rect= rTu.getRect(compID); … … 1208 1230 if (bUseCrossCPrediction) 1209 1231 { 1210 if (xCalcCrossComponentPredictionAlpha( rTu, compID, lumaResidualForEstimate, piResi, uiWidth, uiHeight, MAX_CU_SIZE, uiStride ) == 0) return; 1232 if (xCalcCrossComponentPredictionAlpha( rTu, compID, lumaResidualForEstimate, piResi, uiWidth, uiHeight, MAX_CU_SIZE, uiStride ) == 0) 1233 { 1234 return; 1235 } 1211 1236 TComTrQuant::crossComponentPrediction ( rTu, compID, reconstructedLumaResidual, piResi, piResi, uiWidth, uiHeight, MAX_CU_SIZE, uiStride, uiStride, false ); 1212 1237 } … … 1307 1332 } 1308 1333 } 1309 if (bDebugResi) ss << " - resi: "; 1334 if (bDebugResi) 1335 { 1336 ss << " - resi: "; 1337 } 1310 1338 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1311 1339 { 1312 if (bDebugResi) ss << pResi[ uiX ] << ", "; 1340 if (bDebugResi) 1341 { 1342 ss << pResi[ uiX ] << ", "; 1343 } 1313 1344 pReco [ uiX ] = Pel(ClipBD<Int>( Int(pPred[uiX]) + Int(pResi[uiX]), clipbd )); 1314 1345 pRecQt [ uiX ] = pReco[ uiX ]; … … 1527 1558 xLoadIntraResultQT(COMPONENT_Y, rTu ); 1528 1559 if (rTu.ProcessComponentSection(COMPONENT_Y)) 1560 { 1529 1561 pcCU->setCbfSubParts ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) ); 1562 } 1530 1563 1531 1564 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiFullDepth ][ CI_TEMP_BEST ] ); … … 1902 1935 if( uiTrMode == uiTrDepth ) 1903 1936 { 1904 if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA)) return; 1937 if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA)) 1938 { 1939 return; 1940 } 1905 1941 1906 1942 const UInt uiFullDepth = rTu.GetTransformDepthTotal(); … … 2041 2077 pcCU ->setCrossComponentPredictionAlphaPartRange( bestCrossCPredictionAlpha, compID, subTUAbsPartIdx, partIdxesPerSubTU ); 2042 2078 ruiDist += singleDistC; 2043 } 2044 while (TUIterator.nextSection(rTu)); 2045 2046 if (splitIntoSubTUs) offsetSubTUCBFs(rTu, compID); 2079 } while (TUIterator.nextSection(rTu)); 2080 2081 if (splitIntoSubTUs) 2082 { 2083 offsetSubTUCBFs(rTu, compID); 2084 } 2047 2085 } 2048 2086 } … … 2092 2130 TEncSearch::xSetIntraResultChromaQT(TComYuv* pcRecoYuv, TComTU &rTu) 2093 2131 { 2094 if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA)) return; 2132 if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA)) 2133 { 2134 return; 2135 } 2095 2136 TComDataCU *pcCU=rTu.getCU(); 2096 2137 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); … … 2208 2249 2209 2250 if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y)) 2251 { 2210 2252 initAdiPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) ); 2253 } 2211 2254 2212 2255 Bool doFastSearch = (numModesForFullRD != numModesAvailable); … … 2333 2376 UInt max=numModesForFullRD; 2334 2377 2335 if (DebugOptionList::ForceLumaMode.isSet()) max=0; // we are forcing a direction, so don't bother with mode check 2378 if (DebugOptionList::ForceLumaMode.isSet()) 2379 { 2380 max=0; // we are forcing a direction, so don't bother with mode check 2381 } 2336 2382 for ( UInt uiMode = 0; uiMode < max; uiMode++) 2337 2383 #else … … 2424 2470 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 2425 2471 if (DebugOptionList::ForceLumaMode.isSet()) 2472 { 2426 2473 uiOrgMode = DebugOptionList::ForceLumaMode.getInt(); 2474 } 2427 2475 #endif 2428 2476 … … 2587 2635 { 2588 2636 uiMinMode=DebugOptionList::ForceChromaMode.getInt(); 2589 if (uiModeList[uiMinMode]==34) uiMinMode=4; // if the fixed mode has been renumbered because DM_CHROMA covers it, use DM_CHROMA. 2637 if (uiModeList[uiMinMode]==34) 2638 { 2639 uiMinMode=4; // if the fixed mode has been renumbered because DM_CHROMA covers it, use DM_CHROMA. 2640 } 2590 2641 uiMaxMode=uiMinMode+1; 2591 2642 } … … 3083 3134 { 3084 3135 uiBitsTemp += iRefIdxTemp+1; 3085 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 3136 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) 3137 { 3138 uiBitsTemp--; 3139 } 3086 3140 } 3087 3141 … … 3209 3263 { 3210 3264 uiMotBits[1] += bestBiPRefIdxL1+1; 3211 if ( bestBiPRefIdxL1 == pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_1)-1 ) uiMotBits[1]--; 3265 if ( bestBiPRefIdxL1 == pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_1)-1 ) 3266 { 3267 uiMotBits[1]--; 3268 } 3212 3269 } 3213 3270 … … 3319 3376 { 3320 3377 uiBitsTemp += iRefIdxTemp+1; 3321 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 3378 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) 3379 { 3380 uiBitsTemp--; 3381 } 3322 3382 } 3323 3383 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; … … 3698 3758 assert(pcAMVPInfo->m_acMvCand[riMVPIdx] == rcMvPred); 3699 3759 3700 if (pcAMVPInfo->iN < 2) return; 3760 if (pcAMVPInfo->iN < 2) 3761 { 3762 return; 3763 } 3701 3764 3702 3765 m_pcRdCost->getMotionCost( true, 0, pcCU->getCUTransquantBypass(0) ); … … 3712 3775 for (Int iMVPIdx = 0; iMVPIdx < pcAMVPInfo->iN; iMVPIdx++) 3713 3776 { 3714 if (iMVPIdx == riMVPIdx) continue; 3777 if (iMVPIdx == riMVPIdx) 3778 { 3779 continue; 3780 } 3715 3781 3716 3782 m_pcRdCost->setPredictor( pcAMVPInfo->m_acMvCand[iMVPIdx] ); … … 3839 3905 TComMv cMvPred = *pcMvPred; 3840 3906 3841 if ( bBi ) xSetSearchRange ( pcCU, rcMv , iSrchRng, cMvSrchRngLT, cMvSrchRngRB ); 3842 else xSetSearchRange ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB ); 3907 if ( bBi ) 3908 { 3909 xSetSearchRange ( pcCU, rcMv , iSrchRng, cMvSrchRngLT, cMvSrchRngRB ); 3910 } 3911 else 3912 { 3913 xSetSearchRange ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB ); 3914 } 3843 3915 3844 3916 m_pcRdCost->getMotionCost( true, 0, pcCU->getCUTransquantBypass(uiPartAddr) ); … … 4509 4581 if( (pcCU->getWidth(0) > pcCU->getSlice()->getSPS()->getMaxTrSize()) ) 4510 4582 { 4511 while( pcCU->getWidth(0) > (pcCU->getSlice()->getSPS()->getMaxTrSize()<<uiTrLevel) ) uiTrLevel++; 4583 while( pcCU->getWidth(0) > (pcCU->getSlice()->getSPS()->getMaxTrSize()<<uiTrLevel) ) 4584 { 4585 uiTrLevel++; 4586 } 4512 4587 } 4513 4588 … … 4991 5066 currCompCost = m_pcRdCost->calcRdCost(currCompBits, currCompDist); 4992 5067 4993 if (pcCU->isLosslessCoded(0)) nonCoeffCost = MAX_DOUBLE; 5068 if (pcCU->isLosslessCoded(0)) 5069 { 5070 nonCoeffCost = MAX_DOUBLE; 5071 } 4994 5072 } 4995 5073 else if ((transformSkipModeId == 1) && !bUseCrossCPrediction) … … 5086 5164 pcCU->setCbfPartRange ((((uiAbsSum [compID][subTUIndex] > 0) ? 1 : 0) << uiTrMode), compID, subTUAbsPartIdx, partIdxesPerSubTU ); 5087 5165 pcCU->setCrossComponentPredictionAlphaPartRange( bestCrossCPredictionAlpha [compID][subTUIndex], compID, subTUAbsPartIdx, partIdxesPerSubTU ); 5088 } //end of sub-TU loop 5089 while (TUIterator.nextSection(rTu)); 5166 } while (TUIterator.nextSection(rTu)); //end of sub-TU loop 5090 5167 } // processing section 5091 5168 } // component loop … … 5129 5206 5130 5207 m_pcEntropyCoder->encodeCoeffNxN( rTu, pcCoeffCurr[compID], compID ); 5131 for (UInt subTUIndex = 0; subTUIndex < 2; subTUIndex++) uiSingleDist += uiSingleDistComp[compID][subTUIndex]; 5208 for (UInt subTUIndex = 0; subTUIndex < 2; subTUIndex++) 5209 { 5210 uiSingleDist += uiSingleDistComp[compID][subTUIndex]; 5211 } 5132 5212 } 5133 5213 } … … 5168 5248 5169 5249 for (UInt subTU = 0; subTU < 2; subTU++) 5250 { 5170 5251 bestsubTUCBF[compID][subTU] = pcCU->getCbf ((uiAbsPartIdx + (subTU * partIdxesPerSubTU)), compID, subTUDepth); 5252 } 5171 5253 } 5172 5254 } … … 5189 5271 for(UInt ch = 0; ch < numValidComp; ch++) 5190 5272 { 5191 if (lastPos!=std::string::npos && childString.find(debug_reorder_data_inter_token[ch], lastPos)==lastPos) lastPos+=strlen(debug_reorder_data_inter_token[ch]); // skip leading string 5273 if (lastPos!=std::string::npos && childString.find(debug_reorder_data_inter_token[ch], lastPos)==lastPos) 5274 { 5275 lastPos+=strlen(debug_reorder_data_inter_token[ch]); // skip leading string 5276 } 5192 5277 std::size_t pos=childString.find(debug_reorder_data_inter_token[ch+1], lastPos); 5193 if (pos!=std::string::npos && pos>endStrng) lastPos=endStrng; 5278 if (pos!=std::string::npos && pos>endStrng) 5279 { 5280 lastPos=endStrng; 5281 } 5194 5282 sSplitString[ch]+=childString.substr(lastPos, (pos==std::string::npos)? std::string::npos : (pos-lastPos) ); 5195 5283 lastPos=pos; 5196 5284 } 5197 5285 #endif 5198 } 5199 while ( tuRecurseChild.nextSection(rTu) ) ; 5286 } while ( tuRecurseChild.nextSection(rTu) ) ; 5200 5287 5201 5288 UInt uiCbfAny=0; … … 5474 5561 m_pcEntropyCoder->resetBits(); 5475 5562 if (isLuma(chType)) 5563 { 5476 5564 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset); 5565 } 5477 5566 else 5567 { 5478 5568 m_pcEntropyCoder->encodeIntraDirModeChroma ( pcCU, uiPartOffset); 5569 } 5479 5570 5480 5571 rIntraDirVal = origVal; // restore … … 5491 5582 UInt shift=0; 5492 5583 5493 while ( shift<uiFastCandNum && uiCost<CandCostList[ uiFastCandNum-1-shift ] ) shift++; 5584 while ( shift<uiFastCandNum && uiCost<CandCostList[ uiFastCandNum-1-shift ] ) 5585 { 5586 shift++; 5587 } 5494 5588 5495 5589 if( shift!=0 ) … … 5793 5887 m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && pcSlice->testWeightPred() ) || ( pcSlice->getSliceType()==B_SLICE && pcSlice->testWeightBiPred() ) ; 5794 5888 5795 if ( !m_cDistParam.bApplyWeight ) return; 5889 if ( !m_cDistParam.bApplyWeight ) 5890 { 5891 return; 5892 } 5796 5893 5797 5894 Int iRefIdx0 = ( eRefPicListCur == REF_PIC_LIST_0 ) ? iRefIdx : (-1); … … 5800 5897 getWpScaling( pcCU, iRefIdx0, iRefIdx1, wp0 , wp1 ); 5801 5898 5802 if ( iRefIdx0 < 0 ) wp0 = NULL; 5803 if ( iRefIdx1 < 0 ) wp1 = NULL; 5899 if ( iRefIdx0 < 0 ) 5900 { 5901 wp0 = NULL; 5902 } 5903 if ( iRefIdx1 < 0 ) 5904 { 5905 wp1 = NULL; 5906 } 5804 5907 5805 5908 m_cDistParam.wpCur = NULL; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r1235 r1246 98 98 99 99 // free lambda and QP arrays 100 if ( m_pdRdPicLambda ) { xFree( m_pdRdPicLambda ); m_pdRdPicLambda = NULL; } 101 if ( m_pdRdPicQp ) { xFree( m_pdRdPicQp ); m_pdRdPicQp = NULL; } 102 if ( m_piRdPicQp ) { xFree( m_piRdPicQp ); m_piRdPicQp = NULL; } 100 if ( m_pdRdPicLambda ) 101 { 102 xFree( m_pdRdPicLambda ); 103 m_pdRdPicLambda = NULL; 104 } 105 if ( m_pdRdPicQp ) 106 { 107 xFree( m_pdRdPicQp ); 108 m_pdRdPicQp = NULL; 109 } 110 if ( m_piRdPicQp ) 111 { 112 xFree( m_piRdPicQp ); 113 m_piRdPicQp = NULL; 114 } 103 115 } 104 116 … … 952 964 953 965 if (boundingCtuTsAddr <= ctuTsAddr) 966 { 954 967 break; 968 } 955 969 956 970 pcSlice->setSliceBits( (UInt)(pcSlice->getSliceBits() + numberOfWrittenBits) ); … … 1123 1137 ComponentID compId=ComponentID(comp); 1124 1138 sliceEnabled[compId] = pcSlice->getSaoEnabledFlag(toChannelType(compId)) && (comp < pcPic->getNumberValidComponents()); 1125 if (sliceEnabled[compId]) bIsSAOSliceEnabled=true; 1139 if (sliceEnabled[compId]) 1140 { 1141 bIsSAOSliceEnabled=true; 1142 } 1126 1143 } 1127 1144 if (bIsSAOSliceEnabled) … … 1228 1245 break; 1229 1246 case FIXED_NUMBER_OF_BYTES: 1230 if (encodingSlice) 1231 boundingCtuTSAddrSlice = sliceCurEndCtuTSAddr; 1232 else 1233 boundingCtuTSAddrSlice = numberOfCtusInFrame; 1247 boundingCtuTSAddrSlice = (encodingSlice) ? sliceCurEndCtuTSAddr : numberOfCtusInFrame; 1234 1248 break; 1235 1249 case FIXED_NUMBER_OF_TILES: … … 1302 1316 * \returns Updates startCtuTsAddr, boundingCtuTsAddr with appropriate CTU address 1303 1317 */ 1304 Void TEncSlice::xDetermineStartAndBoundingCtuTsAddr ( UInt& startCtuTsAddr, UInt& boundingCtuTsAddr, TComPic* pcPic, const Bool encodingSlice ) 1318 Void TEncSlice::xDetermineStartAndBoundingCtuTsAddr ( UInt& startCtuTsAddr, UInt& boundingCtuTsAddr, TComPic* pcPic, const Bool encodingSlice ) // TODO: this is now only ever called with encodingSlice=false 1305 1319 { 1306 1320 TComSlice* pcSlice = pcPic->getSlice(getSliceIdx()); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1235 r1246 1516 1516 { 1517 1517 for(Int i=0; i<m_iNumRowsMinus1; i++) 1518 { 1518 1519 uiCummulativeRowHeight += m_tileRowHeight[i]; 1520 } 1519 1521 1520 1522 if( uiCummulativeRowHeight >= iHeightInCU ) -
branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp
r1235 r1246 92 92 93 93 for(Int y = 0; y < iHeight; y++, pPel+=iStride ) 94 { 94 95 for(Int x = 0; x < iWidth; x++ ) 96 { 95 97 iOrgDC += (Int)( pPel[x] ); 98 } 99 } 96 100 } 97 101 … … 103 107 104 108 for(Int y = 0; y < iHeight; y++, pPel += iStride ) 109 { 105 110 for(Int x = 0; x < iWidth; x++ ) 111 { 106 112 iOrgAC += abs( (Int)pPel[x] - (Int)iOrgNormDC ); 113 } 114 } 107 115 } 108 116 … … 117 125 slice->setWpAcDcParam(weightACDCParam); 118 126 } 127 119 128 120 129 /** check weighted pred or non-weighted pred … … 296 305 297 306 if(deltaWeight >= range || deltaWeight < -range) 307 { 298 308 return false; 309 } 299 310 300 311 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp
r1077 r1246 73 73 { 74 74 for (UInt y = 0; y < height; y++, img+=stride) 75 { 75 76 for (UInt x = 0; x < width; x++) 77 { 76 78 img[x] <<= shiftbits; 79 } 80 } 77 81 } 78 82 else if (shiftbits < 0) … … 82 86 Pel rounding = 1 << (shiftbits-1); 83 87 for (UInt y = 0; y < height; y++, img+=stride) 88 { 84 89 for (UInt x = 0; x < width; x++) 90 { 85 91 img[x] = Clip3(minval, maxval, Pel((img[x] + rounding) >> shiftbits)); 92 } 93 } 86 94 } 87 95 } … … 178 186 { 179 187 if (!numFrames) 188 { 180 189 return; 190 } 181 191 182 192 //------------------ … … 188 198 ComponentID compID=ComponentID(component); 189 199 frameSize += (width >> getComponentScaleX(compID, format)) * (height >> getComponentScaleY(compID, format)); 190 if (m_fileBitdepth[toChannelType(compID)] > 8) wordsize=2; 200 if (m_fileBitdepth[toChannelType(compID)] > 8) 201 { 202 wordsize=2; 203 } 191 204 } 192 205 frameSize *= wordsize; … … 197 210 /* attempt to seek */ 198 211 if (!!m_cHandle.seekg(offset, ios::cur)) 212 { 199 213 return; /* success */ 214 } 200 215 m_cHandle.clear(); 201 216 202 217 /* fall back to consuming the input */ 203 218 Char buf[512]; 204 const streamoffoffset_mod_bufsize = offset % sizeof(buf);219 const UInt offset_mod_bufsize = offset % sizeof(buf); 205 220 for (streamoff i = 0; i < offset - offset_mod_bufsize; i += sizeof(buf)) 206 221 { … … 263 278 const Pel value=Pel(1<<(fileBitDepth-1)); 264 279 for (UInt y = 0; y < full_height_dest; y++, dst+=stride_dest) 280 { 265 281 for (UInt x = 0; x < full_width_dest; x++) 282 { 266 283 dst[x] = value; 284 } 285 } 267 286 } 268 287 … … 305 324 { 306 325 for (UInt x = 0; x < width_dest; x++) 326 { 307 327 dst[x] = buf[x<<sx]; 328 } 308 329 } 309 330 else … … 322 343 { 323 344 for (UInt x = 0; x < width_dest; x++) 345 { 324 346 dst[x] = buf[x>>sx]; 347 } 325 348 } 326 349 else 327 350 { 328 351 for (UInt x = 0; x < width_dest; x++) 352 { 329 353 dst[x] = Pel(buf[(x>>sx)*2+0]) | (Pel(buf[(x>>sx)*2+1])<<8); 354 } 330 355 } 331 356 } … … 334 359 const Pel val=dst[width_dest-1]; 335 360 for (UInt x = width_dest; x < full_width_dest; x++) 361 { 336 362 dst[x] = val; 363 } 337 364 338 365 dst += stride_dest; … … 342 369 // process lower padding 343 370 for (UInt y = height_dest; y < full_height_dest; y++, dst+=stride_dest) 371 { 344 372 for (UInt x = 0; x < full_width_dest; x++) 373 { 345 374 dst[x] = (dst - stride_dest)[x]; 375 } 376 } 346 377 } 347 378 delete[] buf; … … 393 424 UChar val(value); 394 425 for (UInt x = 0; x < width_file; x++) 426 { 395 427 buf[x]=val; 428 } 396 429 } 397 430 else … … 520 553 UChar val(value); 521 554 for (UInt x = 0; x < width_file; x++) 555 { 522 556 fieldBuffer[x]=val; 557 } 523 558 } 524 559 else … … 634 669 { 635 670 // check end-of-file 636 if ( isEof() ) return false; 671 if ( isEof() ) 672 { 673 return false; 674 } 637 675 TComPicYuv *pPicYuv=pPicYuvTrueOrg; 638 if (format>=NUM_CHROMA_FORMAT) format=pPicYuv->getChromaFormat(); 676 if (format>=NUM_CHROMA_FORMAT) 677 { 678 format=pPicYuv->getChromaFormat(); 679 } 639 680 640 681 Bool is16bit = false; … … 642 683 for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) 643 684 { 644 if (m_fileBitdepth[ch] > 8) is16bit=true; 685 if (m_fileBitdepth[ch] > 8) 686 { 687 is16bit=true; 688 } 645 689 } 646 690 … … 733 777 for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) 734 778 { 735 if (m_fileBitdepth[ch] > 8) is16bit=true; 736 if (m_bitdepthShift[ch] != 0) nonZeroBitDepthShift=true; 779 if (m_fileBitdepth[ch] > 8) 780 { 781 is16bit=true; 782 } 783 if (m_bitdepthShift[ch] != 0) 784 { 785 nonZeroBitDepthShift=true; 786 } 737 787 } 738 788 739 789 TComPicYuv *dstPicYuv = NULL; 740 790 Bool retval = true; 741 if (format>=NUM_CHROMA_FORMAT) format=pPicYuv->getChromaFormat(); 791 if (format>=NUM_CHROMA_FORMAT) 792 { 793 format=pPicYuv->getChromaFormat(); 794 } 742 795 743 796 if (nonZeroBitDepthShift) … … 817 870 for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) 818 871 { 819 if (m_fileBitdepth[ch] > 8) is16bit=true; 820 if (m_bitdepthShift[ch] != 0) nonZeroBitDepthShift=true; 872 if (m_fileBitdepth[ch] > 8) 873 { 874 is16bit=true; 875 } 876 if (m_bitdepthShift[ch] != 0) 877 { 878 nonZeroBitDepthShift=true; 879 } 821 880 } 822 881 … … 828 887 TComPicYuv *pPicYuv = (field == 0) ? pPicYuvTop : pPicYuvBottom; 829 888 830 if (format>=NUM_CHROMA_FORMAT) format=pPicYuv->getChromaFormat(); 889 if (format>=NUM_CHROMA_FORMAT) 890 { 891 format=pPicYuv->getChromaFormat(); 892 } 831 893 832 894 TComPicYuv* &dstPicYuv = (field == 0) ? dstPicYuvTop : dstPicYuvBottom; … … 949 1011 { 950 1012 for(UInt comp=0; comp<numValidComp; comp++) 1013 { 951 1014 copyPlane(src, ComponentID(bIsForwards?0:comp), dest, ComponentID(comp)); 1015 } 952 1016 } 953 1017 break; … … 955 1019 { 956 1020 for(UInt comp=0; comp<numValidComp; comp++) 1021 { 957 1022 copyPlane(src, ComponentID(comp), dest, ComponentID((numValidComp-comp)%numValidComp)); 1023 } 958 1024 } 959 1025 break; … … 982 1048 { 983 1049 for(UInt comp=0; comp<numValidComp; comp++) 1050 { 984 1051 copyPlane(src, ComponentID(comp), dest, ComponentID(comp)); 1052 } 985 1053 } 986 1054 break; -
branches/SHM-dev/source/Lib/libmd5/MD5.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/libmd5/libmd5.h
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
Note: See TracChangeset for help on using the changeset viewer.