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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef _FRAME_BUFFER_H_
00039 #define _FRAME_BUFFER_H_
00040
00041 #include <vector>
00042 #include <map>
00043 #include <libdirac_common/frame.h>
00044 #include <libdirac_common/common.h>
00045 #include <libdirac_common/pic_io.h>
00046
00047 namespace dirac
00048 {
00050
00059 class FrameBuffer{
00060 public:
00062
00072 FrameBuffer(ChromaFormat cf,int xlen,int ylen);
00073
00075
00087 FrameBuffer(ChromaFormat cf,int L1sep,int xlen, int ylen);
00088
00090
00103 FrameBuffer(ChromaFormat cf,int numL1,int L1sep,int xlen,int ylen);
00104
00106
00110 FrameBuffer(const FrameBuffer& cpy);
00111
00113
00116 FrameBuffer& operator=(const FrameBuffer& rhs);
00117
00119 ~FrameBuffer();
00120
00122 Frame& GetFrame(unsigned int fnum);
00123
00125 const Frame& GetFrame(unsigned int fnum) const;
00126
00128 PicArray& GetComponent(unsigned int frame_num, CompSort c);
00129
00131 const PicArray& GetComponent(unsigned int frame_num, CompSort c) const;
00132
00134 PicArray& GetUpComponent(unsigned int frame_num, CompSort c);
00135
00137 const PicArray& GetUpComponent(unsigned int frame_num, CompSort c) const;
00138
00140 size_t Size() const {return m_frame_data.size();}
00141
00143
00150 void PushFrame(unsigned int frame_num);
00151
00153
00158 void PushFrame(const FrameParams& fp);
00159
00161
00164 void PushFrame( const Frame& frame );
00165
00167
00174 void PushFrame(StreamPicInput* picin,const FrameParams& fp);
00175
00177
00184 void PushFrame(StreamPicInput* picin,unsigned int fnum);
00185
00187
00192 void Clean(int fnum);
00193
00195 const FrameParams& GetFParams() const{return m_fparams;}
00196
00197 private:
00199 std::vector<Frame*> m_frame_data;
00200
00202 std::map<unsigned int,unsigned int> m_fnum_map;
00203
00205 FrameParams m_fparams;
00206
00208 unsigned int m_num_L1;
00209
00211 unsigned int m_L1_sep;
00212
00214 unsigned int m_gop_len;
00215
00216
00217
00219 void SetFrameParams(unsigned int fnum);
00220
00222
00227 void Remove(unsigned int fnum);
00228
00229
00230 };
00231
00232 }
00233
00234 #endif