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.19 2007/11/16 04:50:08 asuraparaju Exp $ $Name: Dirac_0_9_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 
00047 namespace dirac
00048 {
00050 
00059     class FrameBuffer{
00060     public:
00062         FrameBuffer();
00063 
00065 
00082         FrameBuffer(ChromaFormat cf,
00083                     const int orig_xlen,
00084                     const int orig_ylen,
00085                     const int dwt_xlen,
00086                     const int dwt_ylen,
00087                     const int dwt_cxlen,
00088                     const int dwt_cylen,
00089                     const unsigned int luma_depth,
00090                     const unsigned int chroma_depth,
00091                     bool using_ac);
00092 
00094 
00115         FrameBuffer(ChromaFormat cf,
00116                     const int numL1,
00117                     const int L1sep,
00118                     const int orig_xlen,
00119                     const int orig_ylen,
00120                     const int dwt_xlen,
00121                     const int dwt_ylen,
00122                     const int dwt_cxlen,
00123                     const int dwt_cylen,
00124                     const unsigned int luma_depth,
00125                     const unsigned int chroma_depth,
00126                     bool interlace,
00127                     bool using_ac);
00128 
00130 
00134         FrameBuffer(const FrameBuffer& cpy);
00135 
00137 
00140         FrameBuffer& operator=(const FrameBuffer& rhs);
00141 
00143         ~FrameBuffer();
00144 
00146         Frame& GetFrame(const unsigned int fnum );
00147 
00149         const Frame& GetFrame(const unsigned int fnum) const;
00150 
00152         Frame& GetFrame(const unsigned int fnum, bool& is_present);
00153 
00155         const Frame& GetFrame(const unsigned int fnum, bool& is_present) const;
00156 
00158         bool IsFrameAvail(const unsigned int fnum) const;
00159 
00161         PicArray& GetComponent(const unsigned int frame_num, CompSort c);
00162 
00164         const PicArray& GetComponent(const unsigned int frame_num, CompSort c) const;
00165 
00167         PicArray& GetUpComponent(const unsigned int frame_num, CompSort c);
00168 
00170         const PicArray& GetUpComponent(const unsigned int frame_num, CompSort c) const;
00171 
00173         std::vector<int> Members() const;
00174 
00176 
00183         void PushFrame(const unsigned int frame_num);
00184 
00186 
00191         void PushFrame(const FrameParams& fp);
00192 
00194 
00197         void PushFrame( const Frame& frame );
00198 
00200 
00207         void SetRetiredFrameNum(const int show_fnum, const int current_coded_fnum);
00208 
00210 
00217         void CleanAll(const int show_fnum, const int current_coded_fnum);
00218 
00220 
00226         void CleanRetired(const int show_fnum, const int current_coded_fnum);
00227 
00229 
00233         void Clean(int fnum);
00234 
00236         const FrameParams& GetFParams() const{return m_fparams;}
00237 
00239         FrameParams& GetFParams() { return m_fparams; }
00240 
00242         void SetFrameParams(const unsigned int fnum);
00243 
00244     private:
00246 
00251         void Remove(const unsigned int fnum);
00252 
00254         void SetProgressiveFrameParams(const unsigned int fnum);
00255 
00257         void SetInterlacedFrameParams(const unsigned int fnum);
00258 
00259     private:
00260 
00262         int m_ref_count;
00263 
00265         std::vector<Frame*> m_frame_data;
00266 
00268         std::vector<bool> m_frame_in_use;
00269 
00271         std::map<unsigned int,unsigned int> m_fnum_map;
00272 
00274         FrameParams m_fparams;
00275 
00277         unsigned int m_num_L1;
00278 
00280         unsigned int m_L1_sep;
00281 
00283         unsigned int m_gop_len;
00284 
00286         bool m_interlace;
00287 
00289         bool m_using_ac;
00290 
00291 
00292 
00293 
00294     };
00295 
00296 } // namespace dirac
00297 
00298 #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.