mx::MxPEGScanToJPEGConverterSoftwareOnly Class Reference
[MxPEG Core]

Converts an MxPEG stream to a sequence of full JPEG images using no external hardware-optimized acceleration routines. More...

#include <MxPEGScanToJPEGConverterSoftwareOnly.h>

Inheritance diagram for mx::MxPEGScanToJPEGConverterSoftwareOnly:

mx::MxPEGScanDecoderSoftwareOnlyCore mx::IComponent mx::IMxPEGScanToJPEGConverter mxmObject mx::IUndecodedMxPEGFrameReceiver mx::IInterface mx::IUndecodedMxPEGFrameReceiver mx::ISendsSegmentedStream mx::IErrorState mx::IErrorState mx::IInterface mx::IInterface mx::IInterface List of all members.

Public Member Functions

 MxPEGScanToJPEGConverterSoftwareOnly ()
 The converter assumes ownership over the JPEG receiver.
mxm::smart< mxmStringListenumerateInterfaces ()
 (Re)implemented.
mxm::smart< mxmStringListenumerateCapabilities (const mxmString &interface)
 (Re)implemented.
void receiveUndecodedMxPEGFrame (mxmUndecodedMxPEGFrameDescriptor *frame_descriptor)
 (Re)implemented.
void receiveMxPEGAudioFrame (const mxmAudioBlockInfo &audio_info, const mxm::u8 *sample_data)
 (Re)implemented.
void setSegmentedStreamReceiver (ISegmentedStreamReceiver *receiver)
 (Re)implemented.
bool errorState ()
 (Re)implemented.
void setErrorState ()
 (Re)implemented.

Static Public Member Functions

static IComponentInvokernewInvoker ()
 Generates an invoker singleton for the MxPEGParser component.

Private Member Functions

void calcFoldedHuffTables (void)
 Calculate the huffman tables ..
void generateHuffTables1 (const mxm::u8 *bits_tbl_off1, const mxm::u8 *val_tbl, int swap_symbol, HuffCodeTblEntry *folded_tbl_p)
 Create a huffman lookup table.
void initHuffmanEncoderBufferState ()
 Init the Buffer.
void resetHuffmanEncoderBufferState ()
void encodeSubMCUTiles (mxm::s16 *coef_matrix, mxm::s16 *last_dc_coeff, FoldedHuffTbl_DC_AC *huff_code_tbl_entry, HuffmanBufferStateStructure *hbuf_state_ptr)
 This Method takes a 8x8 sub-MCU and preforms a swift Huffman Encoding.
void copyAccuToGlobalHuffBuffer (mxm::u32 huff_accu_32, HuffmanBufferStateStructure *huff_buf_state_ptr)
 Copies a word into the global huffman encoding buffer!
int shutDownHuffAccu (void)
 Closes down huffman encoding stream.
int returnBitsInCoef (mxm::s16 c)
 Number of bits from ....

Static Private Member Functions

static mxm::smart< mxmStringList_enumerateInterfaces ()
 These static methods provide interface and capability ids for registration with the framework (for both the component and its invoker).
static mxm::smart< mxmStringList_enumerateCapabilities (const mxmString &interface_id)

Private Attributes

FoldedHuffTbl_DC_AC Huff_Y_UV [2]
 Array of two tables, size = 2*0xB0 words = 1408 bytes : */.
ISegmentedStreamReceiverJPEGReceiver
HuffmanBufferStateStructure HuffmanBufferState
mxm::u8 * HuffmanTableWriteBuffer
mxm::u8 * HuffmanEncoderBuffer
mxm::s16 * CoeffBuffer
int TileNumX
int TileNumY
mxm::JPEG::MarkerLayoutAPP0 APP0_Block
mxm::JPEG::MarkerLayoutSOF0 SOF0_Block
mxm::JPEG::MarkerLayoutSOS SOS_Block
int FramesProcessed
bool ErrorEncountered

Static Private Attributes

static const int BitstreamBufferSize = 0x100000
static const unsigned char ZigZag_StoreMap [64]
static const HuffCompDC HuffTbl_Y_UV_DC [2]
static const HuffCompAC HuffTbl_Y_UV_AC [2]

Classes

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

Detailed Description

Converts an MxPEG stream to a sequence of full JPEG images using no external hardware-optimized acceleration routines.

The current implementation produces JPEG in Y22U11V11 sampling mode, regardless of the sampling mode used in the input stream.

After multiple revisions, the class should be threadable now.

Author:
[dgr], [khe]


Member Function Documentation

void mx::MxPEGScanToJPEGConverterSoftwareOnly::calcFoldedHuffTables void   )  [private]
 

Calculate the huffman tables ..

Calculates huffman tables a la mobotix!

void mx::MxPEGScanToJPEGConverterSoftwareOnly::copyAccuToGlobalHuffBuffer mxm::u32  huff_accu_32,
HuffmanBufferStateStructure huff_buf_state_ptr
[private]
 

Copies a word into the global huffman encoding buffer!

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

void mx::MxPEGScanToJPEGConverterSoftwareOnly::encodeSubMCUTiles mxm::s16 *  coef_matrix,
mxm::s16 *  last_dc_coeff,
FoldedHuffTbl_DC_AC huff_code_tbl_entry,
HuffmanBufferStateStructure hbuf_state_ptr
[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.

void mx::MxPEGScanToJPEGConverterSoftwareOnly::generateHuffTables1 const mxm::u8 *  bits_tbl_off1,
const mxm::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!

void mx::MxPEGScanToJPEGConverterSoftwareOnly::initHuffmanEncoderBufferState  )  [private]
 

Init the Buffer.

Take care of initialisierung!

void mx::MxPEGScanToJPEGConverterSoftwareOnly::resetHuffmanEncoderBufferState  )  [private]
 

Reset HuffmanEncoderBufferState in order to fetch next frame!

int mx::MxPEGScanToJPEGConverterSoftwareOnly::returnBitsInCoef mxm::s16  c  )  [private]
 

Number of bits from ....

Parameters:
c <- this!


Member Data Documentation

const mx::MxPEGScanToJPEGConverterSoftwareOnly::HuffCompDC mx::MxPEGScanToJPEGConverterSoftwareOnly::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 },
     
  }
}

const unsigned char mx::MxPEGScanToJPEGConverterSoftwareOnly::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
                                             }


The documentation for this class was generated from the following files:
Generated on Fri Jun 29 17:21:07 2007 for MxPEG SDK by  doxygen 1.4.6