source: SHVCSoftware/branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp @ 1510

Last change on this file since 1510 was 1509, checked in by seregin, 9 years ago

correct VPS setting, memory leak fix

  • Property svn:eol-style set to native
File size: 2.8 KB
Line 
1/** \file     TAppEncLayerCfg.cpp
2\brief    Handle encoder configuration parameters
3*/
4
5#include <stdlib.h>
6#include <cassert>
7#include <cstring>
8#include <string>
9#include "TLibCommon/TComRom.h"
10#include "TAppEncCfg.h"
11#include "TAppEncLayerCfg.h"
12#include "TAppCommon/program_options_lite.h"
13
14#ifdef WIN32
15#define strdup _strdup
16#endif
17
18using namespace std;
19namespace po = df::program_options_lite;
20
21//! \ingroup TAppEncoder
22//! \{
23
24// ====================================================================================================================
25// Constructor / destructor / initialization / destroy
26// ====================================================================================================================
27#if SVC_EXTENSION
28TAppEncLayerCfg::TAppEncLayerCfg()
29: m_conformanceWindowMode(0)
30, m_aidQP(NULL)
31, m_repFormatIdx(-1)
32{
33  m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
34  m_aiPad[1] = m_aiPad[0] = 0;
35  m_numRefLayerLocationOffsets = 0;
36  ::memset(m_refLocationOffsetLayerId,   0, sizeof(m_refLocationOffsetLayerId));
37  ::memset(m_scaledRefLayerLeftOffset,   0, sizeof(m_scaledRefLayerLeftOffset));
38  ::memset(m_scaledRefLayerTopOffset,    0, sizeof(m_scaledRefLayerTopOffset));
39  ::memset(m_scaledRefLayerRightOffset,  0, sizeof(m_scaledRefLayerRightOffset));
40  ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset));
41  ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag));
42  ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag));
43  ::memset(m_refRegionLeftOffset,   0, sizeof(m_refRegionLeftOffset));
44  ::memset(m_refRegionTopOffset,    0, sizeof(m_refRegionTopOffset));
45  ::memset(m_refRegionRightOffset,  0, sizeof(m_refRegionRightOffset));
46  ::memset(m_refRegionBottomOffset, 0, sizeof(m_refRegionBottomOffset));
47  ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag));
48  ::memset(m_phaseHorLuma,   0, sizeof(m_phaseHorLuma));
49  ::memset(m_phaseVerLuma,   0, sizeof(m_phaseVerLuma));
50  ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));
51  ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));
52#if SCALABLE_REXT
53  // variables uninitialized otherwise
54  m_intraConstraintFlag = false;
55  m_lowerBitRateConstraintFlag = false;
56  m_onePictureOnlyConstraintFlag = false; 
57#endif
58}
59
60TAppEncLayerCfg::~TAppEncLayerCfg()
61{
62  if( m_numSamplePredRefLayers > 0 )
63  {
64    delete [] m_samplePredRefLayerIds;
65    m_samplePredRefLayerIds = NULL;
66  }
67
68  if( m_numMotionPredRefLayers > 0 )
69  {
70    delete [] m_motionPredRefLayerIds;
71    m_motionPredRefLayerIds = NULL;
72  }
73
74  if( m_numActiveRefLayers > 0 )
75  {
76    delete [] m_predLayerIds;
77    m_predLayerIds = NULL;
78  }
79
80  if( m_aidQP )
81  {
82    delete [] m_aidQP;
83  }
84}
85
86#endif //SVC_EXTENSION
87
88
89//! \}
Note: See TracBrowser for help on using the repository browser.