huffmancode to decode in real-time for motion-jpeg

Dependents:   BaseJpegDecode_example SimpleJpegDecode_example Dumb_box_rev2

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BaseJpegDecode.h Source File

BaseJpegDecode.h

00001 // BaseJpegDecode.h 2013/1/27
00002 #ifndef BASE_JPEG_DECODE_H
00003 #define BASE_JPEG_DECODE_H
00004 #include "bjd_config.h"
00005 #include "HuffmanDecode.h"
00006 #include "BitPattern.h"
00007 
00008 class BaseJpegDecode {
00009 public:
00010     BaseJpegDecode();
00011     void clear();
00012     void input(uint8_t c);
00013     void input(uint8_t* buf, int len);
00014     virtual void outputDC(int mcu, int block, int value) = 0;
00015     virtual void outputAC(int mcu, int block, int scan, int value) = 0;
00016     virtual void outputMARK(uint8_t c) = 0;
00017     uint8_t* qt[2];
00018     int width;
00019     int height;
00020     int yblock;
00021 #ifdef JPEG_USE_REPORT_CODE
00022     int report_scan_count;
00023     int report_scan_dc_count;
00024     int report_scan_ac_count;
00025 #endif //JPEG_USE_REPORT
00026 private:
00027     void inputDQT(uint8_t c, int pos, int len);
00028     void inputSOF(uint8_t c, int pos, int len);
00029     void inputScan(uint8_t c);
00030     void restart();
00031     uint8_t m_seq;
00032     int m_mcu;
00033     int m_block;
00034     int m_scan;
00035     Huff* m_huff;
00036     int m_pre_DC_value[3];
00037     BitPattern m_bitpat;
00038     uint8_t m_mark;
00039     HuffmanDecode* pHD;
00040     int m_seg_pos;
00041     int m_seg_len;
00042     int m_param1;
00043 };
00044 #endif // BASE_JPEG_DECODE_H