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

#include "decompressors/LJpegDecoder.h"

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

Public Member Functions

 LJpegDecoder (ByteStream bs, const RawImage &img)
void decode (uint32_t offsetX, uint32_t offsetY, uint32_t width, uint32_t height, iPoint2D maxDim, bool fixDng16Bug_)
int getSamplePrecision () const

Protected Member Functions

virtual bool erratumImplicitEOIMarkerAfterScan () const
void decodeSOI ()
void parseSOF (ByteStream data, SOFInfo *i)
void parseSOS (ByteStream data)
void parseDHT (ByteStream data)
void parseDRI (ByteStream dri)
JpegMarker getNextMarker (bool allowskip)
std::vector< const PrefixCodeDecoder<> * > getPrefixCodeDecoders (int N_COMP) const
std::vector< uint16_tgetInitialPredictors (int N_COMP) const

Protected Attributes

bool fixDng16Bug = false
bool fullDecodeHT = true
ByteStream input
RawImage mRaw
SOFInfo frame
uint16_t numMCUsPerRestartInterval = 0
uint32_t predictorMode = 0

Private Member Functions

ByteStream::size_type decodeScan () override
virtual void anchor () const

Private Attributes

uint32_t offX = 0
uint32_t offY = 0
uint32_t w = 0
uint32_t h = 0
iPoint2D maxDim
std::vector< std::unique_ptr< const HuffmanCode< BaselineCodeTag > > > huffmanCodeStore
std::vector< std::unique_ptr< const PrefixCodeDecoder<> > > PrefixCodeDecoderStore
uint32_t Pt = 0
std::array< const PrefixCodeDecoder<> *, 4 > huff

Detailed Description

Definition at line 34 of file LJpegDecoder.h.

Constructor & Destructor Documentation

◆ LJpegDecoder()

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

Definition at line 43 of file LJpegDecoder.cpp.

References rawspeed::AbstractLJpegDecoder::AbstractLJpegDecoder(), rawspeed::AbstractLJpegDecoder::mRaw, ThrowRDE, and rawspeed::UINT16.

Here is the call graph for this function:

Member Function Documentation

◆ anchor()

void rawspeed::AbstractLJpegDecoder::anchor ( ) const
privatevirtualinherited

Definition at line 44 of file AbstractLJpegDecoder.cpp.

◆ decode()

void rawspeed::LJpegDecoder::decode ( uint32_t offsetX,
uint32_t offsetY,
uint32_t width,
uint32_t height,
iPoint2D maxDim,
bool fixDng16Bug_ )

Definition at line 66 of file LJpegDecoder.cpp.

References rawspeed::AbstractLJpegDecoder::decodeSOI(), rawspeed::AbstractLJpegDecoder::fixDng16Bug, h, rawspeed::iPoint2D::hasPositiveArea(), rawspeed::implicit_cast(), maxDim, rawspeed::AbstractLJpegDecoder::mRaw, offX, offY, ThrowRDE, w, rawspeed::iPoint2D::x, and rawspeed::iPoint2D::y.

Referenced by rawspeed::ArwDecoder::DecodeLJpeg(), rawspeed::AbstractDngDecompressor::decompressThread(), and LLVMFuzzerTestOneInput().

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

◆ decodeScan()

◆ decodeSOI()

void rawspeed::AbstractLJpegDecoder::decodeSOI ( )
protectedinherited

Definition at line 65 of file AbstractLJpegDecoder.cpp.

References rawspeed::DHT, rawspeed::DQT, rawspeed::DRI, rawspeed::EOI, erratumImplicitEOIMarkerAfterScan(), frame, getNextMarker(), input, parseDHT(), parseDRI(), parseSOF(), parseSOS(), rawspeed::ByteStream::skipBytes(), rawspeed::SOF3, rawspeed::SOI, rawspeed::SOS, and ThrowRDE.

Referenced by rawspeed::Cr2LJpegDecoder::decode(), rawspeed::HasselbladLJpegDecoder::decode(), and rawspeed::LJpegDecoder::decode().

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

◆ erratumImplicitEOIMarkerAfterScan()

virtual bool rawspeed::AbstractLJpegDecoder::erratumImplicitEOIMarkerAfterScan ( ) const
inlinenodiscardprotectedvirtualinherited

Reimplemented in rawspeed::HasselbladLJpegDecoder.

Definition at line 101 of file AbstractLJpegDecoder.h.

Referenced by decodeSOI().

Here is the caller graph for this function:

◆ getInitialPredictors()

std::vector< uint16_t > rawspeed::AbstractLJpegDecoder::getInitialPredictors ( int N_COMP) const
inlinenodiscardprotectedinherited

Definition at line 128 of file AbstractLJpegDecoder.h.

References frame, Pt, and ThrowRDE.

Referenced by rawspeed::Cr2LJpegDecoder::decodeScan(), rawspeed::HasselbladLJpegDecoder::decodeScan(), and rawspeed::LJpegDecoder::decodeScan().

Here is the caller graph for this function:

◆ getNextMarker()

JpegMarker rawspeed::AbstractLJpegDecoder::getNextMarker ( bool allowskip)
protectedinherited

Definition at line 282 of file AbstractLJpegDecoder.cpp.

References rawspeed::advanceToNextMarker(), input, rawspeed::peekMarker(), and ThrowRDE.

Referenced by decodeSOI().

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

◆ getPrefixCodeDecoders()

std::vector< const PrefixCodeDecoder<> * > rawspeed::AbstractLJpegDecoder::getPrefixCodeDecoders ( int N_COMP) const
inlinenodiscardprotectedinherited

Definition at line 113 of file AbstractLJpegDecoder.h.

References frame, huff, rawspeed::implicit_cast(), and ThrowRDE.

Referenced by rawspeed::Cr2LJpegDecoder::decodeScan(), rawspeed::HasselbladLJpegDecoder::decodeScan(), and rawspeed::LJpegDecoder::decodeScan().

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

◆ getSamplePrecision()

int rawspeed::AbstractLJpegDecoder::getSamplePrecision ( ) const
inlinenodiscardinherited

Definition at line 90 of file AbstractLJpegDecoder.h.

References frame.

Referenced by rawspeed::Cr2Decoder::decodeNewFormat(), and rawspeed::Cr2Decoder::decodeOldFormat().

Here is the caller graph for this function:

◆ parseDHT()

void rawspeed::AbstractLJpegDecoder::parseDHT ( ByteStream data)
protectedinherited

Definition at line 230 of file AbstractLJpegDecoder.cpp.

References assert(), fixDng16Bug, fullDecodeHT, rawspeed::ByteStream::getBuffer(), rawspeed::ByteStream::getByte(), rawspeed::ByteStream::getRemainSize(), huff, huffmanCodeStore, PrefixCodeDecoderStore, rawspeed::HuffmanCode< CodeTag >::setCodeValues(), rawspeed::HuffmanCode< CodeTag >::setNCodesPerLength(), and ThrowRDE.

Referenced by decodeSOI().

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

◆ parseDRI()

void rawspeed::AbstractLJpegDecoder::parseDRI ( ByteStream dri)
protectedinherited

Definition at line 276 of file AbstractLJpegDecoder.cpp.

References rawspeed::ByteStream::getRemainSize(), rawspeed::ByteStream::getU16(), numMCUsPerRestartInterval, and ThrowRDE.

Referenced by decodeSOI().

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

◆ parseSOF()

void rawspeed::AbstractLJpegDecoder::parseSOF ( ByteStream data,
SOFInfo * i )
protectedinherited

Definition at line 127 of file AbstractLJpegDecoder.cpp.

References rawspeed::SOFInfo::compInfo, rawspeed::SOFInfo::cps, frame, rawspeed::ByteStream::getByte(), rawspeed::ByteStream::getRemainSize(), rawspeed::ByteStream::getU16(), rawspeed::SOFInfo::h, rawspeed::SOFInfo::initialized, mRaw, rawspeed::SOFInfo::prec, ThrowRDE, and rawspeed::SOFInfo::w.

Referenced by decodeSOI().

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

◆ parseSOS()

void rawspeed::AbstractLJpegDecoder::parseSOS ( ByteStream data)
protectedinherited

Definition at line 181 of file AbstractLJpegDecoder.cpp.

References decodeScan(), frame, rawspeed::ByteStream::getByte(), rawspeed::ByteStream::getRemainSize(), huff, input, invariant, predictorMode, Pt, and ThrowRDE.

Referenced by decodeSOI().

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

Member Data Documentation

◆ fixDng16Bug

bool rawspeed::AbstractLJpegDecoder::fixDng16Bug = false
protectedinherited

Definition at line 95 of file AbstractLJpegDecoder.h.

Referenced by rawspeed::LJpegDecoder::decode(), and parseDHT().

◆ frame

◆ fullDecodeHT

bool rawspeed::AbstractLJpegDecoder::fullDecodeHT = true
protectedinherited

Definition at line 96 of file AbstractLJpegDecoder.h.

Referenced by rawspeed::HasselbladLJpegDecoder::decode(), and parseDHT().

◆ h

uint32_t rawspeed::LJpegDecoder::h = 0
private

Definition at line 40 of file LJpegDecoder.h.

Referenced by decode(), and decodeScan().

◆ huff

std::array<const PrefixCodeDecoder<>*, 4> rawspeed::AbstractLJpegDecoder::huff
privateinherited
Initial value:
{
{}}

Definition at line 83 of file AbstractLJpegDecoder.h.

Referenced by getPrefixCodeDecoders(), parseDHT(), and parseSOS().

◆ huffmanCodeStore

std::vector<std::unique_ptr<const HuffmanCode<BaselineCodeTag> > > rawspeed::AbstractLJpegDecoder::huffmanCodeStore
privateinherited

Definition at line 78 of file AbstractLJpegDecoder.h.

Referenced by parseDHT().

◆ input

◆ maxDim

iPoint2D rawspeed::LJpegDecoder::maxDim
private

Definition at line 42 of file LJpegDecoder.h.

Referenced by decode(), and decodeScan().

◆ mRaw

◆ numMCUsPerRestartInterval

uint16_t rawspeed::AbstractLJpegDecoder::numMCUsPerRestartInterval = 0
protectedinherited

◆ offX

uint32_t rawspeed::LJpegDecoder::offX = 0
private

Definition at line 37 of file LJpegDecoder.h.

Referenced by decode(), and decodeScan().

◆ offY

uint32_t rawspeed::LJpegDecoder::offY = 0
private

Definition at line 38 of file LJpegDecoder.h.

Referenced by decode(), and decodeScan().

◆ predictorMode

uint32_t rawspeed::AbstractLJpegDecoder::predictorMode = 0
protectedinherited

◆ PrefixCodeDecoderStore

std::vector<std::unique_ptr<const PrefixCodeDecoder<> > > rawspeed::AbstractLJpegDecoder::PrefixCodeDecoderStore
privateinherited

Definition at line 80 of file AbstractLJpegDecoder.h.

Referenced by parseDHT().

◆ Pt

uint32_t rawspeed::AbstractLJpegDecoder::Pt = 0
privateinherited

Definition at line 82 of file AbstractLJpegDecoder.h.

Referenced by getInitialPredictors(), and parseSOS().

◆ w

uint32_t rawspeed::LJpegDecoder::w = 0
private

Definition at line 39 of file LJpegDecoder.h.

Referenced by decode(), and decodeScan().


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