Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > media > main-release > by-pkgid > f250c16c2b84c9364a2f35a71121aaa2 > files > 322

lib64dirac-devel-1.0.2-2mdv2010.0.x86_64.rpm

<!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>me_mode_decn.h</h1><a href="a00194.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: me_mode_decn.h,v 1.18 2008/10/01 01:26:47 asuraparaju 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">*</span>
<a name="l00025"></a>00025 <span class="comment">* Alternatively, the contents of this file may be used under the terms of</span>
<a name="l00026"></a>00026 <span class="comment">* the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser</span>
<a name="l00027"></a>00027 <span class="comment">* Public License Version 2.1 (the "LGPL"), in which case the provisions of</span>
<a name="l00028"></a>00028 <span class="comment">* the GPL or the LGPL are applicable instead of those above. If you wish to</span>
<a name="l00029"></a>00029 <span class="comment">* allow use of your version of this file only under the terms of the either</span>
<a name="l00030"></a>00030 <span class="comment">* the GPL or LGPL and not to allow others to use your version of this file</span>
<a name="l00031"></a>00031 <span class="comment">* under the MPL, indicate your decision by deleting the provisions above</span>
<a name="l00032"></a>00032 <span class="comment">* and replace them with the notice and other provisions required by the GPL</span>
<a name="l00033"></a>00033 <span class="comment">* or LGPL. If you do not delete the provisions above, a recipient may use</span>
<a name="l00034"></a>00034 <span class="comment">* your version of this file under the terms of any one of the MPL, the GPL</span>
<a name="l00035"></a>00035 <span class="comment">* or the LGPL.</span>
<a name="l00036"></a>00036 <span class="comment">* ***** END LICENSE BLOCK ***** */</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef _ME_MODE_DECN_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define _ME_MODE_DECN_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;<a class="code" href="a00200.html">libdirac_common/motion.h</a>&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;<a class="code" href="a00167.html">libdirac_motionest/block_match.h</a>&gt;</span>
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="keyword">namespace </span>dirac
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046     <span class="keyword">class </span>EncQueue;
<a name="l00047"></a>00047 
<a name="l00049"></a>00049 
<a name="l00069"></a><a class="code" href="a00085.html">00069</a>     <span class="keyword">class </span><a class="code" href="a00085.html" title="Decides between superblock and block prediction modes.">ModeDecider</a>
<a name="l00070"></a>00070     {
<a name="l00071"></a>00071 
<a name="l00072"></a>00072     <span class="keyword">public</span>:
<a name="l00074"></a>00074 
<a name="l00079"></a>00079         <a class="code" href="a00085.html#4f0b96f094c3e9c4a768c848699c415c" title="Constructor.">ModeDecider</a>(<span class="keyword">const</span> <a class="code" href="a00063.html" title="Parameters for the encoding process.">EncoderParams</a>&amp; encp );
<a name="l00080"></a>00080 
<a name="l00082"></a>00082 
<a name="l00085"></a>00085         <a class="code" href="a00085.html#a13bd9dd2abf11631a78c2036971b7e6" title="Destructor.">~ModeDecider</a>();
<a name="l00086"></a>00086 
<a name="l00088"></a>00088 
<a name="l00093"></a>00093         <span class="keywordtype">void</span> <a class="code" href="a00085.html#ea5a08af5c4864ed7da89d99c00e1497" title="Does the actual mode decision.">DoModeDecn</a>( <a class="code" href="a00065.html" title="Holds pictures both for reference and to overcome reordering delay.">EncQueue</a>&amp; my_buffer , <span class="keywordtype">int</span> pic_num );
<a name="l00094"></a>00094 
<a name="l00095"></a>00095     <span class="keyword">private</span>:
<a name="l00096"></a>00096         <a class="code" href="a00085.html#4f0b96f094c3e9c4a768c848699c415c" title="Constructor.">ModeDecider</a>( <span class="keyword">const</span> <a class="code" href="a00085.html" title="Decides between superblock and block prediction modes.">ModeDecider</a>&amp; cpy );<span class="comment">//private, body-less copy constructor: this class should not be copied</span>
<a name="l00097"></a>00097         <a class="code" href="a00085.html" title="Decides between superblock and block prediction modes.">ModeDecider</a>&amp; <a class="code" href="a00085.html#199ae680080d4520b84b194828d2e930">operator=</a>( <span class="keyword">const</span> <a class="code" href="a00085.html" title="Decides between superblock and block prediction modes.">ModeDecider</a>&amp; rhs );<span class="comment">//private, body-less assignment=: this class should not be assigned</span>
<a name="l00098"></a>00098 
<a name="l00099"></a>00099          <span class="comment">//functions</span>
<a name="l00100"></a>00100         <span class="keywordtype">void</span> <a class="code" href="a00085.html#141e7d5a61036ae2bfb4bbc415ea34b0">DoSBDecn</a>();    <span class="comment">//called by do_mode_decn for each SB</span>
<a name="l00101"></a>00101 
<a name="l00103"></a>00103         <span class="keywordtype">void</span> <a class="code" href="a00085.html#a22edd6a16b80117a5137dff0758d365" title="Make a mode decision given a particular level of decomposition.">DoLevelDecn</a>( <span class="keywordtype">int</span> level );
<a name="l00104"></a>00104 
<a name="l00106"></a>00106         <span class="keywordtype">float</span> <a class="code" href="a00085.html#9cdea8794f99c87ba79628a23fcd6d19" title="Decide on a mode for a given prediction unit (block, sub-SB or SB).">DoUnitDecn</a>( <span class="keyword">const</span> <span class="keywordtype">int</span> xpos , <span class="keyword">const</span> <span class="keywordtype">int</span> ypos , <span class="keyword">const</span> <span class="keywordtype">int</span> level );
<a name="l00107"></a>00107 
<a name="l00109"></a>00109         <span class="keywordtype">void</span> <a class="code" href="a00085.html#891dca9c8c51f3d224f1f2fb465e17bb" title="Do motion estimation for a prediction unit at a given level.">DoME</a>( <span class="keyword">const</span> <span class="keywordtype">int</span> xpos , <span class="keyword">const</span> <span class="keywordtype">int</span> ypos , <span class="keyword">const</span> <span class="keywordtype">int</span> level );
<a name="l00110"></a>00110 
<a name="l00112"></a>00112         <span class="keywordtype">float</span> <a class="code" href="a00085.html#4e4090fd306aff714c4e3044516764cb" title="Return a measure of the cost of coding a given mode.">ModeCost</a>( <span class="keyword">const</span> <span class="keywordtype">int</span> xindex , <span class="keyword">const</span> <span class="keywordtype">int</span> yindex );
<a name="l00113"></a>00113 
<a name="l00115"></a>00115         <a class="code" href="a00234.html#548820ca76f864dc8630df79b2c5c5b9" title="Type of picture data (including motion compensated residuals).">ValueType</a> <a class="code" href="a00085.html#99f85b80c40efda559e4d1e21fa4c826" title="Get a prediction for the dc value of a block.">GetDCPred</a>( <span class="keywordtype">int</span> xblock , <span class="keywordtype">int</span> yblock );
<a name="l00116"></a>00116 
<a name="l00118"></a>00118         <span class="keywordtype">float</span> <a class="code" href="a00085.html#103fb05cdfb02ac60d2bcae6d2c43cf6" title="Get a measure of DC value variance.">GetDCVar</a>( <span class="keyword">const</span> <a class="code" href="a00234.html#548820ca76f864dc8630df79b2c5c5b9" title="Type of picture data (including motion compensated residuals).">ValueType</a> dc_val , <span class="keyword">const</span> <a class="code" href="a00234.html#548820ca76f864dc8630df79b2c5c5b9" title="Type of picture data (including motion compensated residuals).">ValueType</a> dc_pred);
<a name="l00119"></a>00119 
<a name="l00121"></a>00121         <span class="keywordtype">void</span> <a class="code" href="a00085.html#8f7178a4d3d160f04e422daa2faae77f" title="Go through all the intra blocks and extract the chroma dc values to be coded.">SetDC</a>( <a class="code" href="a00065.html" title="Holds pictures both for reference and to overcome reordering delay.">EncQueue</a>&amp; my_buffer, <span class="keywordtype">int</span> pic_num);
<a name="l00122"></a>00122 
<a name="l00124"></a>00124         <span class="keywordtype">void</span> <a class="code" href="a00085.html#8f7178a4d3d160f04e422daa2faae77f" title="Go through all the intra blocks and extract the chroma dc values to be coded.">SetDC</a>(<span class="keyword">const</span> <a class="code" href="a00107.html" title="A class for picture component data.">PicArray</a>&amp; pic_data, <a class="code" href="a00082.html" title="Class for all the motion estimation data.">MEData</a>&amp; me_data,<a class="code" href="a00234.html#39dd89c4c7484412efd87d41548271cd" title="Types of picture component.">CompSort</a> cs);
<a name="l00125"></a>00125 
<a name="l00127"></a>00127         <a class="code" href="a00234.html#548820ca76f864dc8630df79b2c5c5b9" title="Type of picture data (including motion compensated residuals).">ValueType</a> <a class="code" href="a00085.html#aac3c27af518605d0eb9928225c17d21" title="Called by previous fn for each block.">GetBlockDC</a>(<span class="keyword">const</span> <a class="code" href="a00107.html" title="A class for picture component data.">PicArray</a>&amp; pic_data, <span class="keywordtype">int</span> xloc,<span class="keywordtype">int</span> yloc,<span class="keywordtype">int</span> split, <a class="code" href="a00234.html#39dd89c4c7484412efd87d41548271cd" title="Types of picture component.">CompSort</a> cs);
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 
<a name="l00130"></a>00130          <span class="comment">// Member data</span>
<a name="l00131"></a><a class="code" href="a00085.html#6b861899043a9571d0e0a1154310d8de">00131</a>         <a class="code" href="a00115.html" title="Picture type Class.">PictureSort</a> <a class="code" href="a00085.html#6b861899043a9571d0e0a1154310d8de">m_psort</a>;
<a name="l00132"></a>00132 
<a name="l00134"></a><a class="code" href="a00085.html#957f0c1240acc79cbc6606c31a2ccc81">00134</a>     <span class="keyword">const</span> <a class="code" href="a00063.html" title="Parameters for the encoding process.">EncoderParams</a>&amp; <a class="code" href="a00085.html#957f0c1240acc79cbc6606c31a2ccc81" title="A local reference to the encoder parameters.">m_encparams</a>;
<a name="l00135"></a>00135 
<a name="l00137"></a><a class="code" href="a00085.html#1fbb4f66f792c0056f06c5c615d4baf7">00137</a>         <span class="keyword">const</span> <a class="code" href="a00114.html" title="Structure to hold motion parameters when motion comp is used.">PicturePredParams</a>* <a class="code" href="a00085.html#1fbb4f66f792c0056f06c5c615d4baf7" title="A local pointer to the picture prediction params.">m_predparams</a>;
<a name="l00138"></a>00138 
<a name="l00140"></a><a class="code" href="a00085.html#1271f4d6d56fd7812ab6a9240ac92ba0">00140</a>         <span class="keywordtype">float</span> <a class="code" href="a00085.html#1271f4d6d56fd7812ab6a9240ac92ba0" title="The Lagrangian parameter for motion estimation.">m_lambda</a>;
<a name="l00141"></a>00141 
<a name="l00143"></a><a class="code" href="a00085.html#0dc2d25973772f82d777aca337104f55">00143</a>         <a class="code" href="a00097.html">OneDArray&lt;float&gt;</a> <a class="code" href="a00085.html#0dc2d25973772f82d777aca337104f55" title="Correction factor for comparing SAD costs for different SB splittings.">m_level_factor</a>;
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 
<a name="l00147"></a><a class="code" href="a00085.html#87fc96b0a8b9c3e5a1719cd4b4debf16">00147</a>         <a class="code" href="a00097.html">OneDArray&lt;float&gt;</a> <a class="code" href="a00085.html#87fc96b0a8b9c3e5a1719cd4b4debf16" title="Correction factor for comparing mode costs for different SB splittings.">m_mode_factor</a>;
<a name="l00148"></a>00148 
<a name="l00150"></a><a class="code" href="a00085.html#4e62b40e23cf8dd8f6926bd294704133">00150</a>         <a class="code" href="a00097.html">OneDArray&lt; MEData* &gt;</a> <a class="code" href="a00085.html#4e62b40e23cf8dd8f6926bd294704133" title="Motion vector data for each level of splitting.">m_me_data_set</a>;
<a name="l00151"></a>00151 
<a name="l00152"></a><a class="code" href="a00085.html#e1178fd2db1b78ca449e75f2cab3bd5b">00152</a>         <span class="keyword">const</span> <a class="code" href="a00107.html" title="A class for picture component data.">PicArray</a>* <a class="code" href="a00085.html#e1178fd2db1b78ca449e75f2cab3bd5b">m_pic_data</a>;
<a name="l00153"></a><a class="code" href="a00085.html#9bba52c4c71051bb5b1901475246e7c2">00153</a>         <span class="keyword">const</span> <a class="code" href="a00107.html" title="A class for picture component data.">PicArray</a>* <a class="code" href="a00085.html#9bba52c4c71051bb5b1901475246e7c2">m_ref1_updata</a>;
<a name="l00154"></a><a class="code" href="a00085.html#b547ba0aacc3fb23450e431470df272d">00154</a>         <span class="keyword">const</span> <a class="code" href="a00107.html" title="A class for picture component data.">PicArray</a>* <a class="code" href="a00085.html#b547ba0aacc3fb23450e431470df272d">m_ref2_updata</a>;
<a name="l00155"></a><a class="code" href="a00085.html#0feb345b4fb798323a569130f80779ee">00155</a>         <span class="keywordtype">int</span> <a class="code" href="a00085.html#0feb345b4fb798323a569130f80779ee">num_refs</a>;
<a name="l00156"></a>00156 
<a name="l00157"></a><a class="code" href="a00085.html#2c824439a4c4f94e3967378ba1e22788">00157</a>         <a class="code" href="a00078.html" title="A class for calculating the difference between a block and its DC value (average)...">IntraBlockDiff</a>* <a class="code" href="a00085.html#2c824439a4c4f94e3967378ba1e22788">m_intradiff</a>;
<a name="l00158"></a><a class="code" href="a00085.html#992b0eec017f995b5f337ca97a343ce9">00158</a>         <a class="code" href="a00004.html" title="A virtual class for bi-directional differences.">BiBlockDiff</a>* <a class="code" href="a00085.html#992b0eec017f995b5f337ca97a343ce9">m_bicheckdiff</a>;
<a name="l00159"></a>00159 
<a name="l00160"></a>00160         <span class="comment">//position variables, used in all the mode decisions</span>
<a name="l00161"></a><a class="code" href="a00085.html#d5367eb68fe3402961d90984dd8465cb">00161</a>         <span class="keywordtype">int</span> <a class="code" href="a00085.html#6ae903cd1e4079f8f274a648a34a21dc">m_xsb_loc</a>,<a class="code" href="a00085.html#d5367eb68fe3402961d90984dd8465cb">m_ysb_loc</a>;    <span class="comment">//coords of the current SB</span>
<a name="l00162"></a>00162 
<a name="l00163"></a>00163     };
<a name="l00164"></a>00164 
<a name="l00165"></a>00165 } <span class="comment">// namespace dirac</span>
<a name="l00166"></a>00166 
<a name="l00167"></a>00167 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr>
<p align="center"><small>
&copy; 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>