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


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

port rev 4240

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  
    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
     
    5050  namespace program_options_lite
    5151  {
    52    
     52
    5353    Options::~Options()
    5454    {
     
    5858      }
    5959    }
    60    
     60
    6161    void Options::addOption(OptionBase *opt)
    6262    {
     
    6464      names->opt = opt;
    6565      string& opt_string = opt->opt_string;
    66      
     66
    6767      size_t opt_start = 0;
    6868      for (size_t opt_end = 0; opt_end != string::npos;)
     
    9696      return OptionSpecific(*this);
    9797    }
    98    
     98
    9999    static void setOptions(Options::NamesPtrList& opt_list, const string& value)
    100100    {
     
    108108
    109109    static const char spaces[41] = "                                        ";
    110    
     110
    111111    /* format help text for a single option:
    112112     * using the formatting: "-x, --long",
     
    138138      }
    139139    }
    140    
     140
    141141    /* format the help text */
    142142    void doHelp(ostream& out, Options& opts, unsigned columns)
     
    154154      unsigned opt_width = min(max_width+2, 28u + pad_short) + 2;
    155155      unsigned desc_width = columns - opt_width;
    156      
     156
    157157      /* second pass: write out formatted option and help text.
    158158       *  - align start of help text to start at opt_width
     
    209209            split_pos = opt_desc.find_last_not_of(' ', split_pos) + 1;
    210210          }
    211          
     211
    212212          /* bad split if no suitable space to split at.  fall back to width */
    213213          bool bad_split = split_pos == string::npos || split_pos <= cur_pos;
     
    217217          }
    218218          line << opt_desc.substr(cur_pos, split_pos - cur_pos);
    219          
     219
    220220          /* eat up any space for the start of the next line */
    221221          if (!bad_split)
     
    224224          }
    225225          cur_pos = newline_pos = split_pos;
    226          
     226
    227227          if (cur_pos >= opt_desc.size())
    228228          {
     
    235235      }
    236236    }
    237    
     237
    238238    bool storePair(Options& opts, bool allow_long, bool allow_short, const string& name, const string& value)
    239239    {
     
    248248        }
    249249      }
    250      
     250
    251251      /* check for the short list */
    252252      if (allow_short && !(found && allow_long))
     
    269269      return true;
    270270    }
    271    
     271
    272272    bool storePair(Options& opts, const string& name, const string& value)
    273273    {
    274274      return storePair(opts, true, true, name, value);
    275275    }
    276    
     276
    277277    /**
    278278     * returns number of extra arguments consumed
     
    288288      size_t arg_opt_sep = arg.find_first_of('=');
    289289      string option = arg.substr(arg_opt_start, arg_opt_sep - arg_opt_start);
    290      
     290
    291291      unsigned extra_argc_consumed = 0;
    292292      if (arg_opt_sep == string::npos)
     
    299299        * booleans */
    300300        if (argc == 1)
     301        {
    301302          return 0; /* run out of argv for argument */
     303        }
    302304        extra_argc_consumed = 1;
    303305#endif
     
    339341      return 1;
    340342    }
    341    
     343
    342344    list<const char*>
    343345    scanArgv(Options& opts, unsigned argc, const char* argv[])
     
    376378          /* a lone double dash ends option processing */
    377379          while (++i < argc)
     380          {
    378381            non_option_arguments.push_back(argv[i]);
     382          }
    379383          break;
    380384        }
     
    386390      return non_option_arguments;
    387391    }
    388    
     392
    389393    void scanLine(Options& opts, string& line)
    390394    {
     
    441445         * any trailing whitespace will be removed shortly */
    442446        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);
    445448      /* strip any trailing space from value*/
    446449      value_end = line.find_last_not_of(" \t\n\r", value_end);
     
    468471        getline(in, line);
    469472        scanLine(opts, line);
    470       }
    471       while(!!in);
     473      } while(!!in);
    472474    }
    473475
  • branches/SHM-dev/source/Lib/TAppCommon/program_options_lite.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
     
    4949  {
    5050    struct Options;
    51    
     51
    5252    struct ParseFailure : public std::exception
    5353    {
     
    7373    void parseConfigFile(Options& opts, const std::string& filename);
    7474    bool storePair(Options& opts, const std::string& name, const std::string& value);
    75    
     75
    7676    /** OptionBase: Virtual base class for storing information relating to a
    7777     * specific option This base class describes common elements.  Type specific
     
    8282      : opt_string(name), opt_desc(desc)
    8383      {};
    84      
     84
    8585      virtual ~OptionBase() {}
    86      
     86
    8787      /* parse argument arg, to obtain a value for the option */
    8888      virtual void parse(const std::string& arg) = 0;
    8989      /* set the argument to the default value */
    9090      virtual void setDefault() = 0;
    91      
     91
    9292      std::string opt_string;
    9393      std::string opt_desc;
    9494    };
    95    
     95
    9696    /** Type specific option storage */
    9797    template<typename T>
     
    101101      : OptionBase(name, desc), opt_storage(storage), opt_default_val(default_val)
    102102      {}
    103      
     103
    104104      void parse(const std::string& arg);
    105      
     105
    106106      void setDefault()
    107107      {
    108108        opt_storage = opt_default_val;
    109109      }
    110      
     110
    111111      T& opt_storage;
    112112      T opt_default_val;
    113113    };
    114    
     114
    115115    /* Generic parsing */
    116116    template<typename T>
     
    129129      }
    130130    }
    131    
     131
    132132    /* string parsing is specialized -- copy the whole string, not just the
    133133     * first word */
     
    138138      opt_storage = arg;
    139139    }
    140    
     140
    141141    /** Option class for argument handling using a user provided function */
    142142    struct OptionFunc : public OptionBase
    143143    {
    144144      typedef void (Func)(Options&, const std::string&);
    145      
     145
    146146      OptionFunc(const std::string& name, Options& parent_, Func *func_, const std::string& desc)
    147147      : OptionBase(name, desc), parent(parent_), func(func_)
    148148      {}
    149      
     149
    150150      void parse(const std::string& arg)
    151151      {
    152152        func(parent, arg);
    153153      }
    154      
     154
    155155      void setDefault()
    156156      {
    157157        return;
    158158      }
    159      
     159
    160160    private:
    161161      Options& parent;
    162162      void (*func)(Options&, const std::string&);
    163163    };
    164    
     164
    165165    class OptionSpecific;
    166166    struct Options
    167167    {
    168168      ~Options();
    169      
     169
    170170      OptionSpecific addOptions();
    171      
     171
    172172      struct Names
    173173      {
     
    176176        {
    177177          if (opt)
     178          {
    178179            delete opt;
     180          }
    179181        }
    180182        std::list<std::string> opt_long;
     
    184186
    185187      void addOption(OptionBase *opt);
    186      
     188
    187189      typedef std::list<Names*> NamesPtrList;
    188190      NamesPtrList opt_list;
    189      
     191
    190192      typedef std::map<std::string, NamesPtrList> NamesMap;
    191193      NamesMap opt_long_map;
    192194      NamesMap opt_short_map;
    193195    };
    194    
     196
    195197    /* Class with templated overloaded operator(), for use by Options::addOptions() */
    196198    class OptionSpecific
     
    198200    public:
    199201      OptionSpecific(Options& parent_) : parent(parent_) {}
    200      
     202
    201203      /**
    202204       * Add option described by name to the parent Options list,
     
    281283      Options& parent;
    282284    };
    283    
     285
    284286  } /* namespace: program_options_lite */
    285287} /* namespace: df */
  • 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  }
  • branches/SHM-dev/source/Lib/TLibDecoder/AnnexBread.h

    r1029 r1246  
    8989    assert(n <= 4);
    9090    if (m_NumFutureBytes >= n)
     91    {
    9192      return false;
     93    }
    9294
    9395    n -= m_NumFutureBytes;
     
    153155    uint32_t val = 0;
    154156    for (UInt i = 0; i < n; i++)
     157    {
    155158      val = (val << 8) | readByte();
     159    }
    156160    return val;
    157161  }
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r1235 r1246  
    6666{
    6767  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  }
    6972}
    7073
     
    7275{
    7376  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  }
    7581}
    7682
     
    7884{
    7985  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  }
    8190}
    8291
     
    8493{
    8594  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  }
    8799}
    88100
     
    124136    * in the parsing if bitstream not byte-aligned */
    125137    assert(!m_pcBitstream->getNumBitsUntilByteAligned());
    126   } while (m_pcBitstream->getNumBitsLeft() > 8);
     138  }
     139  while (m_pcBitstream->getNumBitsLeft() > 8);
    127140
    128141  UInt rbspTrailingBits;
     
    490503  for (UInt i = 0; i < sei.userDataLength; i++)
    491504  {
    492     sei_read_code( pDecodedMessageOutputStream, 8, val, "user_data" );
     505    sei_read_code( NULL, 8, val, "user_data_payload_byte" );
    493506    sei.userData[i] = val;
     507  }
     508  if (pDecodedMessageOutputStream)
     509  {
     510    (*pDecodedMessageOutputStream) << "  User data payload size: " << sei.userDataLength << "\n";
    494511  }
    495512}
     
    517534  }
    518535
    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  }
    520540
    521541  sei.m_digest.hash.clear();
     
    524544    sei_read_code( NULL, 8, val, traceString);
    525545    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  }
    530556}
    531557
     
    11061132
    11071133  // read nested SEI messages
    1108   do {
     1134  do
     1135  {
    11091136#if O0164_MULTI_LAYER_HRD
    11101137#if LAYERS_NOT_PRESENT_SEI
     
    11221149  } while (m_pcBitstream->getNumBitsLeft() > 8);
    11231150
    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  }
    11251155}
    11261156
     
    12161246            sei_read_flag( pDecodedMessageOutputStream, code, "hours_flag"); currentTimeSet.hoursFlag = code;
    12171247            if(currentTimeSet.hoursFlag)
     1248            {
    12181249              sei_read_code( pDecodedMessageOutputStream, 5, code, "hours_value"); currentTimeSet.hoursValue = code;
     1250            }
    12191251          }
    12201252        }
  • branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp

    r1042 r1246  
    6363  else
    6464  {
    65     fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 
     65    fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue );
    6666  }
    6767  fflush ( g_hTrace );
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp

    r1029 r1246  
    163163#ifdef DEBUG_CABAC_BINS
    164164  if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine)
     165  {
    165166    std::cout << g_debugCounter << ": coding bin value " << ruiBin << ", range = [" << startingRange << "->" << m_uiRange << "]\n";
     167  }
    166168
    167169  if (g_debugCounter >= debugCabacBinTargetLine)
     
    170172    breakPointThis = 7;
    171173  }
    172   if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) exit(0);
     174  if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow))
     175  {
     176    exit(0);
     177  }
    173178  g_debugCounter++;
    174179#endif
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1237 r1246  
    18251825      READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0);
    18261826    }
    1827     else pcSlice->setUseChromaQpAdj(false);
     1827    else
     1828    {
     1829      pcSlice->setUseChromaQpAdj(false);
     1830    }
    18281831
    18291832    if (pps->getDeblockingFilterControlPresentFlag())
     
    25342537
    25352538          if (sizeId==SCALING_LIST_32x32)
     2539          {
    25362540            code*=(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES); // Adjust the decoded code for this size, to cope with the missing 32x32 chroma entries.
     2541          }
    25372542
    25382543          scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1235 r1246  
    485485#ifdef DEBUG_STRING
    486486  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  }
    488491#endif
    489492
     
    492495
    493496#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  }
    495501#endif
    496502
     
    505511  }
    506512#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  }
    508517#endif
    509518
     
    518527                            TComTU     &rTu)
    519528{
    520   if (!rTu.ProcessComponentSection(compID)) return;
     529  if (!rTu.ProcessComponentSection(compID))
     530  {
     531    return;
     532  }
    521533  const Bool       bIsLuma = isLuma(compID);
    522534
     
    544556    {
    545557      xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse);
    546     }
    547     while (subTURecurse.nextSection(rTu));
     558    } while (subTURecurse.nextSection(rTu));
    548559
    549560    //------------------------------------------------
     
    598609  {
    599610    for (UInt y = 0; y < uiHeight; y++)
     611    {
    600612      for (UInt x = 0; x < uiWidth; x++)
    601613      {
    602614        piResi[(y * uiStride) + x] = 0;
    603615      }
     616    }
    604617  }
    605618
    606619#ifdef DEBUG_STRING
    607620  if (psDebug)
     621  {
    608622    ss << (*psDebug);
     623  }
    609624#endif
    610625
     
    627642  const Bool bDebugReco=((DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID));
    628643  if (bDebugPred || bDebugResi || bDebugReco)
     644  {
    629645    ss << "###: " << "CompID: " << compID << " pred mode (ch/fin): " << uiChPredMode << "/" << uiChFinalMode << " absPartIdx: " << rTu.GetAbsPartIdxTU() << std::endl;
     646  }
    630647#endif
    631648
     
    643660  {
    644661#ifdef DEBUG_STRING
    645     if (bDebugPred || bDebugResi || bDebugReco) ss << "###: ";
     662    if (bDebugPred || bDebugResi || bDebugReco)
     663    {
     664      ss << "###: ";
     665    }
    646666
    647667    if (bDebugPred)
     
    653673      }
    654674    }
    655     if (bDebugResi) ss << " - resi: ";
     675    if (bDebugResi)
     676    {
     677      ss << " - resi: ";
     678    }
    656679#endif
    657680
     
    660683#ifdef DEBUG_STRING
    661684      if (bDebugResi)
     685      {
    662686        ss << pResi[ uiX ] << ", ";
     687      }
    663688#endif
    664689#if O0043_BEST_EFFORT_DECODING
     
    680705
    681706    if (bDebugPred || bDebugResi || bDebugReco)
     707    {
    682708      ss << "\n";
     709    }
    683710#endif
    684711    pPred     += uiStride;
     
    742769  {
    743770    if (isLuma(chType))
     771    {
    744772      xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, COMPONENT_Y,  rTu );
     773    }
    745774    else
    746775    {
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.cpp

    r1029 r1246  
    165165  {
    166166    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    }
    168171    printf("coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx));
    169172  }
     
    451454        uiYUVCbf[ch] |= pcCU->getCbf(childTUAbsPartIdx , ComponentID(ch),  uiTrDepth+1 );
    452455      }
    453 
    454456    } while (tuRecurseChild.nextSection(rTu) );
    455457
     
    508510      {
    509511        validCbf = true;
    510         if (isChroma(compID)) validChromaCbf = true;
     512        if (isChroma(compID))
     513        {
     514          validChromaCbf = true;
     515        }
    511516      }
    512517    }
     
    544549        {
    545550#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          }
    547555#endif
    548556
     
    559567              {
    560568#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                }
    562573#endif
    563574                m_pcEntropyDecoderIf->parseCoeffNxN( subTUIterator, compID );
    564575              }
    565             }
    566             while (subTUIterator.nextSection(rTu));
     576            } while (subTUIterator.nextSection(rTu));
    567577          }
    568578          else
     
    636646#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    637647  if (bDebugRQT)
     648  {
    638649    printf("..codeCoeff: uiAbsPartIdx=%d, PU format=%d, 2Nx2N=%d, NxN=%d\n", uiAbsPartIdx, pcCU->getPartitionSize(uiAbsPartIdx), SIZE_2Nx2N, SIZE_NxN);
     650  }
    639651#endif
    640652
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp

    r1230 r1246  
    182182  pcPic->compressMotion();
    183183  Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
    184   if (!pcSlice->isReferenced()) c += 32;
     184  if (!pcSlice->isReferenced())
     185  {
     186    c += 32;
     187  }
    185188
    186189  //-- For time output for each slice
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r1244 r1246  
    230230    m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) );
    231231    uiSymbol++;
    232   }
    233   while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) );
     232  } while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) );
    234233
    235234  if( uiCont && ( uiSymbol == uiMaxSymbol - 1 ) )
     
    286285    m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat));
    287286    uiSymbol++;
    288   }
    289   while( uiCont );
     287  } while( uiCont );
    290288
    291289  ruiSymbol = uiSymbol;
     
    315313      prefix++;
    316314      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));
    319316  }
    320317  else
     
    324321      prefix++;
    325322      m_pcTDecBinIf->decodeBinEP( codeWord RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) );
    326     }
    327     while( codeWord);
     323    } while( codeWord);
    328324  }
    329325
     
    848844  TComDataCU *pcCU = rTu.getCU();
    849845
    850   if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) return;
     846  if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() )
     847  {
     848    return;
     849  }
    851850
    852851  const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU();
     
    982981  m_pcTDecBinIf->decodeBin( symbol, m_ChromaQpAdjFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
    983982
    984   if (symbol && tableSize > 1) {
     983  if (symbol && tableSize > 1)
     984  {
    985985    /* cu_chroma_qp_adjustment_idc */
    986986    xReadUnaryMaxSymbol( symbol,  &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, tableSize - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
     
    12941294    beValid = false;
    12951295    if((!pcCU->isIntra(uiAbsPartIdx)) && pcCU->isRDPCMEnabled(uiAbsPartIdx))
     1296    {
    12961297      parseExplicitRdpcmMode(rTu, compID);
     1298    }
    12971299  }
    12981300  else
     
    14631465      Int absCoeff[1 << MLS_CG_SIZE];
    14641466
    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      }
    14661471      Int numC1Flag = min(numNonZero, C1FLAG_NUMBER);
    14671472      Int firstC2FlagIdx = -1;
     
    15821587        {
    15831588          // Infer sign of 1st element.
    1584           if (absSum&0x1) pcCoef[ blkPos ] = -pcCoef[ blkPos ];
     1589          if (absSum&0x1)
     1590          {
     1591            pcCoef[ blkPos ] = -pcCoef[ blkPos ];
     1592          }
    15851593        }
    15861594        else
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp

    r1245 r1246  
    187187        ComponentID compId=ComponentID(comp);
    188188        sliceEnabled[compId] = pcSlice->getSaoEnabledFlag(toChannelType(compId)) && (comp < pcPic->getNumberValidComponents());
    189         if (sliceEnabled[compId]) bIsSAOSliceEnabled=true;
     189        if (sliceEnabled[compId])
     190        {
     191          bIsSAOSliceEnabled=true;
     192        }
    190193        saoblkParam[compId].modeIdc = SAO_MODE_OFF;
    191194      }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1241 r1246  
    342342Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>* pcListPic)
    343343{
    344   if (!pcListPic || !m_isNoOutputPriorPics) return;
     344  if (!pcListPic || !m_isNoOutputPriorPics)
     345  {
     346    return;
     347  }
    345348
    346349  TComList<TComPic*>::iterator  iterPic   = pcListPic->begin();
  • branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp

    r1237 r1246  
    9999      zeroCount=0;
    100100    }
    101     if (v==0) zeroCount++; else zeroCount=0;
     101
     102    if (v==0)
     103    {
     104      zeroCount++;
     105    }
     106    else
     107    {
     108      zeroCount=0;
     109    }
    102110    outputBuffer[outputAmount++]=v;
    103111  }
     
    108116   * to 0x03 is appended to the end of the data.
    109117   */
    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  }
    111122  out.write((Char*)&(*outputBuffer.begin()), outputAmount);
    112123}
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r1235 r1246  
    247247#if ENC_DEC_TRACE
    248248  if (g_HLSTraceEnable)
    249   xTraceSEIHeader();
     249  {
     250    xTraceSEIHeader();
     251  }
    250252#endif
    251253
     
    267269#if ENC_DEC_TRACE
    268270  if (g_HLSTraceEnable)
    269   xTraceSEIMessageType(sei.payloadType());
     271  {
     272    xTraceSEIMessageType(sei.payloadType());
     273  }
    270274#endif
    271275
     
    592596  WRITE_FLAG( sei.m_arrangementCancelFlag,          "frame_packing_arrangement_cancel_flag" );
    593597
    594   if( sei.m_arrangementCancelFlag == 0 ) {
     598  if( sei.m_arrangementCancelFlag == 0 )
     599  {
    595600    WRITE_CODE( sei.m_arrangementType, 7,           "frame_packing_arrangement_type" );
    596601
     
    890895            WRITE_FLAG(currentTimeSet.hoursFlag, "hours_flag");
    891896            if(currentTimeSet.hoursFlag)
     897            {
    892898              WRITE_CODE(currentTimeSet.hoursValue, 5, "hours_value");
     899            }
    893900          }
    894901        }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncAnalyze.h

    r1029 r1246  
    108108    Int maximumBitDepth = g_bitDepth[0];
    109109    for (UInt channelTypeIndex = 1; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)
     110    {
    110111      if (g_bitDepth[channelTypeIndex] > maximumBitDepth)
     112      {
    111113        maximumBitDepth = g_bitDepth[channelTypeIndex];
     114      }
     115    }
    112116
    113117    const UInt maxval                = 255 << (maximumBitDepth - 8);
     
    148152        const ComponentID compID = ComponentID(componentIndex);
    149153
    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        }
    151158        else
    152159        {
     
    171178          printf( "         \tTotal Frames |   "   "Bitrate     "  "Y-PSNR" );
    172179
    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          }
    175188
    176189          //printf( "\t------------ "  " ----------"   " -------- "  " -------- "  " --------\n" );
     
    192205            printf( "  %8.4lf\n", m_MSEyuvframe[COMPONENT_Y ] / (Double)getNumPic() );
    193206          }
    194           else printf("\n");
     207          else
     208          {
     209            printf("\n");
     210          }
    195211
    196212#if SVC_EXTENSION
     
    208224          printf( "\tTotal Frames |   "   "Bitrate     "  "Y-PSNR" );
    209225
    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          }
    212234
    213235          //printf( "\t------------ "  " ----------"   " -------- "  " -------- "  " --------\n" );
     
    226248            printf( "  %8.4lf\n", m_MSEyuvframe[COMPONENT_Y ] / (Double)getNumPic() );
    227249          }
    228           else printf("\n");
     250          else
     251          {
     252            printf("\n");
     253          }
    229254        }
    230255        break;
     
    246271            printf( "         \tTotal Frames |   "   "Bitrate     "  "Y-PSNR    "  "U-PSNR    "  "V-PSNR    "  "YUV-PSNR " );
    247272
    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            }
    250281
    251282            //printf( "\t------------ "  " ----------"   " -------- "  " -------- "  " --------\n" );
     
    272303                     MSEyuv );
    273304            }
    274             else printf("\n");
     305            else
     306            {
     307              printf("\n");
     308            }
    275309
    276310#if SVC_EXTENSION
     
    295329            printf( "\tTotal Frames |   "   "Bitrate     "  "Y-PSNR    "  "U-PSNR    "  "V-PSNR    "  "YUV-PSNR " );
    296330           
    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            }
    299339
    300340            //printf( "\t------------ "  " ----------"   " -------- "  " -------- "  " --------\n" );
     
    321361                     MSEyuv );
    322362            }
    323             else printf("\n");
     363            else
     364            {
     365              printf("\n");
     366            }
    324367          }
    325368        }
     
    390433                MSEyuv );
    391434          }
    392           else fprintf(pFile, "\n");
     435          else
     436          {
     437            fprintf(pFile, "\n");
     438          }
    393439
    394440          break;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp

    r1029 r1246  
    230230#ifdef DEBUG_CABAC_BINS
    231231  if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine)
     232  {
    232233    std::cout << g_debugCounter << ": coding bin value " << binValue << ", range = [" << startingRange << "->" << m_uiRange << "]\n";
     234  }
    233235
    234236  if (g_debugCounter >= debugCabacBinTargetLine)
     
    237239    breakPointThis = 7;
    238240  }
    239   if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) exit(0);
     241  if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow))
     242  {
     243    exit(0);
     244  }
     245
    240246  g_debugCounter++;
    241247#endif
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp

    r1029 r1246  
    8484#ifdef DEBUG_ENCODER_SEARCH_BINS
    8585  if ((g_debugCounter + debugEncoderSearchBinWindow) >= debugEncoderSearchBinTargetLine)
     86  {
    8687    std::cout << g_debugCounter << ": coding bin value " << binValue << ", fracBits = [" << startingFracBits << "->" << m_fracBits << "]\n";
     88  }
    8789
    8890  if (g_debugCounter >= debugEncoderSearchBinTargetLine)
     
    9193    breakPointThis = 7;
    9294  }
    93   if (g_debugCounter >= (debugEncoderSearchBinTargetLine + debugEncoderSearchBinWindow)) exit(0);
     95  if (g_debugCounter >= (debugEncoderSearchBinTargetLine + debugEncoderSearchBinWindow))
     96  {
     97    exit(0);
     98  }
    9499  g_debugCounter++;
    95100#endif
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1237 r1246  
    11551155    {
    11561156       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       }
    11581161    }
    11591162
     
    12741277    if (pcSlice->getPPS()->getSliceChromaQpFlag())
    12751278    {
    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      }
    12781287      assert(numberValidComponents <= COMPONENT_Cr+1);
    12791288    }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1235 r1246  
    239239
    240240  Int       m_iWaveFrontSynchro;
    241   Int       m_iWaveFrontSubstreams;
    242241
    243242  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  
    955955      {
    956956        if (m_pcEncCfg->getCostMode()==COST_MIXED_LOSSLESS_LOSSY_CODING)
     957        {
    957958          rpcBestCU->getTotalCost()=rpcTempCU->getTotalCost() + (1.0 / m_pcRdCost->getLambda());
     959        }
    958960        else
     961        {
    959962          rpcBestCU->getTotalCost()=rpcTempCU->getTotalCost()+1;
     963        }
    960964      }
    961965
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1235 r1246  
    240240  const Bool bDebugRQT=g_bFinalEncode && DebugOptionList::DebugRQT.getInt()!=0;
    241241  if (bDebugRQT)
     242  {
    242243    printf("x..codeTransform: offsetLuma=%d offsetChroma=%d absPartIdx=%d, uiDepth=%d\n width=%d, height=%d, uiTrIdx=%d, uiInnerQuadIdx=%d\n",
    243244           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  }
    244246#endif
    245247  const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) > uiTrIdx;// + pcCU->getDepth( uiAbsPartIdx ) > uiDepth;
     
    260262    {
    261263      bHaveACodedBlock = true;
    262       if (isChroma(compID)) bHaveACodedChromaBlock = true;
     264      if (isChroma(compID))
     265      {
     266        bHaveACodedChromaBlock = true;
     267      }
    263268    }
    264269  }
     
    322327    {
    323328      xEncodeTransform( bCodeDQP, codeChromaQpAdj, tuRecurseChild );
    324     }
    325     while (tuRecurseChild.nextSection(rTu));
     329    } while (tuRecurseChild.nextSection(rTu));
    326330  }
    327331  else
     
    378382        {
    379383#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          }
    381388#endif
    382389
     
    393400              {
    394401#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                }
    396406#endif
    397407                m_pcEntropyCoderIf->codeCoeffNxN( subTUIterator, (pcCU->getCoeff(compID) + subTUIterator.getCoefficientOffset(compID)), compID );
     
    435445  {
    436446    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    }
    438451    printf("coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx));
    439452  }
     
    683696  TComTURecurse tuRecurse(pcCU, uiAbsPartIdx, uiDepth);
    684697#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  }
    686702#endif
    687703
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1237 r1246  
    598598    sei_time_code.numClockTs = m_pcCfg->getNumberOfTimesets();
    599599    for(Int i = 0; i < sei_time_code.numClockTs; i++)
     600    {
    600601      sei_time_code.timeSetArray[i] = m_pcCfg->getTimeSet(i);
     602    }
    601603
    602604    nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
     
    15421544                {
    15431545                  if(m_pcCfg->getGOPEntry(kk).m_POC==tPoc)
     1546                  {
    15441547                    break;
     1548                  }
    15451549                }
    15461550                Int tTid=m_pcCfg->getGOPEntry(kk).m_temporalId;
     
    30403044                flag = 1;
    30413045              }
    3042               else                            ui64Tmp = maxDiff - tmp + 1;
     3046              else
     3047              {
     3048                ui64Tmp = maxDiff - tmp + 1;
     3049              }
    30433050            }
    30443051            pCRD[ i ] = (UInt)ui64Tmp - uiPrev - 1;
     
    32453252  delete pcBitstreamRedirect;
    32463253
    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  }
    32493262
    32503263#if SVC_EXTENSION
     
    33173330
    33183331  if (!bCalcDist)
     3332  {
    33193333    ruiDist = xFindDistortionFrame(pcPic->getPicYuvOrg(), pcPic->getPicYuvRec());
     3334  }
    33203335}
    33213336
     
    35563571
    35573572  Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B');
    3558   if (!pcSlice->isReferenced()) c += 32;
     3573  if (!pcSlice->isReferenced())
     3574  {
     3575    c += 32;
     3576  }
    35593577
    35603578#if SVC_EXTENSION
     
    38243842      vRL[i] = 0;
    38253843      for( Int j = i - RVM_VCEGAM10_M ; j <= i + RVM_VCEGAM10_M - 1 ; j++ )
     3844      {
    38263845        vRL[i] += m_vRVM_RP[j];
     3846      }
    38273847      vRL[i] /= ( 2 * RVM_VCEGAM10_M );
    38283848      vB[i] = vB[i-1] + m_vRVM_RP[i] - vRL[i];
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPreanalyzer.h

    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
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r1029 r1246  
    519519        for(Int classIdx=0; classIdx<NUM_SAO_EO_CLASSES; classIdx++)
    520520        {
    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          }
    525537
    526538          if( quantOffsets[classIdx] != 0 ) //iterative adjustment only when derived offset is not zero
     
    818830  {
    819831    if (sliceEnabled[compId])
     832    {
    820833      allBlksDisabled = false;
     834    }
    821835  }
    822836
     
    953967    m_lineBufWidth = m_maxCUWidth;
    954968
    955     if (m_signLineBuf1) delete[] m_signLineBuf1; m_signLineBuf1 = NULL;
     969    if (m_signLineBuf1)
     970    {
     971      delete[] m_signLineBuf1;
     972      m_signLineBuf1 = NULL;
     973    }
    956974    m_signLineBuf1 = new Char[m_lineBufWidth+1];
    957975
    958     if (m_signLineBuf2) delete[] m_signLineBuf2; m_signLineBuf2 = NULL;
     976    if (m_signLineBuf2)
     977    {
     978      delete[] m_signLineBuf2;
     979      m_signLineBuf2 = NULL;
     980    }
    959981    m_signLineBuf2 = new Char[m_lineBufWidth+1];
    960982  }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp

    r1244 r1246  
    109109  SliceType eSliceType  = m_pcSlice->getSliceType();
    110110
    111   SliceType encCABACTableIdx = m_pcSlice->getEncCABACTableIdx();;
     111  SliceType encCABACTableIdx = m_pcSlice->getEncCABACTableIdx();
    112112  if (!m_pcSlice->isIntra() && (encCABACTableIdx==B_SLICE || encCABACTableIdx==P_SLICE) && m_pcSlice->getPPS()->getCabacInitPresentFlag())
    113113  {
     
    407407  m_pcBinIf->copyState( pSrc->m_pcBinIf );
    408408  if (isLuma(chType))
     409  {
    409410    this->m_cCUIntraPredSCModel      .copyFrom( &pSrc->m_cCUIntraPredSCModel       );
     411  }
    410412  else
     413  {
    411414    this->m_cCUChromaPredSCModel     .copyFrom( &pSrc->m_cCUChromaPredSCModel      );
     415  }
    412416}
    413417
     
    613617{
    614618  if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     619  {
    615620    return;
     621  }
    616622
    617623  UInt uiCtx           = pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth );
     
    832838  TComDataCU *pcCU = rTu.getCU();
    833839
    834   if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) return;
     840  if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() )
     841  {
     842    return;
     843  }
    835844
    836845  const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU();
     
    12661275      beValid = false;
    12671276      if ( (!pcCU->isIntra(uiAbsPartIdx)) && pcCU->isRDPCMEnabled(uiAbsPartIdx))
     1277      {
    12681278        codeExplicitRdpcmMode( rTu, compID);
     1279      }
    12691280    }
    12701281    else
     
    13261337      uiNumSig--;
    13271338    }
    1328   }
    1329   while ( uiNumSig > 0 );
     1339  } while ( uiNumSig > 0 );
    13301340
    13311341  // Code position of last coefficient
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1244 r1246  
    239239    {
    240240      if (iIdx < iNum)
     241      {
    241242        m_auiMVPIdxCost[iIdx][iNum] = xGetMvpIdxBits(iIdx, iNum);
     243      }
    242244      else
     245      {
    243246        m_auiMVPIdxCost[iIdx][iNum] = MAX_INT;
     247      }
    244248    }
    245249  }
     
    365369
    366370    if ( m_cDistParam.iRows > 32 )
     371    {
    367372      m_cDistParam.iSubShift = 4;
     373    }
    368374    else if ( m_cDistParam.iRows > 16 )
     375    {
    369376      m_cDistParam.iSubShift = 3;
     377    }
    370378    else if ( m_cDistParam.iRows > 8 )
     379    {
    371380      m_cDistParam.iSubShift = 2;
     381    }
    372382    else
     383    {
    373384      m_cDistParam.iSubShift = 1;
     385    }
    374386
    375387    Distortion uiTempSad = m_cDistParam.DistFunc( &m_cDistParam );
     
    385397        uiSad += uiTempSad >>  m_cDistParam.iSubShift;
    386398        if(((uiSad << isubShift) + uiBitCost) > rcStruct.uiBestSad)
     399        {
    387400          break;
     401        }
    388402
    389403        m_cDistParam.iSubShift--;
     
    898912      const ComponentID compID=ComponentID(ch);
    899913      if( rTu.ProcessingAllQuadrants(compID) && (uiTrDepth==0 || pcCU->getCbf( uiAbsPartIdx, compID, uiTrDepth-1 ) ))
     914      {
    900915        m_pcEntropyCoder->encodeQtCbf(rTu, compID, (uiSubdiv == 0));
     916      }
    901917    }
    902918  }
     
    10071023    {
    10081024      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      }
    10101029    }
    10111030  }
     
    10841103                                     )
    10851104{
    1086   if (!rTu.ProcessComponentSection(compID)) return;
     1105  if (!rTu.ProcessComponentSection(compID))
     1106  {
     1107    return;
     1108  }
    10871109  const Bool       bIsLuma = isLuma(compID);
    10881110  const TComRectangle &rect= rTu.getRect(compID);
     
    12081230    if (bUseCrossCPrediction)
    12091231    {
    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      }
    12111236      TComTrQuant::crossComponentPrediction ( rTu, compID, reconstructedLumaResidual, piResi, piResi, uiWidth, uiHeight, MAX_CU_SIZE, uiStride, uiStride, false );
    12121237    }
     
    13071332          }
    13081333        }
    1309         if (bDebugResi) ss << " - resi: ";
     1334        if (bDebugResi)
     1335        {
     1336          ss << " - resi: ";
     1337        }
    13101338        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    13111339        {
    1312           if (bDebugResi) ss << pResi[ uiX ] << ", ";
     1340          if (bDebugResi)
     1341          {
     1342            ss << pResi[ uiX ] << ", ";
     1343          }
    13131344          pReco    [ uiX ] = Pel(ClipBD<Int>( Int(pPred[uiX]) + Int(pResi[uiX]), clipbd ));
    13141345          pRecQt   [ uiX ] = pReco[ uiX ];
     
    15271558        xLoadIntraResultQT(COMPONENT_Y, rTu );
    15281559        if (rTu.ProcessComponentSection(COMPONENT_Y))
     1560        {
    15291561          pcCU->setCbfSubParts  ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) );
     1562        }
    15301563
    15311564        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiFullDepth ][ CI_TEMP_BEST ] );
     
    19021935  if(  uiTrMode == uiTrDepth )
    19031936  {
    1904     if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA)) return;
     1937    if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA))
     1938    {
     1939      return;
     1940    }
    19051941
    19061942    const UInt uiFullDepth = rTu.GetTransformDepthTotal();
     
    20412077        pcCU ->setCrossComponentPredictionAlphaPartRange( bestCrossCPredictionAlpha, compID, subTUAbsPartIdx, partIdxesPerSubTU );
    20422078        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      }
    20472085    }
    20482086  }
     
    20922130TEncSearch::xSetIntraResultChromaQT(TComYuv*    pcRecoYuv, TComTU &rTu)
    20932131{
    2094   if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA)) return;
     2132  if (!rTu.ProcessChannelSection(CHANNEL_TYPE_CHROMA))
     2133  {
     2134    return;
     2135  }
    20952136  TComDataCU *pcCU=rTu.getCU();
    20962137  const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU();
     
    22082249
    22092250    if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y))
     2251    {
    22102252      initAdiPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
     2253    }
    22112254
    22122255    Bool doFastSearch = (numModesForFullRD != numModesAvailable);
     
    23332376    UInt max=numModesForFullRD;
    23342377
    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    }
    23362382    for ( UInt uiMode = 0; uiMode < max; uiMode++)
    23372383#else
     
    24242470#if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
    24252471      if (DebugOptionList::ForceLumaMode.isSet())
     2472      {
    24262473        uiOrgMode = DebugOptionList::ForceLumaMode.getInt();
     2474      }
    24272475#endif
    24282476
     
    25872635        {
    25882636          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          }
    25902641          uiMaxMode=uiMinMode+1;
    25912642        }
     
    30833134        {
    30843135          uiBitsTemp += iRefIdxTemp+1;
    3085           if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
     3136          if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 )
     3137          {
     3138            uiBitsTemp--;
     3139          }
    30863140        }
    30873141
     
    32093263        {
    32103264          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          }
    32123269        }
    32133270
     
    33193376          {
    33203377            uiBitsTemp += iRefIdxTemp+1;
    3321             if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
     3378            if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 )
     3379            {
     3380              uiBitsTemp--;
     3381            }
    33223382          }
    33233383          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
     
    36983758  assert(pcAMVPInfo->m_acMvCand[riMVPIdx] == rcMvPred);
    36993759
    3700   if (pcAMVPInfo->iN < 2) return;
     3760  if (pcAMVPInfo->iN < 2)
     3761  {
     3762    return;
     3763  }
    37013764
    37023765  m_pcRdCost->getMotionCost( true, 0, pcCU->getCUTransquantBypass(0) );
     
    37123775  for (Int iMVPIdx = 0; iMVPIdx < pcAMVPInfo->iN; iMVPIdx++)
    37133776  {
    3714     if (iMVPIdx == riMVPIdx) continue;
     3777    if (iMVPIdx == riMVPIdx)
     3778    {
     3779      continue;
     3780    }
    37153781
    37163782    m_pcRdCost->setPredictor( pcAMVPInfo->m_acMvCand[iMVPIdx] );
     
    38393905  TComMv      cMvPred = *pcMvPred;
    38403906
    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  }
    38433915
    38443916  m_pcRdCost->getMotionCost( true, 0, pcCU->getCUTransquantBypass(uiPartAddr) );
     
    45094581  if( (pcCU->getWidth(0) > pcCU->getSlice()->getSPS()->getMaxTrSize()) )
    45104582  {
    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    }
    45124587  }
    45134588
     
    49915066                currCompCost = m_pcRdCost->calcRdCost(currCompBits, currCompDist);
    49925067                 
    4993                 if (pcCU->isLosslessCoded(0)) nonCoeffCost = MAX_DOUBLE;
     5068                if (pcCU->isLosslessCoded(0))
     5069                {
     5070                  nonCoeffCost = MAX_DOUBLE;
     5071                }
    49945072              }
    49955073              else if ((transformSkipModeId == 1) && !bUseCrossCPrediction)
     
    50865164          pcCU->setCbfPartRange                          ((((uiAbsSum                    [compID][subTUIndex] > 0) ? 1 : 0) << uiTrMode), compID, subTUAbsPartIdx, partIdxesPerSubTU );
    50875165          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
    50905167      } // processing section
    50915168    } // component loop
     
    51295206
    51305207        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        }
    51325212      }
    51335213    }
     
    51685248
    51695249          for (UInt subTU = 0; subTU < 2; subTU++)
     5250          {
    51705251            bestsubTUCBF[compID][subTU] = pcCU->getCbf ((uiAbsPartIdx + (subTU * partIdxesPerSubTU)), compID, subTUDepth);
     5252          }
    51715253        }
    51725254      }
     
    51895271      for(UInt ch = 0; ch < numValidComp; ch++)
    51905272      {
    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        }
    51925277        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        }
    51945282        sSplitString[ch]+=childString.substr(lastPos, (pos==std::string::npos)? std::string::npos : (pos-lastPos) );
    51955283        lastPos=pos;
    51965284      }
    51975285#endif
    5198     }
    5199     while ( tuRecurseChild.nextSection(rTu) ) ;
     5286    } while ( tuRecurseChild.nextSection(rTu) ) ;
    52005287
    52015288    UInt uiCbfAny=0;
     
    54745561  m_pcEntropyCoder->resetBits();
    54755562  if (isLuma(chType))
     5563  {
    54765564    m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset);
     5565  }
    54775566  else
     5567  {
    54785568    m_pcEntropyCoder->encodeIntraDirModeChroma ( pcCU, uiPartOffset);
     5569  }
    54795570
    54805571  rIntraDirVal = origVal; // restore
     
    54915582  UInt shift=0;
    54925583
    5493   while ( shift<uiFastCandNum && uiCost<CandCostList[ uiFastCandNum-1-shift ] ) shift++;
     5584  while ( shift<uiFastCandNum && uiCost<CandCostList[ uiFastCandNum-1-shift ] )
     5585  {
     5586    shift++;
     5587  }
    54945588
    54955589  if( shift!=0 )
     
    57935887  m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && pcSlice->testWeightPred() ) || ( pcSlice->getSliceType()==B_SLICE && pcSlice->testWeightBiPred() ) ;
    57945888
    5795   if ( !m_cDistParam.bApplyWeight ) return;
     5889  if ( !m_cDistParam.bApplyWeight )
     5890  {
     5891    return;
     5892  }
    57965893
    57975894  Int iRefIdx0 = ( eRefPicListCur == REF_PIC_LIST_0 ) ? iRefIdx : (-1);
     
    58005897  getWpScaling( pcCU, iRefIdx0, iRefIdx1, wp0 , wp1 );
    58015898
    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  }
    58045907
    58055908  m_cDistParam.wpCur  = NULL;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r1235 r1246  
    9898
    9999  // 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  }
    103115}
    104116
     
    952964
    953965    if (boundingCtuTsAddr <= ctuTsAddr)
     966    {
    954967      break;
     968    }
    955969
    956970    pcSlice->setSliceBits( (UInt)(pcSlice->getSliceBits() + numberOfWrittenBits) );
     
    11231137        ComponentID compId=ComponentID(comp);
    11241138        sliceEnabled[compId] = pcSlice->getSaoEnabledFlag(toChannelType(compId)) && (comp < pcPic->getNumberValidComponents());
    1125         if (sliceEnabled[compId]) bIsSAOSliceEnabled=true;
     1139        if (sliceEnabled[compId])
     1140        {
     1141          bIsSAOSliceEnabled=true;
     1142        }
    11261143      }
    11271144      if (bIsSAOSliceEnabled)
     
    12281245      break;
    12291246    case FIXED_NUMBER_OF_BYTES:
    1230       if (encodingSlice)
    1231         boundingCtuTSAddrSlice  = sliceCurEndCtuTSAddr;
    1232       else
    1233         boundingCtuTSAddrSlice  = numberOfCtusInFrame;
     1247      boundingCtuTSAddrSlice  = (encodingSlice) ? sliceCurEndCtuTSAddr : numberOfCtusInFrame;
    12341248      break;
    12351249    case FIXED_NUMBER_OF_TILES:
     
    13021316 * \returns Updates startCtuTsAddr, boundingCtuTsAddr with appropriate CTU address
    13031317 */
    1304 Void TEncSlice::xDetermineStartAndBoundingCtuTsAddr  ( UInt& startCtuTsAddr, UInt& boundingCtuTsAddr, TComPic* pcPic, const Bool encodingSlice )
     1318Void TEncSlice::xDetermineStartAndBoundingCtuTsAddr  ( UInt& startCtuTsAddr, UInt& boundingCtuTsAddr, TComPic* pcPic, const Bool encodingSlice ) // TODO: this is now only ever called with encodingSlice=false
    13051319{
    13061320  TComSlice* pcSlice                 = pcPic->getSlice(getSliceIdx());
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1235 r1246  
    15161516  {
    15171517    for(Int i=0; i<m_iNumRowsMinus1; i++)
     1518    {
    15181519      uiCummulativeRowHeight += m_tileRowHeight[i];
     1520    }
    15191521
    15201522    if( uiCummulativeRowHeight >= iHeightInCU )
  • branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r1235 r1246  
    9292
    9393      for(Int y = 0; y < iHeight; y++, pPel+=iStride )
     94      {
    9495        for(Int x = 0; x < iWidth; x++ )
     96        {
    9597          iOrgDC += (Int)( pPel[x] );
     98        }
     99      }
    96100    }
    97101
     
    103107
    104108      for(Int y = 0; y < iHeight; y++, pPel += iStride )
     109      {
    105110        for(Int x = 0; x < iWidth; x++ )
     111        {
    106112          iOrgAC += abs( (Int)pPel[x] - (Int)iOrgNormDC );
     113        }
     114      }
    107115    }
    108116
     
    117125  slice->setWpAcDcParam(weightACDCParam);
    118126}
     127
    119128
    120129/** check weighted pred or non-weighted pred
     
    296305
    297306        if(deltaWeight >= range || deltaWeight < -range)
     307        {
    298308          return false;
     309        }
    299310
    300311#if SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp

    r1077 r1246  
    7373  {
    7474    for (UInt y = 0; y < height; y++, img+=stride)
     75    {
    7576      for (UInt x = 0; x < width; x++)
     77      {
    7678        img[x] <<= shiftbits;
     79      }
     80    }
    7781  }
    7882  else if (shiftbits < 0)
     
    8286    Pel rounding = 1 << (shiftbits-1);
    8387    for (UInt y = 0; y < height; y++, img+=stride)
     88    {
    8489      for (UInt x = 0; x < width; x++)
     90      {
    8591        img[x] = Clip3(minval, maxval, Pel((img[x] + rounding) >> shiftbits));
     92      }
     93    }
    8694  }
    8795}
     
    178186{
    179187  if (!numFrames)
     188  {
    180189    return;
     190  }
    181191
    182192  //------------------
     
    188198    ComponentID compID=ComponentID(component);
    189199    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    }
    191204  }
    192205  frameSize *= wordsize;
     
    197210  /* attempt to seek */
    198211  if (!!m_cHandle.seekg(offset, ios::cur))
     212  {
    199213    return; /* success */
     214  }
    200215  m_cHandle.clear();
    201216
    202217  /* fall back to consuming the input */
    203218  Char buf[512];
    204   const streamoff offset_mod_bufsize = offset % sizeof(buf);
     219  const UInt offset_mod_bufsize = offset % sizeof(buf);
    205220  for (streamoff i = 0; i < offset - offset_mod_bufsize; i += sizeof(buf))
    206221  {
     
    263278      const Pel value=Pel(1<<(fileBitDepth-1));
    264279      for (UInt y = 0; y < full_height_dest; y++, dst+=stride_dest)
     280      {
    265281        for (UInt x = 0; x < full_width_dest; x++)
     282        {
    266283          dst[x] = value;
     284        }
     285      }
    267286    }
    268287
     
    305324          {
    306325            for (UInt x = 0; x < width_dest; x++)
     326            {
    307327              dst[x] = buf[x<<sx];
     328            }
    308329          }
    309330          else
     
    322343          {
    323344            for (UInt x = 0; x < width_dest; x++)
     345            {
    324346              dst[x] = buf[x>>sx];
     347            }
    325348          }
    326349          else
    327350          {
    328351            for (UInt x = 0; x < width_dest; x++)
     352            {
    329353              dst[x] = Pel(buf[(x>>sx)*2+0]) | (Pel(buf[(x>>sx)*2+1])<<8);
     354            }
    330355          }
    331356        }
     
    334359        const Pel val=dst[width_dest-1];
    335360        for (UInt x = width_dest; x < full_width_dest; x++)
     361        {
    336362          dst[x] = val;
     363        }
    337364
    338365        dst += stride_dest;
     
    342369    // process lower padding
    343370    for (UInt y = height_dest; y < full_height_dest; y++, dst+=stride_dest)
     371    {
    344372      for (UInt x = 0; x < full_width_dest; x++)
     373      {
    345374        dst[x] = (dst - stride_dest)[x];
     375      }
     376    }
    346377  }
    347378  delete[] buf;
     
    393424          UChar val(value);
    394425          for (UInt x = 0; x < width_file; x++)
     426          {
    395427            buf[x]=val;
     428          }
    396429        }
    397430        else
     
    520553            UChar val(value);
    521554            for (UInt x = 0; x < width_file; x++)
     555            {
    522556              fieldBuffer[x]=val;
     557            }
    523558          }
    524559          else
     
    634669{
    635670  // check end-of-file
    636   if ( isEof() ) return false;
     671  if ( isEof() )
     672  {
     673    return false;
     674  }
    637675  TComPicYuv *pPicYuv=pPicYuvTrueOrg;
    638   if (format>=NUM_CHROMA_FORMAT) format=pPicYuv->getChromaFormat();
     676  if (format>=NUM_CHROMA_FORMAT)
     677  {
     678    format=pPicYuv->getChromaFormat();
     679  }
    639680
    640681  Bool is16bit = false;
     
    642683  for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
    643684  {
    644     if (m_fileBitdepth[ch] > 8) is16bit=true;
     685    if (m_fileBitdepth[ch] > 8)
     686    {
     687      is16bit=true;
     688    }
    645689  }
    646690
     
    733777  for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
    734778  {
    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    }
    737787  }
    738788
    739789  TComPicYuv *dstPicYuv = NULL;
    740790  Bool retval = true;
    741   if (format>=NUM_CHROMA_FORMAT) format=pPicYuv->getChromaFormat();
     791  if (format>=NUM_CHROMA_FORMAT)
     792  {
     793    format=pPicYuv->getChromaFormat();
     794  }
    742795
    743796  if (nonZeroBitDepthShift)
     
    817870  for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
    818871  {
    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    }
    821880  }
    822881
     
    828887    TComPicYuv *pPicYuv = (field == 0) ? pPicYuvTop : pPicYuvBottom;
    829888
    830     if (format>=NUM_CHROMA_FORMAT) format=pPicYuv->getChromaFormat();
     889    if (format>=NUM_CHROMA_FORMAT)
     890    {
     891      format=pPicYuv->getChromaFormat();
     892    }
    831893
    832894    TComPicYuv* &dstPicYuv = (field == 0) ? dstPicYuvTop : dstPicYuvBottom;
     
    9491011      {
    9501012        for(UInt comp=0; comp<numValidComp; comp++)
     1013        {
    9511014          copyPlane(src, ComponentID(bIsForwards?0:comp), dest, ComponentID(comp));
     1015        }
    9521016      }
    9531017      break;
     
    9551019      {
    9561020        for(UInt comp=0; comp<numValidComp; comp++)
     1021        {
    9571022          copyPlane(src, ComponentID(comp), dest, ComponentID((numValidComp-comp)%numValidComp));
     1023        }
    9581024      }
    9591025      break;
     
    9821048      {
    9831049        for(UInt comp=0; comp<numValidComp; comp++)
     1050        {
    9841051          copyPlane(src, ComponentID(comp), dest, ComponentID(comp));
     1052        }
    9851053      }
    9861054      break;
  • branches/SHM-dev/source/Lib/libmd5/MD5.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/libmd5/libmd5.h

    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
Note: See TracChangeset for help on using the changeset viewer.