Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __DECODER_H__
00026 #define __DECODER_H__
00027
00028 #ifndef __IPPS_H__
00029 #include "ipps.h"
00030 #endif
00031 #ifndef __IPPI_H__
00032 #include "ippi.h"
00033 #endif
00034 #ifndef __IPPJ_H__
00035 #include "ippj.h"
00036 #endif
00037 #ifndef __JPEGBASE_H__
00038 #include "jpegbase.h"
00039 #endif
00040 #ifndef __DECQTBL_H__
00041 #include "decqtbl.h"
00042 #endif
00043 #ifndef __DECHTBL_H__
00044 #include "dechtbl.h"
00045 #endif
00046 #ifndef __COLORCOMP_H__
00047 #include "colorcomp.h"
00048 #endif
00049
00050
00051
00052
00053 class CJPEGDecoder
00054 {
00055 public:
00056
00057 CJPEGDecoder(void);
00058 virtual ~CJPEGDecoder(void);
00059
00060 void Reset(void);
00061
00062 JERRCODE SetSource(
00063 Ipp8u* pSrc,
00064 int srcSize);
00065
00066 JERRCODE SetDestination(
00067 Ipp8u* pDst,
00068 int dstStep,
00069 IppiSize dstSize,
00070 int dstChannels,
00071 JCOLOR dstColor,
00072 int dstPrecision = 8);
00073
00074 JERRCODE SetDestination(
00075 Ipp16s* pDst,
00076 int dstStep,
00077 IppiSize dstSize,
00078 int dstChannels,
00079 JCOLOR dstColor,
00080 int dstPrecision = 16);
00081
00082 JERRCODE ReadHeader(
00083 int* width,
00084 int* height,
00085 int* nchannels,
00086 JCOLOR* color,
00087 JSS* sampling,
00088 int* precision);
00089
00090 JERRCODE ReadData(void);
00091
00092 BITSTREAM m_src;
00093 IMAGE m_dst;
00094 int m_jpeg_width;
00095 int m_jpeg_height;
00096 int m_jpeg_ncomp;
00097 int m_jpeg_precision;
00098 JSS m_jpeg_sampling;
00099 JCOLOR m_jpeg_color;
00100 int m_jpeg_quality;
00101 int m_jpeg_restart_interval;
00102 JMODE m_jpeg_mode;
00103
00104
00105 int m_jpeg_comment_detected;
00106 int m_jpeg_comment_size;
00107 Ipp8u* m_jpeg_comment;
00108
00109
00110 int m_jfif_app0_detected;
00111 int m_jfif_app0_major;
00112 int m_jfif_app0_minor;
00113 int m_jfif_app0_units;
00114 int m_jfif_app0_xDensity;
00115 int m_jfif_app0_yDensity;
00116 int m_jfif_app0_thumb_width;
00117 int m_jfif_app0_thumb_height;
00118
00119
00120 int m_jfxx_app0_detected;
00121 int m_jfxx_thumbnails_type;
00122
00123
00124 int m_adobe_app14_detected;
00125 int m_adobe_app14_version;
00126 int m_adobe_app14_flags0;
00127 int m_adobe_app14_flags1;
00128 int m_adobe_app14_transform;
00129
00130 int m_precision;
00131 int m_numxMCU;
00132 int m_numyMCU;
00133 int m_mcuWidth;
00134 int m_mcuHeight;
00135 int m_ccWidth;
00136 int m_ccHeight;
00137 int m_xPadding;
00138 int m_yPadding;
00139 int m_restarts_to_go;
00140 int m_next_restart_num;
00141 int m_sos_len;
00142 int m_curr_comp_no;
00143 int m_ss;
00144 int m_se;
00145 int m_al;
00146 int m_ah;
00147 int m_dc_scan_completed;
00148 int m_ac_scans_completed;
00149 JMARKER m_marker;
00150 Ipp16s* m_coefbuf;
00151
00152 int m_scan_count;
00153
00154 Ipp16s* m_block_buffer;
00155 int m_num_threads;
00156 int m_nblock;
00157
00158 #ifdef __TIMING__
00159 Ipp64u m_clk_diff;
00160 Ipp64u m_clk_huff;
00161 #endif
00162
00163 CJPEGColorComponent* m_ccomp[MAX_COMPS_PER_SCAN];
00164 CJPEGDecoderQuantTable m_qntbl[MAX_QUANT_TABLES];
00165 CJPEGDecoderHuffmanTable m_dctbl[MAX_HUFF_TABLES];
00166 CJPEGDecoderHuffmanTable m_actbl[MAX_HUFF_TABLES];
00167 CJPEGDecoderHuffmanState m_state;
00168
00169 JERRCODE Init(void);
00170 JERRCODE Clean(void);
00171 JERRCODE ColorConvert(void);
00172 JERRCODE ColorConvert(int nMCURow,int idThread);
00173 JERRCODE UpSampling(void);
00174 JERRCODE UpSampling(int nMCURow,int idThread);
00175 JERRCODE PerformDCT(void);
00176
00177 JERRCODE ParseJPEGBitStream(JOPERATION op);
00178 JERRCODE ParseSOI(void);
00179 JERRCODE ParseEOI(void);
00180 JERRCODE ParseAPP0(void);
00181 JERRCODE ParseAPP14(void);
00182 JERRCODE ParseSOF0(void);
00183 JERRCODE ParseSOF2(void);
00184 JERRCODE ParseSOF3(void);
00185 JERRCODE ParseDRI(void);
00186 JERRCODE ParseRST(void);
00187 JERRCODE ParseSOS(void);
00188 JERRCODE ParseDQT(void);
00189 JERRCODE ParseDHT(void);
00190 JERRCODE ParseCOM(void);
00191 JERRCODE DecodeScanBaseline(void);
00192 JERRCODE DecodeScanLossless(void);
00193 JERRCODE DecodeScanProgressive(void);
00194
00195 JERRCODE ProcessRestart(void);
00196
00197 JERRCODE NextMarker(JMARKER* marker);
00198 JERRCODE SkipMarker(void);
00199
00200
00201 JERRCODE DecodeHuffmanMCURowLS(Ipp16s* pMCUBuf);
00202
00203 JERRCODE DecodeHuffmanMCURowBL(Ipp16s* pMCUBuf);
00204
00205 JERRCODE DCT_QNT_SSCC_MCURowBL(Ipp16s* pMCUBuf,int idThread,int mcu_row);
00206
00207 JERRCODE ReconstructMCURowLS(Ipp16s* pMCUBuf,int idThread,int mcu_row);
00208
00209 JERRCODE _set_sampling(void);
00210 };
00211
00212 #endif // __DECODER_H__
00213