# 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.11 2006/06/05 14:53:51 asuraparaju Exp $ $Name: Dirac_0_6_0 $
    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,int xlen,int ylen, int c_xlen, int c_ylen, unsigned int vd);
    00080
    00082
    00098         FrameBuffer(ChromaFormat cf,int numL1,int L1sep,int xlen,int ylen, int c_xlen, int c_ylen, unsigned int vd);
    00099
    00101
    00105         FrameBuffer(const FrameBuffer& cpy);
    00106
    00108
    00111         FrameBuffer& operator=(const FrameBuffer& rhs);
    00112
    00114         ~FrameBuffer();
    00115
    00117         Frame& GetFrame(unsigned int fnum);
    00118
    00120         const Frame& GetFrame(unsigned int fnum) const;
    00121
    00123         PicArray& GetComponent(unsigned int frame_num, CompSort c);
    00124
    00126         const PicArray& GetComponent(unsigned int frame_num, CompSort c) const;
    00127
    00129         PicArray& GetUpComponent(unsigned int frame_num, CompSort c);
    00130
    00132         const PicArray& GetUpComponent(unsigned int frame_num, CompSort c) const;
    00133
    00135         size_t Size() const {return m_frame_data.size();}
    00136
    00138
    00145         void PushFrame(unsigned int frame_num);
    00146
    00148
    00153         void PushFrame(const FrameParams& fp);
    00154
    00156
    00159         void PushFrame( const Frame& frame );
    00160
    00162
    00169         void PushFrame(StreamPicInput* picin,const FrameParams& fp);
    00170
    00172
    00179         void PushFrame(StreamPicInput* picin,unsigned int fnum);
    00180
    00182
    00189         void Clean(int show_fnum, int current_coded_fnum);
    00190
    00192
    00196         void Clean(int fnum);
    00197
    00199         const FrameParams& GetFParams() const{return m_fparams;}
    00200
    00201     private:
    00203         std::vector<Frame*> m_frame_data;
    00204
    00206         std::vector<bool> m_frame_in_use;
    00207
    00209         std::map<unsigned int,unsigned int> m_fnum_map;
    00210
    00212         FrameParams m_fparams;
    00213
    00215         unsigned int m_num_L1;
    00216
    00218         unsigned int m_L1_sep;
    00219
    00221         unsigned int m_gop_len;
    00222
    00223
    00224
    00226         void SetFrameParams(unsigned int fnum);
    00227
    00229
    00234         void Remove(unsigned int fnum);
    00235
    00236
    00237     };
    00238
    00239 } // namespace dirac
    00240
    00241 #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.