<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Dirac Video Codec</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <h1 align="center" color="#606080"> Dirac - A Video Codec </h1> <p align="center"> Created by the <a href="http://www.bbc.co.uk">British Broadcasting Corporation</a>. </p> <hr> <!-- Generated by Doxygen 1.5.9 --> <h1>picture_buffer.h</h1><a href="a00213.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ***** BEGIN LICENSE BLOCK *****</span> <a name="l00002"></a>00002 <span class="comment">*</span> <a name="l00003"></a>00003 <span class="comment">* $Id: picture_buffer.h,v 1.4 2008/06/19 10:07:03 tjdwave Exp $ $Name: Dirac_1_0_2 $</span> <a name="l00004"></a>00004 <span class="comment">*</span> <a name="l00005"></a>00005 <span class="comment">* Version: MPL 1.1/GPL 2.0/LGPL 2.1</span> <a name="l00006"></a>00006 <span class="comment">*</span> <a name="l00007"></a>00007 <span class="comment">* The contents of this file are subject to the Mozilla Public License</span> <a name="l00008"></a>00008 <span class="comment">* Version 1.1 (the "License"); you may not use this file except in compliance</span> <a name="l00009"></a>00009 <span class="comment">* with the License. You may obtain a copy of the License at</span> <a name="l00010"></a>00010 <span class="comment">* http://www.mozilla.org/MPL/</span> <a name="l00011"></a>00011 <span class="comment">*</span> <a name="l00012"></a>00012 <span class="comment">* Software distributed under the License is distributed on an "AS IS" basis,</span> <a name="l00013"></a>00013 <span class="comment">* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for</span> <a name="l00014"></a>00014 <span class="comment">* the specific language governing rights and limitations under the License.</span> <a name="l00015"></a>00015 <span class="comment">*</span> <a name="l00016"></a>00016 <span class="comment">* The Original Code is BBC Research and Development code.</span> <a name="l00017"></a>00017 <span class="comment">*</span> <a name="l00018"></a>00018 <span class="comment">* The Initial Developer of the Original Code is the British Broadcasting</span> <a name="l00019"></a>00019 <span class="comment">* Corporation.</span> <a name="l00020"></a>00020 <span class="comment">* Portions created by the Initial Developer are Copyright (C) 2004.</span> <a name="l00021"></a>00021 <span class="comment">* All Rights Reserved.</span> <a name="l00022"></a>00022 <span class="comment">*</span> <a name="l00023"></a>00023 <span class="comment">* Contributor(s): Thomas Davies (Original Author),</span> <a name="l00024"></a>00024 <span class="comment">* Anuradha Suraparaju</span> <a name="l00025"></a>00025 <span class="comment">*</span> <a name="l00026"></a>00026 <span class="comment">* Alternatively, the contents of this file may be used under the terms of</span> <a name="l00027"></a>00027 <span class="comment">* the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser</span> <a name="l00028"></a>00028 <span class="comment">* Public License Version 2.1 (the "LGPL"), in which case the provisions of</span> <a name="l00029"></a>00029 <span class="comment">* the GPL or the LGPL are applicable instead of those above. If you wish to</span> <a name="l00030"></a>00030 <span class="comment">* allow use of your version of this file only under the terms of the either</span> <a name="l00031"></a>00031 <span class="comment">* the GPL or LGPL and not to allow others to use your version of this file</span> <a name="l00032"></a>00032 <span class="comment">* under the MPL, indicate your decision by deleting the provisions above</span> <a name="l00033"></a>00033 <span class="comment">* and replace them with the notice and other provisions required by the GPL</span> <a name="l00034"></a>00034 <span class="comment">* or LGPL. If you do not delete the provisions above, a recipient may use</span> <a name="l00035"></a>00035 <span class="comment">* your version of this file under the terms of any one of the MPL, the GPL</span> <a name="l00036"></a>00036 <span class="comment">* or the LGPL.</span> <a name="l00037"></a>00037 <span class="comment">* ***** END LICENSE BLOCK ***** */</span> <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="preprocessor">#ifndef _PICTURE_BUFFER_H_</span> <a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define _PICTURE_BUFFER_H_</span> <a name="l00041"></a>00041 <span class="preprocessor"></span> <a name="l00042"></a>00042 <span class="preprocessor">#include <vector></span> <a name="l00043"></a>00043 <span class="preprocessor">#include <map></span> <a name="l00044"></a>00044 <span class="preprocessor">#include <<a class="code" href="a00212.html">libdirac_common/picture.h</a>></span> <a name="l00045"></a>00045 <span class="preprocessor">#include <<a class="code" href="a00171.html">libdirac_common/common.h</a>></span> <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keyword">namespace </span>dirac <a name="l00048"></a>00048 { <a name="l00050"></a>00050 <a name="l00059"></a><a class="code" href="a00109.html">00059</a> <span class="keyword">class </span><a class="code" href="a00109.html" title="Holds pictures both for reference and to overcome reordering delay.">PictureBuffer</a>{ <a name="l00060"></a>00060 <span class="keyword">public</span>: <a name="l00062"></a>00062 <a class="code" href="a00109.html#c27f1480054a9c9e50dc21f7404cff3b" title="Default Constructor.">PictureBuffer</a>(); <a name="l00063"></a>00063 <a name="l00065"></a>00065 <a name="l00078"></a>00078 <a class="code" href="a00109.html#c27f1480054a9c9e50dc21f7404cff3b" title="Default Constructor.">PictureBuffer</a>(<a class="code" href="a00172.html#4a6c51c10f2eb04abc7209db7caff39f">ChromaFormat</a> cf, <a name="l00079"></a>00079 <span class="keyword">const</span> <span class="keywordtype">int</span> xlen, <a name="l00080"></a>00080 <span class="keyword">const</span> <span class="keywordtype">int</span> ylen, <a name="l00081"></a>00081 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> luma_depth, <a name="l00082"></a>00082 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> chroma_depth, <a name="l00083"></a>00083 <span class="keywordtype">bool</span> using_ac); <a name="l00084"></a>00084 <a name="l00086"></a>00086 <a name="l00103"></a>00103 <a class="code" href="a00109.html#c27f1480054a9c9e50dc21f7404cff3b" title="Default Constructor.">PictureBuffer</a>(<a class="code" href="a00172.html#4a6c51c10f2eb04abc7209db7caff39f">ChromaFormat</a> cf, <a name="l00104"></a>00104 <span class="keyword">const</span> <span class="keywordtype">int</span> numL1, <a name="l00105"></a>00105 <span class="keyword">const</span> <span class="keywordtype">int</span> L1sep, <a name="l00106"></a>00106 <span class="keyword">const</span> <span class="keywordtype">int</span> xlen, <a name="l00107"></a>00107 <span class="keyword">const</span> <span class="keywordtype">int</span> ylen, <a name="l00108"></a>00108 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> luma_depth, <a name="l00109"></a>00109 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> chroma_depth, <a name="l00110"></a>00110 <span class="keywordtype">bool</span> interlace, <a name="l00111"></a>00111 <span class="keywordtype">bool</span> using_ac); <a name="l00112"></a>00112 <a name="l00114"></a>00114 <a name="l00118"></a>00118 <a class="code" href="a00109.html#c27f1480054a9c9e50dc21f7404cff3b" title="Default Constructor.">PictureBuffer</a>(<span class="keyword">const</span> <a class="code" href="a00109.html" title="Holds pictures both for reference and to overcome reordering delay.">PictureBuffer</a>& cpy); <a name="l00119"></a>00119 <a name="l00121"></a>00121 <a name="l00124"></a>00124 <a class="code" href="a00109.html" title="Holds pictures both for reference and to overcome reordering delay.">PictureBuffer</a>& <a class="code" href="a00109.html#62409580eb883c6581fb7a6e11108e86" title="Operator=.">operator=</a>(<span class="keyword">const</span> <a class="code" href="a00109.html" title="Holds pictures both for reference and to overcome reordering delay.">PictureBuffer</a>& rhs); <a name="l00125"></a>00125 <a name="l00127"></a>00127 <a class="code" href="a00109.html#321546600f10838d67e283689894bed5" title="Destructor.">~PictureBuffer</a>(); <a name="l00128"></a>00128 <a name="l00130"></a>00130 <a class="code" href="a00108.html" title="A class for encapsulating all the data relating to a picture.">Picture</a>& <a class="code" href="a00109.html#22a0cf81f924cbd16a301d1dcbc1c7a5" title="Get picture with a given picture number (NOT with a given position in the buffer)...">GetPicture</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pnum ); <a name="l00131"></a>00131 <a name="l00133"></a>00133 <span class="keyword">const</span> <a class="code" href="a00108.html" title="A class for encapsulating all the data relating to a picture.">Picture</a>& <a class="code" href="a00109.html#22a0cf81f924cbd16a301d1dcbc1c7a5" title="Get picture with a given picture number (NOT with a given position in the buffer)...">GetPicture</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pnum) <span class="keyword">const</span>; <a name="l00134"></a>00134 <a name="l00136"></a>00136 <a class="code" href="a00108.html" title="A class for encapsulating all the data relating to a picture.">Picture</a>& <a class="code" href="a00109.html#22a0cf81f924cbd16a301d1dcbc1c7a5" title="Get picture with a given picture number (NOT with a given position in the buffer)...">GetPicture</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pnum, <span class="keywordtype">bool</span>& is_present); <a name="l00137"></a>00137 <a name="l00139"></a>00139 <span class="keyword">const</span> <a class="code" href="a00108.html" title="A class for encapsulating all the data relating to a picture.">Picture</a>& <a class="code" href="a00109.html#22a0cf81f924cbd16a301d1dcbc1c7a5" title="Get picture with a given picture number (NOT with a given position in the buffer)...">GetPicture</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pnum, <span class="keywordtype">bool</span>& is_present) <span class="keyword">const</span>; <a name="l00140"></a>00140 <a name="l00142"></a>00142 <span class="keywordtype">bool</span> <a class="code" href="a00109.html#ebd8f9682b37793f4078d90336451fdc" title="Return true if picture with the particular picture number is available else return...">IsPictureAvail</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pnum) <span class="keyword">const</span>; <a name="l00143"></a>00143 <a name="l00145"></a>00145 std::vector<int> <a class="code" href="a00109.html#6463234e4f17612d92e2e57d1e553d4a" title="Returns a list of member pictures.">Members</a>() <span class="keyword">const</span>; <a name="l00146"></a>00146 <a name="l00148"></a>00148 <a name="l00153"></a>00153 <span class="keywordtype">void</span> <a class="code" href="a00109.html#04c05f92aca0d71e4b4ac5c785721ce0" title="Put a new picture into the top of the buffer.">PushPicture</a>(<span class="keyword">const</span> <a class="code" href="a00113.html" title="Parameters for initialising picture class objects.">PictureParams</a>& pp); <a name="l00154"></a>00154 <a name="l00156"></a>00156 <a name="l00159"></a>00159 <span class="keywordtype">void</span> <a class="code" href="a00109.html#ff9771ac310a2d9fb7d178300e136895">CopyPicture</a>( <span class="keyword">const</span> <a class="code" href="a00108.html" title="A class for encapsulating all the data relating to a picture.">Picture</a>& picture ); <a name="l00160"></a>00160 <a name="l00162"></a>00162 <a name="l00169"></a>00169 <span class="keywordtype">void</span> <a class="code" href="a00109.html#7d62e5c97ea71d22b529622b0e974c87" title="Sets the reference picture number that will be cleaned.">SetRetiredPictureNum</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> show_pnum, <span class="keyword">const</span> <span class="keywordtype">int</span> current_coded_pnum); <a name="l00170"></a>00170 <a name="l00172"></a>00172 <a name="l00176"></a>00176 <span class="keywordtype">void</span> <a class="code" href="a00109.html#df5e5214d22bda716bd1bafe3dc03275" title="Delete picture.">Remove</a>(<span class="keywordtype">int</span> pnum); <a name="l00177"></a>00177 <a name="l00178"></a>00178 <span class="keyword">private</span>: <a name="l00180"></a>00180 <a name="l00183"></a>00183 <span class="keywordtype">void</span> <a class="code" href="a00109.html#f443e53760289ad6f8840859db42fd6a" title="Clear internal data slot number pos.">ClearSlot</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos); <a name="l00184"></a>00184 <a name="l00185"></a>00185 <span class="comment">// //! the count of the number of reference pictures in the buffer</span> <a name="l00186"></a>00186 <span class="comment">// int m_ref_count;</span> <a name="l00187"></a>00187 <a name="l00189"></a><a class="code" href="a00109.html#38a3d6a690384c8cb02fc74fc97041ff">00189</a> std::vector<Picture*> <a class="code" href="a00109.html#38a3d6a690384c8cb02fc74fc97041ff" title="the buffer storing all the values">m_pic_data</a>; <a name="l00190"></a>00190 <a name="l00192"></a><a class="code" href="a00109.html#cbaa5c3806b67ecfc0e418db28e84a96">00192</a> std::map<unsigned int,unsigned int> <a class="code" href="a00109.html#cbaa5c3806b67ecfc0e418db28e84a96" title="the map from picture numbers to position in the buffer">m_pnum_map</a>; <a name="l00193"></a>00193 <a name="l00194"></a>00194 }; <a name="l00195"></a>00195 <a name="l00196"></a>00196 } <span class="comment">// namespace dirac</span> <a name="l00197"></a>00197 <a name="l00198"></a>00198 <span class="preprocessor">#endif</span> </pre></div></div> <hr> <p align="center"><small> © 2004 British Broadcasting Corporation. Dirac code licensed under the <a href="http://www.mozilla.org/MPL/">Mozilla Public License (MPL) Version 1.1</a>.<br> HTML documentation generated by Dimitri van Heesch's excellent <a href="http://www.doxygen.org">Doxygen</a> tool. </small></p> </body> </html>