Changeset 1246 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
14 Jul 2015, 00:26:07 (10 years ago)
Author:
seregin
Message:

port rev 4240

Location:
branches/SHM-dev/source/Lib/TLibCommon
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/AccessUnit.h

    r1029 r1246  
    3232 */
    3333
    34 /** 
     34/**
    3535 \file     AccessUnit.h
    3636 \brief    Access Unit class (header)
  • branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h

    r1201 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    224224
    225225// 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
    227227//       effort can be done without use of macros to alter the names used to indicate the different NAL unit types.
    228228enum NalUnitType
    229229{
    230   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
     230  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
    234234  NAL_UNIT_CODED_SLICE_TSA_R,       // 3
    235  
    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
     235
     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
    240240  NAL_UNIT_CODED_SLICE_RADL_R,      // 7
    241  
    242   NAL_UNIT_CODED_SLICE_RASL_N,    // 8
     241
     242  NAL_UNIT_CODED_SLICE_RASL_N,      // 8
    243243  NAL_UNIT_CODED_SLICE_RASL_R,      // 9
    244244
     
    252252  NAL_UNIT_CODED_SLICE_BLA_W_LP,    // 16
    253253  NAL_UNIT_CODED_SLICE_BLA_W_RADL,  // 17
    254   NAL_UNIT_CODED_SLICE_BLA_N_LP,  // 18
     254  NAL_UNIT_CODED_SLICE_BLA_N_LP,    // 18
    255255  NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 19
    256   NAL_UNIT_CODED_SLICE_IDR_N_LP,  // 20
    257   NAL_UNIT_CODED_SLICE_CRA,       // 21
     256  NAL_UNIT_CODED_SLICE_IDR_N_LP,    // 20
     257  NAL_UNIT_CODED_SLICE_CRA,         // 21
    258258  NAL_UNIT_RESERVED_IRAP_VCL22,
    259259  NAL_UNIT_RESERVED_IRAP_VCL23,
     
    268268  NAL_UNIT_RESERVED_VCL31,
    269269
    270   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
     270  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
    277277  NAL_UNIT_PREFIX_SEI,              // 39
    278278  NAL_UNIT_SUFFIX_SEI,              // 40
  • branches/SHM-dev/source/Lib/TLibCommon/ContextModel.cpp

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
  • branches/SHM-dev/source/Lib/TLibCommon/ContextModel.h

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    6060  ContextModel  ()                        { m_ucState = 0; m_binsCoded = 0; }
    6161  ~ContextModel ()                        {}
    62  
     62
    6363  UChar getState  ()                { return ( m_ucState >> 1 ); }                    ///< get current state
    6464  UChar getMps    ()                { return ( m_ucState  & 1 ); }                    ///< get curret MPS
    6565  Void  setStateAndMps( UChar ucState, UChar ucMPS) { m_ucState = (ucState << 1) + ucMPS; } ///< set state and MPS
    66  
     66
    6767  Void init ( Int qp, Int initValue );   ///< initialize state with initial probability
    68  
     68
    6969  Void updateLPS ()
    7070  {
    7171    m_ucState = m_aucNextStateLPS[ m_ucState ];
    7272  }
    73  
     73
    7474  Void updateMPS ()
    7575  {
    7676    m_ucState = m_aucNextStateMPS[ m_ucState ];
    7777  }
    78  
     78
    7979  Int getEntropyBits(Short val) { return m_entropyBits[m_ucState ^ val]; }
    80    
     80
    8181#if FAST_BIT_EST
    8282  Void update( Int binVal )
     
    8989  Void setBinsCoded(UInt val)   { m_binsCoded = val;  }
    9090  UInt getBinsCoded()           { return m_binsCoded;   }
    91  
     91
    9292private:
    9393  UChar         m_ucState;                                                                  ///< internal state variable
  • branches/SHM-dev/source/Lib/TLibCommon/ContextModel3DBuffer.cpp

    r595 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    6969{
    7070  ctxModel += sliceType * m_sizeXYZ;
    71  
     71
    7272  for ( Int n = 0; n < m_sizeXYZ; n++ )
    7373  {
  • branches/SHM-dev/source/Lib/TLibCommon/ContextModel3DBuffer.h

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    6161  const UInt    m_sizeXY;       ///< X times Y size of 3D buffer
    6262  const UInt    m_sizeXYZ;      ///< total size of 3D buffer
    63  
     63
    6464public:
    6565  ContextModel3DBuffer  ( UInt uiSizeZ, UInt uiSizeY, UInt uiSizeX, ContextModel *basePtr, Int &count );
    6666  ~ContextModel3DBuffer () {}
    67  
     67
    6868  // access functions
    6969  ContextModel& get( UInt uiZ, UInt uiY, UInt uiX )
     
    7979    return &m_contextModel[ uiZ * m_sizeXY ];
    8080  }
    81  
     81
    8282  // initialization & copy functions
    8383  Void initBuffer( SliceType eSliceType, Int iQp, UChar* ctxModel );          ///< initialize 3D buffer by slice type & QP
    84  
     84
    8585  UInt calcCost( SliceType sliceType, Int qp, UChar* ctxModel );      ///< determine cost of choosing a probability table based on current probabilities
    8686  /** copy from another buffer
  • branches/SHM-dev/source/Lib/TLibCommon/ContextTables.h

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    155155#define NUM_SAO_TYPE_IDX_CTX          1       ///< number of context models for SAO type index
    156156
    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
    160160
    161161#define NUM_CROSS_COMPONENT_PREDICTION_CTX 10
     
    172172INIT_CU_TRANSQUANT_BYPASS_FLAG[NUMBER_OF_SLICE_TYPES][NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX] =
    173173{
    174   { 154 }, 
    175   { 154 }, 
    176   { 154 }, 
     174  { 154 },
     175  { 154 },
     176  { 154 },
    177177};
    178178
    179179// initial probability for split flag
    180 static const UChar 
     180static const UChar
    181181INIT_SPLIT_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SPLIT_FLAG_CTX] =
    182182{
    183183  { 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
     188static const UChar
    189189INIT_SKIP_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SKIP_FLAG_CTX] =
    190190{
    191   { 197,  185,  201, }, 
    192   { 197,  185,  201, }, 
    193   { CNU,  CNU,  CNU, }, 
     191  { 197,  185,  201, },
     192  { 197,  185,  201, },
     193  { CNU,  CNU,  CNU, },
    194194};
    195195
     
    197197INIT_MERGE_FLAG_EXT[NUMBER_OF_SLICE_TYPES][NUM_MERGE_FLAG_EXT_CTX] =
    198198{
    199   { 154, }, 
    200   { 110, }, 
    201   { CNU, }, 
    202 };
    203 
    204 static const UChar 
     199  { 154, },
     200  { 110, },
     201  { CNU, },
     202};
     203
     204static const UChar
    205205INIT_MERGE_IDX_EXT[NUMBER_OF_SLICE_TYPES][NUM_MERGE_IDX_EXT_CTX] =
    206206{
    207   { 137, }, 
    208   { 122, }, 
    209   { CNU, }, 
    210 };
    211 
    212 static const UChar 
     207  { 137, },
     208  { 122, },
     209  { CNU, },
     210};
     211
     212static const UChar
    213213INIT_PART_SIZE[NUMBER_OF_SLICE_TYPES][NUM_PART_SIZE_CTX] =
    214214{
    215   { 154,  139,  154,  154 },
    216   { 154,  139,  154,  154 },
    217   { 184,  CNU,  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
     220static const UChar
    221221INIT_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_PRED_MODE_CTX] =
    222222{
    223   { 134, }, 
    224   { 149, }, 
    225   { CNU, }, 
    226 };
    227 
    228 static const UChar 
     223  { 134, },
     224  { 149, },
     225  { CNU, },
     226};
     227
     228static const UChar
    229229INIT_INTRA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_ADI_CTX] =
    230230{
    231   { 183, }, 
    232   { 154, }, 
    233   { 184, }, 
    234 };
    235 
    236 static const UChar 
     231  { 183, },
     232  { 154, },
     233  { 184, },
     234};
     235
     236static const UChar
    237237INIT_CHROMA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_CHROMA_PRED_CTX] =
    238238{
    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
     244static const UChar
    245245INIT_INTER_DIR[NUMBER_OF_SLICE_TYPES][NUM_INTER_DIR_CTX] =
    246246{
    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
     252static const UChar
    253253INIT_MVD[NUMBER_OF_SLICE_TYPES][NUM_MV_RES_CTX] =
    254254{
    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
     260static const UChar
    261261INIT_REF_PIC[NUMBER_OF_SLICE_TYPES][NUM_REF_NO_CTX] =
    262262{
    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
     268static const UChar
    269269INIT_DQP[NUMBER_OF_SLICE_TYPES][NUM_DELTA_QP_CTX] =
    270270{
    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
     276static const UChar
    277277INIT_CHROMA_QP_ADJ_FLAG[NUMBER_OF_SLICE_TYPES][NUM_CHROMA_QP_ADJ_FLAG_CTX] =
    278278{
     
    304304
    305305
    306 static const UChar 
     306static const UChar
    307307INIT_QT_CBF[NUMBER_OF_SLICE_TYPES][NUM_QT_CBF_CTX_SETS * NUM_QT_CBF_CTX_PER_SET] =
    308308{
     
    318318INIT_QT_ROOT_CBF[NUMBER_OF_SLICE_TYPES][NUM_QT_ROOT_CBF_CTX] =
    319319{
    320   {  79, }, 
    321   {  79, }, 
    322   { CNU, }, 
     320  {  79, },
     321  {  79, },
     322  { CNU, },
    323323};
    324324
     
    338338
    339339
    340 static const UChar 
     340static const UChar
    341341INIT_LAST[NUMBER_OF_SLICE_TYPES][NUM_CTX_LAST_FLAG_SETS * NUM_CTX_LAST_FLAG_XY] =
    342342{
     
    349349//--------------------------------------------------------------------------------------------------
    350350
    351 static const UChar 
     351static const UChar
    352352INIT_SIG_CG_FLAG[NUMBER_OF_SLICE_TYPES][2 * NUM_SIG_CG_FLAG_CTX] =
    353353{
    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  },
    363363};
    364364
     
    381381//------------------------------------------------
    382382
    383 static const UChar 
     383static const UChar
    384384INIT_SIG_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SIG_FLAG_CTX] =
    385385{
     
    415415//------------------------------------------------
    416416
    417 static const UChar 
     417static const UChar
    418418INIT_ONE_FLAG[NUMBER_OF_SLICE_TYPES][NUM_ONE_FLAG_CTX] =
    419419{
     
    423423};
    424424
    425 static const UChar 
     425static const UChar
    426426INIT_ABS_FLAG[NUMBER_OF_SLICE_TYPES][NUM_ABS_FLAG_CTX] =
    427427{
     
    434434//--------------------------------------------------------------------------------------------------
    435435
    436 static const UChar 
     436static const UChar
    437437INIT_MVP_IDX[NUMBER_OF_SLICE_TYPES][NUM_MVP_IDX_CTX] =
    438438{
     
    442442};
    443443
    444 static const UChar 
     444static const UChar
    445445INIT_SAO_MERGE_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SAO_MERGE_FLAG_CTX] =
    446446{
    447   { 153,  }, 
    448   { 153,  }, 
    449   { 153,  }, 
    450 };
    451 
    452 static const UChar 
     447  { 153,  },
     448  { 153,  },
     449  { 153,  },
     450};
     451
     452static const UChar
    453453INIT_SAO_TYPE_IDX[NUMBER_OF_SLICE_TYPES][NUM_SAO_TYPE_IDX_CTX] =
    454454{
     
    469469INIT_TRANSFORMSKIP_FLAG[NUMBER_OF_SLICE_TYPES][2*NUM_TRANSFORMSKIP_FLAG_CTX] =
    470470{
    471   { 139,  139}, 
    472   { 139,  139}, 
    473   { 139,  139}, 
     471  { 139,  139},
     472  { 139,  139},
     473  { 139,  139},
    474474};
    475475
  • branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp

    r1029 r1246  
    129129    getEnvVarInUse().push_back(this);
    130130  }
    131   else m_sVal = sDefault;
     131  else
     132  {
     133    m_sVal = sDefault;
     134  }
    132135
    133136  m_dVal = strtod(m_sVal.c_str(), 0);
     
    215218  if (DebugOptionList::DebugSBAC.getInt()!=0 && finalEncode)
    216219  {
    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";
    218221    for (Int i=0; i<width*height; i++)
    219222    {
    220223      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      }
    223232    }
    224233    std::cout << std::endl;
     
    286295    std::string::size_type equalsPosition = result.find(" = ", searchFromPosition);
    287296
    288     if (equalsPosition == std::string::npos) break;
     297    if (equalsPosition == std::string::npos)
     298    {
     299      break;
     300    }
    289301
    290302    //then find the end of the numeric characters
     
    292304
    293305    //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    }
    295310
    296311    //...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    }
    298316
    299317    //start the next search from the end of the " = " string
     
    307325std::string lineWrap(const std::string &input, const UInt maximumLineLength)
    308326{
    309   if (maximumLineLength == 0) return input;
     327  if (maximumLineLength == 0)
     328  {
     329    return input;
     330  }
    310331  std::string result = input;
    311332
     
    318339    const std::string::size_type searchFromPosition = lineStartPosition + maximumLineLength;
    319340
    320     if (searchFromPosition >= result.length()) break;
     341    if (searchFromPosition >= result.length())
     342    {
     343      break;
     344    }
    321345
    322346    //------------------------------------------------
     
    327351    for (std::string::size_type currentPosition = lineStartPosition; currentPosition <= searchFromPosition; currentPosition++)
    328352    {
    329       if (result[currentPosition] == '\n') { nextLineStartPosition = currentPosition + 1; break; }
     353      if (result[currentPosition] == '\n')
     354      {
     355        nextLineStartPosition = currentPosition + 1;
     356        break;
     357      }
    330358    }
    331359
     
    333361
    334362    //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    }
    336367    else
    337368    {
     
    341372      for (Int currentPosition = Int(searchFromPosition); currentPosition >= Int(lineStartPosition); currentPosition--)
    342373      {
    343         if (result[currentPosition] == ' ') { spacePosition = currentPosition; break; }
     374        if (result[currentPosition] == ' ')
     375        {
     376          spacePosition = currentPosition;
     377          break;
     378        }
    344379      }
    345380
     
    373408  while ((offset = result.find('\n', offset)) != std::string::npos)
    374409  {
    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    }
    376414    result.insert(offset, indentString);
    377415  }
     
    402440    {
    403441      if ((y%subBlockHeight)==0 && y!=0)
     442      {
    404443        ss << pLinePrefix << '\n';
     444      }
    405445
    406446      ss << pLinePrefix;
     
    408448      {
    409449        if ((x%subBlockWidth)==0 && x!=0)
     450        {
    410451          ss << std::setw(defWidth+2) << "";
     452        }
    411453
    412454        ss << std::setw(defWidth) << blkSrc[y*stride + x] << ' ';
  • branches/SHM-dev/source/Lib/TLibCommon/Debug.h

    r1029 r1246  
    179179
    180180    for (UInt y = 0; y < height; y++)
     181    {
    181182      for (UInt x = 0; x < width; x++)
    182183      {
     
    188189        }
    189190
    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        }
    192199      }
     200    }
    193201
    194202    outputWidth = std::max<UInt>(getDecimalWidth(Double(minimumValue)), getDecimalWidth(Double(maximumValue))) + 1; //+1 so the numbers don't run into each other
     
    218226
    219227  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  }
    221232  stream << "\n";
    222233}
     
    229240  {
    230241    if (subBlockHeight!=0 && (y%subBlockHeight)==0 && y!=0)
     242    {
    231243      ss << pLinePrefix << '\n';
     244    }
    232245
    233246    ss << pLinePrefix;
     
    235248    {
    236249      if (subBlockWidth!=0 && (x%subBlockWidth)==0 && x!=0)
     250      {
    237251        ss << std::setw(defWidth+2) << "";
     252      }
    238253
    239254      ss << std::setw(defWidth) << blkSrc[y*stride + x] << ' ';
  • branches/SHM-dev/source/Lib/TLibCommon/NAL.h

    r1237 r1246  
    5353
    5454  /** construct an NALunit structure with given header values. */
    55 NALUnit(
     55  NALUnit(
    5656    NalUnitType nalUnitType,
    5757    Int         temporalId = 0,
     
    8787  Bool isSei()
    8888  {
    89     return m_nalUnitType == NAL_UNIT_PREFIX_SEI 
     89    return m_nalUnitType == NAL_UNIT_PREFIX_SEI
    9090        || m_nalUnitType == NAL_UNIT_SUFFIX_SEI;
    9191  }
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp

    r1099 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    7373  SEIMessages result;
    7474
    75   SEIMessages::iterator it=seiList.begin(); 
    76   while ( it!=seiList.end() ) 
     75  SEIMessages::iterator it=seiList.begin();
     76  while ( it!=seiList.end() )
    7777  {
    7878    if ((*it)->payloadType() == seiType)
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.h

    r1230 r1246  
    120120#endif
    121121  };
    122  
     122
    123123  SEI() {}
    124124  virtual ~SEI() {}
    125  
     125
    126126  static const Char *getSEIMessageString(SEI::PayloadType payloadType);
    127127
     
    146146
    147147  UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN];
    148   UInt userDataLength;
     148  UInt  userDataLength;
    149149  UChar *userData;
    150150};
     
    157157  SEIDecodedPictureHash() {}
    158158  virtual ~SEIDecodedPictureHash() {}
    159  
     159
    160160  enum Method
    161161  {
     
    169169};
    170170
    171 class SEIActiveParameterSets : public SEI 
     171class SEIActiveParameterSets : public SEI
    172172{
    173173public:
    174174  PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
    175175
    176   SEIActiveParameterSets() 
     176  SEIActiveParameterSets()
    177177    : activeVPSId            (0)
    178178    , m_selfContainedCvsFlag (false)
     
    182182  virtual ~SEIActiveParameterSets() {}
    183183
    184   Int activeVPSId; 
     184  Int activeVPSId;
    185185  Bool m_selfContainedCvsFlag;
    186186  Bool m_noParameterSetUpdateFlag;
     
    527527SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
    528528
    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.
    530530SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
    531531
     
    538538  PayloadType payloadType() const { return SCALABLE_NESTING; }
    539539
    540   SEIScalableNesting()
    541     : m_callerOwnsSEIs(false)
    542   {}
     540  SEIScalableNesting() {}
    543541  virtual ~SEIScalableNesting()
    544542  {
  • branches/SHM-dev/source/Lib/TLibCommon/TComBitCounter.h

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    5757protected:
    5858  UInt  m_uiBitCounter;
    59  
     59
    6060public:
    6161  TComBitCounter()            {}
    6262  virtual ~TComBitCounter()   {}
    63  
     63
    6464  Void        write                 ( UInt /*uiBits*/, UInt uiNumberOfBits )  { m_uiBitCounter += uiNumberOfBits; }
    6565  Void        resetBits             ()                                    { m_uiBitCounter = 0;               }
  • branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.cpp

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    247247{
    248248  assert( uiNumberOfBits <= 32 );
    249  
     249
    250250  m_numBitsRead += uiNumberOfBits;
    251251
  • branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h

    r1235 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    197197    byte = (*m_fifo)[m_fifo_idx - 1];
    198198  }
    199  
     199
    200200  UInt        readOutTrailingBits ();
    201201  UChar getHeldBits  ()          { return m_held_bits;          }
  • branches/SHM-dev/source/Lib/TLibCommon/TComCABACTables.cpp

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
  • branches/SHM-dev/source/Lib/TLibCommon/TComCABACTables.h

    r1029 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
  • branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.cpp

    r1029 r1246  
    4646InputColourSpaceConversion stringToInputColourSpaceConvert(const std::string &value, const Bool bIsForward)
    4747{
    48   if (value.empty() || value=="UNCHANGED") return IPCOLOURSPACE_UNCHANGED;
     48  if (value.empty() || value=="UNCHANGED")
     49  {
     50    return IPCOLOURSPACE_UNCHANGED;
     51  }
    4952  if (bIsForward)
    5053  {
    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    }
    5466  }
    5567  else
    5668  {
    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    }
    5977  }
    6078  return NUMBER_INPUT_COLOUR_SPACE_CONVERSIONS;
     
    128146    {
    129147      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      }
    131152    }
    132153    else
  • branches/SHM-dev/source/Lib/TLibCommon/TComCodingStatistics.h

    r1029 r1246  
    246246    {
    247247      if (width==0)
     248      {
    248249        OutputLine(pName, sep, "-", pSubClassStr, sCABAC, sEP);
     250      }
    249251      else
     252      {
    250253        printf("%c%-45s%c  %6d %6s %12lld %12lld %12lld %12lld %12lld %12lld %12lld (%12lld)%c\n",
    251254          sep=='~'?'[':' ', pName, sep, 1<<width, pSubClassStr,
    252255              sCABAC.count, sCABAC.sum, sCABAC.bits, sEP.count, sEP.sum, sEP.bits, sCABAC.bits+sEP.bits, (sCABAC.bits+sEP.bits)/8, sep=='~'?']':' ');
     256      }
    253257    }
    254258    static Void OutputLine(const Char *pName, const Char sep, const Char *pWidthString, const Char *pSubClassStr, const SStat &sCABAC, const SStat &sEP)
     
    270274      UInt tot=0;
    271275      for(;pText[tot]!=0; tot++);
     276
    272277      tot+=2;
    273278      for (; tot<168; tot++)
     
    316321          SStat &sEP=data.statistics_ep[i][c];
    317322
    318           if (sCABACorig.bits==0 && sEP.bits==0) continue;
     323          if (sCABACorig.bits==0 && sEP.bits==0)
     324          {
     325            continue;
     326          }
    319327
    320328          SStat sCABAC;
    321329          {
    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;
    324339          }
    325340          UInt width=TComCodingStatisticsClassType::GetSubClassWidth(c);
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r1244 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    175175      {
    176176#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        }
    178181#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        }
    180186#endif
    181187
     
    185191      else
    186192      {
    187          m_pcArlCoeff[compID] = (TCoeff*)xMalloc(TCoeff, totalSize);
     193        m_pcArlCoeff[compID] = (TCoeff*)xMalloc(TCoeff, totalSize);
    188194      }
    189195#endif
     
    225231  if ( !m_bDecSubCu )
    226232  {
    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    }
    241295
    242296    for (UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
     
    246300    }
    247301
    248     if ( m_puhTrIdx           ) { xFree(m_puhTrIdx);            m_puhTrIdx          = NULL; }
     302    if ( m_puhTrIdx )
     303    {
     304      xFree(m_puhTrIdx);
     305      m_puhTrIdx = NULL;
     306    }
    249307
    250308    for (UInt comp=0; comp<MAX_NUM_COMPONENT; comp++)
    251309    {
    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      }
    257335
    258336#if ADAPTIVE_QP_SELECTION
    259337      if (!m_ArlCoeffIsAliasedAllocation)
    260338      {
    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      }
    265351#endif
    266352
    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    }
    270364
    271365    for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    272366    {
    273367      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      }
    276378    }
    277379
     
    14461548  pcCULeft = getPULeft( LeftPartIdx, m_absZIdxInCtu + uiAbsPartIdx );
    14471549
    1448   if (isChroma(compID)) LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm);
     1550  if (isChroma(compID))
     1551  {
     1552    LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm);
     1553  }
    14491554  iLeftIntraDir  = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX;
    14501555
     
    14521557  pcCUAbove = getPUAbove( AbovePartIdx, m_absZIdxInCtu + uiAbsPartIdx, true, true );
    14531558
    1454   if (isChroma(compID)) AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm);
     1559  if (isChroma(compID))
     1560  {
     1561    AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm);
     1562  }
    14551563  iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX;
    14561564
    14571565  if (isChroma(chType))
    14581566  {
    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    }
    14611575  }
    14621576
     
    15011615  }
    15021616  for (UInt i=0; i<NUM_MOST_PROBABLE_MODES; i++)
     1617  {
    15031618    assert(uiIntraDirPred[i] < 35);
     1619  }
    15041620}
    15051621
     
    32833399  //this mechanism is available for intra only
    32843400
    3285   if (!isIntra(uiAbsPartIdx)) return SCAN_DIAG;
     3401  if (!isIntra(uiAbsPartIdx))
     3402  {
     3403    return SCAN_DIAG;
     3404  }
    32863405
    32873406  //------------------------------------------------
     
    32943413  const UInt maximumHeight = MDCS_MAXIMUM_HEIGHT >> getComponentScaleY(compID, format);
    32953414
    3296   if ((uiWidth > maximumWidth) || (uiHeight > maximumHeight)) return SCAN_DIAG;
     3415  if ((uiWidth > maximumWidth) || (uiHeight > maximumHeight))
     3416  {
     3417    return SCAN_DIAG;
     3418  }
    32973419
    32983420  //------------------------------------------------
     
    33143436  //------------------
    33153437
    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  }
    33193450}
    33203451
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h

    r1244 r1246  
    202202
    203203  Void          copyToPic             ( UChar uiDepth );
    204  
     204
    205205  // -------------------------------------------------------------------------------------------------------------------
    206206  // member functions for CU description
  • branches/SHM-dev/source/Lib/TLibCommon/TComInterpolationFilter.cpp

    r1029 r1246  
    137137        Pel val = src[ col ];
    138138        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        }
    141147        dst[col] = val;
    142148      }
  • branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp

    r1203 r1246  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    476476        TComMv pcMvQ1 = pcCUQ->getCUMvField(REF_PIC_LIST_1)->getMv(uiPartQ);
    477477
    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        }
    482494
    483495        if ( ((piRefP0==piRefQ0)&&(piRefP1==piRefQ1)) || ((piRefP0==piRefQ1)&&(piRefP1==piRefQ0)) )
     
    528540        TComMv pcMvQ0 = pcCUQ->getCUMvField(REF_PIC_LIST_0)->getMv(uiPartQ);
    529541
    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        }
    532550
    533551        uiBs  = ((piRefP0 != piRefQ0) ||
     
    767785        if (iQP >= chromaQPMappingTableSize)
    768786        {
    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          }
    771795        }
    772796        else if (iQP >= 0 )
  • branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp

    r1029 r1246  
    176176        {
    177177          if (x==0 || y==0)
     178          {
    178179            ss << piAdiTemp[y*uiROIWidth + x] << ", ";
    179180//          if (x%16==15) ss << "\nPart size: ~ ";
     181          }
    180182        }
    181183        ss << "\n";
     
    210212        const Bool bilinearAbove = abs((topLeft    + topRight) - (2 * piAdiTemp[         uiTuWidth ])) < threshold; //ends and the middle
    211213        if ((uiTuWidth < 32) || (!bilinearLeft) || (!bilinearAbove))
     214        {
    212215          useStrongIntraSmoothing = false;
     216        }
    213217      }
    214218
     
    292296        {
    293297          if (x==0 || y==0)
     298          {
    294299            ss << m_piYuvExt[compID][PRED_BUF_FILTERED][y*uiROIWidth + x] << ", ";
    295300//          if (x%16==15) ss << "\nPart size: ~ ";
     301          }
    296302        }
    297303        ss << "\n";
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp

    r1235 r1246  
    148148  m_saoBlkParams = new SAOBlkParam[m_numCtusInFrame];
    149149
     150
    150151  xInitTiles();
    151152  xInitCtuTsRsAddrMaps();
     153
    152154}
    153155
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp

    r1235 r1246  
    133133
    134134    for (Int cuRow = 0; cuRow < numCuInHeight; cuRow++)
     135    {
    135136      for (Int cuCol = 0; cuCol < numCuInWidth; cuCol++)
     137      {
    136138        m_ctuOffsetInBuffer[chan][cuRow * numCuInWidth + cuCol] = stride * cuRow * ctuHeight + cuCol * ctuWidth;
     139      }
     140    }
    137141
    138142    m_subCuOffsetInBuffer[chan] = new Int[(size_t)1 << (2 * uiMaxCUDepth)];
     
    143147
    144148    for (Int buRow = 0; buRow < numSubBlockPartitions; buRow++)
     149    {
    145150      for (Int buCol = 0; buCol < numSubBlockPartitions; buCol++)
     151      {
    146152        m_subCuOffsetInBuffer[chan][(buRow << uiMaxCUDepth) + buCol] = stride  * buRow * minSubBlockHeight + buCol * minSubBlockWidth;
     153      }
     154    }
    147155  }
    148156  return;
     
    157165    m_piPicOrg[chan] = NULL;
    158166
    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    }
    160172  }
    161173
    162174  for(UInt chan=0; chan<MAX_NUM_CHANNEL_TYPE; chan++)
    163175  {
    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    }
    166186  }
    167187}
     
    186206Void TComPicYuv::extendPicBorder ()
    187207{
    188   if ( m_bIsBorderExtended ) return;
     208  if ( m_bIsBorderExtended )
     209  {
     210    return;
     211  }
    189212
    190213  for(Int chan=0; chan<getNumberValidComponents(); chan++)
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuvMD5.cpp

    r1029 r1246  
    7777     * NB, for 8bit data, data is truncated to 8bits. */
    7878    for (UInt x = 0; x < width_less_modN; x += N)
     79    {
    7980      md5_block<OUTPUT_BITDEPTH_DIV8>(md5, &plane[y*stride + x], N);
     81    }
    8082
    8183    /* mop up any of the remaining line */
     
    212214  for(Int pos=0; pos<Int(digest.hash.size()); pos++)
    213215  {
    214     if ((pos % numChar) == 0 && pos!=0 ) result += ',';
     216    if ((pos % numChar) == 0 && pos!=0 )
     217    {
     218      result += ',';
     219    }
    215220    result += hex[digest.hash[pos] >> 4];
    216221    result += hex[digest.hash[pos] & 0xf];
  • branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r1238 r1246  
    611611
    612612  for (UInt ch=COMPONENT_Y; ch<pcYuvPred->getNumberValidComponents(); ch++)
     613  {
    613614    xPredInterBlk  (ComponentID(ch),  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi );
     615  }
    614616}
    615617
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1201 r1246  
    106106            m_column = 0;
    107107          }
    108           else m_column++;
     108          else
     109          {
     110            m_column++;
     111          }
    109112        }
    110113        break;
     
    119122            m_line = 0;
    120123          }
    121           else m_line++;
     124          else
     125          {
     126            m_line++;
     127          }
    122128        }
    123129        break;
  • branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r1203 r1246  
    118118  destroy();
    119119
    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  }
    122130}
    123131
     
    320328    m_lineBufWidth = m_maxCUWidth;
    321329
    322     if (m_signLineBuf1) delete[] m_signLineBuf1; m_signLineBuf1 = NULL;
     330    if (m_signLineBuf1)
     331    {
     332      delete[] m_signLineBuf1;
     333      m_signLineBuf1 = NULL;
     334    }
    323335    m_signLineBuf1 = new Char[m_lineBufWidth+1];
    324336
    325     if (m_signLineBuf2) delete[] m_signLineBuf2; m_signLineBuf2 = NULL;
     337    if (m_signLineBuf2)
     338    {
     339      delete[] m_signLineBuf2;
     340      m_signLineBuf2 = NULL;
     341    }
    326342    m_signLineBuf2 = new Char[m_lineBufWidth+1];
    327343  }
     
    553569  for(Int compIdx = 0; compIdx < numberOfComponents; compIdx++)
    554570  {
    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  }
    558580
    559581  //block boundary availability
     
    605627  for(Int compIdx = 0; compIdx < numberOfComponents; compIdx++)
    606628  {
    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  }
    610638
    611639  TComPicYuv* resYuv = pDecPic->getPicYuvRec();
     
    673701      if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )
    674702#endif
     703      {
    675704        xPCMCURestoration( pcCU, uiAbsZorderIdx, uiDepth+1 );
     705      }
    676706    }
    677707    return;
  • branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h

    r1029 r1246  
    5656// ====================================================================================================================
    5757#if !SVC_EXTENSION
    58 extern UInt g_saoMaxOffsetQVal[MAX_NUM_COMPONENT]; 
     58extern UInt g_saoMaxOffsetQVal[MAX_NUM_COMPONENT];
    5959#endif
    6060
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1235 r1246  
    218218  m_bCheckLDC = false;
    219219
    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  }
    221224
    222225  m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
     
    252255  {
    253256    iterPicExtract = rcListPic.begin();
    254     for (Int j = 0; j < i; j++) iterPicExtract++;
     257    for (Int j = 0; j < i; j++)
     258    {
     259      iterPicExtract++;
     260    }
    255261    pcPicExtract = *(iterPicExtract);
    256262    pcPicExtract->setCurrSliceIdx(0);
     
    330336        picPoc = picPoc & (pocCycle - 1);
    331337      }
    332      
     338
    333339      if (poc == picPoc)
    334340      {
     
    603609#endif //SVC_EXTENSION
    604610
    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  }
    614619  assert(cIdx == numPocTotalCurr);
    615620
     
    893898      }
    894899#else
    895       if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false);
     900      if (rpcPic->getPOC() != pocCurr)
     901      {
     902        rpcPic->getSlice(0)->setReferenced(false);
     903      }
    896904#endif
    897905      iterPic++;
     
    991999  m_bCheckLDC             = pSrc->m_bCheckLDC;
    9921000  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  }
    9941005  for (i = 0; i < NUM_REF_PIC_LIST_01; i++)
    9951006  {
     
    27342745}
    27352746
     2747
    27362748/** get default address of quantization matrix
    27372749 * \param sizeId size index
  • branches/SHM-dev/source/Lib/TLibCommon/TComTU.cpp

    r1235 r1246  
    169169
    170170    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    }
    172175  }
    173176}
     
    185188    {
    186189      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      }
    188194      mRect[i].x0+=mRect[i].width;
    189195      const TComRectangle &parentRect=parent.getRect(ComponentID(i));
     
    195201      if (!mCodeAll[i])
    196202      {
    197         if (!mbProcessLastOfLevel || mSection!=2) mRect[i].width=0;
     203        if (!mbProcessLastOfLevel || mSection!=2)
     204        {
     205          mRect[i].width=0;
     206        }
    198207      }
    199208    }
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r1240 r1246  
    436436      TCoeff result = 0;
    437437      for (Int column = 0; column < 4; column++)
     438      {
    438439        result += c[column] * g_as_DST_MAT_4[TRANSFORM_FORWARD][row][column]; // use the defined matrix, rather than hard-wired numbers
     440      }
    439441
    440442      coeff[(row * 4) + i] = rightShift((result + rnd_factor), shift);
     
    462464      result = 0;
    463465      for (Int row = 0; row < 4; row++)
     466      {
    464467        result += c[row] * g_as_DST_MAT_4[TRANSFORM_INVERSE][row][column]; // use the defined matrix, rather than hard-wired numbers
     468      }
    465469
    466470      result = Clip3( outputMinimum, outputMaximum, rightShift((result + rnd_factor), shift));
     
    862866           fastForwardDst( block, tmp, shift_1st );
    863867        }
    864         else partialButterfly4 ( block, tmp, shift_1st, iHeight );
     868        else
     869        {
     870          partialButterfly4 ( block, tmp, shift_1st, iHeight );
     871        }
    865872      }
    866873      break;
     
    881888          fastForwardDst( tmp, coeff, shift_2nd );
    882889        }
    883         else partialButterfly4 ( tmp, coeff, shift_2nd, iWidth );
     890        else
     891        {
     892          partialButterfly4 ( tmp, coeff, shift_2nd, iWidth );
     893        }
    884894      }
    885895      break;
     
    922932          fastInverseDst( coeff, tmp, shift_1st, clipMinimum, clipMaximum);
    923933        }
    924         else partialButterflyInverse4 ( coeff, tmp, shift_1st, iWidth, clipMinimum, clipMaximum);
     934        else
     935        {
     936          partialButterflyInverse4 ( coeff, tmp, shift_1st, iWidth, clipMinimum, clipMaximum);
     937        }
    925938      }
    926939      break;
     
    943956          fastInverseDst( tmp, block, shift_2nd, std::numeric_limits<Pel>::min(), std::numeric_limits<Pel>::max() );
    944957        }
    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        }
    946962      }
    947963      break;
     
    14641480      //------------------
    14651481
    1466     }
    1467     while (subTURecurse.nextSection(rTu));
     1482    } while (subTURecurse.nextSection(rTu));
    14681483
    14691484    //------------------------------------------------
     
    15601575                                        TComTU &rTu)
    15611576{
    1562   if (!rTu.ProcessComponentSection(compID)) return;
     1577  if (!rTu.ProcessComponentSection(compID))
     1578  {
     1579    return;
     1580  }
    15631581
    15641582  TComDataCU* pcCU = rTu.getCU();
     
    15921610#ifdef DEBUG_STRING
    15931611      if (psDebug != 0)
     1612      {
    15941613        std::cout << (*psDebug);
     1614      }
    15951615#endif
    15961616    }
     
    16181638    {
    16191639      invRecurTransformNxN( compID, pResidual, tuRecurseChild );
    1620     }
    1621     while (tuRecurseChild.nextSection(rTu));
     1640    } while (tuRecurseChild.nextSection(rTu));
    16221641  }
    16231642}
     
    17091728      applyForwardRDPCM( rTu, compID, pcResidual, uiStride, cQP, pcCoeff, uiAbsSum, rdpcmMode );
    17101729    }
    1711     else rdpcmMode = RDPCM_OFF;
     1730    else
     1731    {
     1732      rdpcmMode = RDPCM_OFF;
     1733    }
    17121734  }
    17131735  else // not intra, need to select the best mode
     
    18391861
    18401862  for (Int y = 0; y < iHeight; y++)
     1863  {
    18411864    for (Int x = 0; x < iWidth; x++)
    18421865    {
    18431866      block[(y * iWidth) + x] = piBlkResi[(y * uiStride) + x];
    18441867    }
     1868  }
    18451869
    18461870  xTrMxN( g_bitDepth[toChannelType(compID)], block, coeff, iWidth, iHeight, useDST, g_maxTrDynamicRange[toChannelType(compID)] );
     
    18821906
    18831907  for (Int y = 0; y < iHeight; y++)
     1908  {
    18841909    for (Int x = 0; x < iWidth; x++)
    18851910    {
    18861911      pResidual[(y * uiStride) + x] = Pel(block[(y * iWidth) + x]);
    18871912    }
     1913  }
    18881914}
    18891915
     
    23482374        iScanPos = iCGScanPos*uiCGSize + iScanPosinCG;
    23492375
    2350         if (iScanPos > iLastScanPos) continue;
     2376        if (iScanPos > iLastScanPos)
     2377        {
     2378          continue;
     2379        }
    23512380        UInt   uiBlkPos     = codingParameters.scan[iScanPos];
    23522381
     
    25442573Int  TComTrQuant::calcPatternSigCtx( const UInt* sigCoeffGroupFlag, UInt uiCGPosX, UInt uiCGPosY, UInt widthInGroups, UInt heightInGroups )
    25452574{
    2546   if ((widthInGroups <= 1) && (heightInGroups <= 1)) return 0;
     2575  if ((widthInGroups <= 1) && (heightInGroups <= 1))
     2576  {
     2577    return 0;
     2578  }
    25472579
    25482580  const Bool rightAvailable = uiCGPosX < (widthInGroups  - 1);
     
    25522584  UInt sigLower = 0;
    25532585
    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  }
    25562594
    25572595  return sigRight + (sigLower << 1);
     
    25852623  const UInt posX           = rasterPosition - (posY << log2BlockWidth);
    25862624
    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  }
    25882629
    25892630  Int offset = MAX_INT;
     
    29012942  UInt sigLower = 0;
    29022943
    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  }
    29052952
    29062953  return ((sigRight + sigLower) != 0) ? 1 : 0;
     
    31523199      for(UInt qp = 0; qp < SCALING_LIST_REM_NUM; qp++)
    31533200      {
    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        }
    31573213      }
    31583214    }
  • branches/SHM-dev/source/Lib/TLibCommon/TComYuv.cpp

    r1029 r1246  
    8080  for(Int ch=0; ch<MAX_NUM_COMPONENT; ch++)
    8181  {
    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    }
    8387  }
    8488}
     
    8993  {
    9094    if (m_apiBuf[ch]!=NULL)
     95    {
    9196      ::memset( m_apiBuf[ch], 0, ( getWidth(ComponentID(ch)) * getHeight(ComponentID(ch))  )*sizeof(Pel) );
     97    }
    9298  }
    9399}
     
    99105{
    100106  for(Int ch=0; ch<getNumberValidComponents(); ch++)
     107  {
    101108    copyToPicComponent  ( ComponentID(ch), pcPicYuvDst, ctuRsAddr, uiAbsZorderIdx, uiPartDepth, uiPartIdx );
     109  }
    102110}
    103111
     
    127135{
    128136  for(Int ch=0; ch<getNumberValidComponents(); ch++)
     137  {
    129138    copyFromPicComponent  ( ComponentID(ch), pcPicYuvSrc, ctuRsAddr, uiAbsZorderIdx );
     139  }
    130140}
    131141
     
    154164{
    155165  for(Int ch=0; ch<getNumberValidComponents(); ch++)
     166  {
    156167    copyToPartComponent  ( ComponentID(ch), pcYuvDst, uiDstPartIdx );
     168  }
    157169}
    158170
     
    181193{
    182194  for(Int ch=0; ch<getNumberValidComponents(); ch++)
     195  {
    183196    copyPartToComponent  ( ComponentID(ch), pcYuvDst, uiSrcPartIdx );
     197  }
    184198}
    185199
     
    209223{
    210224  for(Int ch=0; ch<getNumberValidComponents(); ch++)
     225  {
    211226    copyPartToPartComponent   (ComponentID(ch), pcYuvDst, uiPartIdx, iWidth>>getComponentScaleX(ComponentID(ch)), iHeight>>getComponentScaleY(ComponentID(ch)) );
     227  }
    212228}
    213229
  • branches/SHM-dev/source/Lib/TLibCommon/TComYuv.h

    r1029 r1246  
    172172                                                Int blkX = ( iTransUnitIdx * iBlkSizeForComponent ) &  ( width - 1 );
    173173                                                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                                                }
    176178                                                return m_apiBuf[id] + blkX + blkY * iBlkSizeForComponent;
    177179                                              }
     
    182184                                                Int blkX = ( iTransUnitIdx * iBlkSizeForComponent ) &  ( width - 1 );
    183185                                                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                                                }
    187190                                                return m_apiBuf[id] + blkX + blkY * iBlkSizeForComponent;
    188191                                              }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1235 r1246  
    870870  Bool operator==(const TComDigest &other) const
    871871  {
    872     if (other.hash.size() != hash.size()) return false;
     872    if (other.hash.size() != hash.size())
     873    {
     874      return false;
     875    }
    873876    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    }
    875883    return true;
    876884  }
Note: See TracChangeset for help on using the changeset viewer.