Repository URL to install this package:
Version:
7:2.7.1-1ubuntu3 ▾
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>FFmpeg: libavutil/cpu.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">FFmpeg
 <span id="projectnumber">2.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">libavutil/cpu.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="cpu_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (c) 2000, 2001, 2002 Fabrice Bellard</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * This file is part of FFmpeg.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * FFmpeg is free software; you can redistribute it and/or</span>
<a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * FFmpeg is distributed in the hope that it will be useful,</span>
<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00014"></a>00014 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00015"></a>00015 <span class="comment"> *</span>
<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00017"></a>00017 <span class="comment"> * License along with FFmpeg; if not, write to the Free Software</span>
<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00019"></a>00019 <span class="comment"> */</span>
<a name="l00020"></a>00020
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef AVUTIL_CPU_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define AVUTIL_CPU_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="attributes_8h.html" title="Macro definitions for various function/variable attributes.">attributes.h</a>"</span>
<a name="l00025"></a>00025
<a name="l00026"></a><a class="code" href="cpu_8h.html#af73205a325a7353debd757a40d379064">00026</a> <span class="preprocessor">#define AV_CPU_FLAG_FORCE 0x80000000 </span><span class="comment">/* force usage of selected flags (OR) */</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="comment">/* lower 16 bits - CPU features */</span>
<a name="l00029"></a><a class="code" href="cpu_8h.html#aeab63e0c708c2c8cf519adb924306273">00029</a> <span class="preprocessor">#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX</span>
<a name="l00030"></a><a class="code" href="cpu_8h.html#a821273926dc2c8282d9b0990582e3e3f">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext</span>
<a name="l00031"></a><a class="code" href="cpu_8h.html#a53053dcf8c045b05ca3b5326db518b49">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext</span>
<a name="l00032"></a><a class="code" href="cpu_8h.html#afa9fdb485b595b4d3b2358ae46e7cc90">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW</span>
<a name="l00033"></a><a class="code" href="cpu_8h.html#a4cbf9faebf34070327d31989da5f14be">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions</span>
<a name="l00034"></a><a class="code" href="cpu_8h.html#a0f19ba5104672eb4065f56f9a3877dc6">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions</span>
<a name="l00035"></a><a class="code" href="cpu_8h.html#a7e90443f6a8a3f65c01d2a034c4a2cfd">00035</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="comment"> ///< than regular MMX/SSE (e.g. Core1)</span>
<a name="l00037"></a><a class="code" href="cpu_8h.html#a9bb0453b7c1a5e10e049c435240edb25">00037</a> <span class="comment"></span><span class="preprocessor">#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt</span>
<a name="l00038"></a><a class="code" href="cpu_8h.html#a87b1633fbec64188f3eadb1bffd7703d">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions</span>
<a name="l00039"></a><a class="code" href="cpu_8h.html#a20f4702905f3ca20721afa834a4ab81d">00039</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="comment"> ///< than regular MMX/SSE (e.g. Core1)</span>
<a name="l00041"></a><a class="code" href="cpu_8h.html#aba281a8be7e4c8f87624c30ab227d1b6">00041</a> <span class="comment"></span><span class="preprocessor">#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions</span>
<a name="l00042"></a><a class="code" href="cpu_8h.html#ab11e6283f7f8b3f5bbc34fcb0eb20fc5">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower</span>
<a name="l00043"></a><a class="code" href="cpu_8h.html#a5dbc718bec5f578602a7854d05db76de">00043</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions</span>
<a name="l00044"></a><a class="code" href="cpu_8h.html#a2e3bc1f71c16c5fe8975c10f30d69be7">00044</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions</span>
<a name="l00045"></a><a class="code" href="cpu_8h.html#afb5537bbc8fc14343de2b2ec15eeba17">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used</span>
<a name="l00046"></a><a class="code" href="cpu_8h.html#adfe16e24b7016bbb64fa1937e04389f2">00046</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_AVXSLOW 0x8000000 ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer)</span>
<a name="l00047"></a><a class="code" href="cpu_8h.html#a9db899a1c86c9ff8d05bbb667d2ffb21">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions</span>
<a name="l00048"></a><a class="code" href="cpu_8h.html#a5fc98ebd0ad5759f823070c0604a6778">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="comment">// #if LIBAVUTIL_VERSION_MAJOR <52</span>
<a name="l00050"></a><a class="code" href="cpu_8h.html#a422f69279d4c977d660b72a47fa3478b">00050</a> <span class="preprocessor">#define AV_CPU_FLAG_CMOV 0x1001000 ///< supports cmov instruction</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="comment">// #else</span>
<a name="l00052"></a>00052 <span class="comment">// #define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction</span>
<a name="l00053"></a>00053 <span class="comment">// #endif</span>
<a name="l00054"></a><a class="code" href="cpu_8h.html#ab5be3b16a597bf9cbd489968ce36e082">00054</a> <span class="preprocessor">#define AV_CPU_FLAG_AVX2 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used</span>
<a name="l00055"></a><a class="code" href="cpu_8h.html#a0bd7cc622a20c9007b534f6f3d6813d0">00055</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions</span>
<a name="l00056"></a><a class="code" href="cpu_8h.html#a0ff82a9bfc71daaeb7cc820eb3de4ddc">00056</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1</span>
<a name="l00057"></a><a class="code" href="cpu_8h.html#a6da0856fda17125587965fe12f64c4f4">00057</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span>
<a name="l00059"></a><a class="code" href="cpu_8h.html#aa6791350072da71e22a7dc3b3ddc6a0e">00059</a> <span class="preprocessor">#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard</span>
<a name="l00060"></a><a class="code" href="cpu_8h.html#a65baf7beab71a0678e6374ea3d110f12">00060</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06</span>
<a name="l00061"></a><a class="code" href="cpu_8h.html#a65d7913cdb148cd898ae1bd602de4551">00061</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_POWER8 0x0004 ///< ISA 2.07</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span>
<a name="l00063"></a><a class="code" href="cpu_8h.html#a0ba37cad66b79c3ddf88693c2784359d">00063</a> <span class="preprocessor">#define AV_CPU_FLAG_ARMV5TE (1 << 0)</span>
<a name="l00064"></a><a class="code" href="cpu_8h.html#ae5d6618c7fff92e08b04d6106328ae2a">00064</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_ARMV6 (1 << 1)</span>
<a name="l00065"></a><a class="code" href="cpu_8h.html#a9a7b76aa259dc33fa13f76340e071a35">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_ARMV6T2 (1 << 2)</span>
<a name="l00066"></a><a class="code" href="cpu_8h.html#a283a152bbb636275c23d01a18b9bdc7b">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_VFP (1 << 3)</span>
<a name="l00067"></a><a class="code" href="cpu_8h.html#a1bc3bbebdc0195433b08cba3453c512f">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_VFPV3 (1 << 4)</span>
<a name="l00068"></a><a class="code" href="cpu_8h.html#a2fc7de5c42009f68624e5dd1c77d7390">00068</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_NEON (1 << 5)</span>
<a name="l00069"></a><a class="code" href="cpu_8h.html#acbf2841ca197280ccbaa56405f768025">00069</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_ARMV8 (1 << 6)</span>
<a name="l00070"></a><a class="code" href="cpu_8h.html#a66d259974ecca8f1f846a40bb79f8520">00070</a> <span class="preprocessor"></span><span class="preprocessor">#define AV_CPU_FLAG_SETEND (1 <<16)</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00072"></a>00072 <span class="comment">/**</span>
<a name="l00073"></a>00073 <span class="comment"> * Return the flags which specify extensions supported by the CPU.</span>
<a name="l00074"></a>00074 <span class="comment"> * The returned value is affected by av_force_cpu_flags() if that was used</span>
<a name="l00075"></a>00075 <span class="comment"> * before. So av_get_cpu_flags() can easily be used in a application to</span>
<a name="l00076"></a>00076 <span class="comment"> * detect the enabled cpu flags.</span>
<a name="l00077"></a>00077 <span class="comment"> */</span>
<a name="l00078"></a>00078 <span class="keywordtype">int</span> <a class="code" href="cpu_8h.html#af731555385cb4808386a716504d5fcc1" title="Return the flags which specify extensions supported by the CPU.">av_get_cpu_flags</a>(<span class="keywordtype">void</span>);
<a name="l00079"></a>00079 <span class="comment"></span>
<a name="l00080"></a>00080 <span class="comment">/**</span>
<a name="l00081"></a>00081 <span class="comment"> * Disables cpu detection and forces the specified flags.</span>
<a name="l00082"></a>00082 <span class="comment"> * -1 is a special case that disables forcing of specific flags.</span>
<a name="l00083"></a>00083 <span class="comment"> */</span>
<a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="cpu_8h.html#a07015a8f8d5e73558e5deb683ad55823" title="Disables cpu detection and forces the specified flags.">av_force_cpu_flags</a>(<span class="keywordtype">int</span> flags);
<a name="l00085"></a>00085 <span class="comment"></span>
<a name="l00086"></a>00086 <span class="comment">/**</span>
<a name="l00087"></a>00087 <span class="comment"> * Set a mask on flags returned by av_get_cpu_flags().</span>
<a name="l00088"></a>00088 <span class="comment"> * This function is mainly useful for testing.</span>
<a name="l00089"></a>00089 <span class="comment"> * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible</span>
<a name="l00090"></a>00090 <span class="comment"> *</span>
<a name="l00091"></a>00091 <span class="comment"> * @warning this function is not thread safe.</span>
<a name="l00092"></a>00092 <span class="comment"> */</span>
<a name="l00093"></a>00093 <a class="code" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> <span class="keywordtype">void</span> <a class="code" href="cpu_8h.html#a31d8326d4536304e315b9a79c9aa750f" title="Set a mask on flags returned by av_get_cpu_flags().">av_set_cpu_flags_mask</a>(<span class="keywordtype">int</span> mask);
<a name="l00094"></a>00094 <span class="comment"></span>
<a name="l00095"></a>00095 <span class="comment">/**</span>
<a name="l00096"></a>00096 <span class="comment"> * Parse CPU flags from a string.</span>
<a name="l00097"></a>00097 <span class="comment"> *</span>
<a name="l00098"></a>00098 <span class="comment"> * The returned flags contain the specified flags as well as related unspecified flags.</span>
<a name="l00099"></a>00099 <span class="comment"> *</span>
<a name="l00100"></a>00100 <span class="comment"> * This function exists only for compatibility with libav.</span>
<a name="l00101"></a>00101 <span class="comment"> * Please use av_parse_cpu_caps() when possible.</span>
<a name="l00102"></a>00102 <span class="comment"> * @return a combination of AV_CPU_* flags, negative on error.</span>
<a name="l00103"></a>00103 <span class="comment"> */</span>
<a name="l00104"></a>00104 <a class="code" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a>
<a name="l00105"></a>00105 <span class="keywordtype">int</span> <a class="code" href="cpu_8h.html#a577da6114dc4448f5defdac188a01644" title="Parse CPU flags from a string.">av_parse_cpu_flags</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *s);
<a name="l00106"></a>00106 <span class="comment"></span>
<a name="l00107"></a>00107 <span class="comment">/**</span>
<a name="l00108"></a>00108 <span class="comment"> * Parse CPU caps from a string and update the given AV_CPU_* flags based on that.</span>
<a name="l00109"></a>00109 <span class="comment"> *</span>
<a name="l00110"></a>00110 <span class="comment"> * @return negative on error.</span>
<a name="l00111"></a>00111 <span class="comment"> */</span>
<a name="l00112"></a>00112 <span class="keywordtype">int</span> <a class="code" href="cpu_8h.html#a851439bc19de673484e788402734b1a5" title="Parse CPU caps from a string and update the given AV_CPU_* flags based on that.">av_parse_cpu_caps</a>(<span class="keywordtype">unsigned</span> *flags, <span class="keyword">const</span> <span class="keywordtype">char</span> *s);
<a name="l00113"></a>00113 <span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment">/**</span>
<a name="l00115"></a>00115 <span class="comment"> * @return the number of logical CPU cores present.</span>
<a name="l00116"></a>00116 <span class="comment"> */</span>
<a name="l00117"></a>00117 <span class="keywordtype">int</span> <a class="code" href="cpu_8h.html#af8bdb502bd3964052fc8595b0fe721a8">av_cpu_count</a>(<span class="keywordtype">void</span>);
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <span class="preprocessor">#endif </span><span class="comment">/* AVUTIL_CPU_H */</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>