RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
rawspeed::VC5Decompressor Class Referencefinal

#include "decompressors/VC5Decompressor.h"

Inheritance diagram for rawspeed::VC5Decompressor:
[legend]
Collaboration diagram for rawspeed::VC5Decompressor:
[legend]

Classes

struct  BandData
class  Wavelet
struct  Channel

Public Member Functions

 VC5Decompressor (ByteStream bs, const RawImage &img)
void decode (unsigned int offsetX, unsigned int offsetY, unsigned int width, unsigned int height)

Private Types

using PrefixCodeDecoder

Private Member Functions

void initPrefixCodeDecoder ()
void initVC5LogTable ()
void parseLargeCodeblock (ByteStream bs)
template<BayerPhase p>
void combineFinalLowpassBandsImpl () const noexcept
void combineFinalLowpassBands () const noexcept
void createWaveletBandDecodingTasks (bool &exceptionThrown) const noexcept
void decodeThread (bool &exceptionThrown) const noexcept
void parseVC5 ()

Static Private Member Functions

static std::pair< int16_t, unsigned int > getRLV (const PrefixCodeDecoder &decoder, BitStreamerMSB &bits)

Private Attributes

RawImage mRaw
ByteStream mBs
BayerPhase phase
int outputBits
SimpleLUT< unsigned, VC5_LOG_TABLE_BITWIDTHmVC5LogTable
Optional< PrefixCodeDecodercodeDecoder
struct { 
   uint16_t   iChannel = 0 
   Optional< uint16_t >   iSubband 
   Optional< uint16_t >   lowpassPrecision 
   Optional< int16_t >   quantization 
   const uint16_t   imgFormat = 4 
   const uint16_t   patternWidth = 2 
   const uint16_t   patternHeight = 2 
   const uint16_t   cps = 1 
mVC5
std::array< Channel, numChannelschannels

Static Private Attributes

static constexpr auto VC5_LOG_TABLE_BITWIDTH = 12
static constexpr int numWaveletLevels = 3
static constexpr int numHighPassBands = 3
static constexpr int numLowPassBands = 1
static constexpr int numSubbands
static constexpr int numChannels = 4
static constexpr int numSubbandsTotal = numSubbands * numChannels
static constexpr int numLowPassBandsTotal = numWaveletLevels * numChannels

Detailed Description

Definition at line 95 of file VC5Decompressor.h.

Member Typedef Documentation

◆ PrefixCodeDecoder

Constructor & Destructor Documentation

◆ VC5Decompressor()

rawspeed::VC5Decompressor::VC5Decompressor ( ByteStream bs,
const RawImage & img )

Member Function Documentation

◆ combineFinalLowpassBands()

void rawspeed::VC5Decompressor::combineFinalLowpassBands ( ) const
privatenoexcept

Definition at line 933 of file VC5Decompressor.cpp.

References combineFinalLowpassBandsImpl(), rawspeed::GBRG, phase, and rawspeed::RGGB.

Referenced by decodeThread().

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

◆ combineFinalLowpassBandsImpl()

template<BayerPhase p>
void rawspeed::VC5Decompressor::combineFinalLowpassBandsImpl ( ) const
privatenoexcept

Definition at line 876 of file VC5Decompressor.cpp.

References rawspeed::applyStablePhaseShift(), assert(), rawspeed::VC5Decompressor::Wavelet::bands, channels, rawspeed::Array2DRef< T >::height(), rawspeed::VC5Decompressor::Wavelet::height, mRaw, mVC5LogTable, rawspeed::RGGB, rawspeed::Array2DRef< T >::width(), and rawspeed::VC5Decompressor::Wavelet::width.

Referenced by combineFinalLowpassBands().

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

◆ createWaveletBandDecodingTasks()

void rawspeed::VC5Decompressor::createWaveletBandDecodingTasks ( bool & exceptionThrown) const
privatenoexcept

Definition at line 818 of file VC5Decompressor.cpp.

References channels, rawspeed::VC5Decompressor::Wavelet::maxBands, mRaw, and numWaveletLevels.

Referenced by decodeThread().

Here is the caller graph for this function:

◆ decode()

void rawspeed::VC5Decompressor::decode ( unsigned int offsetX,
unsigned int offsetY,
unsigned int width,
unsigned int height )

Definition at line 849 of file VC5Decompressor.cpp.

References assert(), decodeThread(), rawspeed::VC5Decompressor::Wavelet::height, initPrefixCodeDecoder(), initVC5LogTable(), mRaw, ThrowRDE, and rawspeed::VC5Decompressor::Wavelet::width.

Referenced by rawspeed::AbstractDngDecompressor::decompressThread().

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

◆ decodeThread()

void rawspeed::VC5Decompressor::decodeThread ( bool & exceptionThrown) const
privatenoexcept

Definition at line 835 of file VC5Decompressor.cpp.

References combineFinalLowpassBands(), and createWaveletBandDecodingTasks().

Referenced by decode().

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

◆ getRLV()

std::pair< int16_t, unsigned int > rawspeed::VC5Decompressor::getRLV ( const PrefixCodeDecoder & decoder,
BitStreamerMSB & bits )
inlinestaticprivate

Definition at line 949 of file VC5Decompressor.cpp.

References rawspeed::PrefixCodeVectorDecoder< CodeTag >::decodeCodeValue(), rawspeed::BitStreamer< Tag >::getBitsNoFill(), rawspeed::implicit_cast(), and rawspeed::RLVRunLengthBitWidth.

Referenced by rawspeed::VC5Decompressor::Wavelet::HighPassBand::decode().

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

◆ initPrefixCodeDecoder()

void rawspeed::VC5Decompressor::initPrefixCodeDecoder ( )
private

Definition at line 437 of file VC5Decompressor.cpp.

References assert(), codeDecoder, rawspeed::DecompandedCodeValueBitWidth, rawspeed::isIntN(), and rawspeed::RLVRunLengthBitWidth.

Referenced by decode().

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

◆ initVC5LogTable()

void rawspeed::VC5Decompressor::initVC5LogTable ( )
private

Definition at line 464 of file VC5Decompressor.cpp.

References rawspeed::implicit_cast(), mVC5LogTable, outputBits, x, and y.

Referenced by decode().

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

◆ parseLargeCodeblock()

void rawspeed::VC5Decompressor::parseLargeCodeblock ( ByteStream bs)
private

Definition at line 744 of file VC5Decompressor.cpp.

References rawspeed::VC5Decompressor::Wavelet::allBandsValid(), assert(), rawspeed::VC5Decompressor::Wavelet::bands, channels, codeDecoder, rawspeed::Buffer::getAsArray1DRef(), rawspeed::VC5Decompressor::Wavelet::isBandValid(), mVC5, numWaveletLevels, rawspeed::VC5Decompressor::Wavelet::setBandValid(), and ThrowRDE.

Referenced by parseVC5().

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

◆ parseVC5()

void rawspeed::VC5Decompressor::parseVC5 ( )
private

Member Data Documentation

◆ channels

std::array<Channel, numChannels> rawspeed::VC5Decompressor::channels
private

◆ codeDecoder

Optional<PrefixCodeDecoder> rawspeed::VC5Decompressor::codeDecoder
private

Definition at line 108 of file VC5Decompressor.h.

Referenced by initPrefixCodeDecoder(), and parseLargeCodeblock().

◆ cps

const uint16_t rawspeed::VC5Decompressor::cps = 1

Definition at line 129 of file VC5Decompressor.h.

◆ iChannel

uint16_t rawspeed::VC5Decompressor::iChannel = 0

Definition at line 121 of file VC5Decompressor.h.

◆ imgFormat

const uint16_t rawspeed::VC5Decompressor::imgFormat = 4

Definition at line 126 of file VC5Decompressor.h.

◆ iSubband

Optional<uint16_t> rawspeed::VC5Decompressor::iSubband

Definition at line 122 of file VC5Decompressor.h.

◆ lowpassPrecision

Optional<uint16_t> rawspeed::VC5Decompressor::lowpassPrecision

Definition at line 123 of file VC5Decompressor.h.

◆ mBs

ByteStream rawspeed::VC5Decompressor::mBs
private

Definition at line 97 of file VC5Decompressor.h.

Referenced by VC5Decompressor(), and parseVC5().

◆ mRaw

RawImage rawspeed::VC5Decompressor::mRaw
private

◆ [struct]

struct { ... } rawspeed::VC5Decompressor::mVC5

◆ mVC5LogTable

SimpleLUT<unsigned, VC5_LOG_TABLE_BITWIDTH> rawspeed::VC5Decompressor::mVC5LogTable
private

Definition at line 103 of file VC5Decompressor.h.

Referenced by combineFinalLowpassBandsImpl(), and initVC5LogTable().

◆ numChannels

int rawspeed::VC5Decompressor::numChannels = 4
staticconstexprprivate

Definition at line 222 of file VC5Decompressor.h.

Referenced by parseVC5().

◆ numHighPassBands

int rawspeed::VC5Decompressor::numHighPassBands = 3
staticconstexprprivate

Definition at line 115 of file VC5Decompressor.h.

◆ numLowPassBands

int rawspeed::VC5Decompressor::numLowPassBands = 1
staticconstexprprivate

Definition at line 116 of file VC5Decompressor.h.

◆ numLowPassBandsTotal

int rawspeed::VC5Decompressor::numLowPassBandsTotal = numWaveletLevels * numChannels
staticconstexprprivate

Definition at line 224 of file VC5Decompressor.h.

◆ numSubbands

int rawspeed::VC5Decompressor::numSubbands
staticconstexprprivate
Initial value:

Definition at line 117 of file VC5Decompressor.h.

Referenced by parseVC5().

◆ numSubbandsTotal

int rawspeed::VC5Decompressor::numSubbandsTotal = numSubbands * numChannels
staticconstexprprivate

Definition at line 223 of file VC5Decompressor.h.

◆ numWaveletLevels

int rawspeed::VC5Decompressor::numWaveletLevels = 3
staticconstexprprivate

◆ outputBits

int rawspeed::VC5Decompressor::outputBits
private

Definition at line 102 of file VC5Decompressor.h.

Referenced by VC5Decompressor(), and initVC5LogTable().

◆ patternHeight

const uint16_t rawspeed::VC5Decompressor::patternHeight = 2

Definition at line 128 of file VC5Decompressor.h.

◆ patternWidth

const uint16_t rawspeed::VC5Decompressor::patternWidth = 2

Definition at line 127 of file VC5Decompressor.h.

◆ phase

BayerPhase rawspeed::VC5Decompressor::phase
private

Definition at line 99 of file VC5Decompressor.h.

Referenced by VC5Decompressor(), and combineFinalLowpassBands().

◆ quantization

Optional<int16_t> rawspeed::VC5Decompressor::quantization

Definition at line 124 of file VC5Decompressor.h.

◆ VC5_LOG_TABLE_BITWIDTH

auto rawspeed::VC5Decompressor::VC5_LOG_TABLE_BITWIDTH = 12
staticconstexprprivate

Definition at line 101 of file VC5Decompressor.h.

Referenced by parseVC5().


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