Dirac - A Video Codec

Created by the British Broadcasting Corporation.


frame_buffer.h

Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002 *
00003 * $Id: frame_buffer.h,v 1.13 2006/12/05 14:36:57 tjdwave 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): Thomas Davies (Original Author),
00024 *                 Anuradha Suraparaju
00025 *
00026 * Alternatively, the contents of this file may be used under the terms of
00027 * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
00028 * Public License Version 2.1 (the "LGPL"), in which case the provisions of
00029 * the GPL or the LGPL are applicable instead of those above. If you wish to
00030 * allow use of your version of this file only under the terms of the either
00031 * the GPL or LGPL and not to allow others to use your version of this file
00032 * under the MPL, indicate your decision by deleting the provisions above
00033 * and replace them with the notice and other provisions required by the GPL
00034 * or LGPL. If you do not delete the provisions above, a recipient may use
00035 * your version of this file under the terms of any one of the MPL, the GPL
00036 * or the LGPL.
00037 * ***** END LICENSE BLOCK ***** */
00038 
00039 #ifndef _FRAME_BUFFER_H_
00040 #define _FRAME_BUFFER_H_
00041 
00042 #include <vector>
00043 #include <map>
00044 #include <libdirac_common/frame.h>
00045 #include <libdirac_common/common.h>
00046 #include <libdirac_common/pic_io.h>
00047 
00048 namespace dirac
00049 {
00051 
00060     class FrameBuffer{
00061     public:
00063         FrameBuffer();
00064         
00066 
00079         FrameBuffer(ChromaFormat cf,
00080                     const int xlen,
00081                     const int ylen, 
00082                     const int c_xlen, 
00083                     const int c_ylen, 
00084                     const unsigned int vd);
00085 
00087 
00103         FrameBuffer(ChromaFormat cf,
00104                     const int numL1,
00105                     const int L1sep,
00106                     const int xlen,
00107                     const int ylen, 
00108                     const int c_xlen, 
00109                     const int c_ylen, 
00110                     const unsigned int vd);
00111 
00113 
00117         FrameBuffer(const FrameBuffer& cpy);
00118 
00120 
00123         FrameBuffer& operator=(const FrameBuffer& rhs);
00124 
00126         ~FrameBuffer();
00127 
00129         Frame& GetFrame(const unsigned int fnum );
00130 
00132         const Frame& GetFrame(const unsigned int fnum) const;
00133 
00135         Frame& GetFrame(const unsigned int fnum, bool& is_present);
00136 
00138         const Frame& GetFrame(const unsigned int fnum, bool& is_present) const;
00139 
00141         PicArray& GetComponent(const unsigned int frame_num, CompSort c);
00142 
00144         const PicArray& GetComponent(const unsigned int frame_num, CompSort c) const;    
00145 
00147         PicArray& GetUpComponent(const unsigned int frame_num, CompSort c);
00148 
00150         const PicArray& GetUpComponent(const unsigned int frame_num, CompSort c) const;
00151 
00153         std::vector<int> Members() const; 
00154 
00156 
00163         void PushFrame(const unsigned int frame_num);    
00164 
00166 
00171         void PushFrame(const FrameParams& fp);
00172 
00174 
00177         void PushFrame( const Frame& frame );
00178 
00180 
00187         void PushFrame(StreamPicInput* picin,const FrameParams& fp);
00188 
00190 
00197         void PushFrame(StreamPicInput* picin,const unsigned int fnum);
00198 
00200 
00207         void SetRetiredList(const int show_fnum, const int current_coded_fnum);
00208 
00210 
00217         void Clean(const int show_fnum, const int current_coded_fnum);
00218 
00220 
00224         void Clean(int fnum);
00225 
00227         const FrameParams& GetFParams() const{return m_fparams;}
00228 
00229     private:
00231         void SetFrameParams(const unsigned int fnum);
00232 
00234 
00239         void Remove(const unsigned int fnum);
00240 
00241     private:
00242             
00244         int m_ref_count;
00245 
00247         std::vector<Frame*> m_frame_data;
00248         
00250         std::vector<bool> m_frame_in_use;
00251 
00253         std::map<unsigned int,unsigned int> m_fnum_map;
00254 
00256         FrameParams m_fparams;
00257 
00259         unsigned int m_num_L1;
00260 
00262         unsigned int m_L1_sep;
00263 
00265         unsigned int m_gop_len;
00266 
00267 
00268 
00269 
00270 
00271     };
00272 
00273 } // namespace dirac
00274 
00275 #endif

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.