huffmancode to decode in real-time for motion-jpeg
Dependents: BaseJpegDecode_example SimpleJpegDecode_example Dumb_box_rev2
example code:
Import programBaseJpegDecode_example
BaseJpegDeocde exampe program
Import programSimpleJpegDecode_example
convert JPEG stream data to bitmap, BaseJpegDecode example program
Diff: BaseJpegDecode.h
- Revision:
- 1:bfbc18000cca
- Parent:
- 0:417b7ae90eff
- Child:
- 2:5b1dd4e34857
--- a/BaseJpegDecode.h Mon Oct 22 13:55:09 2012 +0000 +++ b/BaseJpegDecode.h Thu Oct 25 11:00:05 2012 +0000 @@ -4,7 +4,6 @@ #include "HuffmanDecode.h" #include "BitPattern.h" - class BaseJpegDecode { public: BaseJpegDecode(); @@ -14,7 +13,18 @@ virtual void outputDC(int mcu, int block, int value) = 0; virtual void outputAC(int mcu, int block, int scan, int value) = 0; virtual void outputMARK(uint8_t c) = 0; + uint8_t* qt[2]; + int width; + int height; + int m_yblocks; +#ifdef JPEG_USE_REPORT_CODE + int report_scan_count; + int report_scan_dc_count; + int report_scan_ac_count; +#endif //JPEG_USE_REPORT private: + void inputDQT(uint8_t c, int pos, int len); + void inputSOF(uint8_t c, int pos, int len); void inputScan(uint8_t c); void restart(); protected: @@ -25,9 +35,10 @@ Huff* m_huff; int m_old_DC_value[2]; BitPattern m_bitpat; - int m_skip; uint8_t m_mark; HuffmanDecode* pHD; - int m_yblocks; + int m_seg_pos; + int m_seg_len; + int m_param1; }; #endif // BASE_JPEG_DECODE_H