# 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.14 2007/04/26 13:56:31 asuraparaju Exp $ $Name: Dirac_0_7_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,
    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         bool IsFrameAvail(const unsigned int fnum) const;
    00142
    00144         PicArray& GetComponent(const unsigned int frame_num, CompSort c);
    00145
    00147         const PicArray& GetComponent(const unsigned int frame_num, CompSort c) const;
    00148
    00150         PicArray& GetUpComponent(const unsigned int frame_num, CompSort c);
    00151
    00153         const PicArray& GetUpComponent(const unsigned int frame_num, CompSort c) const;
    00154
    00156         std::vector<int> Members() const;
    00157
    00159
    00166         void PushFrame(const unsigned int frame_num);
    00167
    00169
    00174         void PushFrame(const FrameParams& fp);
    00175
    00177
    00180         void PushFrame( const Frame& frame );
    00181
    00183
    00190         void PushFrame(StreamPicInput* picin,const FrameParams& fp);
    00191
    00193
    00200         void PushFrame(StreamPicInput* picin,const unsigned int fnum);
    00201
    00203
    00210         void SetRetiredList(const int show_fnum, const int current_coded_fnum);
    00211
    00213
    00220         void Clean(const int show_fnum, const int current_coded_fnum);
    00221
    00223
    00227         void Clean(int fnum);
    00228
    00230         const FrameParams& GetFParams() const{return m_fparams;}
    00231
    00232     private:
    00234         void SetFrameParams(const unsigned int fnum);
    00235
    00237
    00242         void Remove(const unsigned int fnum);
    00243
    00244     private:
    00245
    00247         int m_ref_count;
    00248
    00250         std::vector<Frame*> m_frame_data;
    00251
    00253         std::vector<bool> m_frame_in_use;
    00254
    00256         std::map<unsigned int,unsigned int> m_fnum_map;
    00257
    00259         FrameParams m_fparams;
    00260
    00262         unsigned int m_num_L1;
    00263
    00265         unsigned int m_L1_sep;
    00266
    00268         unsigned int m_gop_len;
    00269
    00270
    00271
    00272
    00273
    00274     };
    00275
    00276 } // namespace dirac
    00277
    00278 #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.