frame_buffer.h

00001 /* ***** BEGIN LICENSE BLOCK *****
00002 *
00003 * $Id: frame_buffer.h,v 1.2 2005/01/30 05:11:40 gabest Exp $ $Name:  $
00004 *
00005 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00006 *
00007 * The contents of this file are subject to the Mozilla Public License
00008 * Version 1.1 (the "License"); you may not use this file except in compliance
00009 * with the License. You may obtain a copy of the License at
00010 * http://www.mozilla.org/MPL/
00011 *
00012 * Software distributed under the License is distributed on an "AS IS" basis,
00013 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
00014 * the specific language governing rights and limitations under the License.
00015 *
00016 * The Original Code is BBC Research and Development code.
00017 *
00018 * The Initial Developer of the Original Code is the British Broadcasting
00019 * Corporation.
00020 * Portions created by the Initial Developer are Copyright (C) 2004.
00021 * All Rights Reserved.
00022 *
00023 * Contributor(s):
00024 *
00025 * Alternatively, the contents of this file may be used under the terms of
00026 * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
00027 * Public License Version 2.1 (the "LGPL"), in which case the provisions of
00028 * the GPL or the LGPL are applicable instead of those above. If you wish to
00029 * allow use of your version of this file only under the terms of the either
00030 * the GPL or LGPL and not to allow others to use your version of this file
00031 * under the MPL, indicate your decision by deleting the provisions above
00032 * and replace them with the notice and other provisions required by the GPL
00033 * or LGPL. If you do not delete the provisions above, a recipient may use
00034 * your version of this file under the terms of any one of the MPL, the GPL
00035 * or the LGPL.
00036 * ***** END LICENSE BLOCK ***** */
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 } // namespace dirac
00233 
00234 #endif

Generated on Tue Dec 13 14:47:13 2005 for guliverkli by  doxygen 1.4.5