Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members

mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly Class Reference
[mxcpc (MOBOTIX Cross Platform Client Library)]

#include <mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h>

Inheritance diagram for mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly:

Inheritance graph
[legend]
Collaboration diagram for mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly (mxcpcMxPEGScanToJPEGConverterBackEnd *backend)
 The converter assumes ownership over the converter backend.
void setYQuantizationTable (unsigned char *data_bytes)
 (Re)implemented.
void setUVQuantizationTable (unsigned char *data_bytes)
 (Re)implemented.
void performScanSweep (mxcpcFramewiseMxPEGDecoder::UndecodedFrameDescriptor *frame_descriptor)
 (Re)implemented.

Private Member Functions

void calcFoldedHuffTables (void)
 Huffman encoding stuff.
void generateHuffTables1 (const mxcpc::u8 *bits_tbl_off1, const mxcpc::u8 *val_tbl, int swap_symbol, HuffCodeTblEntry *folded_tbl_p)
 Create a huffman lookup table.
void initHuffmanEncoderBufferState ()
 Init the Buffer.
void resetHuffmanEncoderBufferState ()
bool consumeScanBit (void)
 We need this often in inner loops of performScanSweep(), so we request inline substitution and hope the compiler sufficiently rocks.
const mxcpcHuffmanTree::Node * consumeHuffmanCodeword (const mxcpcHuffmanTree::Node *current_huffman_node)
 We need this often in inner loops of performScanSweep(), so we request inline substitution and hope the compiler sufficiently rocks.
bool consumeAdditionalBits (int n)
 We need this often in inner loops of performScanSweep(), so we request inline substitution and hope the compiler sufficiently rocks.
void encodeSubMCUTiles (mxcpc::s16 *coef_matrix, mxcpc::s16 *last_dc_coeff, FoldedHuffTbl_DC_AC *huff_code_tbl_entry, HuffmanBufferStateStructure *hbuf_state_ptr)

Static Private Member Functions

static void copyAccuToGlobalHuffBuffer (mxcpc::u32 huff_accu_32, HuffmanBufferStateStructure *huff_buf_state_ptr)
static int shutDownHuffAccu ()
static int returnBitsInCoef (mxcpc::s16 c)

Private Attributes

mxcpc::u8 * HuffmanEncoderBuffer
 Pointer to Huffman encode buffer.
mxcpcHuffmanTreeHuffmanTree_Y_DC
mxcpcHuffmanTreeHuffmanTree_Y_AC
mxcpcHuffmanTreeHuffmanTree_UV_DC
mxcpcHuffmanTreeHuffmanTree_UV_AC
mxcpc::s16 QuantizationTable_Y [64]
mxcpc::s16 QuantizationTable_UV [64]
mxcpc::s16 * CoeffBuffer
 Ptr. to decoded frame!
int TileNumX
 Nb. of tiles to handle per frame!
int TileNumY
 Nb. of tiles to handle per frame!
unsigned char * CurrentScanByte
 The following fields' state is defined to only be valid during scan sweeps
  • so they won't show up in the constructor.

unsigned char ScanMask
 The following fields' state is defined to only be valid during scan sweeps
  • so they won't show up in the constructor.

int ScanBytesLeft
int CoeffInAdditionalBits
std::FILE * OutStream
mxcpc_mxpeg::APP0 APP0_Block
mxcpc_mxpeg::SOF0 SOF0_Block
mxcpc_mxpeg::SOS SOS_Block
int FramesProcessed
mxcpcMxPEGScanToJPEGConverterBackEndConverterBackEnd
 Backend-> Defines how to handle the processed data!

Static Private Attributes

static const unsigned char ZigZag_StoreMap [64]
static const int ZigZagMap [64]
static const HuffCompDC HuffTbl_Y_UV_DC [2]
static const HuffCompAC HuffTbl_Y_UV_AC [2]
static FoldedHuffTbl_DC_AC Huff_Y_UV [2]
 Array of two tables, size = 2*0xB0 words = 1408 bytes : */.
static HuffmanBufferStateStructure HuffmanBufferState
 Instance of HuffmanBufferStateStructure hold once!

Classes

struct  FoldedHuffTbl_DC_AC
struct  HuffCodeTblEntry
 Single entry in table :. More...
struct  HuffCompAC
 One AC huffman tables-rules for one component (Y or UV). More...
struct  HuffCompDC
 One DC huffman tables-rules for one component (Y or UV). More...
struct  HuffmanBufferStateStructure
 This structure holds the buffer state for huffman encoding ... More...
union  u32t
 Used to convert a HuffCodeTblEntry -> mxcpc::u32 ! More...

Detailed Description

Framewise scan decoder for implementation converting an MxPEG stream to a sequence of JPEG images using no external hw-optimized acceleration routines.

Does not use the decoder backend ->therefore default backend!

Definition at line 44 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.


Member Function Documentation

void mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::calcFoldedHuffTables void   )  [private]
 

Huffman encoding stuff.

Calculate the huffman tables ..

Definition at line 741 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.

References generateHuffTables1(), and Huff_Y_UV.

Referenced by mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly().

bool mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::consumeAdditionalBits int  n  )  [inline, private]
 

We need this often in inner loops of performScanSweep(), so we request inline substitution and hope the compiler sufficiently rocks.

Specify as argument the number n >= 1 of additional bits to read.

The coefficient represented by the read bits will be stored to the class member variable CoeffInAdditionalBits.

The method internally checks for ScanBytesLeft > 0.

It returns false on success, and true if all scan bytes were cosumed before a valid codeword was detected.

Definition at line 326 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

References consumeScanBit().

const mxcpcHuffmanTree ::Node* mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::consumeHuffmanCodeword const mxcpcHuffmanTree::Node *  current_huffman_node  )  [inline, private]
 

We need this often in inner loops of performScanSweep(), so we request inline substitution and hope the compiler sufficiently rocks.

Specify as argument the root of the Huffman tree to be used for codeword recognition.

Internally checks for ScanBytesLeft > 0.

Returns the Huffman leaf node corresponding to the codeword just consumed or 0 in case of failure. Failure conditions can be

  • an invalid bitstring was encountered
  • all scan bytes were cosumed before a valid codeword was detected

Definition at line 284 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

References consumeScanBit().

bool mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::consumeScanBit void   )  [inline, private]
 

We need this often in inner loops of performScanSweep(), so we request inline substitution and hope the compiler sufficiently rocks.

Only to be called if ScanBytesLeft > 0.

Returns whether or not the bit just consumed was set.

Definition at line 231 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

References CurrentScanByte, ScanMask, and mxcpc::sendStatusMsg().

Referenced by consumeAdditionalBits(), and consumeHuffmanCodeword().

static void mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::copyAccuToGlobalHuffBuffer mxcpc::u32  huff_accu_32,
HuffmanBufferStateStructure huff_buf_state_ptr
[inline, static, private]
 

Copies a word into the global huffman encoding buffer!

Parameters:
huff_accu_32 Input word.
huff_buf_state_ptr Ptr. to global buffer.

Definition at line 613 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

References mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_current_w_pos, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_end1, and mxcpc::sendStatusMsg().

Referenced by encodeSubMCUTiles().

void mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::encodeSubMCUTiles mxcpc::s16 *  coef_matrix,
mxcpc::s16 *  last_dc_coeff,
FoldedHuffTbl_DC_AC huff_code_tbl_entry,
HuffmanBufferStateStructure hbuf_state_ptr
[inline, private]
 

This Method takes a 8x8 sub-MCU and preforms a swift Huffman Encoding.

Parameters:
coef_matrix The 8x8 input coefficient matrix!
last_dc_coeff Ptr to a list of the last DC coefficients.
huff_code_tbl_entry A huffman table.
hbuf_state_ptr Ptr to global buffer state.

Definition at line 375 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

References copyAccuToGlobalHuffBuffer(), mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_accu, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_bits_used, returnBitsInCoef(), mxcpc::sendStatusMsg(), mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::u32t::table_entry, and mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::u32t::u32_word.

void mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::generateHuffTables1 const mxcpc::u8 *  bits_tbl_off1,
const mxcpc::u8 *  val_tbl,
int  swap_symbol,
HuffCodeTblEntry folded_tbl_p
[private]
 

Create a huffman lookup table.

Parameters:
bits_tbl_off1 Entries 0..15 count no. of symbols with 1..16 bits, respectively.
val_tbl Table of symbols that need to be encoded, size = sum of entries in bits_tbl_off1.
swap_symbol Set if the swapped symbol is used to access the generated folded table (for ac-coefs).
folded_tbl_p Holds the generated huffman tables!

Definition at line 793 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.

References mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffCodeTblEntry::bit_len.

Referenced by calcFoldedHuffTables().

void mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::initHuffmanEncoderBufferState  )  [private]
 

Init the Buffer.

Take care of initialisierung!

Definition at line 849 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.

References mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_current_w_pos, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_end1, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_start, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_accu, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_bits_used, HuffmanBufferState, and HuffmanEncoderBuffer.

Referenced by mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly().

void mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::performScanSweep mxcpcFramewiseMxPEGDecoder::UndecodedFrameDescriptor *  frame_descriptor  )  [virtual]
 

(Re)implemented.

<

Implements mxcpcFramewiseMxPEGScanDecoder.

Definition at line 292 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.

References mxcpc::sendStatusMsg().

void mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::resetHuffmanEncoderBufferState  )  [private]
 

Reset HuffmanEncoderBufferState in order to fetch next frame!

Definition at line 864 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.

References mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_current_w_pos, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_start, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_accu, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_bits_used, HuffmanBufferState, and HuffmanEncoderBuffer.

static int mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::returnBitsInCoef mxcpc::s16  c  )  [inline, static, private]
 

Number of bits from ....

Parameters:
c <- this!

Definition at line 693 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

Referenced by encodeSubMCUTiles().

static int mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::shutDownHuffAccu  )  [inline, static, private]
 

Closing down huffman encoding stream.

Definition at line 653 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

References mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_current_w_pos, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::buf_end1, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_accu, mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffmanBufferStateStructure::huf_bits_used, HuffmanBufferState, and mxcpc::sendStatusMsg().


Member Data Documentation

unsigned char* mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::CurrentScanByte [private]
 

The following fields' state is defined to only be valid during scan sweeps

  • so they won't show up in the constructor.

..

Definition at line 162 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

Referenced by consumeScanBit().

const mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffCompDC mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::HuffTbl_Y_UV_DC [static, private]
 

Initial value:

 {
    { 
    { 0, 1, 5, 1, 1, 1, 1, 1, 1, 0,  0,  0, 0, 0, 0, 0 }, 
    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },                
      },
      { 
    { 0, 3, 1, 1, 1, 1, 1, 1, 1, 1,  1,  0, 0, 0, 0, 0 }, 
    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },                
      }
  }

Definition at line 48 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.

unsigned char mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::ScanMask [private]
 

The following fields' state is defined to only be valid during scan sweeps

  • so they won't show up in the constructor.

..

Definition at line 162 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.h.

Referenced by consumeScanBit().

const unsigned char mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::ZigZag_StoreMap [static, private]
 

Initial value:

 {
  0,  1,  5,  6, 14, 15, 27, 28,
  2,  4,  7, 13, 16, 26, 29, 42,
  3,  8, 12, 17, 25, 30, 41, 43,
  9, 11, 18, 24, 31, 40, 44, 53,
  10, 19, 23, 32, 39, 45, 52, 54,
  20, 22, 33, 38, 46, 51, 55, 60,
  21, 34, 37, 47, 50, 56, 59, 61,
  35, 36, 48, 49, 57, 58, 62, 63
}

Definition at line 35 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.

const int mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly::ZigZagMap [static, private]
 

Initial value:

 {  
                               0,  1,  8, 16,  9,  2,  3, 10, 
                               17, 24, 32, 25, 18, 11,  4,  5,
                               12, 19, 26, 33, 40, 48, 41, 34, 
                               27, 20, 13,  6,  7, 14, 21, 28,
                               35, 42, 49, 56, 57, 50, 43, 36,
                               29, 22, 15, 23, 30, 37, 44, 51, 
                               58, 59, 52, 45, 38, 31, 39, 46, 
                               53, 60, 61, 54, 47, 55, 62, 63 
                             }

Definition at line 24 of file mxcpcFramewiseMxPEGScanToJPEGConverterSoftwareOnly.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Aug 15 03:39:51 2005 for mxcpc by  doxygen 1.4.2-20050421