Coverage Report

Created: 2026-06-16 07:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/vvdec/source/Lib/CommonLib/ParameterSetManager.h
Line
Count
Source
1
/* -----------------------------------------------------------------------------
2
The copyright in this software is being made available under the Clear BSD
3
License, included below. No patent rights, trademark rights and/or 
4
other Intellectual Property Rights other than the copyrights concerning 
5
the Software are granted under this license.
6
7
The Clear BSD License
8
9
Copyright (c) 2018-2026, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVdeC Authors.
10
All rights reserved.
11
12
Redistribution and use in source and binary forms, with or without modification,
13
are permitted (subject to the limitations in the disclaimer below) provided that
14
the following conditions are met:
15
16
     * Redistributions of source code must retain the above copyright notice,
17
     this list of conditions and the following disclaimer.
18
19
     * Redistributions in binary form must reproduce the above copyright
20
     notice, this list of conditions and the following disclaimer in the
21
     documentation and/or other materials provided with the distribution.
22
23
     * Neither the name of the copyright holder nor the names of its
24
     contributors may be used to endorse or promote products derived from this
25
     software without specific prior written permission.
26
27
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
28
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
29
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
31
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
35
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
36
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
POSSIBILITY OF SUCH DAMAGE.
39
40
41
------------------------------------------------------------------------------------------- */
42
43
#pragma once
44
45
#include "CommonDef.h"
46
#include "Slice.h"
47
48
#include <map>
49
#include <vector>
50
#include <array>
51
52
namespace vvdec
53
{
54
55
template<class T, int MAX_ID>
56
class ParameterSetMap
57
{
58
public:
59
  struct MapData
60
  {
61
    AlignedByteVec     cNaluData;   // Can be empty
62
    std::shared_ptr<T> parameterSet;
63
    bool               bChanged = false;
64
  };
65
66
  ~ParameterSetMap()
67
7.48k
  {
68
7.48k
    m_paramsetMap.clear();
69
7.48k
    m_lastActiveParameterSet.reset();
70
7.48k
  }
vvdec::ParameterSetMap<vvdec::VPS, 16>::~ParameterSetMap()
Line
Count
Source
67
1.87k
  {
68
1.87k
    m_paramsetMap.clear();
69
1.87k
    m_lastActiveParameterSet.reset();
70
1.87k
  }
vvdec::ParameterSetMap<vvdec::APS, 64>::~ParameterSetMap()
Line
Count
Source
67
1.87k
  {
68
1.87k
    m_paramsetMap.clear();
69
1.87k
    m_lastActiveParameterSet.reset();
70
1.87k
  }
vvdec::ParameterSetMap<vvdec::PPS, 64>::~ParameterSetMap()
Line
Count
Source
67
1.87k
  {
68
1.87k
    m_paramsetMap.clear();
69
1.87k
    m_lastActiveParameterSet.reset();
70
1.87k
  }
vvdec::ParameterSetMap<vvdec::SPS, 16>::~ParameterSetMap()
Line
Count
Source
67
1.87k
  {
68
1.87k
    m_paramsetMap.clear();
69
1.87k
    m_lastActiveParameterSet.reset();
70
1.87k
  }
71
72
  void storePS( int psId, T* ps, AlignedByteVec&& cNaluData )
73
2.39k
  {
74
2.39k
    CHECK( psId >= MAX_ID, "Invalid PS id" );
75
2.39k
    if( m_paramsetMap.find( psId ) != m_paramsetMap.end() )
76
0
    {
77
0
      MapData& mapData   = m_paramsetMap[psId];
78
79
      // work out changed flag
80
0
      mapData.parameterSet->m_changedFlag |= ( mapData.cNaluData != cNaluData );
81
82
      // Don't throw away identical parameter sets as VTM does:
83
      //   The PPS can be identical to a previous one, but the SPS changed, so it needs to be interpreted differently.
84
      //
85
      // if( !mapData.parameterSet->m_changedFlag )
86
      // {
87
      //   // just keep the old one
88
      //   delete ps;
89
      //   return;
90
      // }
91
92
0
      if( find( m_activePsId.begin(), m_activePsId.end(), psId ) != m_activePsId.end() )
93
0
      {
94
0
        std::swap( m_paramsetMap[psId].parameterSet, m_lastActiveParameterSet );
95
0
      }
96
0
      m_paramsetMap[psId].cNaluData.clear();
97
0
      m_paramsetMap[psId].parameterSet.reset(ps);
98
0
    }
99
2.39k
    else
100
2.39k
    {
101
2.39k
      m_paramsetMap[psId].parameterSet.reset(ps);
102
2.39k
      ps->m_changedFlag = false;
103
2.39k
    }
104
105
2.39k
    if( !cNaluData.empty() )
106
2.39k
    {
107
2.39k
      m_paramsetMap[psId].cNaluData = std::move( cNaluData );
108
2.39k
    }
109
0
    else
110
0
    {
111
0
      m_paramsetMap[psId].cNaluData.clear();
112
0
    }
113
2.39k
  }
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::VPS, 16>::storePS(int, vvdec::VPS*, std::__1::vector<unsigned char, vvdec::AlignedAllocator<unsigned char> >&&)
vvdec::ParameterSetMap<vvdec::SPS, 16>::storePS(int, vvdec::SPS*, std::__1::vector<unsigned char, vvdec::AlignedAllocator<unsigned char> >&&)
Line
Count
Source
73
817
  {
74
817
    CHECK( psId >= MAX_ID, "Invalid PS id" );
75
817
    if( m_paramsetMap.find( psId ) != m_paramsetMap.end() )
76
0
    {
77
0
      MapData& mapData   = m_paramsetMap[psId];
78
79
      // work out changed flag
80
0
      mapData.parameterSet->m_changedFlag |= ( mapData.cNaluData != cNaluData );
81
82
      // Don't throw away identical parameter sets as VTM does:
83
      //   The PPS can be identical to a previous one, but the SPS changed, so it needs to be interpreted differently.
84
      //
85
      // if( !mapData.parameterSet->m_changedFlag )
86
      // {
87
      //   // just keep the old one
88
      //   delete ps;
89
      //   return;
90
      // }
91
92
0
      if( find( m_activePsId.begin(), m_activePsId.end(), psId ) != m_activePsId.end() )
93
0
      {
94
0
        std::swap( m_paramsetMap[psId].parameterSet, m_lastActiveParameterSet );
95
0
      }
96
0
      m_paramsetMap[psId].cNaluData.clear();
97
0
      m_paramsetMap[psId].parameterSet.reset(ps);
98
0
    }
99
817
    else
100
817
    {
101
817
      m_paramsetMap[psId].parameterSet.reset(ps);
102
817
      ps->m_changedFlag = false;
103
817
    }
104
105
817
    if( !cNaluData.empty() )
106
817
    {
107
817
      m_paramsetMap[psId].cNaluData = std::move( cNaluData );
108
817
    }
109
0
    else
110
0
    {
111
0
      m_paramsetMap[psId].cNaluData.clear();
112
0
    }
113
817
  }
vvdec::ParameterSetMap<vvdec::PPS, 64>::storePS(int, vvdec::PPS*, std::__1::vector<unsigned char, vvdec::AlignedAllocator<unsigned char> >&&)
Line
Count
Source
73
802
  {
74
802
    CHECK( psId >= MAX_ID, "Invalid PS id" );
75
802
    if( m_paramsetMap.find( psId ) != m_paramsetMap.end() )
76
0
    {
77
0
      MapData& mapData   = m_paramsetMap[psId];
78
79
      // work out changed flag
80
0
      mapData.parameterSet->m_changedFlag |= ( mapData.cNaluData != cNaluData );
81
82
      // Don't throw away identical parameter sets as VTM does:
83
      //   The PPS can be identical to a previous one, but the SPS changed, so it needs to be interpreted differently.
84
      //
85
      // if( !mapData.parameterSet->m_changedFlag )
86
      // {
87
      //   // just keep the old one
88
      //   delete ps;
89
      //   return;
90
      // }
91
92
0
      if( find( m_activePsId.begin(), m_activePsId.end(), psId ) != m_activePsId.end() )
93
0
      {
94
0
        std::swap( m_paramsetMap[psId].parameterSet, m_lastActiveParameterSet );
95
0
      }
96
0
      m_paramsetMap[psId].cNaluData.clear();
97
0
      m_paramsetMap[psId].parameterSet.reset(ps);
98
0
    }
99
802
    else
100
802
    {
101
802
      m_paramsetMap[psId].parameterSet.reset(ps);
102
802
      ps->m_changedFlag = false;
103
802
    }
104
105
802
    if( !cNaluData.empty() )
106
802
    {
107
802
      m_paramsetMap[psId].cNaluData = std::move( cNaluData );
108
802
    }
109
0
    else
110
0
    {
111
0
      m_paramsetMap[psId].cNaluData.clear();
112
0
    }
113
802
  }
vvdec::ParameterSetMap<vvdec::APS, 64>::storePS(int, vvdec::APS*, std::__1::vector<unsigned char, vvdec::AlignedAllocator<unsigned char> >&&)
Line
Count
Source
73
780
  {
74
780
    CHECK( psId >= MAX_ID, "Invalid PS id" );
75
780
    if( m_paramsetMap.find( psId ) != m_paramsetMap.end() )
76
0
    {
77
0
      MapData& mapData   = m_paramsetMap[psId];
78
79
      // work out changed flag
80
0
      mapData.parameterSet->m_changedFlag |= ( mapData.cNaluData != cNaluData );
81
82
      // Don't throw away identical parameter sets as VTM does:
83
      //   The PPS can be identical to a previous one, but the SPS changed, so it needs to be interpreted differently.
84
      //
85
      // if( !mapData.parameterSet->m_changedFlag )
86
      // {
87
      //   // just keep the old one
88
      //   delete ps;
89
      //   return;
90
      // }
91
92
0
      if( find( m_activePsId.begin(), m_activePsId.end(), psId ) != m_activePsId.end() )
93
0
      {
94
0
        std::swap( m_paramsetMap[psId].parameterSet, m_lastActiveParameterSet );
95
0
      }
96
0
      m_paramsetMap[psId].cNaluData.clear();
97
0
      m_paramsetMap[psId].parameterSet.reset(ps);
98
0
    }
99
780
    else
100
780
    {
101
780
      m_paramsetMap[psId].parameterSet.reset(ps);
102
780
      ps->m_changedFlag = false;
103
780
    }
104
105
780
    if( !cNaluData.empty() )
106
780
    {
107
780
      m_paramsetMap[psId].cNaluData = std::move( cNaluData );
108
780
    }
109
0
    else
110
0
    {
111
0
      m_paramsetMap[psId].cNaluData.clear();
112
0
    }
113
780
  }
114
115
  T* getPS_nothrow( int psId )
116
5.38k
  {
117
5.38k
    auto it = m_paramsetMap.find( psId );
118
5.38k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
119
5.38k
  }
vvdec::ParameterSetMap<vvdec::SPS, 16>::getPS_nothrow(int)
Line
Count
Source
116
1.42k
  {
117
1.42k
    auto it = m_paramsetMap.find( psId );
118
1.42k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
119
1.42k
  }
vvdec::ParameterSetMap<vvdec::PPS, 64>::getPS_nothrow(int)
Line
Count
Source
116
1.42k
  {
117
1.42k
    auto it = m_paramsetMap.find( psId );
118
1.42k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
119
1.42k
  }
vvdec::ParameterSetMap<vvdec::APS, 64>::getPS_nothrow(int)
Line
Count
Source
116
2.53k
  {
117
2.53k
    auto it = m_paramsetMap.find( psId );
118
2.53k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
119
2.53k
  }
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::VPS, 16>::getPS_nothrow(int)
120
121
  const T* getPS_nothrow( int psId ) const
122
7.97k
  {
123
7.97k
    auto it = m_paramsetMap.find( psId );
124
7.97k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
125
7.97k
  }
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::VPS, 16>::getPS_nothrow(int) const
vvdec::ParameterSetMap<vvdec::SPS, 16>::getPS_nothrow(int) const
Line
Count
Source
122
3.75k
  {
123
3.75k
    auto it = m_paramsetMap.find( psId );
124
3.75k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
125
3.75k
  }
vvdec::ParameterSetMap<vvdec::PPS, 64>::getPS_nothrow(int) const
Line
Count
Source
122
2.93k
  {
123
2.93k
    auto it = m_paramsetMap.find( psId );
124
2.93k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
125
2.93k
  }
vvdec::ParameterSetMap<vvdec::APS, 64>::getPS_nothrow(int) const
Line
Count
Source
122
1.28k
  {
123
1.28k
    auto it = m_paramsetMap.find( psId );
124
1.28k
    return it == m_paramsetMap.end() ? nullptr : it->second.parameterSet.get();
125
1.28k
  }
126
127
  T* getPS( int psId )
128
5.38k
  {
129
5.38k
    T* ps = getPS_nothrow( psId );
130
5.38k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
131
5.38k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
132
5.38k
    return ps;
133
5.38k
  }
vvdec::ParameterSetMap<vvdec::SPS, 16>::getPS(int)
Line
Count
Source
128
1.42k
  {
129
1.42k
    T* ps = getPS_nothrow( psId );
130
1.42k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
131
1.42k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
132
1.42k
    return ps;
133
1.42k
  }
vvdec::ParameterSetMap<vvdec::PPS, 64>::getPS(int)
Line
Count
Source
128
1.42k
  {
129
1.42k
    T* ps = getPS_nothrow( psId );
130
1.42k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
131
1.42k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
132
1.42k
    return ps;
133
1.42k
  }
vvdec::ParameterSetMap<vvdec::APS, 64>::getPS(int)
Line
Count
Source
128
2.53k
  {
129
2.53k
    T* ps = getPS_nothrow( psId );
130
2.53k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
131
2.53k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
132
2.53k
    return ps;
133
2.53k
  }
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::VPS, 16>::getPS(int)
134
135
  const T* getPS( int psId ) const
136
7.97k
  {
137
7.97k
    const T* ps = getPS_nothrow( psId );
138
7.97k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
139
7.97k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
140
7.95k
    return ps;
141
7.97k
  }
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::VPS, 16>::getPS(int) const
vvdec::ParameterSetMap<vvdec::SPS, 16>::getPS(int) const
Line
Count
Source
136
3.75k
  {
137
3.75k
    const T* ps = getPS_nothrow( psId );
138
3.75k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
139
3.75k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
140
3.74k
    return ps;
141
3.75k
  }
vvdec::ParameterSetMap<vvdec::PPS, 64>::getPS(int) const
Line
Count
Source
136
2.93k
  {
137
2.93k
    const T* ps = getPS_nothrow( psId );
138
2.93k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
139
2.93k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
140
2.93k
    return ps;
141
2.93k
  }
vvdec::ParameterSetMap<vvdec::APS, 64>::getPS(int) const
Line
Count
Source
136
1.28k
  {
137
1.28k
    const T* ps = getPS_nothrow( psId );
138
1.28k
    constexpr static int apsIdShift = std::is_same<T, APS>::value ? NUM_APS_TYPE_LEN : 0;
139
1.28k
    CHECK( !ps, "Missing Parameter Set (id:" << ( psId >> apsIdShift ) << ')' );
140
1.27k
    return ps;
141
1.28k
  }
142
143
  T* getFirstPS() const
144
0
  {
145
0
    return ( m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second.parameterSet.get();
146
0
  }
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::SPS, 16>::getFirstPS() const
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::PPS, 64>::getFirstPS() const
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::APS, 64>::getFirstPS() const
147
148
2.69k
  void setActive( int psId ) { m_activePsId.push_back( psId ); }
Unexecuted instantiation: vvdec::ParameterSetMap<vvdec::VPS, 16>::setActive(int)
vvdec::ParameterSetMap<vvdec::SPS, 16>::setActive(int)
Line
Count
Source
148
714
  void setActive( int psId ) { m_activePsId.push_back( psId ); }
vvdec::ParameterSetMap<vvdec::PPS, 64>::setActive(int)
Line
Count
Source
148
714
  void setActive( int psId ) { m_activePsId.push_back( psId ); }
vvdec::ParameterSetMap<vvdec::APS, 64>::setActive(int)
Line
Count
Source
148
1.26k
  void setActive( int psId ) { m_activePsId.push_back( psId ); }
149
2.85k
  void clearActive()         { m_activePsId.clear(); }
vvdec::ParameterSetMap<vvdec::APS, 64>::clearActive()
Line
Count
Source
149
714
  void clearActive()         { m_activePsId.clear(); }
vvdec::ParameterSetMap<vvdec::VPS, 16>::clearActive()
Line
Count
Source
149
714
  void clearActive()         { m_activePsId.clear(); }
vvdec::ParameterSetMap<vvdec::SPS, 16>::clearActive()
Line
Count
Source
149
714
  void clearActive()         { m_activePsId.clear(); }
vvdec::ParameterSetMap<vvdec::PPS, 64>::clearActive()
Line
Count
Source
149
714
  void clearActive()         { m_activePsId.clear(); }
150
  void clearMap()            { m_paramsetMap.clear(); }
151
152
private:
153
  std::map<int, MapData> m_paramsetMap;
154
  std::shared_ptr<T>     m_lastActiveParameterSet;
155
  std::vector<int>       m_activePsId;
156
};
157
158
159
class ParameterSetManager
160
{
161
public:
162
1.87k
  ParameterSetManager()  = default;
163
1.87k
  ~ParameterSetManager() = default;
164
165
  using APSArray = std::array<const APS*, ALF_CTB_MAX_NUM_APS>;
166
167
  struct ActivePSs
168
  {
169
    const SPS*      sps;
170
    const PPS*      pps;
171
          APSArray* alfAPSs;
172
    const APS*      lmcsAps;
173
    const APS*      scalingListAps;
174
  };
175
176
  ActivePSs xActivateParameterSets( const bool isFirstSlice, const Slice* pPilot, const PicHeader* picHeader );
177
178
  //! store sequence parameter set and take ownership of it
179
  //! store picture parameter set and take ownership of it
180
0
  void                  storeVPS( VPS* vps, AlignedByteVec& naluData ) { m_vpsMap.storePS( vps->getVPSId(),                                             vps, std::move( naluData ) ); }
181
817
  void                  storeSPS( SPS* sps, AlignedByteVec& naluData ) { m_spsMap.storePS( sps->getSPSId(),                                             sps, std::move( naluData ) ); }
182
802
  void                  storePPS( PPS* pps, AlignedByteVec& naluData ) { m_ppsMap.storePS( pps->getPPSId(),                                             pps, std::move( naluData ) ); }
183
780
  void                  storeAPS( APS* aps, AlignedByteVec& naluData ) { m_apsMap.storePS( ( aps->getAPSId() << NUM_APS_TYPE_LEN ) + aps->getAPSType(), aps, std::move( naluData ) ); }
184
185
  //! get pointer to existing sequence parameter set
186
1.42k
  const VPS*            getVPS        ( int vpsId )              const { if( !vpsId ) return nullptr; return m_vpsMap.getPS( vpsId );              }
187
3.75k
  const SPS*            getSPS        ( int spsId )              const { return m_spsMap.getPS        ( spsId );                                   }
188
2.93k
  const PPS*            getPPS        ( int ppsId )              const { return m_ppsMap.getPS        ( ppsId );                                   }
189
1.28k
  const APS*            getAPS        ( int apsId, int apsType ) const { return m_apsMap.getPS        ( ( apsId << NUM_APS_TYPE_LEN ) + apsType ); }
190
0
  const APS*            getAPS_nothrow( int apsId, int apsType ) const { return m_apsMap.getPS_nothrow( ( apsId << NUM_APS_TYPE_LEN ) + apsType ); }
191
  // getter only used by DecLibParser::prepareLostPicture(). Is it really needed?
192
0
  const APSArray&       getAlfAPSs()                             const { return m_alfAPSs; }
193
194
0
  const SPS*            getFirstSPS()                            const { return m_spsMap.getFirstPS();                                     }
195
0
  const PPS*            getFirstPPS()                            const { return m_ppsMap.getFirstPS();                                     }
196
0
  const APS*            getFirstAPS()                            const { return m_apsMap.getFirstPS();                                     }
197
198
  //! activate a PPS and, depending on isIDR parameter, also SPS. returns true, if activation is successful
199
  bool                  activatePPS( int ppsId, bool isIRAP );
200
  bool                  activateAPS( int apsId, int apsType );
201
202
0
  const SPS*            getActiveSPS()                           const { return m_spsMap.getPS( m_activeSPSId );                           }
203
204
private:
205
714
  SPS*                  getSPS( int spsId )                            { return m_spsMap.getPS( spsId );                                   }
206
714
  PPS*                  getPPS( int ppsId )                            { return m_ppsMap.getPS( ppsId );                                   }
207
1.26k
  APS*                  getAPS( int apsId, int apsType )               { return m_apsMap.getPS( ( apsId << NUM_APS_TYPE_LEN ) + apsType ); }
208
209
  ParameterSetMap<SPS, MAX_NUM_SPS>                            m_spsMap;
210
  ParameterSetMap<PPS, MAX_NUM_PPS>                            m_ppsMap;
211
  ParameterSetMap<APS, ALF_CTB_MAX_NUM_APS * MAX_NUM_APS_TYPE> m_apsMap;
212
  ParameterSetMap<VPS, MAX_NUM_VPS>                            m_vpsMap;
213
214
  APSArray m_alfAPSs;
215
216
  int m_activeSPSId = -1;   // -1 for nothing active
217
  int m_activeVPSId = -1;   // -1 for nothing active
218
};
219
220
}