RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
rawspeed::PrefixCodeLookupDecoder< CodeTag > Class Template Reference

#include "codes/PrefixCodeLookupDecoder.h"

Inheritance diagram for rawspeed::PrefixCodeLookupDecoder< CodeTag >:
[legend]
Collaboration diagram for rawspeed::PrefixCodeLookupDecoder< CodeTag >:
[legend]

Public Types

using Tag = CodeTag
using Base = AbstractPrefixCodeDecoder<CodeTag>
using Traits = typename Base::Traits
using Parent = typename Base::Parent
using CodeSymbol = typename Base::CodeSymbol

Public Member Functions

 PrefixCodeLookupDecoder (HuffmanCode< CodeTag > &&hc)
 PrefixCodeLookupDecoder (PrefixCode< CodeTag >)=delete
 PrefixCodeLookupDecoder (const PrefixCode< CodeTag > &)=delete
 PrefixCodeLookupDecoder (PrefixCode< CodeTag > &&)=delete
void setup (bool fullDecode_, bool fixDNGBug16_)
template<typename BIT_STREAM>
Traits::CodeValueTy decodeCodeValue (BIT_STREAM &bs) const
template<typename BIT_STREAM>
int decodeDifference (BIT_STREAM &bs) const
template<typename BIT_STREAM, bool FULL_DECODE>
int decode (BIT_STREAM &bs) const
template<typename BIT_STREAM, bool FULL_DECODE>
int processSymbol (BIT_STREAM &bs, CodeSymbol symbol, typename Traits::CodeValueTy codeValue) const
void verifyCodeValuesAsDiffLengths () const
bool RAWSPEED_READONLY isFullDecode () const
bool RAWSPEED_READONLY handleDNGBug16 () const
bool operator== (const AbstractPrefixCodeTranscoder &other) const

Static Public Member Functions

static int RAWSPEED_READNONE extend (uint32_t diff, uint32_t len)

Public Attributes

PrefixCode< CodeTag > code

Protected Member Functions

template<typename BIT_STREAM>
std::pair< typename Base::CodeSymbol, int > finishReadingPartialSymbol (BIT_STREAM &bs, typename Base::CodeSymbol partial) const
template<typename BIT_STREAM>
std::pair< typename Base::CodeSymbol, int > readSymbol (BIT_STREAM &bs) const
size_t RAWSPEED_READONLY maxCodeLength () const
size_t RAWSPEED_READONLY __attribute__ ((pure)) maxCodePlusDiffLength() const

Protected Attributes

std::vector< typename Traits::CodeTy > maxCodeOL
std::vector< typename Traits::CodeTy > codeOffsetOL

Static Protected Attributes

static constexpr auto MaxCodeValue

Private Attributes

bool fullDecode = true
bool fixDNGBug16 = false

Detailed Description

template<typename CodeTag>
class rawspeed::PrefixCodeLookupDecoder< CodeTag >

Definition at line 72 of file PrefixCodeLookupDecoder.h.

Member Typedef Documentation

◆ Base

template<typename CodeTag>
using rawspeed::PrefixCodeLookupDecoder< CodeTag >::Base = AbstractPrefixCodeDecoder<CodeTag>

Definition at line 75 of file PrefixCodeLookupDecoder.h.

◆ CodeSymbol

template<typename CodeTag>
using rawspeed::AbstractPrefixCodeDecoder< CodeTag >::CodeSymbol = typename Base::CodeSymbol
inherited

Definition at line 38 of file AbstractPrefixCodeDecoder.h.

◆ Parent

template<typename CodeTag>
using rawspeed::AbstractPrefixCodeDecoder< CodeTag >::Parent = typename Base::Parent
inherited

Definition at line 37 of file AbstractPrefixCodeDecoder.h.

◆ Tag

template<typename CodeTag>
using rawspeed::PrefixCodeLookupDecoder< CodeTag >::Tag = CodeTag

Definition at line 74 of file PrefixCodeLookupDecoder.h.

◆ Traits

template<typename CodeTag>
using rawspeed::PrefixCodeLookupDecoder< CodeTag >::Traits = typename Base::Traits

Definition at line 76 of file PrefixCodeLookupDecoder.h.

Constructor & Destructor Documentation

◆ PrefixCodeLookupDecoder() [1/4]

template<typename CodeTag>
rawspeed::PrefixCodeLookupDecoder< CodeTag >::PrefixCodeLookupDecoder ( HuffmanCode< CodeTag > && hc)
inlineexplicit

Definition at line 79 of file PrefixCodeLookupDecoder.h.

◆ PrefixCodeLookupDecoder() [2/4]

template<typename CodeTag>
rawspeed::PrefixCodeLookupDecoder< CodeTag >::PrefixCodeLookupDecoder ( PrefixCode< CodeTag > )
delete

◆ PrefixCodeLookupDecoder() [3/4]

template<typename CodeTag>
rawspeed::PrefixCodeLookupDecoder< CodeTag >::PrefixCodeLookupDecoder ( const PrefixCode< CodeTag > & )
delete

◆ PrefixCodeLookupDecoder() [4/4]

template<typename CodeTag>
rawspeed::PrefixCodeLookupDecoder< CodeTag >::PrefixCodeLookupDecoder ( PrefixCode< CodeTag > && )
delete

Member Function Documentation

◆ __attribute__()

template<typename CodeTag>
size_t RAWSPEED_READONLY rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::__attribute__ ( (pure) ) const
inlinenodiscardprotectedinherited

Definition at line 65 of file AbstractPrefixCodeTranscoder.h.

References code, and maxCodeLength().

Here is the call graph for this function:

◆ decode()

template<typename CodeTag>
template<typename BIT_STREAM, bool FULL_DECODE>
int rawspeed::PrefixCodeLookupDecoder< CodeTag >::decode ( BIT_STREAM & bs) const
inline

Definition at line 183 of file PrefixCodeLookupDecoder.h.

References invariant, rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::isFullDecode(), rawspeed::AbstractPrefixCodeDecoder< CodeTag >::processSymbol(), and readSymbol().

Referenced by rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::__attribute__(), rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::__attribute__(), rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::__attribute__(), decodeCodeValue(), and decodeDifference().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodeCodeValue()

template<typename CodeTag>
template<typename BIT_STREAM>
Traits::CodeValueTy rawspeed::PrefixCodeLookupDecoder< CodeTag >::decodeCodeValue ( BIT_STREAM & bs) const
inline

Definition at line 116 of file PrefixCodeLookupDecoder.h.

References decode(), invariant, and rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::isFullDecode().

Referenced by rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::__attribute__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodeDifference()

template<typename CodeTag>
template<typename BIT_STREAM>
int rawspeed::PrefixCodeLookupDecoder< CodeTag >::decodeDifference ( BIT_STREAM & bs) const
inline

Definition at line 124 of file PrefixCodeLookupDecoder.h.

References decode(), invariant, and rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::isFullDecode().

Referenced by rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::__attribute__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extend()

◆ finishReadingPartialSymbol()

template<typename CodeTag>
template<typename BIT_STREAM>
std::pair< typename Base::CodeSymbol, int > rawspeed::PrefixCodeLookupDecoder< CodeTag >::finishReadingPartialSymbol ( BIT_STREAM & bs,
typename Base::CodeSymbol partial ) const
inlineprotected

Definition at line 135 of file PrefixCodeLookupDecoder.h.

References assert(), rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::code, codeOffsetOL, rawspeed::implicit_cast(), rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::maxCodeLength(), maxCodeOL, MaxCodeValue, and ThrowRDE.

Referenced by rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::__attribute__(), and readSymbol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleDNGBug16()

template<typename CodeTag>
bool RAWSPEED_READONLY rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::handleDNGBug16 ( ) const
inlinenodiscardinherited

Definition at line 90 of file AbstractPrefixCodeTranscoder.h.

References fixDNGBug16.

Referenced by rawspeed::PrefixCodeVectorEncoder< CodeTag >::encodeDifference(), rawspeed::AbstractPrefixCodeDecoder< CodeTag >::processSymbol(), and rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::setup().

Here is the caller graph for this function:

◆ isFullDecode()

template<typename CodeTag>
bool RAWSPEED_READONLY rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::isFullDecode ( ) const
inlinenodiscardinherited

◆ maxCodeLength()

template<typename CodeTag>
size_t RAWSPEED_READONLY rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::maxCodeLength ( ) const
inlinenodiscardprotectedinherited

Definition at line 61 of file AbstractPrefixCodeTranscoder.h.

References code.

Referenced by __attribute__(), rawspeed::PrefixCodeLookupDecoder< CodeTag >::finishReadingPartialSymbol(), rawspeed::PrefixCodeVectorDecoder< CodeTag >::finishReadingPartialSymbol(), and rawspeed::PrefixCodeLookupDecoder< CodeTag >::setup().

Here is the caller graph for this function:

◆ operator==()

template<typename CodeTag>
bool rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::operator== ( const AbstractPrefixCodeTranscoder< CodeTag > & other) const
inlineinherited

Definition at line 94 of file AbstractPrefixCodeTranscoder.h.

References AbstractPrefixCodeTranscoder(), and code.

Here is the call graph for this function:

◆ processSymbol()

template<typename CodeTag>
template<typename BIT_STREAM, bool FULL_DECODE>
int rawspeed::AbstractPrefixCodeDecoder< CodeTag >::processSymbol ( BIT_STREAM & bs,
CodeSymbol symbol,
typename Traits::CodeValueTy codeValue ) const
inlineinherited

Definition at line 44 of file AbstractPrefixCodeDecoder.h.

References extend(), rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::handleDNGBug16(), and invariant.

Referenced by rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::__attribute__(), rawspeed::PrefixCodeLookupDecoder< CodeTag >::decode(), rawspeed::PrefixCodeTreeDecoder< CodeTag >::decode(), and rawspeed::PrefixCodeVectorDecoder< CodeTag >::decode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSymbol()

template<typename CodeTag>
template<typename BIT_STREAM>
std::pair< typename Base::CodeSymbol, int > rawspeed::PrefixCodeLookupDecoder< CodeTag >::readSymbol ( BIT_STREAM & bs) const
inlineprotected

Definition at line 168 of file PrefixCodeLookupDecoder.h.

References finishReadingPartialSymbol().

Referenced by decode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup()

template<typename CodeTag>
void rawspeed::PrefixCodeLookupDecoder< CodeTag >::setup ( bool fullDecode_,
bool fixDNGBug16_ )
inline

Definition at line 97 of file PrefixCodeLookupDecoder.h.

References assert(), rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::code, codeOffsetOL, rawspeed::implicit_cast(), rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::maxCodeLength(), maxCodeOL, MaxCodeValue, and rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::setup().

Referenced by rawspeed::PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > >::setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verifyCodeValuesAsDiffLengths()

template<typename CodeTag>
void rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::verifyCodeValuesAsDiffLengths ( ) const
inlineinherited

Definition at line 50 of file AbstractPrefixCodeTranscoder.h.

References assert(), code, and ThrowRDE.

Referenced by setup().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ code

◆ codeOffsetOL

template<typename CodeTag>
std::vector<typename Traits::CodeTy> rawspeed::PrefixCodeLookupDecoder< CodeTag >::codeOffsetOL
protected

Definition at line 91 of file PrefixCodeLookupDecoder.h.

Referenced by finishReadingPartialSymbol(), and setup().

◆ fixDNGBug16

template<typename CodeTag>
bool rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::fixDNGBug16 = false
privateinherited

Definition at line 37 of file AbstractPrefixCodeTranscoder.h.

Referenced by handleDNGBug16().

◆ fullDecode

template<typename CodeTag>
bool rawspeed::AbstractPrefixCodeTranscoder< CodeTag >::fullDecode = true
privateinherited

Definition at line 36 of file AbstractPrefixCodeTranscoder.h.

Referenced by isFullDecode(), and setup().

◆ maxCodeOL

template<typename CodeTag>
std::vector<typename Traits::CodeTy> rawspeed::PrefixCodeLookupDecoder< CodeTag >::maxCodeOL
protected

Definition at line 90 of file PrefixCodeLookupDecoder.h.

Referenced by finishReadingPartialSymbol(), and setup().

◆ MaxCodeValue

template<typename CodeTag>
auto rawspeed::PrefixCodeLookupDecoder< CodeTag >::MaxCodeValue
staticconstexprprotected
Initial value:
=
std::numeric_limits<typename Traits::CodeTy>::max()

Definition at line 93 of file PrefixCodeLookupDecoder.h.

Referenced by finishReadingPartialSymbol(), and setup().


The documentation for this class was generated from the following file: