Skip to content
Snippets Groups Projects
Commit 311811df authored by Frederic Barbier's avatar Frederic Barbier
Browse files

Cleanup dead code

parent eb547a55
No related branches found
No related tags found
1 merge request!317Cleanup dead code
......@@ -520,106 +520,4 @@ private:
class CtxStateBuf
{
public:
CtxStateBuf () : m_valid(false) {}
~CtxStateBuf() {}
inline void reset() { m_valid = false; }
inline bool getIfValid(Ctx &ctx) const
{
if (m_valid)
{
ctx.loadPStates(m_states);
return true;
}
return false;
}
inline void store(const Ctx &ctx)
{
ctx.savePStates(m_states);
m_valid = true;
}
private:
std::vector<uint16_t> m_states;
bool m_valid;
};
class CtxStateArray
{
public:
CtxStateArray () {}
~CtxStateArray() {}
inline void resetAll()
{
for (std::size_t k = 0; k < m_data.size(); k++)
{
m_data[k].reset();
}
}
inline void resize(std::size_t reqSize)
{
if (m_data.size() < reqSize)
{
m_data.resize(reqSize);
}
}
inline bool getIfValid(Ctx &ctx, unsigned id) const
{
if (id < m_data.size())
{
return m_data[id].getIfValid(ctx);
}
return false;
}
inline void store(const Ctx &ctx, unsigned id)
{
if (id >= m_data.size())
{
resize(id + 1);
}
m_data[id].store(ctx);
}
private:
std::vector<CtxStateBuf> m_data;
};
class CtxWSizeSet
{
public:
CtxWSizeSet() : m_valid(false), m_changes(false), m_coded(false), m_log2WinSizes() {}
bool isValid() const { return m_valid; }
const std::vector<uint8_t>& getWinSizeBuffer() const { return m_log2WinSizes; }
std::vector<uint8_t>& getWinSizeBuffer() { return m_log2WinSizes; }
int getMode() const { return ( !m_valid || !m_changes ? 0 : ( m_coded ? 2 : 1 ) ); }
void setInvalid() { m_valid = m_changes = m_coded = false; }
void setCoded() { m_coded = true; }
void setValidOnly() { m_valid = true; }
void setValid( uint8_t defSize )
{
m_valid = true;
m_changes = false;
for( std::size_t n = 0; n < m_log2WinSizes.size(); n++ )
{
if( m_log2WinSizes[n] && m_log2WinSizes[n] != defSize )
{
m_changes = true;
return;
}
}
}
private:
bool m_valid;
bool m_changes;
bool m_coded;
std::vector<uint8_t> m_log2WinSizes;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment