#ifndef _ENTROPYDEC_H #define _ENTROPYDEC_H #include class EntropyDecoder{ public: EntropyDecoder(const char filename[],int parity); ~EntropyDecoder(void); void init_ptrs(int gq_vals[],int *mq_vals[],int pic_prop[], int **mb_prop[],int ** (*mot_vec)[2]); int get_frame(pel_t ** (*frame_data)[3]); //public declarations int format; private: // PICTURE LAYER int picture_layer(void); int psc(void); int remaining_psc(void); void tr(void); void ptype(void); void disgard_pspare(); // GROUP OF BLOCKS LAYER int gob_layer(pel_t **gob[3]); int gbsc(void); int gn(void); void gquant(int gnum); void disgard_gspare(); // MACROBLOCK LAYER int mb_layer(pel_t **gob[3],int gnum); int mba(void); int mtype(int gnum,int mbnum); void mquant(int gnum,int mbnum); void mvd(int gnum,int mbnum); void cbp(int p[6]); // BLOCK LAYER void block_layer(pel_t *block[]); void get_tcoeff(pel_t *tc[]); // TRANSMISSION BUFFER int bit_peak(void); int read_bits(char bits[],int num); int next_vlc_value(nodep head,int info[2]); void check_parity(); int read_buffer(); // *************************************************************** // Pointers to Data // // gquant_vals[{GOB #}]: GOB quantization vals // mquant_vals[{GOB #}][{MB #}]: MB quantization vals (-1 if no change) // motion_vectors[{_DX_,_DY_}][row][col] // pic_properties[{bit-1}]: ptype options // mb_properties[{gob #}][{mb #}][{MODE,MC_PRESENT,FIL_PRESENT}] // *************************************************************** pel_t **data[3]; int *pic_properties; int ***mb_properties; int *gquant_vals; int **mquant_vals; int **motion_vectors[2]; //VLC trees nodep head_MBA,head_MTYPE,head_MVD,head_CBP,head_TCOEFF; //options int use_parity; //MB variables int prev_mb,prev_mb_mc; //bit-stream input file handle ifstream instream; //*************************************************************** // 'buffer' holds encoded data and parity check code. // 8 buffers make up one transmission frame. // for one buffer: // // Si(1) Data(BUFFER_DATA_WIDTH) // |----|-----|-----------...---------|---------------------------| // Fi(1) Parity(BUFFER_PARITY_WIDTH) //*************************************************************** unsigned char buffer[BUFFER_FRAME_WIDTH/8+1]; //*************************************************************** // COUNTERS // -------- // bit_counter: [0,BUFFER_FRAME_WIDTH-1] // 'bit_counter' starts at its max value for each // of the 8 frames in the multiframe buffer. It // keeps track of which bit the buffer has been // filled to, including Si, Fi, Data, and Parity // // s_counter: [0,7] 's_counter' keeps track of which frame is // currently being buffered //*************************************************************** int bit_counter; int s_counter; int frame_num; int eofbytes; }; #endif /* ENTROPYDEC_H */