Created by the British Broadcasting Corporation.
00001 /* ***** BEGIN LICENSE BLOCK ***** 00002 * 00003 * $Id: frame_buffer.h,v 1.17 2007/09/26 12:18:43 asuraparaju Exp $ $Name: Dirac_0_8_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 00081 FrameBuffer(ChromaFormat cf, 00082 const int orig_xlen, 00083 const int orig_ylen, 00084 const int dwt_xlen, 00085 const int dwt_ylen, 00086 const int dwt_cxlen, 00087 const int dwt_cylen, 00088 const unsigned int luma_depth, 00089 const unsigned int chroma_depth); 00090 00092 00112 FrameBuffer(ChromaFormat cf, 00113 const int numL1, 00114 const int L1sep, 00115 const int orig_xlen, 00116 const int orig_ylen, 00117 const int dwt_xlen, 00118 const int dwt_ylen, 00119 const int dwt_cxlen, 00120 const int dwt_cylen, 00121 const unsigned int luma_depth, 00122 const unsigned int chroma_depth, 00123 bool interlace); 00124 00126 00130 FrameBuffer(const FrameBuffer& cpy); 00131 00133 00136 FrameBuffer& operator=(const FrameBuffer& rhs); 00137 00139 ~FrameBuffer(); 00140 00142 Frame& GetFrame(const unsigned int fnum ); 00143 00145 const Frame& GetFrame(const unsigned int fnum) const; 00146 00148 Frame& GetFrame(const unsigned int fnum, bool& is_present); 00149 00151 const Frame& GetFrame(const unsigned int fnum, bool& is_present) const; 00152 00154 bool IsFrameAvail(const unsigned int fnum) const; 00155 00157 PicArray& GetComponent(const unsigned int frame_num, CompSort c); 00158 00160 const PicArray& GetComponent(const unsigned int frame_num, CompSort c) const; 00161 00163 PicArray& GetUpComponent(const unsigned int frame_num, CompSort c); 00164 00166 const PicArray& GetUpComponent(const unsigned int frame_num, CompSort c) const; 00167 00169 std::vector<int> Members() const; 00170 00172 00179 void PushFrame(const unsigned int frame_num); 00180 00182 00187 void PushFrame(const FrameParams& fp); 00188 00190 00193 void PushFrame( const Frame& frame ); 00194 00196 00203 void SetRetiredList(const int show_fnum, const int current_coded_fnum); 00204 00206 00213 void Clean(const int show_fnum, const int current_coded_fnum); 00214 00216 00220 void Clean(int fnum); 00221 00223 const FrameParams& GetFParams() const{return m_fparams;} 00224 00226 FrameParams& GetFParams() { return m_fparams; } 00227 00229 void SetFrameParams(const unsigned int fnum); 00230 00231 private: 00233 00238 void Remove(const unsigned int fnum); 00239 00241 void SetProgressiveFrameParams(const unsigned int fnum); 00242 00244 void SetInterlacedFrameParams(const unsigned int fnum); 00245 00246 private: 00247 00249 int m_ref_count; 00250 00252 std::vector<Frame*> m_frame_data; 00253 00255 std::vector<bool> m_frame_in_use; 00256 00258 std::map<unsigned int,unsigned int> m_fnum_map; 00259 00261 FrameParams m_fparams; 00262 00264 unsigned int m_num_L1; 00265 00267 unsigned int m_L1_sep; 00268 00270 unsigned int m_gop_len; 00271 00273 bool m_interlace; 00274 00275 00276 00277 00278 }; 00279 00280 } // namespace dirac 00281 00282 #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.