36template <
typename CodeTag>
50 template <
typename BIT_STREAM>
56 "This BitStreamer specialization is not marked as usable here");
61 const bool bit = bs.getBitsNoFill(1);
71 invariant(partial.code_len == symbol.code_len);
72 if (symbol == partial)
73 return {symbol,
Base::code.codeValues[codeId]};
77 ThrowRDE(
"bad Huffman code: %u (len: %u)", partial.code, partial.code_len);
80 template <
typename BIT_STREAM>
92 void setup(
bool fullDecode_,
bool fixDNGBug16_) {
97 for (
auto codeLen = 1UL; codeLen <
Base::code.nCodesPerLength.size();
100 minCodeId +=
Base::code.nCodesPerLength[codeLen];
106 template <
typename BIT_STREAM>
110 "This BitStreamer specialization is not marked as usable here");
118 "This BitStreamer specialization is not marked as usable here");
127 template <
typename BIT_STREAM,
bool FULL_DECODE>
131 "This BitStreamer specialization is not marked as usable here");
137 typename Traits::CodeValueTy codeValue;
assert(dim.area() >=area)
int processSymbol(BIT_STREAM &bs, CodeSymbol symbol, typename Traits::CodeValueTy codeValue) const
typename Base::Traits Traits
AbstractPrefixCodeTranscoder< CodeTag > Base
typename Base::CodeSymbol CodeSymbol
bool RAWSPEED_READONLY isFullDecode() const
size_t RAWSPEED_READONLY maxCodeLength() const
PrefixCode< CodeTag > code
void setup(bool fullDecode_, bool fixDNGBug16_)
int decodeDifference(BIT_STREAM &bs) const
std::vector< uint32_t > extrCodeIdForLen
typename Base::Traits Traits
void setup(bool fullDecode_, bool fixDNGBug16_)
int decode(BIT_STREAM &bs) const
std::pair< typename Base::CodeSymbol, int > finishReadingPartialSymbol(BIT_STREAM &bs, typename Base::CodeSymbol partial) const
std::pair< typename Base::CodeSymbol, int > readSymbol(BIT_STREAM &bs) const
AbstractPrefixCodeDecoder< CodeTag > Base
Traits::CodeValueTy decodeCodeValue(BIT_STREAM &bs) const