1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-22 11:18:32 +00:00

Merge svn changes up to 27824

Conflicts:
	cfg-common-opts.h
	libmpcodecs/dec_video.c
	libmpcodecs/vd.c
	libvo/x11_common.h
	mplayer.c
	stream/cache2.c
This commit is contained in:
Uoti Urpala 2008-10-25 05:12:34 +03:00
commit 0301309425
143 changed files with 1553 additions and 2712 deletions

View File

@ -3,7 +3,7 @@
.\" Tobias Diedrich gepflegt.
.\" Encoding: iso-8859-1
.\"
.\" In sync with r27182
.\" In sync with r27384
.
.\" --------------------------------------------------------------------------
.\" Makrodefinitionen
@ -64,7 +64,7 @@ mencoder \- Movie Encoder
.
.br
.B mplayer
[dvd|dvdnav]://[Titel|[Starttitel]\-Endtitel]
[dvd|dvdnav]://[Titel|[Starttitel]\-Endtitel][/Gerät]
[Optionen]
.
.br
@ -976,7 +976,7 @@ identify=6.
Zum Beispiel listet es für eine DVD die Kapitel die zeitliche Länge jedes
Titels sowie die Disc-ID.
Kombiniere dies mit \-frames 0, um alle Ausgaben zu unterdrücken.
Das Wrapper-Script TOOLS/\:midentify.sh unterdrückt die anderen Ausgaben von
Das Wrapper-Script TOOLS/\:midentify unterdrückt die anderen Ausgaben von
MPlayer
und führt (hoffentlich) Shell-Escaping für die Dateinamen aus.
.
@ -1098,6 +1098,10 @@ gesendet werden (momentan werden nur die Derivate von X11 unterst
Nötig, um in DVD-Menüs Schaltflächen auszuwählen.
.
.TP
.B \-noar
Schaltet Unterstützung für Apple-Infrarotfernbedienung ab.
.
.TP
.B \-noconsolecontrols
Für Ereignisse wird von MPlayer nicht die Standardeingabe (stdin) verwendet.
Das ist nützlich beim Lesen von Daten von der Standardeingabe.
@ -1117,10 +1121,6 @@ Schaltet die Joystickunterst
Schaltet Unterstützung für LIRC aus.
.
.TP
.B \-noar
Schaltet Unterstützung für Apple-Infrarotfernbedienung ab.
.
.TP
.B \-nomouseinput
Sperrt die Eingabe mittels Mausbuttons (Buttonpress/\:-release) (diese Option
wird unter anderem von mozplayerxp verwendet, um ein eigenes Kontextmenü
@ -3028,7 +3028,6 @@ Wird nur von fbdev-, dga2-, svga- und vesa-Videoausgabetreibern unterst
Spiele den Film mit Fensterrand und Dekoration.
Da dies standardmäßig an ist, benutze \-noborder um die normale
Fensterdekoration abzuschalten.
Wird vom directx-Videoausgabetreiber unterstützt.
.
.TP
.B \-brightness <\-100\-100>
@ -3394,7 +3393,7 @@ beispielsweise n
mit der plugger-Erweiterung).
.
.TP
.B \-xineramascreen <\-2\-...> (nur bei X11)
.B \-xineramascreen <\-2\-...>
Bei Xinerama-Konfigurationen (z.B.\& bei einem einzigen Desktop, der sich
über mehrere Monitore erstreckt) gibt diese Option an, auf welchem Schirm
das Video angezeigt werden soll.
@ -3405,6 +3404,10 @@ Die mit der Option \-geometry gesetzte Initialposition ist relativ zum
angegebenen Bildschirm.
Wird normalerweise nur mit "\-fstype \-fullscreen" oder "\-fstype none"
funktionieren.
Diese Option ist nicht geeignet, nur das Startbild zu setzen (und nicht auch
das Bild im Vollbildmodus), \-geometry ist für diesen Zweck momentan die beste
zur Verfügung stehende Option.
Unterstützt von den Videoausgabetreibern gl, gl2, x11 und xv.
.
.TP
.B \-zrbw (nur bei \-vo zr)
@ -11028,6 +11031,10 @@ momentan nur f
Manchmal ist es nötig, diese zu erhöhen, um "Buffer Underflows" zu verweiden.
.
.TP
.B "o\ \ \ \ \ \ "
FIXME: Dokumentiere diese Option.
.
.TP
.B packetsize=<Größe>
Größe, ausgedrückt in Bytes, des einheitlichen Pakets für das gewählte Format.
Beim Muxing zu MPEG[12]-Implementierungen sind die Standardwerte 2324 für
@ -11041,9 +11048,6 @@ Decodierungszeitstempels (DTS) f
(Verzögerung von Demuxing zu Decodierung).
.
.TP
.B "o\ \ \ \ \ \ "
FIXME: Dokumentiere diese Option.
.
.
.
.\" --------------------------------------------------------------------------

View File

@ -3080,7 +3080,7 @@ than the screen.
.br
.I NOTE:
This option is only supported by the x11, xmga, xv, xvmc, xvidix,
gl, gl2, directx and tdfxfb video output drivers.
gl, gl2, directx, fbdev and tdfxfb video output drivers.
.sp 1
.I EXAMPLE:
.PD 0
@ -3206,12 +3206,12 @@ Not supported by all video output drivers.
.
.TP
.B \-screenh <pixels>
Specify the vertical screen resolution for video output drivers which
Specify the screen height for video output drivers which
do not know the screen resolution like fbdev, x11 and TV-out.
.
.TP
.B \-screenw <pixels>
Specify the horizontal screen resolution for video output drivers which
Specify the screen width for video output drivers which
do not know the screen resolution like fbdev, x11 and TV-out.
.
.TP
@ -9093,7 +9093,6 @@ FIXME: Document this.
FIXME: Document this.
.
.
.
.SS nuv (\-nuvopts)
.
Nuppel video is based on RTJPEG and LZO.
@ -10043,7 +10042,7 @@ exhaustive search (very slow, and no better than umh)
radius of exhaustive or multi-hexagon motion search (default: 16)
.
.TP
.B subq=<1\-7>
.B subq=<1\-9>
Adjust subpel refinement quality.
This parameter controls quality versus speed tradeoffs involved in the motion
estimation decision process.
@ -10068,12 +10067,18 @@ Then selects the best type.
Then finishes the quarterpixel refinement for that type.
.IPs 5
Runs best quality quarterpixel precision motion estimation on all
candidate macroblock types, before selecting the best type (default).
candidate macroblock types, before selecting the best type.
Also refines the two motion vectors used in bidirectional macroblocks,
rather than reusing vectors from the forward and backward searches.
.IPs 6
Enables rate-distortion optimization of macroblock types in
I- and P-frames.
I- and P-frames (default).
.IPs 7
Enables rate-distortion optimization of motion vectors and intra modes. (best)
Enables rate-distortion optimization of macroblock types in all frames.
.IPs 8
Enables rate-distortion optimization of motion vectors and intra prediction modes in I- and P-frames.
.IPs 9
Enables rate-distortion optimization of motion vectors and intra prediction modes in all frames (best).
.RE
.PD 1
.RS
@ -10095,18 +10100,7 @@ Without this option, a whole macroblock must use the same reference.
Requires frameref>1.
.
.TP
.B (no)brdo
Enables rate-distortion optimization of macroblock types in B-frames.
Requires subq>=6.
.
.TP
.B (no)bime
Refine the two motion vectors used in bidirectional macroblocks,
rather than re-using vectors from the forward and backward searches.
This option has no effect without B-frames.
.
.TP
.B trellis=<0\-2>
.B trellis=<0\-2> (cabac only)
rate-distortion optimal quantization
.PD 0
.RSs
@ -10120,6 +10114,19 @@ enabled during all mode decisions (slow, requires subq>=6)
.PD 1
.
.TP
.B psy-rd=rd[:trell]
Sets the strength of the psychovisual optimization.
.PD 0
.RSs
.IPs rd=<0.0\-10.0>
psy optimization strength (requires subq>=6) (default: 1.0)
.IPs trell=<0.0\-10.0>
trellis (requires trellis, experimental) (default: 0.0)
.RE
.PD 1
.
.
.TP
.B deadzone_inter=<0\-32>
Set the size of the inter luma quantization deadzone for non-trellis
quantization (default: 21).
@ -10515,7 +10522,6 @@ Encryption key the demuxer should use.
This is the raw binary data of the key converted to a hexadecimal string.
.
.
.
.SS FFmpeg libavformat muxers (\-lavfopts) (also see \-of lavf)
.
.TP

View File

@ -1,4 +1,4 @@
.\" synced with r27651
.\" synced with r27691
.\" Encoding: iso-8859-1
.\" MPlayer (C) 2000-2008 MPlayer Team
.\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
@ -3241,7 +3241,7 @@ fen
.br
.I NOTE:
Cette option n'est permise que par les pilotes de sortie vidéo x11, xmga, xv,
xvmc, xvidix, gl, gl2, directx et tdfxfb.
xvmc, xvidix, gl, gl2, directx, fbdev et tdfxfb.
.sp 1
.I EXEMPLE:
.PD 0

View File

@ -1,4 +1,4 @@
.\" Synced with r27607
.\" Synced with r27691
.\" MPlayer (C) 2000-2008 MPlayer Team
.\" Ezt a man oldalt Gabucino, Diego Biurrun és Jonas Jermann készíti/készítette
.\" Karbantartó: Gabrov
@ -33,7 +33,7 @@
.\" Név
.\" --------------------------------------------------------------------------
.
.TH MPlayer 1 "2008. 09. 14." "MPlayer Project" "A film lejátszó"
.TH MPlayer 1 "2008. 10. 05." "MPlayer Project" "A film lejátszó"
.
.SH NÉV
mplayer \- film lejátszó
@ -3092,8 +3092,8 @@ Ha egy k
koordináták az ablak bal felső sarkához viszonyulnak a képernyő helyett.
.br
.I MEGJEGYZÉS:
Ezt az opciót csak az x11, xmga, xv, xvmc, xvidix, gl, gl2, directx és
tdfxfb videó kimeneti vezérlők támogatják.
Ezt az opciót csak az x11, xmga, xv, xvmc, xvidix, gl, gl2, directx,
fbdev és tdfxfb videó kimeneti vezérlők támogatják.
.sp 1
.I PÉLDA:
.PD 0
@ -4226,6 +4226,8 @@ Minden f
.IPs z=<0\-9>
Megadja a tömörítési szintet.
0-val nincs tömörítés, 9 a maximális tömörítés.
.IPs outdir=<könyvtárnév>
Megadja a könyvtárat, ahova a PNG fájlokat menteni kell (alapértelmezett: ./).
.RE
.PD 1
.
@ -4507,8 +4509,21 @@ Ez nem hiba, hanem a nem teljes felbont
Ha a <w> is meg van adva, a lowres dekódolás csak akkor lesz használva, ha a
videó szélessége nagyobb vagy egyenlő mint <w>.
.RE
.IPs "o\ \ \ \ "
FIXME: nem dokumentált
.B o=<kulcs>=<érték>[,<kulcs>=<érték>[,...]]
AVOptions átadása a libavcodec dekódolójának.
Megjegyezzük, hogy az o= kapcsolót feleslegessé tevő, az összes ismeretlen
opciót az AVOption rendszernek átadó javítást szívesen fogadunk.
Az AVOptions teljes listája megtalálható az FFmpeg kézikönyvében.
Figyelj rá, hogy néhány opció ütközhet a MEncoder kapcsolóival.
.sp 1
.RS
.I PÉLDA:
.RE
.RSs
.PD 0
.IPs o=debug=pict
.PD 1
.RE
.IPs "sb=<szám> (csak MPEG-2)"
Kihagyja a megadott számú makroblokk sort a tetején.
.IPs "st=<szám> (csak MPEG-2)"
@ -7652,9 +7667,11 @@ N
.
.TP
.B o=<kulcs>=<érték>[,<kulcs>=<érték>[,...]]
AVOption átadása a libavcodec-nek
Emlékezz rá, hogy az o= kapcsolót feleslegessé tevő, az összes ismeretlen
opciót a AVOption rendszernek átadó javítást szívesen fogadunk.
AVOption átadása a libavcodec kódolójának.
Megjegyezzük, hogy az o= kapcsolót feleslegessé tevő, az összes ismeretlen
opciót az AVOption rendszernek átadó javítást szívesen fogadunk.
Az AVOptions teljes listája megtalálható az FFmpeg kézikönyvében.
Figyelj rá, hogy néhány opció ütközhet a MEncoder kapcsolóival.
.sp 1
.RS
.I PÉLDA:
@ -10498,8 +10515,21 @@ A folyam tulajdons
Kényszeríti a megadott libavformat demuxer-t.
.
.TP
.B "o\ \ \ \ \ \ "
FIXME: nem dokumentált
.B o=<kulcs>=<érték>[,<kulcs>=<érték>[,...]]
AVOptions átadása a libavformat demuxer-ének.
Megjegyezzük, hogy az o= kapcsolót feleslegessé tevő, az összes ismeretlen
opciót az AVOption rendszernek átadó javítást szívesen fogadunk.
Az AVOptions teljes listája megtalálható az FFmpeg kézikönyvében.
Figyelj rá, hogy néhány opció ütközhet az MPlayer/MEncoder kapcsolóival.
.sp 1
.RS
.I PÉLDA:
.RE
.RSs
.PD 0
.IPs o=ignidx
.PD 1
.RE
.
.TP
.B probesize=<érték>
@ -10555,6 +10585,8 @@ MPEG-4 form
MPEG-4 formátum extra fejléc flag-ekkel, melyek az Apple iPod firmware-jének kellenek
.IPs "dv\ \ \ "
Sony Digital Video konténer
.IPs "matroska\ \ \ "
Matroska
.RE
.PD 1
.TP
@ -10564,8 +10596,21 @@ jelenleg csak MPEG[12] eset
Néha szükséges növelni a "buffer alulcsordulás" elkerüléséhez.
.
.TP
.B "o\ \ \ \ \ \ "
FIXME: nem dokumentált
.B o=<kulcs>=<érték>[,<kulcs>=<érték>[,...]]
AVOptions átadása a libavformat muxer-ének.
Megjegyezzük, hogy az o= kapcsolót feleslegessé tevő, az összes ismeretlen
opciót az AVOption rendszernek átadó javítást szívesen fogadunk.
Az AVOptions teljes listája megtalálható az FFmpeg kézikönyvében.
Figyelj rá, hogy néhány opció ütközhet a MEncoder kapcsolóival.
.sp 1
.RS
.I PÉLDA:
.RE
.RSs
.PD 0
.IPs o=packetsize=100
.PD 1
.RE
.
.TP
.B packetsize=<méret>

View File

@ -15,65 +15,7 @@ of our homepage.
</para>
<para>
The most important ones above all:
</para>
<itemizedlist>
<listitem><para>
<emphasis role="bold">MPEG-1</emphasis> (<emphasis role="bold">VCD</emphasis>) and
<emphasis role="bold">MPEG-2</emphasis> (<emphasis role="bold">DVD</emphasis>) video
</para></listitem>
<listitem><para>
native decoders for <emphasis role="bold">all DivX variants,
3ivX, Microsoft MPEG-4</emphasis> v1, v2 and other MPEG-4 variants
</para></listitem>
<listitem><para>
native decoder for <emphasis role="bold">Windows Media Video 7/8</emphasis>
(<emphasis role="bold">WMV1/WMV2</emphasis>), and Win32 DLL decoder
for <emphasis role="bold">Windows Media Video 9</emphasis>
(<emphasis role="bold">WMV3</emphasis>),
both used in <filename>.wmv</filename> files
</para></listitem>
<listitem><para>
native <emphasis role="bold">Sorenson 1 (SVQ1)</emphasis> decoder
</para></listitem>
<listitem><para>
native <emphasis role="bold">Sorenson 3 (SVQ3)</emphasis> decoder
</para></listitem>
<listitem><para>
<emphasis role="bold">3ivx</emphasis> v1, v2 decoder
</para></listitem>
<listitem><para>
Cinepak and <emphasis role="bold">Intel Indeo</emphasis> codecs
(3.1,3.2,4.1,5.0)
</para></listitem>
<listitem><para>
<emphasis role="bold">MJPEG</emphasis>, AVID, VCR2, ASV2 and other hardware
formats
</para></listitem>
<listitem><para>
VIVO 1.0, 2.0, I263 and other <emphasis role="bold">H.263(+)</emphasis>
variants
</para></listitem>
<listitem><para>
FLI/FLC
</para></listitem>
<listitem><para>
<emphasis role="bold">RealVideo 1.0 &amp; 2.0</emphasis> from
<systemitem class="library">libavcodec</systemitem>, and
<emphasis role="bold">RealVideo 3.0 &amp; 4.0</emphasis> codecs using
RealPlayer libraries
</para></listitem>
<listitem><para>
native decoder for HuffYUV
</para></listitem>
<listitem><para>
Various old simple RLE-like formats
</para></listitem>
</itemizedlist>
<para>
If you have a Win32 codec not listed here which is not supported yet,
If you have a Win32 codec which is not supported yet,
please read the <link linkend="codec-importing">codec importing HOWTO</link>
and help us add support for it.
</para>
@ -116,22 +58,8 @@ Just run <filename>./configure</filename> and compile.
<para>
<ulink url="http://www.xvid.org">Xvid</ulink> is a free software MPEG-4 ASP
compliant video codec, which features two pass encoding and full MPEG-4 ASP
support, making it a lot more efficient than the well-known DivX codec.
It yields very good video quality and good performance due to CPU
optimizations for most modern processors.
</para>
<para>
It began as a forked development of the OpenDivX codec.
This happened when ProjectMayo changed OpenDivX to closed source
DivX4, and the non-ProjectMayo people working on OpenDivX got angry,
then started Xvid. So both projects have the same origin.
</para>
<para>
Note that Xvid is not necessary to decode Xvid-encoded video.
<systemitem class="library">libavcodec</systemitem> is used by
compliant video codec. Note that Xvid is not necessary to decode Xvid-encoded
video. <systemitem class="library">libavcodec</systemitem> is used by
default as it offers better speed.
</para>
@ -184,154 +112,27 @@ default as it offers better speed.
<sect2 id="codec-x264">
<title><systemitem class="library">x264</systemitem></title>
<sect3 id="codec-x264-whatis">
<title>What is <systemitem class="library">x264</systemitem>?</title>
<para>
<ulink url="http://developers.videolan.org/x264.html"><systemitem class="library">x264</systemitem></ulink>
is a library for creating H.264 video streams.
It is not 100% complete, but supports most of H.264's features which impact
quality.
There are also many advanced features in the H.264 specification
which have nothing to do with video quality per se; many of these
are not yet implemented in <systemitem class="library">x264</systemitem>.
</para>
<itemizedlist>
<title>Encoder features</title>
<listitem><para>CAVLC/CABAC</para></listitem>
<listitem><para>Multi-references</para></listitem>
<listitem><para>
Intra: all macroblock types (16x16, 8x8, and 4x4 with all predictions)
</para></listitem>
<listitem><para>
Inter P: all partitions (from 16x16 down to 4x4)
</para></listitem>
<listitem><para>
Inter B: partitions from 16x16 down to 8x8 (including SKIP/DIRECT)
</para></listitem>
<listitem><para>
Ratecontrol: constant quantizer, constant bitrate, single or multipass ABR,
optional VBV
</para></listitem>
<listitem><para>Scene cut detection</para></listitem>
<listitem><para>Adaptive B-frame placement</para></listitem>
<listitem><para>
B-frames as references / arbitrary frame order
</para></listitem>
<listitem><para>8x8 and 4x4 adaptive spatial transform</para></listitem>
<listitem><para>Lossless mode</para></listitem>
<listitem><para>Custom quantization matrices</para></listitem>
<listitem><para>Parallel encoding of multiple slices</para></listitem>
<listitem><para>Interlacing</para></listitem>
</itemizedlist>
</sect3>
<sect3 id="codec-h264-whatis">
<title>What is H.264?</title>
<para>
H.264 is one name for a new digital video codec jointly developed
by the ITU and MPEG.
It can also be correctly referred to by the cumbersome names of
"ISO/IEC 14496-10" or "MPEG-4 Part 10".
More frequently, it is referred to as "MPEG-4 AVC" or just "AVC".
</para>
<para>
Whatever you call it, H.264 may be worth trying because it can typically match
the quality of MPEG-4 ASP with 5%-30% less bitrate.
Actual results will depend on both the source material and the encoder.
The gains from using H.264 do not come for free: Decoding H.264
streams seems to have steep CPU and memory requirements.
For instance, on a 1733 MHz Athlon, a DVD-resolution 1500kbps H.264
video requires around 35% CPU to decode.
By comparison, decoding a DVD-resolution 1500kbps MPEG-4 ASP stream
requires around 10% CPU.
This means that decoding high-definition streams is almost out of
the question for most users.
It also means that even a decent DVD rip may sometimes stutter on
processors slower than 2.0 GHz or so.
</para>
<para>
At least with <systemitem class="library">x264</systemitem>,
encoding requirements are not much worse than what you are used to
with MPEG-4 ASP.
For instance, on a 1733 MHz Athlon a typical DVD encode would run
at 5-15fps.
</para>
<para>
This document is not intended to explain the details of H.264,
but if you are interested in a brief overview, you may want to read
<ulink url="http://www.cdt.luth.se/~peppar/kurs/smd151/spie04-h264OverviewPaper.pdf">The H.264/AVC Advanced Video Coding Standard: Overview and Introduction to the Fidelity Range Extensions</ulink>.
</para>
</sect3>
<sect3 id="codec-x264-playback">
<title>How can I play H.264 videos with
<application>MPlayer</application>?</title>
<para>
<application>MPlayer</application> uses
<systemitem class="library">libavcodec</systemitem>'s H.264 decoder.
<systemitem class="library">libavcodec</systemitem> has had at
least minimally usable H.264 decoding since around July 2004,
however major changes and improvements have been implemented since
that time, both in terms of more functionality supported and in
terms of improved CPU usage.
Just to be certain, it is always a good idea to use a recent Subversion
checkout.
</para>
<para>
If you want a quick and easy way to know whether there have been
recent changes to <systemitem class="library">libavcodec</systemitem>'s
H.264 decoding, you might keep an eye on
<ulink url="http://svn.mplayerhq.hu/ffmpeg/trunk/libavcodec/h264.c?view=log">FFmpeg Subversion repository's web interface</ulink>.
</para>
</sect3>
<sect3 id="codec-x264-encode">
<title>How can I encode videos using <application>MEncoder</application>
and <systemitem class="library">x264</systemitem>?</title>
<para>
If you have the GIT client installed, the latest x264
sources can be gotten with this command:
<screen>git clone git://git.videolan.org/x264.git</screen>
is a library for creating H.264 video.
<application>MPlayer</application> sources are updated whenever
an <systemitem class="library">x264</systemitem> API change
occurs, so it is always suggested to use
<application>MPlayer</application> from Subversion as well.
Perhaps this situation will change when and if an
<systemitem class="library">x264</systemitem> "release" occurs.
Meanwhile, <systemitem class="library">x264</systemitem> should
be considered a bit unstable, in the sense that its programming
interface is subject to change.
<application>MPlayer</application> from Subversion.
</para>
<para>
<systemitem class="library">x264</systemitem> is built and
installed in the standard way:
<screen>./configure &amp;&amp; make &amp;&amp; sudo make install</screen>
This installs libx264.a in /usr/local/lib and x264.h is placed in
/usr/local/include.
If you have a GIT client installed, the latest x264
sources can be gotten with this command:
<screen>git clone git://git.videolan.org/x264.git</screen>
With the <systemitem class="library">x264</systemitem> library
and header placed in the standard locations, building
<application>MPlayer</application> with
<systemitem class="library">x264</systemitem> support is easy.
Just run the standard:
<screen>./configure &amp;&amp; make &amp;&amp; sudo make install</screen>
The <filename>./configure</filename> script will autodetect that you have
satisfied the requirements for <systemitem class="library">x264</systemitem>.
Then build and install in the standard way:
<screen>./configure &amp;&amp; make &amp;&amp; make install</screen>
Now rerun <filename>./configure</filename> for
<application>MPlayer</application> to pick up
<systemitem class="library">x264</systemitem> support.
</para>
</sect3>
</sect2>
</sect1>
@ -342,55 +143,6 @@ satisfied the requirements for <systemitem class="library">x264</systemitem>.
<sect1 id="audio-codecs">
<title>Audio codecs</title>
<itemizedlist>
<title>The most important audio codecs above all:</title>
<listitem><para>
MPEG layer 1/2/3 (MP1/2/3) audio (<emphasis role="bold">native</emphasis>
code, with MMX/SSE/3DNow! optimization)
</para></listitem>
<listitem><para>
Windows Media Audio 7 and 8 (AKA WMAv1 and WMAv2)
(<emphasis role="bold">native</emphasis> code, with
<link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link>)
</para></listitem>
<listitem><para>
Windows Media Audio 9 (WMAv3) (using DMO DLL)
</para></listitem>
<listitem><para>
AC-3 Dolby audio (<emphasis role="bold">native</emphasis> code, with
MMX/SSE/3DNow! optimization)
</para></listitem>
<listitem><para>
AC-3 passing through sound card hardware
</para></listitem>
<listitem><para>
AAC
</para></listitem>
<listitem><para>
Ogg Vorbis audio codec (<emphasis role="bold">native</emphasis> library)
</para></listitem>
<listitem><para>
RealAudio: DNET (low bitrate AC-3), Cook, Sipro and ATRAC3
</para></listitem>
<listitem><para>
QuickTime: Qualcomm and QDesign audio codecs
</para></listitem>
<listitem><para>
VIVO audio (g723, Vivo Siren)
</para></listitem>
<listitem><para>
Voxware audio (using DirectShow DLL)
</para></listitem>
<listitem><para>
alaw and ulaw, various GSM, ADPCM and PCM formats and other simple old
audio codecs
</para></listitem>
<listitem><para>
Adaptive Multi-Rate (AMR) speech codecs
</para></listitem>
</itemizedlist>
<!-- ********** -->
<sect2 id="swac3">
<title>Software AC-3 decoding</title>
@ -490,21 +242,23 @@ only white noise).
<title>AAC codec</title>
<para>
AAC (Advanced Audio Coding) is an audio codec sometimes found in MOV and MP4
files. An open source decoder called FAAD is available from
<ulink url="http://www.audiocoding.com"/>.
<application>MPlayer</application> includes a CVS snapshot of libfaad 2.1
beta, so you do not need to get it separately.
An open source AAC decoder called FAAD2 is available from
<ulink url="http://www.audiocoding.com/downloads.html"/>.
<application>MPlayer</application> includes a copy of it in its source tree.
If you want to use the external library instead, install it and pass
<option>--enable-faad-external</option> to <filename>./configure</filename>.
</para>
<para>
If you use gcc 3.2 which fails to compile our internal FAAD or want to use
the external library for some other reason, download the library from the
<ulink url="http://www.audiocoding.com/modules/mydownloads/">download page</ulink>
and pass <option>--enable-faad-external</option>
to <filename>./configure</filename>.
You do not need all of faad2 to decode AAC files, libfaad is enough. Build
it like this:
FAAD2 binaries are not available from audiocoding.com, but you can (apt-)get
Debian packages from
<ulink url="http://www.debian-multimedia.org/">Christian Marillat</ulink>,
Mandrake/Mandriva RPMs from the <ulink url="http://plf.zarb.org">P.L.F</ulink>
and Fedora RPMs from <ulink url="http://rpm.livna.org/">Livna</ulink>.
</para>
<para>
If you choose to build from source, you do not need all of FAAD2 to decode
AAC files, libfaad is enough. Build it like this:
<screen>
cd faad2/
sh bootstrap
@ -513,11 +267,6 @@ cd libfaad
make
make install
</screen>
Binaries are not available from audiocoding.com, but you can (apt-)get Debian
packages from
<ulink url="http://www.debian-multimedia.org/">Christian Marillat's homepage</ulink>,
Mandrake/Mandriva RPMs from the <ulink url="http://plf.zarb.org">P.L.F</ulink>
and Fedora RPMs from <ulink url="http://rpm.livna.org/">Livna</ulink>.
</para>
</sect2>

View File

@ -1,520 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter id="containers">
<title>Containers</title>
<para>
It is important to clarify a common mistake. When people see a file with a
<filename>.AVI</filename> extension, they immediately conclude that it is
not an MPEG file. That is not true. At least not entirely. Contrary to
popular belief such a file <emphasis>can</emphasis> contain MPEG-1 video.
</para>
<para>
You see, a <emphasis role="bold">codec</emphasis> is not the same as a
<emphasis role="bold">container format</emphasis>.
Examples of video <emphasis role="bold">codecs</emphasis> are: MPEG-1, MPEG-2,
MPEG-4 (DivX), Indeo5, 3ivx.
Examples of container <emphasis role="bold">formats</emphasis> are:
MPG, AVI, ASF.
</para>
<para>
In theory, you can put an OpenDivX video and MP3 audio
into an <emphasis role="bold">MPG container</emphasis>. However, most
players will not play it, since they expect MPEG-1 video and MP2 audio (unlike
<emphasis role="bold">AVI</emphasis>, <emphasis role="bold">MPG</emphasis>
does not have the necessary fields to describe its video and audio streams).
Or you might put MPEG-1 video into an AVI file.
<ulink url="http://ffmpeg.org/">FFmpeg</ulink> and
<link linkend="mencoder"><application>MEncoder</application></link>
can create these files.
</para>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="video-formats">
<title>Video formats</title>
<sect2 id="mpg-vob-dat">
<title>MPEG files</title>
<para>
MPEG files come in different guises:
</para>
<itemizedlist>
<listitem><para>
MPG: This is the most <emphasis role="bold">basic</emphasis> form of the
MPEG file formats. It contains MPEG-1 video, and MP2 (MPEG-1 layer 2) or
rarely MP1 audio.
</para></listitem>
<listitem><para>
DAT: This is the very same format as MPG with a different extension. It
is used on <emphasis role="bold">Video CDs</emphasis>. Due to the way VCDs
are created and Linux is designed, the DAT files cannot be played nor copied
from VCDs as regular files. You have to use <option>vcd://</option>
to play a Video CD.
</para></listitem>
<listitem><para>
VOB: This is the MPEG file format on <emphasis role="bold">DVDs</emphasis>.
It is the same as MPG, plus the capability to contain subtitles or non-MPEG
(AC-3) audio. It contains encoded MPEG-2 video and usually AC-3 audio, but DTS,
MP2 and uncompressed LPCM are allowed, too. <emphasis role="bold">Read the
<link linkend="dvd">DVD</link> section</emphasis>!
</para></listitem>
<listitem><para>
TY: This is a TiVo MPEG stream. It contains MPEG PES data for audio and
video streams, as well as extra information like closed captions. The
container is not an MPEG program stream, but a closed format created by
TiVo. For more information on TiVo stream format, please refer to
<ulink url="http://dvd-create.sourceforge.net/tystudio/tystream.shtml">
the TyStudio page</ulink>.
</para></listitem>
</itemizedlist>
<para>
Series of frames form independent groups in MPEG files. This means that you
can cut/join an MPEG file with standard file tools (like
<command>dd</command>, <command>cut</command>), and it remains completely
functional.
</para>
<para>
One important feature of MPEG files is that they have a field to describe the
aspect ratio of the video stream within. For example SVCDs have 480x480
resolution video, and in the header that field is set to 4:3, so that it is
played at 640x480. AVI files often lack this field, so they have to be
rescaled during encoding or played with the <option>-aspect</option>
option.
</para>
</sect2>
<!-- ********** -->
<sect2 id="avi">
<title>AVI files</title>
<para>
Designed by Microsoft,
<emphasis role="bold">AVI (Audio Video Interleaved)</emphasis>
is a widespread multipurpose format currently used mostly for MPEG-4 (DivX and
DivX4) video. It has many known drawbacks and shortcomings (for example in
streaming).
It supports one video stream and 0 to 99 audio streams and can be as big as
2GB, but there exists an extension allowing bigger files called
<emphasis role="bold">OpenDML</emphasis>. Microsoft currently strongly
discourages its use and encourages ASF/WMV. Not that anybody cares.
</para>
<para>
There is a hack that allows AVI files to contain an Ogg Vorbis audio
stream, but makes them incompatible with standard AVI.
<application>MPlayer</application> supports playing these files. Seeking is
also implemented but severely hampered by badly encoded files with
confusing headers. Unfortunately the only encoder currently capable of
creating these files, <application>NanDub</application>, has this problem.
</para>
<note><para>
DV cameras create raw DV streams that DV grabbing utilities convert to two
different types of AVI files. The AVI will then contain either separate
audio and video streams that <application>MPlayer</application> can play or
the raw DV stream for which support is under development.
</para></note>
<para>
There are two kinds of AVI files:
<itemizedlist>
<listitem><para>
<emphasis role="bold">Interleaved:</emphasis> Audio and video content is
interleaved. This is the standard usage. Recommended and mostly used. Some
tools create interleaved AVIs with bad sync.
<application>MPlayer</application> detects these as interleaved, and this
climaxes in loss of A/V sync, probably at seeking.
These files should be played as non-interleaved
(with the <option>-ni</option> option).
</para></listitem>
<listitem><para>
<emphasis role="bold">Non-interleaved:</emphasis> First comes the whole
video stream, then the whole audio stream. It thus needs a lot of seeking,
making playing from network or CD-ROM difficult.
</para></listitem>
</itemizedlist>
</para>
<para>
<application>MPlayer</application> supports two kinds of timings for AVI
files:
<itemizedlist>
<listitem><para>
<emphasis role="bold">bps-based:</emphasis> It is based on the
bitrate/samplerate of the video/audio stream. This method is used by
most players, including <ulink url="http://avifile.sf.net">avifile</ulink>
and <application>Windows Media Player</application>. Files with broken
headers, and files created with VBR audio but not VBR-compliant encoder
will result in A/V desync with this method (mostly at seeking).
</para></listitem>
<listitem><para>
<emphasis role="bold">interleaving-based:</emphasis> It does not use the
bitrate value of the header, instead it uses the relative position of
interleaved audio and video chunks,
making badly encoded files with VBR audio playable.
</para></listitem>
</itemizedlist>
</para>
<para>
Any audio and video codec is allowed, but note that VBR audio is not well
supported by most players. The file format makes it possible to use VBR
audio, but most players expect CBR audio, thus they fail with VBR. VBR is
uncommon and Microsoft's AVI specs only describe CBR audio. I also noticed
that most AVI encoders/multiplexers create bad files when using VBR audio.
There are only two known exceptions: <application>NanDub</application> and
<link linkend="mencoder"><application>MEncoder</application></link>.
</para>
</sect2>
<!-- ********** -->
<sect2 id="asf-wmv">
<title>ASF/WMV files</title>
<para>
ASF (Active Streaming Format) comes from Microsoft. They developed two
variants of ASF, v1.0 and v2.0. v1.0 is used by their media tools
(<application>Windows Media Player</application> and
<application>Windows Media Encoder</application>)
and is very secret. v2.0 is published and patented :). Of course they differ,
there is no compatibility at all (it is just another legal game).
<application>MPlayer</application> supports only v1.0, as nobody has ever seen
v2.0 files :). Note that ASF files nowadays come with the extension
<filename>.WMA</filename> or <filename>.WMV</filename>.
</para>
</sect2>
<!-- ********** -->
<sect2 id="mov">
<title>QuickTime/MOV files</title>
<para>
These formats were designed by Apple and can contain any codec, CBR or VBR.
They usually have a <filename>.QT</filename> or <filename>.MOV</filename>
extension. Note that since the MPEG-4 group chose QuickTime as the recommended
file format for MPEG-4, their MOV files come with a <filename>.MPG</filename> or
<filename>.MP4</filename> extension (Interestingly the video and audio
streams in these files are real MPG and AAC files. You can even extract them
with the <option>-dumpvideo</option> and <option>-dumpaudio</option> options.).
</para>
</sect2>
<!-- ********** -->
<sect2 id="vivo">
<title>VIVO files</title>
<para>
<application>MPlayer</application> happily demuxes VIVO file formats. The
biggest disadvantage of the format is that it has no index block, nor a
fixed packet size or sync bytes and most files lack even keyframes, so
forget seeking!
</para>
<para>
The video codec of VIVO/1.0 files is standard
<emphasis role="bold">h.263</emphasis>.
The video codec of VIVO/2.0 files is a modified, nonstandard
<emphasis role="bold">h.263v2</emphasis>. The audio is the same, it may be
<emphasis role="bold">g.723 (standard)</emphasis>, or
<emphasis role="bold">Vivo Siren</emphasis>.
</para>
</sect2>
<!-- ********** -->
<sect2 id="fli">
<title>FLI files</title>
<para>
<emphasis role="bold">FLI</emphasis> is a very old file format used by
Autodesk Animator, but it is a common file format for short animations on the
net.
<application>MPlayer</application> demuxes and decodes FLI movies and is
even able to seek within them (useful when looping with the
<option>-loop</option> option). FLI files do not have keyframes, so the
picture will be messy for a short time after seeking.
</para>
</sect2>
<!-- ********** -->
<sect2 id="realmedia">
<title>RealMedia (RM) files</title>
<para>
Yes, <application>MPlayer</application> can read (demux) RealMedia
(<filename>.rm</filename>) files.
</para>
</sect2>
<!-- ********** -->
<sect2 id="nuppelvideo">
<title>NuppelVideo files</title>
<para>
NuppelVideo
is a TV grabber tool (AFAIK:). <application>MPlayer</application> can read
its <filename>.NUV</filename> files (only NuppelVideo 5.0). Those files can
contain uncompressed YV12, YV12+RTJpeg compressed, YV12 RTJpeg+lzo
compressed, and YV12+lzo compressed frames.
<application>MPlayer</application> decodes (and also
<emphasis role="bold">encodes</emphasis>
them with <application>MEncoder</application> to MPEG-4 (DivX)/etc!) them all.
Seeking works.
</para>
</sect2>
<!-- ********** -->
<sect2 id="yuv4mpeg">
<title>yuv4mpeg files</title>
<para>
<ulink url="http://mjpeg.sf.net">yuv4mpeg / yuv4mpeg2</ulink>
is a file format used by the
<ulink url="http://mjpeg.sf.net">mjpegtools programs</ulink>.
You can grab, produce, filter or encode video in this format using these tools.
The file format is really a sequence of uncompressed YUV 4:2:0 images.
</para>
</sect2>
<!-- ********** -->
<sect2 id="film">
<title>FILM files</title>
<para>
This format is used on old Sega Saturn CD-ROM games.
</para>
</sect2>
<!-- ********** -->
<sect2 id="roq">
<title>RoQ files</title>
<para>
RoQ files are multimedia files used in some ID games such as Quake III and
Return to Castle Wolfenstein.
</para>
</sect2>
<!-- ********** -->
<sect2 id="ogg">
<title>OGG/OGM files</title>
<para>
This is a new file format from the
<ulink url="http://www.xiph.org">Xiph.Org Foundation</ulink>.
It can contain any video or audio codec, CBR or VBR. You'll need
<systemitem class="library">libogg</systemitem> and
<systemitem class="library">libvorbis</systemitem> installed before
compiling <application>MPlayer</application> to be able to play it.
</para>
</sect2>
<!-- ********** -->
<sect2 id="sdp">
<title>SDP files</title>
<para>
<ulink url="ftp://ftp.rfc-editor.org/in-notes/rfc2327.txt">SDP</ulink> is an
IETF standard format for describing video and/or audio RTP streams.
(The "<ulink url="http://www.live555.com/mplayer/">LIVE555 Streaming Media</ulink>"
are required.)
</para>
</sect2>
<!-- ********** -->
<sect2 id="pva">
<title>PVA files</title>
<para>
PVA is an MPEG-like format used by DVB TV boards' software (e.g.:
<application>MultiDec</application>,
<application>WinTV</application> under Windows).
</para>
</sect2>
<!-- ********** -->
<sect2 id="nsv">
<title>NSV files</title>
<para>
NSV (NullSoft Video) is the file format used by the
<application>Winamp</application> player to stream audio and video.
Video is VP3, VP5 or VP6, audio is MP3, AAC or VLB.
The audio only version of NSV has the <filename>.nsa</filename> extension.
<application>MPlayer</application> can play both NSV streams and files.
Please note that most files from the
<ulink url="http://www.winamp.com">Winamp site</ulink> use VLB audio, that
can't be decoded yet. Moreover streams from that site need an extra
depacketization layer that still has to be implemented (those files are
unplayable anyway because they use VLB audio).
</para>
</sect2>
<!-- ********** -->
<sect2 id="matroska">
<title>Matroska files</title>
<para>
Matroska is an open container format.
Read more on the <ulink url="http://www.matroska.org/">official site</ulink>.
</para>
</sect2>
<!-- ********** -->
<sect2 id="nut">
<title>NUT files</title>
<para>
NUT is the container format developed by <application>MPlayer</application> and
<application>FFmpeg</application> folks. Both projects support it.
Read more on the <ulink url="http://www.nut-container.org/">official
site</ulink>.
</para>
</sect2>
<!-- ********** -->
<sect2 id="gif">
<title>GIF files</title>
<para>
The <emphasis role="bold">GIF</emphasis> format is a common format for web
graphics. There are two versions of the GIF spec, GIF87a and GIF89a.
The main difference is that GIF89a allows for animation.
<application>MPlayer</application> supports both formats through use of
<systemitem class="library">libungif</systemitem> or
another libgif-compatible library. Non-animated GIFs will be displayed as
single frame videos. (Use the <option>-loop</option> and
<option>-fixed-vo</option> options to display these longer.)
</para>
<para>
<application>MPlayer</application> currently does not support seeking in GIF
files. GIF files do not necessarily have a fixed frame size, nor a fixed
framerate. Rather, each frame is of independent size and is supposed to be
positioned in a certain place on a field of fixed-size. The framerate is
controlled by an optional block before each frame that specifies the next
frame's delay in centiseconds.
</para>
<para>
Standard GIF files contain 24-bit RGB frames with at most an 8-bit indexed
palette. These frames are usually LZW-compressed, although some GIF encoders
produce uncompressed frames to avoid patent issues with LZW compression.
</para>
<para>
If your distribution does not come with
<systemitem class="library">libungif</systemitem>, download a copy from the
<ulink url="http://sourceforge.net/projects/libungif">libungif
homepage</ulink>. For detailed technical information, have a look at the
<ulink url="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF89a specification</ulink>.
</para>
</sect2>
</sect1>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<sect1 id="audio-formats">
<title>Audio formats</title>
<para>
<application>MPlayer</application> is a <emphasis role="bold">movie</emphasis>
and not a <emphasis role="bold">media</emphasis> player, although it can play
some audio file formats (they are listed in the sections below). This is not
a recommended usage of <application>MPlayer</application>, you better use <ulink
url="http://www.xmms.org">XMMS</ulink>.
</para>
<!-- ********** -->
<sect2 id="mp3">
<title>MP3 files</title>
<para>
You may have problems playing certain MP3 files that
<application>MPlayer</application> will misdetect as MPEGs and play
incorrectly or not at all. This cannot be fixed without dropping support
for certain broken MPEG files and thus will remain like this for the
foreseeable future. The <option>-demuxer</option> flag described in the
man page may help you in these cases.
</para>
</sect2>
<!-- ********** -->
<sect2 id="ogg-vorbis">
<title>OGG/OGM files (Vorbis)</title>
<para>
Requires properly installed
<systemitem class="library">libogg</systemitem> and
<systemitem class="library">libvorbis</systemitem>.
</para>
</sect2>
<!-- ********** -->
<sect2 id="cdda">
<title>CD audio</title>
<para>
<application>MPlayer</application> can use <application>cdparanoia</application>
to play CDDA (Audio CD). The scope of this section does not contain enumerating
<application>cdparanoia</application>'s features.
</para>
<para>
See the man page's <option>-cdda</option> option which can be used to pass
options to <application>cdparanoia</application>.
</para>
</sect2>
<!-- ********** -->
<sect2 id="xmms">
<title>XMMS</title>
<para>
<application>MPlayer</application> can use <application>XMMS</application> input
plugins to play many file formats. There are plugins for SNES game tunes, SID
tunes (from Commodore 64), many Amiga formats, .xm, .it, VQF, Musepack, Bonk,
shorten and many others. You can find them at the
<ulink url="http://www.xmms.org/plugins.php?category=input">XMMS input plugin page</ulink>.
</para>
<para>
For this feature you need to have <application>XMMS</application> and compile
<application>MPlayer</application> with
<filename>./configure --enable-xmms</filename>.
</para>
</sect2>
</sect1>
</chapter>

View File

@ -168,7 +168,6 @@ can be distributed under the terms of the GNU General Public License Version 2.
&cd-dvd.xml;
&faq.xml;
&containers.xml;
&codecs.xml;
&video.xml;
&audio.xml;

View File

@ -3815,7 +3815,7 @@ and development advancements, you may get very different results.
<systemitem class="library">x264</systemitem> is a free library for
encoding H.264/AVC video streams.
Before starting to encode, you need to
<link linkend="codec-x264-encode">set up <application>MEncoder</application> to support it</link>.
<link linkend="codec-x264">set up <application>MEncoder</application> to support it</link>.
</para>
<!-- ********** -->

View File

@ -110,11 +110,6 @@ Here are just a few tips:
images, the captured image will be actually later converted back into YV12 so
the only thing you achieve is a massive waste of CPU power.
</para></listitem>
<listitem><para>
To specify the I420 colorspace (<option>outfmt=i420</option>), you have to
add an option <option>-vc rawi420</option> due to a fourcc conflict with an
Intel Indeo video codec.
</para></listitem>
<listitem><para>
There are several ways of capturing audio. You can grab the sound either using
your sound card via an external cable connection between video card and

View File

@ -1549,19 +1549,14 @@ to enable driver autodetection.
Since VIDIX requires direct hardware access you can either run it as root
or set the SUID bit on the <application>MPlayer</application> binary
(<emphasis role="bold">Warning: This is a security risk!</emphasis>).
Alternatively, if you are running Linux kernel 2.4.x, you can use a
special kernel module, like this:
Alternatively, you can use a special kernel module, like this:
</para>
<procedure>
<step><para>
Download the
<ulink url="http://www.arava.co.il/matan/svgalib/">development version</ulink>
of svgalib (for example 1.9.17), <emphasis role="bold">OR</emphasis>
download a version made by Alex especially for usage with
<application>MPlayer</application> (it doesn't need the svgalib source to
compile) from
<ulink url="http://www.mplayerhq.hu/MPlayer/contrib/svgalib/svgalib_helper-1.9.17-mplayer.tar.bz2">here</ulink>.
of svgalib (1.9.x).
</para></step>
<step><para>
Compile the module in the
@ -1579,7 +1574,8 @@ special kernel module, like this:
<step><para>
Then run <filename>configure</filename> again and pass the parameter
<option>--enable-svgalib_helper</option> as well as
<option>--with-extraincdir=/path/to/svgalib_helper/sources</option>,
<option>--with-extraincdir=<replaceable>/path/to/svgalib_helper/sources/</replaceable>kernel/svgalib_helper</option>,
where <replaceable>/path/to/svgalib_helper/sources/</replaceable> has to be
adjusted to wherever you extracted svgalib_helper sources.
</para></step>
<step><para>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- synced with r27230 -->
<!-- synced with r27683 -->
<chapter id="faq" xreflabel="FAQ">
<title>Gyakran ismételt kérdések</title>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- synced with r26990 -->
<!-- synced with r27663 -->
<chapter id="install">
<title>Telepítés</title>
@ -177,11 +177,9 @@ Lásd a <link linkend="subosd">Feliratok és az OSD</link> részt bővebben.
<title>Mi a helyzet a GUI-val?</title>
<para>
A GUI-hoz GTK 1.2.x vagy GTK 2.0 kell (nem teljesen GTK-s, de a panelek igen).
A skinek sPNG formátumúak, így telepített GTK,
<systemitem class="library">libpng</systemitem> (és a fejlesztői cuccok, amik
általában <systemitem class="library">gtk-dev</systemitem>
és <systemitem class="library">libpng-dev</systemitem> néven futnak) szükséges.
A GUI-hoz GTK 1.2.x vagy GTK 2.0 kell (nem teljesen GTK-s, de a panelek igen),
így telepített <systemitem class="library">GTK</systemitem> (és a fejlesztői
cuccok, amik általában <systemitem class="library">gtk-dev</systemitem>) szükséges.
A <filename>./configure</filename>-nak az <option>--enable-gui</option> kapcsoló
megadásával írhatod elő, hogy GUI-t is készítsen. Ezután ha a GUI-s változatot
akarod futtatni, akkor a <command>gmplayer</command> binárist kell elindítanod.
@ -189,9 +187,9 @@ akarod futtatni, akkor a <command>gmplayer</command> binárist kell elindítanod
<para>
Mivel az <application>MPlayer</application> nem rendelkezik beépített skin-nel,
le kell töltened őket, ha a GUI-t használni akarod. Lásd a <ulink
le kell töltened egyet, ha a GUI-t használni akarod. Lásd a <ulink
url="http://www.mplayerhq.hu/dload.html">letöltési oldalt</ulink>.
Ajánlott egy rendszerszinten elérhető könyvtárba tenni őket (<filename
Ajánlott egy rendszerszinten elérhető könyvtárba tenni (<filename
class="directory">$PREFIX/share/mplayer/skins</filename>), vagy a <filename
class="directory">$HOME/.mplayer/skins</filename>-be.
Az <application>MPlayer</application> ezekben a könyvtárakban

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- synced with r26990 -->
<!-- synced with r27640 -->
<chapter id="mencoder">
<title>A <application>MEncoder</application> használatának alapjai</title>
@ -327,11 +327,11 @@ A név abból a tényből ered, hogy ez a módszer a fájlt
lépés) létrehoz pár ideiglenes, néhány megabájtos fájlt
(<filename>*.log</filename>), ezeket ne töröld le még (az AVI-t
letörölheted vagy egyszerűen létre sem hozod, a videó
<filename>/dev/null</filename> -ba irányításával). A második lépésben,
a két menetes kimenet fájl lesz létrehozva, az ideiglenes fájlok
bitrátájának felhasználásával. Az eredmény fájlnak sokkal jobb lesz a
képminősége. Ha most hallasz erről először, nézz meg pár a neten
elérhető leírást.
<filename>/dev/null</filename>-ba vagy Windows alatt a <filename>NUL</filename>-ba
irányításával). A második lépésben, a két menetes kimenet fájl lesz létrehozva,
az ideiglenes fájlok bitrátájának felhasználásával. Az eredmény fájlnak
sokkal jobb lesz a képminősége. Ha most hallasz erről először, nézz meg
pár a neten elérhető leírást.
</para>
<example id="copy_audio_track">

View File

@ -817,7 +817,7 @@ $(VIDIX_DEPS) $(VIDIX_OBJS): $(VIDIX_PCI_FILES)
install: $(INSTALL_TARGETS-yes)
install-dirs:
$(INSTALL) -d $(BINDIR) $(CONFDIR)
$(INSTALL) -d $(BINDIR) $(CONFDIR) $(LIBDIR)
install-%: %$(EXESUF) install-dirs
$(INSTALL) -m 755 $(INSTALLSTRIP) $< $(BINDIR)

17
README
View File

@ -42,6 +42,16 @@ section of our homepage at
http://www.mplayerhq.hu/dload.html
MPlayer has builtin support for the most common audio and video formats. For a
few formats no native decoder exists and external binary codecs are required
to handle them. Examples are newer RealVideo variants and a variety of rare
formats. However, binary codecs are NOT required in this day and age, they are
strictly optional.
Please note that binary codecs only work on the processor architecture they
were compiled for. Choose the correct package for your processor. No other
package is necessary.
The GUI needs at least one skin and codec packages add support for some more
video and audio formats. MPlayer does not come with any of these by default,
you have to download and install them separately.
@ -64,13 +74,6 @@ _______________________________
STEP1: Installing Binary Codecs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MPlayer has builtin support for the most common audio and video formats. For a
few formats no native decoder exists and external binary codecs are required
to handle them, for example newer RealVideo variants and a variety of uncommon
formats. This step is not mandatory, but recommended for getting MPlayer to
play a broader range of formats. Please note that binary codecs only work on
the processor architecture they were compiled for.
Unpack the codecs archives and put the contents in a directory where MPlayer
will find them. The default directory is /usr/local/lib/codecs/ (it used to be
/usr/local/lib/win32 in the past, this also works) but you can change that to

View File

@ -86,7 +86,7 @@ static unsigned int GetTimer(){
static inline unsigned long long int read_tsc( void )
{
unsigned long long int retval;
__asm __volatile ("rdtsc":"=A"(retval)::"memory");
__asm__ volatile ("rdtsc":"=A"(retval)::"memory");
return retval;
}

View File

@ -44,7 +44,7 @@
#include "mpbswap.h"
/// Netstream packets def and some helpers
#include "stream/netstream.h"
#include "stream/stream_netstream.h"
// linking hacks
char *info_name;
@ -59,11 +59,6 @@ char* out_filename = NULL;
char* force_fourcc=NULL;
char* passtmpfile="divx2pass.log";
#ifdef __MINGW32__
#define usleep sleep
void strsep() {};
#endif
static unsigned short int port = 10000;
typedef struct client_st client_t;

View File

@ -5,11 +5,12 @@
{"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL},
{"msglevel", (void *) msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
{"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
{"nomsgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
{"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
#ifdef CONFIG_ICONV
{"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
#endif
#ifdef WIN32
#if defined(__MINGW32__) || defined(__CYGWIN__)
{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
#endif
{"noconfig", (void *) noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},

View File

@ -342,9 +342,7 @@ const m_option_t msgl_config[]={
};
extern char * proc_priority;
#ifdef WIN32
#if defined(__MINGW32__) || defined(__CYGWIN__)
struct {
char* name;
int prio;
@ -361,7 +359,7 @@ struct {
{ "idle", IDLE_PRIORITY_CLASS},
{ NULL, NORMAL_PRIORITY_CLASS} /* default */
};
#endif /* WIN32 */
#endif /* defined(__MINGW32__) || defined(__CYGWIN__) */
extern const m_option_t noconfig_opts[];

1338
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ CpuCaps gCpuCaps;
#include <signal.h>
#endif
#ifdef WIN32
#if defined(__MINGW32__) || defined(__CYGWIN__)
#include <windows.h>
#endif
@ -57,7 +57,7 @@ static int has_cpuid(void)
long a, c;
// code from libavcodec:
__asm__ __volatile__ (
__asm__ volatile (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
"pushf\n\t"
@ -85,14 +85,14 @@ static void
do_cpuid(unsigned int ax, unsigned int *p)
{
#if 0
__asm __volatile(
__asm__ volatile(
"cpuid;"
: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
: "0" (ax)
);
#else
// code from libavcodec:
__asm __volatile
__asm__ volatile
("mov %%"REG_b", %%"REG_S"\n\t"
"cpuid\n\t"
"xchg %%"REG_b", %%"REG_S
@ -314,7 +314,7 @@ static void sigill_handler_sse( int signal, struct sigcontext sc )
}
#endif /* __linux__ && _POSIX_SOURCE */
#ifdef WIN32
#if defined(__MINGW32__) || defined(__CYGWIN__)
LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
{
if(ep->ExceptionRecord->ExceptionCode==EXCEPTION_ILLEGAL_INSTRUCTION){
@ -325,7 +325,7 @@ LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
}
return EXCEPTION_CONTINUE_SEARCH;
}
#endif /* WIN32 */
#endif /* defined(__MINGW32__) || defined(__CYGWIN__) */
#ifdef __OS2__
ULONG _System os2_sig_handler_sse( PEXCEPTIONREPORTRECORD p1,
@ -395,12 +395,12 @@ static void check_os_katmai_support( void )
gCpuCaps.hasSSE = 0;
mp_msg(MSGT_CPUDETECT,MSGL_WARN, "No OS support for SSE, disabling to be safe.\n" );
#endif
#elif defined(WIN32)
#elif defined(__MINGW32__) || defined(__CYGWIN__)
LPTOP_LEVEL_EXCEPTION_FILTER exc_fil;
if ( gCpuCaps.hasSSE ) {
mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
exc_fil = SetUnhandledExceptionFilter(win32_sig_handler_sse);
__asm __volatile ("xorps %xmm0, %xmm0");
__asm__ volatile ("xorps %xmm0, %xmm0");
SetUnhandledExceptionFilter(exc_fil);
mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
}
@ -409,7 +409,7 @@ static void check_os_katmai_support( void )
if ( gCpuCaps.hasSSE ) {
mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
DosSetExceptionHandler( &RegRec );
__asm __volatile ("xorps %xmm0, %xmm0");
__asm__ volatile ("xorps %xmm0, %xmm0");
DosUnsetExceptionHandler( &RegRec );
mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
}
@ -432,8 +432,8 @@ static void check_os_katmai_support( void )
if ( gCpuCaps.hasSSE ) {
mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
// __asm __volatile ("xorps %%xmm0, %%xmm0");
__asm __volatile ("xorps %xmm0, %xmm0");
// __asm__ volatile ("xorps %%xmm0, %%xmm0");
__asm__ volatile ("xorps %xmm0, %xmm0");
mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
}
@ -532,7 +532,7 @@ void GetCpuCaps( CpuCaps *caps)
} else {
canjump = 1;
asm volatile ("mtspr 256, %0\n\t"
__asm__ volatile ("mtspr 256, %0\n\t"
"vand %%v0, %%v0, %%v0"
:
: "r" (-1));

View File

@ -8,7 +8,7 @@
#include <string.h>
#include <unistd.h>
#if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION <= 3) && (__MINGW32_MINOR_VERSION < 10)
#if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION <= 3) && (__MINGW32_MINOR_VERSION < 10) && !defined(MINGW64)
#include <sys/timeb.h>
void gettimeofday(struct timeval* t,void* timezone) {
struct timeb timebuffer;
@ -49,9 +49,9 @@ cpuid(int func) {
cpuid_regs_t regs;
#define CPUID ".byte 0x0f, 0xa2; "
#ifdef __x86_64__
asm("mov %%rbx, %%rsi\n\t"
__asm__("mov %%rbx, %%rsi\n\t"
#else
asm("mov %%ebx, %%esi\n\t"
__asm__("mov %%ebx, %%esi\n\t"
#endif
CPUID"\n\t"
#ifdef __x86_64__
@ -70,7 +70,7 @@ rdtsc(void)
{
uint64_t i;
#define RDTSC ".byte 0x0f, 0x31; "
asm volatile (RDTSC : "=A"(i) : );
__asm__ volatile (RDTSC : "=A"(i) : );
return i;
}

View File

@ -129,7 +129,7 @@ static int swap_fourcc __initdata = 0;
static inline double FastSin(double x)
{
register double res;
__asm __volatile("fsin":"=t"(res):"0"(x));
__asm__ volatile("fsin":"=t"(res):"0"(x));
return res;
}
#undef sin
@ -138,7 +138,7 @@ static inline double FastSin(double x)
static inline double FastCos(double x)
{
register double res;
__asm __volatile("fcos":"=t"(res):"0"(x));
__asm__ volatile("fcos":"=t"(res):"0"(x));
return res;
}
#undef cos

View File

@ -18,13 +18,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#endif
#ifdef WIN32
#elif __MINGW32__
#include <windows.h>
#endif
#ifdef __OS2__
#elif __CYGWIN__
#include <windows.h>
#include <sys/cygwin.h>
#elif __OS2__
#define INCL_DOS
#include <os2.h>
#endif
@ -140,7 +139,7 @@ char *get_path(const char *filename){
return buff;
}
#if defined(WIN32) && defined(CONFIG_WIN32DLL)
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
void set_path_env()
{
/*make our codec dirs available for LoadLibraryA()*/
@ -176,4 +175,4 @@ void set_path_env()
if (!SetEnvironmentVariableA("PATH", tmppath))
mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!");
}
#endif /*WIN32 && CONFIG_WIN32DLL*/
#endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */

View File

@ -2,7 +2,7 @@
// Updated by: Roberto Togni <see AUTHORS for email address>
// Updated by: PaulTT <see AUTHORS for email address>
// Updated to help_mp-en.h r27071
// Updated to help_mp-en.h r27402
// ========================= MPlayer help ===========================
@ -1092,6 +1092,11 @@ static char help_text[]=
// audio_out.c
#define MSGTR_AO_ALSA9_1x_Removed "audio_out: i moduli alsa9/alsa1x sono stati rimossi, ora usa -ao alsa.\n"
#define MSGTR_AO_TryingPreferredAudioDriver "Provo con il driver audio preferito '%.*s', opzioni '%s'\n"
#define MSGTR_AO_NoSuchDriver "driver audio '%.*s' non trovato\n"
#define MSGTR_AO_FailedInit "Inizializzazione del driver audio '%s' non riuscita\n"
#define MSGTR_AO_TryingEveryKnown "Provo con tutti i driver audio conosciuti...\n"
// ao_oss.c
#define MSGTR_AO_OSS_CantOpenMixer "[AO OSS] audio_setup: Non posso aprire il dispositivo mixer %s: %s\n"

View File

@ -689,7 +689,7 @@ void upmix_C (sample_t * samples, int acmod, int output)
#if defined(ARCH_X86) || defined(ARCH_X86_64)
static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %2, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -712,7 +712,7 @@ static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
static void mix3to1_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -733,7 +733,7 @@ static void mix3to1_SSE (sample_t * samples, sample_t bias)
static void mix4to1_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -755,7 +755,7 @@ static void mix4to1_SSE (sample_t * samples, sample_t bias)
static void mix5to1_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -778,7 +778,7 @@ static void mix5to1_SSE (sample_t * samples, sample_t bias)
static void mix3to2_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -801,7 +801,7 @@ static void mix3to2_SSE (sample_t * samples, sample_t bias)
static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %2, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -824,7 +824,7 @@ static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias)
static void mix21toS_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -848,7 +848,7 @@ static void mix21toS_SSE (sample_t * samples, sample_t bias)
static void mix31to2_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -872,7 +872,7 @@ static void mix31to2_SSE (sample_t * samples, sample_t bias)
static void mix31toS_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -898,7 +898,7 @@ static void mix31toS_SSE (sample_t * samples, sample_t bias)
static void mix22toS_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -923,7 +923,7 @@ static void mix22toS_SSE (sample_t * samples, sample_t bias)
static void mix32to2_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -947,7 +947,7 @@ static void mix32to2_SSE (sample_t * samples, sample_t bias)
static void mix32toS_SSE (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -974,7 +974,7 @@ static void mix32toS_SSE (sample_t * samples, sample_t bias)
static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movlps %2, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -997,7 +997,7 @@ static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias)
static void zero_MMX(sample_t * samples)
{
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"pxor %%mm0, %%mm0 \n\t"
ASMALIGN(4)
@ -1223,7 +1223,7 @@ static void upmix_MMX (sample_t * samples, int acmod, int output)
static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %2, %%mm7 \n\t"
"punpckldq %2, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1254,7 +1254,7 @@ static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias)
static void mix3to1_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1281,7 +1281,7 @@ static void mix3to1_3dnow (sample_t * samples, sample_t bias)
static void mix4to1_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1310,7 +1310,7 @@ static void mix4to1_3dnow (sample_t * samples, sample_t bias)
static void mix5to1_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1341,7 +1341,7 @@ static void mix5to1_3dnow (sample_t * samples, sample_t bias)
static void mix3to2_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1372,7 +1372,7 @@ static void mix3to2_3dnow (sample_t * samples, sample_t bias)
static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %2, %%mm7 \n\t"
"punpckldq %2, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1403,7 +1403,7 @@ static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias)
static void mix21toS_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1436,7 +1436,7 @@ static void mix21toS_3dnow (sample_t * samples, sample_t bias)
static void mix31to2_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1469,7 +1469,7 @@ static void mix31to2_3dnow (sample_t * samples, sample_t bias)
static void mix31toS_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1506,7 +1506,7 @@ static void mix31toS_3dnow (sample_t * samples, sample_t bias)
static void mix22toS_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1541,7 +1541,7 @@ static void mix22toS_3dnow (sample_t * samples, sample_t bias)
static void mix32to2_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1575,7 +1575,7 @@ static void mix32to2_3dnow (sample_t * samples, sample_t bias)
/* todo: should be optimized better */
static void mix32toS_3dnow (sample_t * samples, sample_t bias)
{
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -1614,7 +1614,7 @@ static void mix32toS_3dnow (sample_t * samples, sample_t bias)
static void move2to1_3dnow (sample_t * src, sample_t * dest, sample_t bias)
{
asm volatile(
__asm__ volatile(
"movd %2, %%mm7 \n\t"
"punpckldq %2, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@ -1782,7 +1782,7 @@ static void downmix_3dnow (sample_t * samples, int acmod, int output, sample_t b
memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
break;
}
__asm __volatile("femms":::"memory");
__asm__ volatile("femms":::"memory");
}
#endif // ARCH_X86 || ARCH_X86_64

View File

@ -750,7 +750,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* Pre IFFT complex multiply plus IFFT cmplx conjugate */
/* Bit reversed shuffling */
asm volatile(
__asm__ volatile(
"xor %%"REG_S", %%"REG_S" \n\t"
"lea "MANGLE(bit_reverse_512)", %%"REG_a"\n\t"
"mov $1008, %%"REG_D" \n\t"
@ -810,7 +810,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* 1. iteration */
// Note w[0][0]={1,0}
asm volatile(
__asm__ volatile(
"xorps %%xmm1, %%xmm1 \n\t"
"xorps %%xmm2, %%xmm2 \n\t"
"mov %0, %%"REG_S" \n\t"
@ -832,7 +832,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* 2. iteration */
// Note w[1]={{1,0}, {0,-1}}
asm volatile(
__asm__ volatile(
"movaps "MANGLE(ps111_1)", %%xmm7\n\t" // 1,1,1,-1
"mov %0, %%"REG_S" \n\t"
ASMALIGN(4)
@ -860,7 +860,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
Note sseW2+32={0,0,-sqrt(2),-sqrt(2))
Note sseW2+48={1,-1,sqrt(2),-sqrt(2))
*/
asm volatile(
__asm__ volatile(
"movaps 48+"MANGLE(sseW2)", %%xmm6\n\t"
"movaps 16+"MANGLE(sseW2)", %%xmm7\n\t"
"xorps %%xmm5, %%xmm5 \n\t"
@ -905,7 +905,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
two_m_plus_one = two_m<<1;
two_m_plus_one_shl3 = (two_m_plus_one<<3);
buf_offset = buf+128;
asm volatile(
__asm__ volatile(
"mov %0, %%"REG_S" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -937,7 +937,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
}
/* Post IFFT complex multiply plus IFFT complex conjugate*/
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -960,7 +960,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
window_ptr = a52_imdct_window;
/* Window and convert to real valued signal */
asm volatile(
__asm__ volatile(
"xor %%"REG_D", %%"REG_D" \n\t" // 0
"xor %%"REG_S", %%"REG_S" \n\t" // 0
"movss %3, %%xmm2 \n\t" // bias
@ -987,7 +987,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
delay_ptr+=128;
// window_ptr+=128;
asm volatile(
__asm__ volatile(
"mov $1024, %%"REG_D" \n\t" // 512
"xor %%"REG_S", %%"REG_S" \n\t" // 0
"movss %3, %%xmm2 \n\t" // bias
@ -1016,7 +1016,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* The trailing edge of the window goes into the delay line */
delay_ptr = delay;
asm volatile(
__asm__ volatile(
"xor %%"REG_D", %%"REG_D" \n\t" // 0
"xor %%"REG_S", %%"REG_S" \n\t" // 0
ASMALIGN(4)
@ -1038,7 +1038,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
delay_ptr+=128;
// window_ptr-=128;
asm volatile(
__asm__ volatile(
"mov $1024, %%"REG_D" \n\t" // 1024
"xor %%"REG_S", %%"REG_S" \n\t" // 0
ASMALIGN(4)

View File

@ -45,7 +45,7 @@ static void FFT_4_3DNOW(complex_t *x)
/* delta_p = 1 here */
/* x[k] = sum_{i=0..3} x[i] * w^{i*k}, w=e^{-2*pi/4}
*/
__asm__ __volatile__(
__asm__ volatile(
"movq 24(%1), %%mm3\n\t"
"movq 8(%1), %%mm1\n\t"
"pxor %2, %%mm3\n\t" /* mm3.re | -mm3.im */
@ -90,7 +90,7 @@ static void FFT_8_3DNOW(complex_t *x)
*/
complex_t wT1, wB1, wB2;
__asm__ __volatile__(
__asm__ volatile(
"movq 8(%2), %%mm0\n\t"
"movq 24(%2), %%mm1\n\t"
"movq %%mm0, %0\n\t" /* wT1 = x[1]; */
@ -99,7 +99,7 @@ static void FFT_8_3DNOW(complex_t *x)
:"r"(x)
:"memory");
__asm__ __volatile__(
__asm__ volatile(
"movq 16(%0), %%mm2\n\t"
"movq 32(%0), %%mm3\n\t"
"movq %%mm2, 8(%0)\n\t" /* x[1] = x[2]; */
@ -114,7 +114,7 @@ static void FFT_8_3DNOW(complex_t *x)
/* x[0] x[4] x[2] x[6] */
__asm__ __volatile__(
__asm__ volatile(
"movq 40(%1), %%mm0\n\t"
"movq %%mm0, %%mm3\n\t"
"movq 56(%1), %%mm1\n\t"
@ -153,7 +153,7 @@ static void FFT_8_3DNOW(complex_t *x)
:"memory");
/* x[1] x[5] */
__asm__ __volatile__ (
__asm__ volatile (
"movq %6, %%mm6\n\t"
"movq %5, %%mm7\n\t"
"movq %1, %%mm0\n\t"
@ -203,7 +203,7 @@ static void FFT_8_3DNOW(complex_t *x)
/* x[3] x[7] */
__asm__ __volatile__(
__asm__ volatile(
"movq %1, %%mm0\n\t"
#ifdef HAVE_3DNOWEX
"pswapd %3, %%mm1\n\t"
@ -358,13 +358,13 @@ imdct_do_512_3dnow
/* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/
#if 1
__asm__ __volatile__ (
__asm__ volatile (
"movq %0, %%mm7\n\t"
::"m"(x_plus_minus_3dnow)
:"memory");
for( i=0; i < 128; i++) {
int j = pm128[i];
__asm__ __volatile__ (
__asm__ volatile (
"movd %1, %%mm0\n\t"
"movd %3, %%mm1\n\t"
"punpckldq %2, %%mm0\n\t" /* mm0 = data[256-2*j-1] | data[2*j]*/
@ -394,7 +394,7 @@ imdct_do_512_3dnow
buf[i].im = (data[256-2*j-1] * xsin1[j] + data[2*j] * xcos1[j])*(-1.0);*/
}
#else
__asm__ __volatile__ ("femms":::"memory");
__asm__ volatile ("femms":::"memory");
for( i=0; i < 128; i++) {
/* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */
int j= pm128[i];
@ -431,18 +431,18 @@ imdct_do_512_3dnow
*/
FFT_128P_3DNOW (&buf[0]);
// asm volatile ("femms \n\t":::"memory");
// __asm__ volatile ("femms \n\t":::"memory");
/* Post IFFT complex multiply plus IFFT complex conjugate*/
#if 1
__asm__ __volatile__ (
__asm__ volatile (
"movq %0, %%mm7\n\t"
"movq %1, %%mm6\n\t"
::"m"(x_plus_minus_3dnow),
"m"(x_minus_plus_3dnow)
:"eax","memory");
for (i=0; i < 128; i++) {
__asm__ __volatile__ (
__asm__ volatile (
"movq %1, %%mm0\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
"movq %%mm0, %%mm1\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
#ifndef HAVE_3DNOWEX
@ -473,7 +473,7 @@ imdct_do_512_3dnow
ac3_buf[i].im =(tmp_a_r * ac3_xsin1[i]) - (tmp_a_i * ac3_xcos1[i]);*/
}
#else
__asm__ __volatile__ ("femms":::"memory");
__asm__ volatile ("femms":::"memory");
for( i=0; i < 128; i++) {
/* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
tmp_a_r = buf[i].real;
@ -489,14 +489,14 @@ imdct_do_512_3dnow
/* Window and convert to real valued signal */
#if 1
asm volatile (
__asm__ volatile (
"movd (%0), %%mm3 \n\t"
"punpckldq %%mm3, %%mm3 \n\t"
:: "r" (&bias)
);
for (i=0; i< 64; i++) {
/* merge two loops in one to enable working of 2 decoders */
__asm__ __volatile__ (
__asm__ volatile (
"movd 516(%1), %%mm0\n\t"
"movd (%1), %%mm1\n\t" /**data_ptr++=-buf[64+i].im**window_ptr+++*delay_ptr++;*/
"punpckldq (%2), %%mm0\n\t"/*data_ptr[128]=-buf[i].re*window_ptr[128]+delay_ptr[128];*/
@ -520,7 +520,7 @@ imdct_do_512_3dnow
}
window_ptr += 128;
#else
__asm__ __volatile__ ("femms":::"memory");
__asm__ volatile ("femms":::"memory");
for(i=0; i< 64; i++) {
*data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias;
*data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias;
@ -538,7 +538,7 @@ imdct_do_512_3dnow
for(i=0; i< 64; i++) {
/* merge two loops in one to enable working of 2 decoders */
window_ptr -=2;
__asm__ __volatile__(
__asm__ volatile(
"movd 508(%1), %%mm0\n\t"
"movd (%1), %%mm1\n\t"
"punpckldq (%2), %%mm0\n\t"
@ -565,9 +565,9 @@ imdct_do_512_3dnow
:"memory");
delay_ptr += 2;
}
__asm__ __volatile__ ("femms":::"memory");
__asm__ volatile ("femms":::"memory");
#else
__asm__ __volatile__ ("femms":::"memory");
__asm__ volatile ("femms":::"memory");
for(i=0; i< 64; i++) {
*delay_ptr++ = -buf[64+i].real * *--window_ptr;
*delay_ptr++ = buf[64-i-1].imag * *--window_ptr;

View File

@ -1,6 +1,6 @@
--- include/a52.h 2006-06-12 15:04:57.000000000 +0200
+++ liba52/a52.h 2006-06-05 02:23:02.000000000 +0200
@@ -59,4 +63,9 @@
@@ -63,4 +63,9 @@
int a52_block (a52_state_t * state);
void a52_free (a52_state_t * state);
@ -12,7 +12,7 @@
#endif /* A52_H */
--- liba52/a52_internal.h 2006-06-12 15:05:07.000000000 +0200
+++ liba52/a52_internal.h 2006-06-05 02:23:02.000000000 +0200
@@ -103,18 +107,34 @@
@@ -107,18 +107,34 @@
#define DELTA_BIT_NONE (2)
#define DELTA_BIT_RESERVED (3)
@ -52,7 +52,7 @@
+void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias);
--- liba52/bitstream.c 2006-06-12 15:05:07.000000000 +0200
+++ liba52/bitstream.c 2006-06-05 02:23:02.000000000 +0200
@@ -31,6 +35,10 @@
@@ -35,6 +35,10 @@
#define BUFFER_SIZE 4096
@ -63,7 +63,7 @@
void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf)
{
int align;
@@ -38,6 +46,9 @@
@@ -42,6 +46,9 @@
align = (long)buf & 3;
state->buffer_start = (uint32_t *) (buf - align);
state->bits_left = 0;
@ -75,7 +75,7 @@
--- liba52/bitstream.h 2006-06-12 15:05:07.000000000 +0200
+++ liba52/bitstream.h 2006-06-05 02:23:02.000000000 +0200
@@ -21,6 +25,42 @@
@@ -25,6 +25,42 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@ -118,7 +118,7 @@
/* (stolen from the kernel) */
#ifdef WORDS_BIGENDIAN
@@ -28,7 +74,7 @@
@@ -32,7 +74,7 @@
#else
@ -127,7 +127,7 @@
# define swab32(x) __i386_swab32(x)
static inline const uint32_t __i386_swab32(uint32_t x)
@@ -39,19 +85,34 @@
@@ -43,19 +85,34 @@
# else
@ -166,7 +166,7 @@
uint32_t result;
if (num_bits < state->bits_left) {
@@ -61,10 +122,29 @@
@@ -65,10 +122,29 @@
}
return a52_bitstream_get_bh (state, num_bits);
@ -196,7 +196,7 @@
int32_t result;
if (num_bits < state->bits_left) {
@@ -74,4 +154,5 @@
@@ -78,4 +154,5 @@
}
return a52_bitstream_get_bh_2 (state, num_bits);
@ -204,7 +204,7 @@
}
--- liba52/downmix.c 2006-06-12 15:17:53.000000000 +0200
+++ liba52/downmix.c 2006-06-05 02:23:02.000000000 +0200
@@ -19,18 +23,46 @@
@@ -23,18 +23,46 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@ -251,7 +251,7 @@
int a52_downmix_init (int input, int flags, sample_t * level,
sample_t clev, sample_t slev)
{
@@ -447,7 +479,7 @@
@@ -451,7 +479,7 @@
samples[i] = 0;
}
@ -260,7 +260,7 @@
sample_t clev, sample_t slev)
{
switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
@@ -559,7 +591,7 @@
@@ -563,7 +591,7 @@
break;
case CONVERT (A52_3F2R, A52_2F1R):
@ -269,7 +269,7 @@
move2to1 (samples + 768, samples + 512, bias);
break;
@@ -583,12 +615,12 @@
@@ -587,12 +615,12 @@
break;
case CONVERT (A52_3F1R, A52_3F2R):
@ -284,7 +284,7 @@
{
switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
@@ -653,3 +685,1104 @@
@@ -657,3 +685,1104 @@
goto mix_31to21;
}
}
@ -292,7 +292,7 @@
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %2, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -315,7 +315,7 @@
+
+static void mix3to1_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -336,7 +336,7 @@
+
+static void mix4to1_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -358,7 +358,7 @@
+
+static void mix5to1_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -381,7 +381,7 @@
+
+static void mix3to2_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -404,7 +404,7 @@
+
+static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %2, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -427,7 +427,7 @@
+
+static void mix21toS_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -451,7 +451,7 @@
+
+static void mix31to2_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -475,7 +475,7 @@
+
+static void mix31toS_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -501,7 +501,7 @@
+
+static void mix22toS_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -526,7 +526,7 @@
+
+static void mix32to2_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -550,7 +550,7 @@
+
+static void mix32toS_SSE (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -577,7 +577,7 @@
+
+static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movlps %2, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -600,7 +600,7 @@
+
+static void zero_MMX(sample_t * samples)
+{
+ asm volatile(
+ __asm__ volatile(
+ "mov $-1024, %%"REG_S" \n\t"
+ "pxor %%mm0, %%mm0 \n\t"
+ ASMALIGN(4)
@ -826,7 +826,7 @@
+
+static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %2, %%mm7 \n\t"
+ "punpckldq %2, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -857,7 +857,7 @@
+
+static void mix3to1_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -884,7 +884,7 @@
+
+static void mix4to1_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -913,7 +913,7 @@
+
+static void mix5to1_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -944,7 +944,7 @@
+
+static void mix3to2_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -975,7 +975,7 @@
+
+static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %2, %%mm7 \n\t"
+ "punpckldq %2, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -1006,7 +1006,7 @@
+
+static void mix21toS_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -1039,7 +1039,7 @@
+
+static void mix31to2_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -1072,7 +1072,7 @@
+
+static void mix31toS_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -1109,7 +1109,7 @@
+
+static void mix22toS_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -1144,7 +1144,7 @@
+
+static void mix32to2_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -1178,7 +1178,7 @@
+/* todo: should be optimized better */
+static void mix32toS_3dnow (sample_t * samples, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "mov $-1024, %%"REG_S" \n\t"
+ ASMALIGN(4)
+ "1: \n\t"
@ -1217,7 +1217,7 @@
+
+static void move2to1_3dnow (sample_t * src, sample_t * dest, sample_t bias)
+{
+ asm volatile(
+ __asm__ volatile(
+ "movd %2, %%mm7 \n\t"
+ "punpckldq %2, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@ -1385,13 +1385,13 @@
+ memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
+ break;
+ }
+ __asm __volatile("femms":::"memory");
+ __asm__ volatile("femms":::"memory");
+}
+
+#endif // ARCH_X86 || ARCH_X86_64
--- liba52/imdct.c 2008-02-19 00:18:33.000000000 +0100
+++ liba52/imdct.c 2008-02-19 00:16:40.000000000 +0100
@@ -22,6 +26,11 @@
@@ -26,6 +26,11 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@ -1403,7 +1403,7 @@
*/
#include "config.h"
@@ -39,12 +48,49 @@
@@ -43,12 +48,49 @@
#include "a52.h"
#include "a52_internal.h"
#include "mm_accel.h"
@ -1453,7 +1453,7 @@
static uint8_t fftorder[] = {
0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176,
8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88,
@@ -56,6 +102,40 @@
@@ -60,6 +102,40 @@
6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86
};
@ -1494,7 +1494,7 @@
/* Root values for IFFT */
static sample_t roots16[3];
static sample_t roots32[7];
@@ -241,7 +321,7 @@
@@ -245,7 +321,7 @@
ifft_pass (buf, roots128 - 32, 32);
}
@ -1503,7 +1503,7 @@
{
int i, k;
sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2;
@@ -285,6 +365,701 @@
@@ -289,6 +365,701 @@
}
}
@ -1892,7 +1892,7 @@
+
+ /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
+ /* Bit reversed shuffling */
+ asm volatile(
+ __asm__ volatile(
+ "xor %%"REG_S", %%"REG_S" \n\t"
+ "lea "MANGLE(bit_reverse_512)", %%"REG_a"\n\t"
+ "mov $1008, %%"REG_D" \n\t"
@ -1952,7 +1952,7 @@
+
+ /* 1. iteration */
+ // Note w[0][0]={1,0}
+ asm volatile(
+ __asm__ volatile(
+ "xorps %%xmm1, %%xmm1 \n\t"
+ "xorps %%xmm2, %%xmm2 \n\t"
+ "mov %0, %%"REG_S" \n\t"
@ -1974,7 +1974,7 @@
+
+ /* 2. iteration */
+ // Note w[1]={{1,0}, {0,-1}}
+ asm volatile(
+ __asm__ volatile(
+ "movaps "MANGLE(ps111_1)", %%xmm7\n\t" // 1,1,1,-1
+ "mov %0, %%"REG_S" \n\t"
+ ASMALIGN(4)
@ -2002,7 +2002,7 @@
+ Note sseW2+32={0,0,-sqrt(2),-sqrt(2))
+ Note sseW2+48={1,-1,sqrt(2),-sqrt(2))
+*/
+ asm volatile(
+ __asm__ volatile(
+ "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t"
+ "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t"
+ "xorps %%xmm5, %%xmm5 \n\t"
@ -2047,7 +2047,7 @@
+ two_m_plus_one = two_m<<1;
+ two_m_plus_one_shl3 = (two_m_plus_one<<3);
+ buf_offset = buf+128;
+ asm volatile(
+ __asm__ volatile(
+ "mov %0, %%"REG_S" \n\t"
+ ASMALIGN(4)
+ "1: \n\t"
@ -2079,7 +2079,7 @@
+ }
+
+ /* Post IFFT complex multiply plus IFFT complex conjugate*/
+ asm volatile(
+ __asm__ volatile(
+ "mov $-1024, %%"REG_S" \n\t"
+ ASMALIGN(4)
+ "1: \n\t"
@ -2102,7 +2102,7 @@
+ window_ptr = a52_imdct_window;
+
+ /* Window and convert to real valued signal */
+ asm volatile(
+ __asm__ volatile(
+ "xor %%"REG_D", %%"REG_D" \n\t" // 0
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ "movss %3, %%xmm2 \n\t" // bias
@ -2129,7 +2129,7 @@
+ delay_ptr+=128;
+// window_ptr+=128;
+
+ asm volatile(
+ __asm__ volatile(
+ "mov $1024, %%"REG_D" \n\t" // 512
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ "movss %3, %%xmm2 \n\t" // bias
@ -2158,7 +2158,7 @@
+ /* The trailing edge of the window goes into the delay line */
+ delay_ptr = delay;
+
+ asm volatile(
+ __asm__ volatile(
+ "xor %%"REG_D", %%"REG_D" \n\t" // 0
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ ASMALIGN(4)
@ -2180,7 +2180,7 @@
+ delay_ptr+=128;
+// window_ptr-=128;
+
+ asm volatile(
+ __asm__ volatile(
+ "mov $1024, %%"REG_D" \n\t" // 1024
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ ASMALIGN(4)
@ -2205,7 +2205,7 @@
void a52_imdct_256(sample_t * data, sample_t * delay, sample_t bias)
{
int i, k;
@@ -364,7 +1145,7 @@
@@ -368,7 +1145,7 @@
void a52_imdct_init (uint32_t mm_accel)
{
@ -2214,7 +2214,7 @@
double sum;
/* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */
@@ -416,6 +1197,99 @@
@@ -420,6 +1197,99 @@
post2[i].real = cos ((M_PI / 128) * (i + 0.5));
post2[i].imag = sin ((M_PI / 128) * (i + 0.5));
}
@ -2314,7 +2314,7 @@
#ifdef LIBA52_DJBFFT
if (mm_accel & MM_ACCEL_DJBFFT) {
@@ -426,7 +1300,5 @@
@@ -430,7 +1300,5 @@
#endif
{
fprintf (stderr, "No accelerated IMDCT transform found\n");
@ -2324,7 +2324,7 @@
}
--- include/mm_accel.h 2006-06-12 15:05:00.000000000 +0200
+++ liba52/mm_accel.h 2006-06-05 02:23:04.000000000 +0200
@@ -30,7 +34,12 @@
@@ -34,7 +34,12 @@
/* x86 accelerations */
#define MM_ACCEL_X86_MMX 0x80000000
#define MM_ACCEL_X86_3DNOW 0x40000000

View File

@ -38,7 +38,7 @@ static uint64_t attribute_used __attribute__((aligned(8))) wm1100= 0xFFFFFFFF000
static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-512, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"movq "MANGLE(wm1100)", %%mm3 \n\t"
@ -77,7 +77,7 @@ static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
/* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it
#ifdef HAVE_SSE
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"1: \n\t"
"cvtps2pi (%1, %%"REG_S"), %%mm0\n\t"
@ -93,7 +93,7 @@ static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
:: "r" (s16+512), "r" (f+256)
:"%"REG_S, "memory"
);*/
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"1: \n\t"
@ -123,7 +123,7 @@ static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
static int a52_resample_3F_to_5_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"pxor %%mm6, %%mm6 \n\t"
@ -177,7 +177,7 @@ static int a52_resample_3F_to_5_MMX(float * _f, int16_t * s16){
static int a52_resample_2F_2R_to_4_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"1: \n\t"
@ -228,7 +228,7 @@ static int a52_resample_2F_2R_to_4_MMX(float * _f, int16_t * s16){
static int a52_resample_3F_2R_to_5_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"1: \n\t"
@ -287,7 +287,7 @@ static int a52_resample_3F_2R_to_5_MMX(float * _f, int16_t * s16){
static int a52_resample_MONO_LFE_to_6_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"pxor %%mm6, %%mm6 \n\t"
@ -327,7 +327,7 @@ static int a52_resample_MONO_LFE_to_6_MMX(float * _f, int16_t * s16){
static int a52_resample_STEREO_LFE_to_6_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"pxor %%mm6, %%mm6 \n\t"
@ -365,7 +365,7 @@ static int a52_resample_STEREO_LFE_to_6_MMX(float * _f, int16_t * s16){
static int a52_resample_3F_LFE_to_6_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"pxor %%mm6, %%mm6 \n\t"
@ -405,7 +405,7 @@ static int a52_resample_3F_LFE_to_6_MMX(float * _f, int16_t * s16){
static int a52_resample_2F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
// "pxor %%mm6, %%mm6 \n\t"
@ -451,7 +451,7 @@ static int a52_resample_2F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){
static int a52_resample_3F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
asm volatile(
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
// "pxor %%mm6, %%mm6 \n\t"

View File

@ -39,7 +39,7 @@ typedef struct
}i_cmplx_t;
#define TRANS_FILL_MM6_MM7_3DNOW()\
__asm__ __volatile__(\
__asm__ volatile(\
"movq %1, %%mm7\n\t"\
"movq %0, %%mm6\n\t"\
::"m"(x_plus_minus_3dnow),\
@ -66,7 +66,7 @@ typedef struct
#define TRANSZERO_3DNOW(A0,A4,A8,A12) \
{ \
__asm__ __volatile__(\
__asm__ volatile(\
"movq %4, %%mm0\n\t" /* mm0 = wTB[0]*/\
"movq %5, %%mm1\n\t" /* mm1 = wTB[k*2]*/ \
"movq %%mm0, %%mm5\n\t"/*u.re = wTB[0].re + wTB[k*2].re;*/\
@ -95,7 +95,7 @@ typedef struct
#define TRANSHALF_16_3DNOW(A2,A6,A10,A14)\
{\
__asm__ __volatile__(\
__asm__ volatile(\
"movq %4, %%mm0\n\t"/*u.re = wTB[2].im + wTB[2].re;*/\
"movq %%mm0, %%mm1\n\t"\
"pxor %%mm7, %%mm1\n\t"\
@ -136,7 +136,7 @@ typedef struct
#define TRANS_3DNOW(A1,A5,A9,A13,WT,WB,D,D3)\
{ \
__asm__ __volatile__(\
__asm__ volatile(\
"movq %1, %%mm4\n\t"\
"movq %%mm4, %%mm5\n\t"\
"punpckldq %%mm4, %%mm4\n\t"/*mm4 = D.re | D.re */\
@ -166,7 +166,7 @@ typedef struct
:\
:"m"(WT), "m"(D), "m"(WB), "m"(D3)\
:"memory");\
__asm__ __volatile__(\
__asm__ volatile(\
"movq %4, %%mm0\n\t"/* a1 = A1*/\
"movq %5, %%mm2\n\t"/* a1 = A5*/\
"movq %%mm0, %%mm1\n\t"\

View File

@ -46,7 +46,7 @@ void mp_msg( int x, const char *format, ... ) // stub for cpudetect.c
static inline long long rdtsc()
{
long long l;
asm volatile( "rdtsc\n\t"
__asm__ volatile("rdtsc\n\t"
: "=A" (l)
);
// printf("%d\n", int(l/1000));

View File

@ -296,16 +296,15 @@ static void* mydlopen(const char *filename, int flag) {
size_t filenamelen;
void *result = NULL;
# ifdef WIN32 /* for windows there's only absolute path support.
* if you have a windows machine, feel free to fix
* this. (path separator, shared objects extension,
* et cetera).
*/
#if defined(__MINGW32__) || defined(__CYGWIN__)
/* For Windows there's only absolute path support.
* If you have a Windows machine, feel free to fix this.
* (path separator, shared objects extension, et cetera). */
af_msg(AF_MSG_VERBOSE, "\ton windows, only absolute pathnames "
"are supported\n");
af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", filename);
return dlopen(filename, flag);
# endif
#endif
filenamelen = strlen(filename);

View File

@ -1109,6 +1109,7 @@ static int channel_layout_mapping_5ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = {
AF_CHANNEL_LAYOUT_LAVC_LIBA52_5CH_DEFAULT,
AF_CHANNEL_LAYOUT_LAVC_DCA_5CH_DEFAULT,
AF_CHANNEL_LAYOUT_VORBIS_5CH_DEFAULT,
AF_CHANNEL_LAYOUT_FLAC_5CH_DEFAULT,
};
static int channel_layout_mapping_6ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = {
@ -1119,6 +1120,7 @@ static int channel_layout_mapping_6ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = {
AF_CHANNEL_LAYOUT_LAVC_LIBA52_6CH_DEFAULT,
AF_CHANNEL_LAYOUT_LAVC_DCA_6CH_DEFAULT,
AF_CHANNEL_LAYOUT_VORBIS_6CH_DEFAULT,
AF_CHANNEL_LAYOUT_FLAC_6CH_DEFAULT,
};
void reorder_channel_copy_nch(void *src,

View File

@ -73,6 +73,8 @@
#define AF_CHANNEL_LAYOUT_LAVC_DCA_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_D
#define AF_CHANNEL_LAYOUT_VORBIS_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_C
#define AF_CHANNEL_LAYOUT_VORBIS_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_C
#define AF_CHANNEL_LAYOUT_FLAC_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_A
#define AF_CHANNEL_LAYOUT_FLAC_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_A
#define AF_CHANNEL_MASK 0xFF
#define AF_GET_CH_NUM(A) ((A)&0x7F)
@ -105,7 +107,8 @@ void reorder_channel(void *buf,
#define AF_CHANNEL_LAYOUT_LAVC_LIBA52_DEFAULT 4
#define AF_CHANNEL_LAYOUT_LAVC_DCA_DEFAULT 5
#define AF_CHANNEL_LAYOUT_VORBIS_DEFAULT 6
#define AF_CHANNEL_LAYOUT_SOURCE_NUM 7
#define AF_CHANNEL_LAYOUT_FLAC_DEFAULT 7
#define AF_CHANNEL_LAYOUT_SOURCE_NUM 8
#define AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT AF_CHANNEL_LAYOUT_ALSA_DEFAULT
/// Optimized channel reorder between different audio sources and targets.

View File

@ -192,7 +192,7 @@ static int control(int cmd, void *arg)
set_vol = vol->left / f_multi + pmin + 0.5;
//setting channels
if ((err = snd_mixer_selem_set_playback_volume(elem, 0, set_vol)) < 0) {
if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, set_vol)) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingLeftChannel,
snd_strerror(err));
return CONTROL_ERROR;
@ -201,7 +201,7 @@ static int control(int cmd, void *arg)
set_vol = vol->right / f_multi + pmin + 0.5;
if ((err = snd_mixer_selem_set_playback_volume(elem, 1, set_vol)) < 0) {
if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, set_vol)) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingRightChannel,
snd_strerror(err));
return CONTROL_ERROR;
@ -221,9 +221,9 @@ static int control(int cmd, void *arg)
}
}
else {
snd_mixer_selem_get_playback_volume(elem, 0, &get_vol);
snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, &get_vol);
vol->left = (get_vol - pmin) * f_multi;
snd_mixer_selem_get_playback_volume(elem, 1, &get_vol);
snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, &get_vol);
vol->right = (get_vol - pmin) * f_multi;
mp_msg(MSGT_AO,MSGL_DBG2,"left=%f, right=%f\n",vol->left,vol->right);
@ -707,7 +707,7 @@ static int init(int rate_hz, int channels, int format, int flags)
/* end setting sw-params */
mp_msg(MSGT_AO,MSGL_V,"alsa: %d Hz/%d channels/%d bpf/%d bytes buffer/%s\n",
ao_data.samplerate, ao_data.channels, bytes_per_sample, ao_data.buffersize,
ao_data.samplerate, ao_data.channels, (int)bytes_per_sample, ao_data.buffersize,
snd_pcm_format_description(alsa_format));
} // end switch alsa_handler (spdif)
@ -765,6 +765,10 @@ static void audio_resume(void)
{
int err;
if (snd_pcm_state(alsa_handler) == SND_PCM_STATE_SUSPENDED) {
mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_PcmInSuspendModeTryingResume);
while ((err = snd_pcm_resume(alsa_handler)) == -EAGAIN) sleep(1);
}
if (alsa_can_pause) {
if ((err = snd_pcm_pause(alsa_handler, 0)) < 0)
{

View File

@ -52,7 +52,7 @@ LIBAO_EXTERN(sdl)
#undef USE_SDL_INTERNAL_MIXER
// Samplesize used by the SDLlib AudioSpec struct
#if defined(WIN32) || defined(__AMIGAOS4__)
#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__AMIGAOS4__)
#define SAMPLESIZE 2048
#else
#define SAMPLESIZE 1024

View File

@ -438,7 +438,7 @@ dvd_reader_t *DVDOpen( const char *path )
verbose = get_verbose();
#ifdef WIN32
#if defined(__CYGWIN__) || defined(__MINGW32__)
/* Stat doesn't work on devices under mingwin/cygwin. */
if( path[0] && path[1] == ':' && path[2] == '\0' )
{
@ -495,7 +495,8 @@ dvd_reader_t *DVDOpen( const char *path )
/* XXX: We should scream real loud here. */
if( !(path_copy = strdup( path ) ) ) return 0;
#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
/* don't have fchdir, and getcwd( NULL, ... ) is strange */
#if !(defined(__CYGWIN__) || defined(__MINGW32__))
/* Resolve any symlinks and get the absolut dir name. */
{
char *new_path;

View File

@ -42,6 +42,15 @@
/* Loop over all titles and call dvdcss_title to crack the keys. */
static int initAllCSSKeys( dvd_reader_t *dvd )
{
@@ -438,7 +438,7 @@
verbose = get_verbose();
-#ifdef WIN32
+#if defined(__CYGWIN__) || defined(__MINGW32__)
/* Stat doesn't work on devices under mingwin/cygwin. */
if( path[0] && path[1] == ':' && path[2] == '\0' )
{
@@ -494,7 +488,7 @@
char *path_copy;
#if defined(SYS_BSD)
@ -51,7 +60,17 @@
FILE *mntfile;
#endif
@@ -598,7 +592,7 @@
@@ -495,7 +495,8 @@
/* XXX: We should scream real loud here. */
if( !(path_copy = strdup( path ) ) ) return 0;
-#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
+/* don't have fchdir, and getcwd( NULL, ... ) is strange */
+#if !(defined(__CYGWIN__) || defined(__MINGW32__))
/* Resolve any symlinks and get the absolut dir name. */
{
char *new_path;
@@ -597,7 +592,7 @@
}
fclose( mntfile );
}
@ -512,3 +531,7 @@
uint16_t next_pgc_nr;
uint16_t prev_pgc_nr;
uint16_t goup_pgc_nr;
Index: libdvdread/dvd_reader.c
===================================================================
--- libdvdread/dvd_reader.c (revision 27759)
+++ libdvdread/dvd_reader.c (working copy)

View File

@ -33,7 +33,7 @@ static struct vf_priv_s* st_priv = NULL;
static mp_image_t* pause_mpi = NULL;
static int go2pause = 0;
/// if nonzero display menu at startup
int attribute_used menu_startup = 0;
int menu_startup = 0;
struct vf_priv_s {
menu_t* root;

View File

@ -177,6 +177,8 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m
src_ch_layout = AF_CHANNEL_LAYOUT_LAVC_LIBA52_DEFAULT;
else if (!strcasecmp(codec, "vorbis"))
src_ch_layout = AF_CHANNEL_LAYOUT_VORBIS_DEFAULT;
else if (!strcasecmp(codec, "flac"))
src_ch_layout = AF_CHANNEL_LAYOUT_FLAC_DEFAULT;
else
src_ch_layout = AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT;
reorder_channel_nch(buf, src_ch_layout,

View File

@ -138,7 +138,7 @@ static int init_vqf_audio_codec(sh_audio_t *sh_audio){
priv->framesize=TvqGetFrameSize();
sh_audio->audio_in_minsize=priv->framesize*in_fmt->nChannels;
sh_audio->a_in_buffer_size=4*sh_audio->audio_in_minsize;
sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
sh_audio->a_in_buffer=av_malloc(sh_audio->a_in_buffer_size);
sh_audio->a_in_buffer_len=0;

View File

@ -74,8 +74,7 @@ static int init_audio_codec(sh_audio_t *sh_audio)
sh_audio->a_in_buffer_size = sh_audio->audio_in_minsize;
mp_msg(MSGT_DECAUDIO, MSGL_V, MSGTR_AllocatingBytesForInputBuffer,
sh_audio->a_in_buffer_size);
sh_audio->a_in_buffer = memalign(16, sh_audio->a_in_buffer_size);
memset(sh_audio->a_in_buffer, 0, sh_audio->a_in_buffer_size);
sh_audio->a_in_buffer = av_mallocz(sh_audio->a_in_buffer_size);
sh_audio->a_in_buffer_len = 0;
}
@ -84,12 +83,11 @@ static int init_audio_codec(sh_audio_t *sh_audio)
mp_msg(MSGT_DECAUDIO, MSGL_V, MSGTR_AllocatingBytesForOutputBuffer,
sh_audio->audio_out_minsize, MAX_OUTBURST, sh_audio->a_buffer_size);
sh_audio->a_buffer = memalign(16, sh_audio->a_buffer_size);
sh_audio->a_buffer = av_mallocz(sh_audio->a_buffer_size);
if (!sh_audio->a_buffer) {
mp_msg(MSGT_DECAUDIO, MSGL_ERR, MSGTR_CantAllocAudioBuf);
return 0;
}
memset(sh_audio->a_buffer, 0, sh_audio->a_buffer_size);
sh_audio->a_buffer_len = 0;
if (!sh_audio->ad_driver->init(sh_audio)) {
@ -306,12 +304,8 @@ void uninit_audio(sh_audio_t *sh_audio)
free(sh_audio->a_out_buffer);
sh_audio->a_out_buffer = NULL;
sh_audio->a_out_buffer_size = 0;
if (sh_audio->a_buffer)
free(sh_audio->a_buffer);
sh_audio->a_buffer = NULL;
if (sh_audio->a_in_buffer)
free(sh_audio->a_in_buffer);
sh_audio->a_in_buffer = NULL;
av_freep(&sh_audio->a_buffer);
av_freep(&sh_audio->a_in_buffer);
}

View File

@ -414,9 +414,9 @@ void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size,
// some codecs are broken, and doesn't restore MMX state :(
// it happens usually with broken/damaged files.
if (gCpuCaps.has3DNow) {
__asm __volatile("femms\n\t":::"memory");
__asm__ volatile("femms\n\t":::"memory");
} else if (gCpuCaps.hasMMX) {
__asm __volatile("emms\n\t":::"memory");
__asm__ volatile("emms\n\t":::"memory");
}
#endif

View File

@ -57,24 +57,24 @@ typedef union {
#define mmx_i2r(op,imm,reg) \
__asm__ __volatile__ (#op " %0, %%" #reg \
__asm__ volatile (#op " %0, %%" #reg \
: /* nothing */ \
: "i" (imm) )
#define mmx_m2r(op, mem, reg) \
__asm__ __volatile__ (#op " %0, %%" #reg \
__asm__ volatile (#op " %0, %%" #reg \
: /* nothing */ \
: "m" (mem))
#define mmx_r2m(op, reg, mem) \
__asm__ __volatile__ (#op " %%" #reg ", %0" \
__asm__ volatile (#op " %%" #reg ", %0" \
: "=m" (mem) \
: /* nothing */ )
#define mmx_r2r(op, regs, regd) \
__asm__ __volatile__ (#op " %" #regs ", %" #regd)
__asm__ volatile (#op " %" #regs ", %" #regd)
#define emms() __asm__ __volatile__ ("emms")
#define emms() __asm__ volatile ("emms")
#endif /* MPLAYER_MMX_H */

View File

@ -14,7 +14,7 @@
static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
{
int ret;
asm volatile (
__asm__ volatile (
"movl $4, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"
@ -61,7 +61,7 @@ static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
static int licomb_y_mmx(unsigned char *a, unsigned char *b, int s)
{
int ret;
asm volatile (
__asm__ volatile (
"movl $4, %%ecx \n\t"
"pxor %%mm6, %%mm6 \n\t"
"pxor %%mm7, %%mm7 \n\t"
@ -150,7 +150,7 @@ static int licomb_y_mmx(unsigned char *a, unsigned char *b, int s)
static int var_y_mmx(unsigned char *a, unsigned char *b, int s)
{
int ret;
asm volatile (
__asm__ volatile (
"movl $3, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"

View File

@ -103,6 +103,9 @@ const vd_functions_t * const mpcodecs_vd_drivers[] = {
#include "libvo/video_out.h"
#define SCREEN_SIZE_X 1
#define SCREEN_SIZE_Y 1
int mpcodecs_config_vo(sh_video_t *sh, int w, int h,
unsigned int preferred_outfmt)
{

View File

@ -83,9 +83,7 @@ static int init(sh_video_t *sh){
#elif ARCH_ARM
accel |= MPEG2_ACCEL_ARM;
#endif
#ifdef HAVE_IWMMXT
accel |= MPEG2_ACCEL_ARM_IWMMXT;
#elif HAVE_MVI
#ifdef HAVE_MVI
accel |= MPEG2_ACCEL_ALPHA_MVI;
#elif HAVE_VIS
accel |= MPEG2_ACCEL_SPARC_VIS;

View File

@ -109,7 +109,7 @@ static int get_int2(unsigned char *buf) {
static unsigned int guess_mjpeg_type(unsigned char *data, unsigned int size,
int d_height) {
unsigned int p;
int marker, length, height, ncomps, i, hf[3], vf[3];
int marker, length, height, i, hf[3], vf[3];
unsigned int app0 = 0, header = 0;
/* The initial marker must be SIO */

View File

@ -23,7 +23,7 @@ struct vf_priv_s {
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
{
volatile short out[4];
asm (
__asm__ (
"movl $8, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"

View File

@ -37,7 +37,7 @@ struct vf_priv_s
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
{
volatile short out[4];
asm (
__asm__ (
"movl $8, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t"
"pxor %%mm7, %%mm7 \n\t"
@ -128,7 +128,7 @@ static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
unsigned int shift;
uint32_t sum, t;
unsigned char *e, *e2;
#if MP_WORDSIZE==64
#if __WORDSIZE==64
typedef uint64_t wsum_t;
#else
typedef uint32_t wsum_t;
@ -143,7 +143,7 @@ static unsigned int checksum_plane(unsigned char *p, unsigned char *z,
for(wsum=0, e2=e-sizeof(wsum_t)+1; p<e2; p+=sizeof(wsum_t))
wsum^=*(wsum_t *)p;
#if MP_WORDSIZE==64
#if __WORDSIZE==64
t=be2me_32((uint32_t)(wsum>>32^wsum));
#else
t=be2me_32(wsum);

View File

@ -44,7 +44,7 @@ static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, in
contvec[0] = contvec[1] = contvec[2] = contvec[3] = contrast;
while (h--) {
asm volatile (
__asm__ volatile (
"movq (%5), %%mm3 \n\t"
"movq (%6), %%mm4 \n\t"
"pxor %%mm0, %%mm0 \n\t"
@ -82,7 +82,7 @@ static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, in
src += sstep;
dest += dstep;
}
asm volatile ( "emms \n\t" ::: "memory" );
__asm__ volatile ( "emms \n\t" ::: "memory" );
}
#endif

View File

@ -130,7 +130,7 @@ void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
dstep = dstride - w;
while (h-- > 0) {
asm volatile (
__asm__ volatile (
"movq (%5), %%mm3 \n\t"
"movq (%6), %%mm4 \n\t"
"pxor %%mm0, %%mm0 \n\t"
@ -170,7 +170,7 @@ void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
dst += dstep;
}
asm volatile ( "emms \n\t" ::: "memory" );
__asm__ volatile ( "emms \n\t" ::: "memory" );
}
#endif

View File

@ -366,13 +366,13 @@ block_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs,
#define MEQ(X,Y) ((X).even == (Y).even && (X).odd == (Y).odd && (X).temp == (Y).temp && (X).noise == (Y).noise)
#define BLOCK_METRICS_TEMPLATE() \
asm volatile("pxor %mm7, %mm7\n\t" /* The result is colleted in mm7 */ \
__asm__ volatile("pxor %mm7, %mm7\n\t" /* The result is colleted in mm7 */ \
"pxor %mm6, %mm6\n\t" /* Temp to stay at 0 */ \
); \
a -= as; \
b -= bs; \
do { \
asm volatile( \
__asm__ volatile( \
"movq (%0,%2), %%mm0\n\t" \
"movq (%1,%3), %%mm1\n\t" /* mm1 = even */ \
PSADBW(%%mm1, %%mm0, %%mm4, %%mm6) \
@ -437,7 +437,7 @@ block_metrics_3dnow(unsigned char *a, unsigned char *b, int as, int bs,
static const unsigned long long ones = 0x0101010101010101ull;
BLOCK_METRICS_TEMPLATE();
asm volatile("movq %%mm7, %0\n\temms" : "=m" (tm));
__asm__ volatile("movq %%mm7, %0\n\temms" : "=m" (tm));
get_block_stats(&tm, p, s);
#endif
return tm;
@ -469,7 +469,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
#ifdef DEBUG
struct frame_stats ts = *s;
#endif
asm volatile("prefetcht0 (%0,%2)\n\t"
__asm__ volatile("prefetcht0 (%0,%2)\n\t"
"prefetcht0 (%1,%3)\n\t" :
: "r" (a), "r" (b),
"r" (prefetch_line * as), "r" (prefetch_line * bs));
@ -477,7 +477,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
BLOCK_METRICS_TEMPLATE();
s->num_blocks++;
asm volatile(
__asm__ volatile(
"movq %3, %%mm0\n\t"
"movq %%mm7, %%mm1\n\t"
"psubusw %%mm0, %%mm1\n\t"
@ -523,7 +523,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
s->interlaced_high += interlaced >> 16;
s->interlaced_low += interlaced;
} else {
asm volatile(
__asm__ volatile(
"pcmpeqw %%mm0, %%mm0\n\t" /* -1 */
"psubw %%mm0, %%mm4\n\t"
"psubw %%mm0, %%mm5\n\t"
@ -537,7 +537,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
: "=m" (s->tiny), "=m" (s->low), "=m" (s->high)
);
asm volatile(
__asm__ volatile(
"pshufw $0, %2, %%mm0\n\t"
"psubusw %%mm7, %%mm0\n\t"
"pcmpeqw %%mm6, %%mm0\n\t" /* 0 if below sad_thres */
@ -554,7 +554,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
);
}
asm volatile(
__asm__ volatile(
"movq %%mm7, (%1)\n\t"
PMAXUW((%0), %%mm7)
"movq %%mm7, (%0)\n\t"
@ -595,7 +595,7 @@ dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
#else
unsigned long len = (w+7) >> 3;
int ret;
asm volatile (
__asm__ volatile (
"pxor %%mm6, %%mm6 \n\t" /* deinterlaced pixel counter */
"movd %0, %%mm7 \n\t"
"punpcklbw %%mm7, %%mm7 \n\t"
@ -605,7 +605,7 @@ dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
: "rm" (t)
);
do {
asm volatile (
__asm__ volatile (
"movq (%0), %%mm0\n\t"
"movq (%0,%3,2), %%mm1\n\t"
"movq %%mm0, (%2)\n\t"
@ -637,7 +637,7 @@ dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
dst += 8;
} while (--len);
asm volatile ("pxor %%mm7, %%mm7 \n\t"
__asm__ volatile ("pxor %%mm7, %%mm7 \n\t"
"psadbw %%mm6, %%mm7 \n\t"
"movd %%mm7, %0 \n\t"
"emms \n\t"

View File

@ -187,7 +187,7 @@ static void store_slice_mmx(uint8_t *dst, int16_t *src, long dst_stride, long sr
width = (width+7)&~7;
dst_stride-=width;
//src_stride=(src_stride-width)*2;
asm volatile(
__asm__ volatile(
"mov %5, %%"REG_d" \n\t"
"mov %6, %%"REG_S" \n\t"
"mov %7, %%"REG_D" \n\t"
@ -255,7 +255,7 @@ static void store_slice2_mmx(uint8_t *dst, int16_t *src, long dst_stride, long s
width = (width+7)&~7;
dst_stride-=width;
//src_stride=(src_stride-width)*2;
asm volatile(
__asm__ volatile(
"mov %5, %%"REG_d" \n\t"
"mov %6, %%"REG_S" \n\t"
"mov %7, %%"REG_D" \n\t"
@ -318,7 +318,7 @@ static void store_slice2_mmx(uint8_t *dst, int16_t *src, long dst_stride, long s
static void mul_thrmat_mmx(struct vf_priv_s *p, int q)
{
uint64_t *adr=&p->threshold_mtx_noq[0];
asm volatile(
__asm__ volatile(
"movd %0, %%mm7 \n\t"
"add $8*8*2, %%"REG_D" \n\t"
"movq 0*8(%%"REG_S"), %%mm0 \n\t"
@ -558,10 +558,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
}
#ifdef HAVE_MMX
if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);
}
@ -868,7 +868,7 @@ static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int
static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt)
{
uint64_t __attribute__((aligned(8))) temps[4];
asm volatile(
__asm__ volatile(
ASMALIGN(4)
"1: \n\t"
"movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
@ -1669,7 +1669,7 @@ static void row_idct_mmx (DCTELEM* workspace,
int16_t* output_adr, int output_stride, int cnt)
{
uint64_t __attribute__((aligned(8))) temps[4];
asm volatile(
__asm__ volatile(
"lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
"1: \n\t"
"movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm0 \n\t"
@ -1935,7 +1935,7 @@ static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int
static void row_fdct_mmx(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt)
{
uint64_t __attribute__((aligned(8))) temps[4];
asm volatile(
__asm__ volatile(
"lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
"6: \n\t"
"movd (%%"REG_S"), %%mm0 \n\t"

View File

@ -33,7 +33,6 @@
#include "mp_image.h"
#include "vf.h"
#define HAVE_AV_CONFIG_H
#include "libavcodec/avcodec.h"
#include "libavcodec/eval.h"

View File

@ -37,7 +37,7 @@ static void halfpack_MMX(unsigned char *dst, unsigned char *src[3],
vinc = srcstride[2] - w/2;
for (h/=2; h; h--) {
asm (
__asm__ (
"pxor %%mm0, %%mm0 \n\t"
ASMALIGN(4)
"1: \n\t"
@ -99,7 +99,7 @@ static void halfpack_MMX(unsigned char *dst, unsigned char *src[3],
v += vinc;
dst += dstinc;
}
asm volatile ( "emms \n\t" ::: "memory" );
__asm__ volatile ( "emms \n\t" ::: "memory" );
}
#endif

View File

@ -61,7 +61,7 @@ static void pack_li_1_C(unsigned char *dst, unsigned char *y,
static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w)
{
asm volatile (""
__asm__ volatile (""
ASMALIGN(4)
"1: \n\t"
"movq (%0), %%mm1 \n\t"
@ -91,7 +91,7 @@ static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w, int us, int vs)
{
asm volatile (""
__asm__ volatile (""
"push %%"REG_BP" \n\t"
#ifdef ARCH_X86_64
"mov %6, %%"REG_BP" \n\t"
@ -199,7 +199,7 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w, int us, int vs)
{
asm volatile (""
__asm__ volatile (""
"push %%"REG_BP" \n\t"
#ifdef ARCH_X86_64
"mov %6, %%"REG_BP" \n\t"

View File

@ -46,7 +46,7 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
int i;
short out[24]; // output buffer for the partial metrics from the mmx code
asm (
__asm__ (
"movl $4, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t" // 4 even difference sums
"pxor %%mm5, %%mm5 \n\t" // 4 odd difference sums
@ -105,7 +105,7 @@ static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char
m->o = out[4]+out[5]+out[6]+out[7];
m->d = m->e + m->o;
asm (
__asm__ (
// First loop to measure first four columns
"movl $4, %%ecx \n\t"
"pxor %%mm4, %%mm4 \n\t" // Past spacial noise

View File

@ -150,7 +150,7 @@ static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int
long mmx_len= len&(~7);
noise+=shift;
asm volatile(
__asm__ volatile(
"mov %3, %%"REG_a" \n\t"
"pcmpeqb %%mm7, %%mm7 \n\t"
"psllw $15, %%mm7 \n\t"
@ -179,7 +179,7 @@ static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int
long mmx_len= len&(~7);
noise+=shift;
asm volatile(
__asm__ volatile(
"mov %3, %%"REG_a" \n\t"
"pcmpeqb %%mm7, %%mm7 \n\t"
"psllw $15, %%mm7 \n\t"
@ -220,7 +220,7 @@ static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int le
static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
long mmx_len= len&(~7);
asm volatile(
__asm__ volatile(
"mov %5, %%"REG_a" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -357,10 +357,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
vf_clone_mpi_attributes(dmpi, mpi);
#ifdef HAVE_MMX
if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);

View File

@ -108,15 +108,15 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
break;
case 24:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
palette8topacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
palette8torgb24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
palette8topacked24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
break;
case 32:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
palette8topacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
else
palette8torgb32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
palette8topacked32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);
break;
}
} else {
@ -139,15 +139,15 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
break;
case 24:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr24(src,dst,mpi->w,mpi->planes[1]);
palette8topacked24(src,dst,mpi->w,mpi->planes[1]);
else
palette8torgb24(src,dst,mpi->w,mpi->planes[1]);
palette8topacked24(src,dst,mpi->w,mpi->planes[1]);
break;
case 32:
if (IMGFMT_IS_BGR(dmpi->imgfmt))
palette8tobgr32(src,dst,mpi->w,mpi->planes[1]);
palette8topacked32(src,dst,mpi->w,mpi->planes[1]);
else
palette8torgb32(src,dst,mpi->w,mpi->planes[1]);
palette8topacked32(src,dst,mpi->w,mpi->planes[1]);
break;
}
}

View File

@ -157,7 +157,7 @@ static void dctB_c(DCTELEM *dst, DCTELEM *src){
#ifdef HAVE_MMX
static void dctB_mmx(DCTELEM *dst, DCTELEM *src){
asm volatile (
__asm__ volatile (
"movq (%0), %%mm0 \n\t"
"movq 1*4*2(%0), %%mm1 \n\t"
"paddw 6*4*2(%0), %%mm0 \n\t"
@ -398,10 +398,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
}
#ifdef HAVE_MMX
if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);

View File

@ -33,8 +33,6 @@
#include "vf.h"
#include "libvo/fastmemcpy.h"
// Needed to bring in lrintf.
#define HAVE_AV_CONFIG_H
#include "libavcodec/avcodec.h"
#include "libavcodec/eval.h"

View File

@ -140,7 +140,7 @@ static int config(struct vf_instance* vf,
unsigned int flags, unsigned int outfmt){
int sw, sh;
//asm volatile("emms\n\t");
//__asm__ volatile("emms\n\t");
allocStuff(&vf->priv->luma, width, height);
getSubSampleFactors(&sw, &sh, outfmt);

View File

@ -557,7 +557,7 @@ void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, Sw
#ifdef ARCH_X86
if(gCpuCaps.hasMMX)
asm volatile("emms\n\t"::: "memory"); //FIXME this shouldnt be required but it IS (even for non mmx versions)
__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
#endif
if(firstTime)
{

View File

@ -153,7 +153,7 @@ static void hardthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *pe
threshold1= qp*((1<<4) - bias) - 1;
asm volatile(
__asm__ volatile(
#define REQUANT_CORE(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \
"movq " #src0 ", %%mm0 \n\t"\
"movq " #src1 ", %%mm1 \n\t"\
@ -221,7 +221,7 @@ static void softthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *pe
threshold1= qp*((1<<4) - bias) - 1;
asm volatile(
__asm__ volatile(
#undef REQUANT_CORE
#define REQUANT_CORE(dst0, dst1, dst2, dst3, src0, src1, src2, src3) \
"movq " #src0 ", %%mm0 \n\t"\
@ -334,7 +334,7 @@ static void store_slice_mmx(uint8_t *dst, int16_t *src, int dst_stride, int src_
for(y=0; y<height; y++){
uint8_t *dst1= dst;
int16_t *src1= src;
asm volatile(
__asm__ volatile(
"movq (%3), %%mm3 \n\t"
"movq (%3), %%mm4 \n\t"
"movd %4, %%mm2 \n\t"
@ -500,10 +500,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
}
#ifdef HAVE_MMX
if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);

View File

@ -59,7 +59,7 @@ static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int
s += ss;
}
for (i=h-1; i; i--) {
asm volatile(
__asm__ volatile(
"1: \n\t"
"movq (%%"REG_S"), %%mm0 \n\t"
"movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t"
@ -79,7 +79,7 @@ static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int
s += ss;
}
if (!up) fast_memcpy(d, s, w);
asm volatile("emms \n\t" : : : "memory");
__asm__ volatile("emms \n\t" : : : "memory");
}
#endif
@ -95,7 +95,7 @@ static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int d
s += ss;
}
for (i=h-1; i; i--) {
asm volatile(
__asm__ volatile(
"pxor %%mm7, %%mm7 \n\t"
"2: \n\t"
"movq (%%"REG_S"), %%mm0 \n\t"
@ -116,7 +116,7 @@ static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int d
s += ss;
}
if (!up) fast_memcpy(d, s, w);
asm volatile("emms \n\t" : : : "memory");
__asm__ volatile("emms \n\t" : : : "memory");
}
#endif
@ -132,7 +132,7 @@ static void qpel_li_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds
s += ss;
}
for (i=h-1; i; i--) {
asm volatile(
__asm__ volatile(
"pxor %%mm7, %%mm7 \n\t"
"3: \n\t"
"movq (%%"REG_S"), %%mm0 \n\t"
@ -166,7 +166,7 @@ static void qpel_li_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds
s += ss;
}
if (!up) fast_memcpy(d, s, w);
asm volatile("emms \n\t" : : : "memory");
__asm__ volatile("emms \n\t" : : : "memory");
}
static void qpel_4tap_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
@ -186,7 +186,7 @@ static void qpel_4tap_MMX(unsigned char *d, unsigned char *s, int w, int h, int
d[j] = (s[j+ssd] + 3*s[j])>>2;
d += ds; s += ss;
for (i=h-3; i; i--) {
asm volatile(
__asm__ volatile(
"pxor %%mm0, %%mm0 \n\t"
"movq (%%"REG_d"), %%mm4 \n\t"
"movq 8(%%"REG_d"), %%mm5 \n\t"
@ -246,7 +246,7 @@ static void qpel_4tap_MMX(unsigned char *d, unsigned char *s, int w, int h, int
d[j] = (s[j+ssd] + 3*s[j])>>2;
d += ds; s += ss;
if (!up) fast_memcpy(d, s, w);
asm volatile("emms \n\t" : : : "memory");
__asm__ volatile("emms \n\t" : : : "memory");
}
#endif

View File

@ -194,11 +194,11 @@ static int put_image( struct vf_instance* vf, mp_image_t *mpi, double pts) {
#ifdef HAVE_MMX
if(gCpuCaps.hasMMX)
asm volatile ("emms\n\t");
__asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
if(gCpuCaps.hasMMX2)
asm volatile ("sfence\n\t");
__asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image( vf, dmpi, pts);

View File

@ -292,10 +292,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
}
#ifdef HAVE_MMX
if(gCpuCaps.hasMMX) asm volatile ("emms\n\t");
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
#ifdef HAVE_MMX2
if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t");
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);

View File

@ -143,7 +143,7 @@ static void filter_line_mmx2(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, u
#define FILTER\
for(x=0; x<w; x+=4){\
asm volatile(\
__asm__ volatile(\
"pxor %%mm7, %%mm7 \n\t"\
LOAD4("(%[cur],%[mrefs])", %%mm0) /* c = cur[x-refs] */\
LOAD4("(%[cur],%[prefs])", %%mm1) /* e = cur[x+refs] */\
@ -260,7 +260,7 @@ static void filter_line_mmx2(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, u
[pb1] "m"(pb_1),\
[mode] "g"(mode)\
);\
asm volatile("movd %%mm1, %0" :"=m"(*dst));\
__asm__ volatile("movd %%mm1, %0" :"=m"(*dst));\
dst += 4;\
prev+= 4;\
cur += 4;\
@ -371,7 +371,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst[3], int dst_stride[3], int
}
}
#if defined(HAVE_MMX) && defined(NAMED_ASM_ARGS)
if(gCpuCaps.hasMMX2) asm volatile("emms \n\t" : : : "memory");
if(gCpuCaps.hasMMX2) __asm__ volatile("emms \n\t" : : : "memory");
#endif
}

View File

@ -49,15 +49,11 @@
* be2me_32, otherwise the linker will complain that it doesn't exist */
#define HAVE_AV_CONFIG_H
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/mpegvideo.h"
#include "libavcodec/mjpegenc.h"
//#include "jpeg_enc.h" /* this file is not present yet */
#undef malloc
#undef free
#undef realloc
extern int avcodec_initialized;
/* some convenient #define's, is this portable enough? */
/// Printout with vf_zrmjpeg: prefix at VERBOSE level
@ -72,21 +68,6 @@ extern int avcodec_initialized;
// set when init is done, so that initialization is not done twice.
extern int avcodec_initialized;
/// structure copied from mjpeg.c
/* zrmjpeg_encode_mb needs access to these tables for the black & white
* option */
typedef struct MJpegContext {
uint8_t huff_size_dc_luminance[12];
uint16_t huff_code_dc_luminance[12];
uint8_t huff_size_dc_chrominance[12];
uint16_t huff_code_dc_chrominance[12];
uint8_t huff_size_ac_luminance[256];
uint16_t huff_code_ac_luminance[256];
uint8_t huff_size_ac_chrominance[256];
uint16_t huff_code_ac_chrominance[256];
} MJpegContext;
/// The get_pixels() routine to use. The real routine comes from dsputil
static void (*get_pixels)(DCTELEM *restrict block, const uint8_t *pixels, int line_size);

View File

@ -90,14 +90,4 @@ static int find_asf_guid(char *buf, const char *guid, int cur_pos, int buf_len)
return -1;
}
static int find_backwards_asf_guid(char *buf, const char *guid, int cur_pos)
{
int i;
for (i=cur_pos-16; i>0; i--) {
if (memcmp(&buf[i], guid, 16) == 0)
return i + 16 + 8; // point after guid + length
}
return -1;
}
#endif /* MPLAYER_ASFGUID_H */

View File

@ -352,6 +352,16 @@ static int asf_init_audio_stream(demuxer_t *demuxer,struct asf_priv* asf, sh_aud
return 1;
}
static int find_backwards_asf_guid(char *buf, const char *guid, int cur_pos)
{
int i;
for (i=cur_pos-16; i>0; i--) {
if (memcmp(&buf[i], guid, 16) == 0)
return i + 16 + 8; // point after guid + length
}
return -1;
}
int read_asf_header(demuxer_t *demuxer,struct asf_priv* asf){
int hdr_len = asf->header.objh.size - sizeof(asf->header);
int hdr_skip = 0;

View File

@ -392,7 +392,6 @@ static int demux_audio_open(demuxer_t* demuxer) {
l -= 16;
if (l >= 2) {
w->cbSize = stream_read_word_le(s);
if (w->cbSize < 0) w->cbSize = 0;
l -= 2;
if (l < w->cbSize) {
mp_msg(MSGT_DEMUX,MSGL_ERR,"[demux_audio] truncated extradata (%d < %d)\n",

View File

@ -86,8 +86,6 @@ static demuxer_t * demux_open_nut(demuxer_t * demuxer) {
while ((ret = nut_read_headers(nut, &s, NULL)) == NUT_ERR_EAGAIN);
if (ret) {
mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(ret));
nut_demuxer_uninit(nut);
free(priv);
return NULL;
}

View File

@ -372,7 +372,7 @@ extern "C" void demux_close_rtp(demuxer_t* demuxer) {
////////// Extra routines that help implement the above interface functions:
#define MAX_RTP_FRAME_SIZE 50000
#define MAX_RTP_FRAME_SIZE 5000000
// >= the largest conceivable frame composed from one or more RTP packets
static void afterReading(void* clientData, unsigned frameSize,

View File

@ -574,14 +574,14 @@ static char TY_XDS [ 8 ][ 25 ][ 34 ];
static char TY_XDS_new[ 8 ][ 25 ][ 34 ];
// Array of [ MPAARating|TVRating ][ NumberRatings ]
static const char const *TY_XDS_CHIP[ 2 ][ 8 ] =
static const char * const TY_XDS_CHIP[ 2 ][ 8 ] =
{
{ "(NOT APPLICABLE)", "G", "PG", "PG-13", "R", "NC-17", "X", "(NOT RATED)" },
{ "(NOT RATED)", "TV-Y", "TV-Y7", "TV-G", "TV-PG", "TV-14", "TV-MA",
"(NOT RATED)" }
};
static const char const *TY_XDS_modes[] =
static const char * const TY_XDS_modes[] =
{
"CURRENT", // 01h-02h current program
"FUTURE ", // 03h-04h future program

View File

@ -10,6 +10,14 @@
struct MPOpts;
#ifdef HAVE_BUILTIN_EXPECT
#define likely(x) __builtin_expect ((x) != 0, 1)
#define unlikely(x) __builtin_expect ((x) != 0, 0)
#else
#define likely(x) (x)
#define unlikely(x) (x)
#endif
#define MAX_PACKS 4096
#define MAX_PACK_BYTES 0x8000000 // 128 MiB

View File

@ -213,84 +213,23 @@ void sws_rgb2rgb_init(int flags){
}
/**
* Palette is assumed to contain BGR32.
* Convert the palette to the same packet 32-bit format as the palette
*/
void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
void palette8topacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
{
long i;
/*
for (i=0; i<num_pixels; i++)
((unsigned *)dst)[i] = ((unsigned *)palette)[src[i]];
*/
for (i=0; i<num_pixels; i++)
{
#ifdef WORDS_BIGENDIAN
dst[3]= palette[src[i]*4+2];
dst[2]= palette[src[i]*4+1];
dst[1]= palette[src[i]*4+0];
#else
//FIXME slow?
dst[0]= palette[src[i]*4+2];
dst[1]= palette[src[i]*4+1];
dst[2]= palette[src[i]*4+0];
//dst[3]= 0; /* do we need this cleansing? */
#endif
dst+= 4;
}
}
void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
{
long i;
for (i=0; i<num_pixels; i++)
{
#ifdef WORDS_BIGENDIAN
dst[3]= palette[src[i]*4+0];
dst[2]= palette[src[i]*4+1];
dst[1]= palette[src[i]*4+2];
#else
//FIXME slow?
dst[0]= palette[src[i]*4+0];
dst[1]= palette[src[i]*4+1];
dst[2]= palette[src[i]*4+2];
//dst[3]= 0; /* do we need this cleansing? */
#endif
dst+= 4;
}
((uint32_t *) dst)[i] = ((const uint32_t *) palette)[src[i]];
}
/**
* Palette is assumed to contain BGR32.
* Palette format: ABCD -> dst format: ABC
*/
void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
void palette8topacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
{
long i;
/*
Writes 1 byte too much and might cause alignment issues on some architectures?
for (i=0; i<num_pixels; i++)
((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[src[i]];
*/
for (i=0; i<num_pixels; i++)
{
//FIXME slow?
dst[0]= palette[src[i]*4+2];
dst[1]= palette[src[i]*4+1];
dst[2]= palette[src[i]*4+0];
dst+= 3;
}
}
void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette)
{
long i;
/*
Writes 1 byte too much and might cause alignment issues on some architectures?
for (i=0; i<num_pixels; i++)
((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[src[i]];
*/
for (i=0; i<num_pixels; i++)
{
//FIXME slow?

View File

@ -61,10 +61,8 @@ extern void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
extern void bgr8torgb8 (const uint8_t *src, uint8_t *dst, long src_size);
extern void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8tobgr32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8topacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8topacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
extern void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);

View File

@ -28,12 +28,6 @@
*/
#include <stddef.h>
#include <inttypes.h> /* for __WORDSIZE */
#ifndef __WORDSIZE
// #warning You have a misconfigured system and will probably lose performance!
#define __WORDSIZE MP_WORDSIZE
#endif
#undef PREFETCH
#undef MOVNTQ
@ -58,17 +52,12 @@
#define PREFETCHW "prefetcht0"
#define PAVGB "pavgb"
#else
#ifdef __APPLE__
#define PREFETCH "#"
#define PREFETCHW "#"
#else
#define PREFETCH " # nop"
#define PREFETCHW " # nop"
#endif
#endif
#ifdef HAVE_3DNOW
/* On K6 femms is faster than emms. On K7 femms is directly mapped on emms. */
/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
#define EMMS "femms"
#else
#define EMMS "emms"
@ -92,12 +81,12 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long s
#endif
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 23;
asm volatile("movq %0, %%mm7"::"m"(mask32):"memory");
__asm__ volatile("movq %0, %%mm7"::"m"(mask32):"memory");
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"punpckldq 3%1, %%mm0 \n\t"
@ -121,8 +110,8 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long s
dest += 32;
s += 24;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -152,11 +141,11 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long s
#endif
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 31;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq 8%1, %%mm1 \n\t"
@ -207,8 +196,8 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long s
dest += 24;
s += 32;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -242,12 +231,12 @@ static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_
const uint8_t *mm_end;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s));
asm volatile("movq %0, %%mm4"::"m"(mask15s));
__asm__ volatile(PREFETCH" %0"::"m"(*s));
__asm__ volatile("movq %0, %%mm4"::"m"(mask15s));
mm_end = end - 15;
while (s<mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq 8%1, %%mm2 \n\t"
@ -265,8 +254,8 @@ static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_
d+=16;
s+=16;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
mm_end = end - 3;
while (s < mm_end)
@ -291,13 +280,13 @@ static inline void RENAME(rgb16to15)(const uint8_t *src, uint8_t *dst, long src_
const uint8_t *mm_end;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s));
asm volatile("movq %0, %%mm7"::"m"(mask15rg));
asm volatile("movq %0, %%mm6"::"m"(mask15b));
__asm__ volatile(PREFETCH" %0"::"m"(*s));
__asm__ volatile("movq %0, %%mm7"::"m"(mask15rg));
__asm__ volatile("movq %0, %%mm6"::"m"(mask15b));
mm_end = end - 15;
while (s<mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq 8%1, %%mm2 \n\t"
@ -319,8 +308,8 @@ static inline void RENAME(rgb16to15)(const uint8_t *src, uint8_t *dst, long src_
d+=16;
s+=16;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
mm_end = end - 3;
while (s < mm_end)
@ -351,7 +340,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
#ifdef HAVE_MMX
mm_end = end - 15;
#if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
asm volatile(
__asm__ volatile(
"movq %3, %%mm5 \n\t"
"movq %4, %%mm6 \n\t"
"movq %5, %%mm7 \n\t"
@ -386,14 +375,14 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
: "r" (mm_end), "m" (mask3216g), "m" (mask3216br), "m" (mul3216)
);
#else
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_16mask),"m"(green_16mask));
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 4%1, %%mm3 \n\t"
@ -427,8 +416,8 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
s += 16;
}
#endif
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -447,15 +436,15 @@ static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long s
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_16mask),"m"(green_16mask));
mm_end = end - 15;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 4%1, %%mm3 \n\t"
@ -488,8 +477,8 @@ static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long s
d += 4;
s += 16;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -510,7 +499,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
#ifdef HAVE_MMX
mm_end = end - 15;
#if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
asm volatile(
__asm__ volatile(
"movq %3, %%mm5 \n\t"
"movq %4, %%mm6 \n\t"
"movq %5, %%mm7 \n\t"
@ -545,14 +534,14 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
: "r" (mm_end), "m" (mask3215g), "m" (mask3216br), "m" (mul3215)
);
#else
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_15mask),"m"(green_15mask));
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 4%1, %%mm3 \n\t"
@ -586,8 +575,8 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
s += 16;
}
#endif
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -606,15 +595,15 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long s
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_15mask),"m"(green_15mask));
mm_end = end - 15;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 4%1, %%mm3 \n\t"
@ -647,8 +636,8 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long s
d += 4;
s += 16;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -667,15 +656,15 @@ static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long s
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_16mask),"m"(green_16mask));
mm_end = end - 11;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 3%1, %%mm3 \n\t"
@ -708,8 +697,8 @@ static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long s
d += 4;
s += 12;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -730,15 +719,15 @@ static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_16mask),"m"(green_16mask));
mm_end = end - 15;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 3%1, %%mm3 \n\t"
@ -771,8 +760,8 @@ static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_
d += 4;
s += 12;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -793,15 +782,15 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_15mask),"m"(green_15mask));
mm_end = end - 11;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 3%1, %%mm3 \n\t"
@ -834,8 +823,8 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s
d += 4;
s += 12;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -856,15 +845,15 @@ static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*src):"memory");
asm volatile(
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
"movq %1, %%mm6 \n\t"
::"m"(red_15mask),"m"(green_15mask));
mm_end = end - 15;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movd %1, %%mm0 \n\t"
"movd 3%1, %%mm3 \n\t"
@ -897,8 +886,8 @@ static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_
d += 4;
s += 12;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -940,11 +929,11 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long s
const uint16_t *s = (const uint16_t*)src;
end = s + src_size/2;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 7;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq %1, %%mm1 \n\t"
@ -1007,7 +996,7 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long s
:"m"(*s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null)
:"memory");
/* borrowed 32 to 24 */
asm volatile(
__asm__ volatile(
"movq %%mm0, %%mm4 \n\t"
"movq %%mm3, %%mm5 \n\t"
"movq %%mm6, %%mm0 \n\t"
@ -1059,8 +1048,8 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long s
d += 24;
s += 8;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -1082,11 +1071,11 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long s
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 7;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq %1, %%mm1 \n\t"
@ -1148,7 +1137,7 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long s
:"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null)
:"memory");
/* borrowed 32 to 24 */
asm volatile(
__asm__ volatile(
"movq %%mm0, %%mm4 \n\t"
"movq %%mm3, %%mm5 \n\t"
"movq %%mm6, %%mm0 \n\t"
@ -1200,8 +1189,8 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long s
d += 24;
s += 8;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -1223,12 +1212,12 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
asm volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
mm_end = end - 3;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq %1, %%mm1 \n\t"
@ -1264,8 +1253,8 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_
d += 16;
s += 4;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -1301,12 +1290,12 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_
const uint16_t *s = (const uint16_t*)src;
end = s + src_size/2;
#ifdef HAVE_MMX
asm volatile(PREFETCH" %0"::"m"(*s):"memory");
asm volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
mm_end = end - 3;
while (s < mm_end)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq %1, %%mm1 \n\t"
@ -1342,8 +1331,8 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_
d += 16;
s += 4;
}
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
while (s < end)
{
@ -1369,7 +1358,7 @@ static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long s
const uint8_t *s = src-idx;
uint8_t *d = dst-idx;
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"test %0, %0 \n\t"
"jns 2f \n\t"
PREFETCH" (%1, %0) \n\t"
@ -1432,7 +1421,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s
unsigned i;
#ifdef HAVE_MMX
long mmx_size= 23 - src_size;
asm volatile (
__asm__ volatile (
"test %%"REG_a", %%"REG_a" \n\t"
"jns 2f \n\t"
"movq "MANGLE(mask24r)", %%mm5 \n\t"
@ -1476,8 +1465,8 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s
: "r" (src-mmx_size), "r"(dst-mmx_size)
);
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
if (mmx_size==23) return; //finished, was multiple of 8
@ -1507,7 +1496,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
{
#ifdef HAVE_MMX
//FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
asm volatile(
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -1548,10 +1537,10 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
y2 = yc2[n]; \
u = uc[n]; \
v = vc[n]; \
asm("unpkbw %1, %0" : "=r"(y1) : "r"(y1)); \
asm("unpkbw %1, %0" : "=r"(y2) : "r"(y2)); \
asm("unpkbl %1, %0" : "=r"(u) : "r"(u)); \
asm("unpkbl %1, %0" : "=r"(v) : "r"(v)); \
__asm__("unpkbw %1, %0" : "=r"(y1) : "r"(y1)); \
__asm__("unpkbw %1, %0" : "=r"(y2) : "r"(y2)); \
__asm__("unpkbl %1, %0" : "=r"(u) : "r"(u)); \
__asm__("unpkbl %1, %0" : "=r"(v) : "r"(v)); \
yuv1 = (u << 8) + (v << 24); \
yuv2 = yuv1 + y2; \
yuv1 += y1; \
@ -1568,10 +1557,10 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
uint64_t y1, y2, yuv1, yuv2;
uint64_t u, v;
/* Prefetch */
asm("ldq $31,64(%0)" :: "r"(yc));
asm("ldq $31,64(%0)" :: "r"(yc2));
asm("ldq $31,64(%0)" :: "r"(uc));
asm("ldq $31,64(%0)" :: "r"(vc));
__asm__("ldq $31,64(%0)" :: "r"(yc));
__asm__("ldq $31,64(%0)" :: "r"(yc2));
__asm__("ldq $31,64(%0)" :: "r"(uc));
__asm__("ldq $31,64(%0)" :: "r"(vc));
pl2yuy2(0);
pl2yuy2(1);
@ -1589,7 +1578,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
ysrc += lumStride;
dst += dstStride;
#elif __WORDSIZE >= 64
#elif HAVE_FAST_64BIT
int i;
uint64_t *ldst = (uint64_t *) dst;
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
@ -1631,7 +1620,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
dst += dstStride;
}
#ifdef HAVE_MMX
asm( EMMS" \n\t"
__asm__( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
#endif
@ -1659,7 +1648,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
{
#ifdef HAVE_MMX
//FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
asm volatile(
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -1695,7 +1684,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
#else
//FIXME adapt the Alpha ASM code from yv12->yuy2
#if __WORDSIZE >= 64
#if HAVE_FAST_64BIT
int i;
uint64_t *ldst = (uint64_t *) dst;
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
@ -1737,7 +1726,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
dst += dstStride;
}
#ifdef HAVE_MMX
asm( EMMS" \n\t"
__asm__( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
#endif
@ -1788,7 +1777,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
for (y=0; y<height; y+=2)
{
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
"pcmpeqw %%mm7, %%mm7 \n\t"
"psrlw $8, %%mm7 \n\t" // FF,00,FF,00...
@ -1843,7 +1832,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
ydst += lumStride;
src += srcStride;
asm volatile(
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -1893,7 +1882,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
src += srcStride;
}
#ifdef HAVE_MMX
asm volatile( EMMS" \n\t"
__asm__ volatile( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
#endif
@ -1927,7 +1916,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi
for (y=1; y<srcHeight; y++){
#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
const long mmxSize= srcWidth&~15;
asm volatile(
__asm__ volatile(
"mov %4, %%"REG_a" \n\t"
"1: \n\t"
"movq (%0, %%"REG_a"), %%mm0 \n\t"
@ -2005,7 +1994,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi
#endif
#ifdef HAVE_MMX
asm volatile( EMMS" \n\t"
__asm__ volatile( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
#endif
@ -2026,7 +2015,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
for (y=0; y<height; y+=2)
{
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"xorl %%eax, %%eax \n\t"
"pcmpeqw %%mm7, %%mm7 \n\t"
"psrlw $8, %%mm7 \n\t" // FF,00,FF,00...
@ -2081,7 +2070,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
ydst += lumStride;
src += srcStride;
asm volatile(
__asm__ volatile(
"xorl %%eax, %%eax \n\t"
ASMALIGN(4)
"1: \n\t"
@ -2131,7 +2120,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
src += srcStride;
}
#ifdef HAVE_MMX
asm volatile( EMMS" \n\t"
__asm__ volatile( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
#endif
@ -2156,7 +2145,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
long i;
for (i=0; i<2; i++)
{
asm volatile(
__asm__ volatile(
"mov %2, %%"REG_a" \n\t"
"movq "MANGLE(ff_bgr2YCoeff)", %%mm6 \n\t"
"movq "MANGLE(ff_w1111)", %%mm5 \n\t"
@ -2229,7 +2218,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
src += srcStride;
}
src -= srcStride*2;
asm volatile(
__asm__ volatile(
"mov %4, %%"REG_a" \n\t"
"movq "MANGLE(ff_w1111)", %%mm5 \n\t"
"movq "MANGLE(ff_bgr2UCoeff)", %%mm6 \n\t"
@ -2383,7 +2372,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
src += srcStride*2;
}
asm volatile( EMMS" \n\t"
__asm__ volatile( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
#else
@ -2440,7 +2429,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
}
}
void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
static void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
long width, long height, long src1Stride,
long src2Stride, long dstStride){
long h;
@ -2451,7 +2440,7 @@ void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
#ifdef HAVE_MMX
#ifdef HAVE_SSE2
asm(
__asm__(
"xor %%"REG_a", %%"REG_a" \n\t"
"1: \n\t"
PREFETCH" 64(%1, %%"REG_a") \n\t"
@ -2470,7 +2459,7 @@ void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
: "memory", "%"REG_a""
);
#else
asm(
__asm__(
"xor %%"REG_a", %%"REG_a" \n\t"
"1: \n\t"
PREFETCH" 64(%1, %%"REG_a") \n\t"
@ -2513,7 +2502,7 @@ void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
src2 += src2Stride;
}
#ifdef HAVE_MMX
asm(
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"
@ -2530,7 +2519,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
long y,x,w,h;
w=width/2; h=height/2;
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
PREFETCH" %0 \n\t"
PREFETCH" %1 \n\t"
::"m"(*(src1+srcStride1)),"m"(*(src2+srcStride2)):"memory");
@ -2542,7 +2531,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
#ifdef HAVE_MMX
for (;x<w-31;x+=32)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq 8%1, %%mm2 \n\t"
@ -2582,7 +2571,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
#ifdef HAVE_MMX
for (;x<w-31;x+=32)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32%1 \n\t"
"movq %1, %%mm0 \n\t"
"movq 8%1, %%mm2 \n\t"
@ -2616,7 +2605,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
for (;x<w;x++) d[2*x]=d[2*x+1]=s2[x];
}
#ifdef HAVE_MMX
asm(
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"
@ -2641,7 +2630,7 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
#ifdef HAVE_MMX
for (;x<w-7;x+=8)
{
asm volatile(
__asm__ volatile(
PREFETCH" 32(%1, %0) \n\t"
PREFETCH" 32(%2, %0) \n\t"
PREFETCH" 32(%3, %0) \n\t"
@ -2707,7 +2696,7 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
}
}
#ifdef HAVE_MMX
asm(
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"

View File

@ -120,7 +120,7 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride);
#if defined(ARCH_X86)
asm volatile ("emms\n\t");
__asm__ volatile ("emms\n\t");
#endif
ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h);
@ -215,7 +215,7 @@ int main(int argc, char **argv){
sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);
#if defined(ARCH_X86)
asm volatile ("emms\n\t");
__asm__ volatile ("emms\n\t");
#endif
selfTest(src, stride, W, H);

View File

@ -155,6 +155,13 @@ unsigned swscale_version(void)
|| isRGB(x) \
|| isBGR(x) \
)
#define usePal(x) ( \
(x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_BGR4_BYTE \
|| (x)==PIX_FMT_RGB4_BYTE \
|| (x)==PIX_FMT_BGR8 \
|| (x)==PIX_FMT_RGB8 \
)
#define RGB2YUV_SHIFT 15
#define BY ( (int)(0.114*219/255*(1<<RGB2YUV_SHIFT)+0.5))
@ -205,11 +212,6 @@ DECLARE_ASM_CONST(8, uint64_t, bm00000111)=0x0000000000FFFFFFLL;
DECLARE_ASM_CONST(8, uint64_t, bm11111000)=0xFFFFFFFFFF000000LL;
DECLARE_ASM_CONST(8, uint64_t, bm01010101)=0x00FF00FF00FF00FFLL;
static volatile uint64_t attribute_used __attribute__((aligned(8))) b5Dither;
static volatile uint64_t attribute_used __attribute__((aligned(8))) g5Dither;
static volatile uint64_t attribute_used __attribute__((aligned(8))) g6Dither;
static volatile uint64_t attribute_used __attribute__((aligned(8))) r5Dither;
const DECLARE_ALIGNED(8, uint64_t, ff_dither4[2]) = {
0x0103010301030103LL,
0x0200020002000200LL,};
@ -242,18 +244,18 @@ DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YOffset) = 0x1010101010101010ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_bgr24toY1Coeff) = 0x0C88000040870C88ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_bgr24toY2Coeff) = 0x20DE4087000020DEULL;
DECLARE_ALIGNED(8, const uint64_t, ff_rgb24toY1Coeff) = 0x20DE0000408720DEULL;
DECLARE_ALIGNED(8, const uint64_t, ff_rgb24toY2Coeff) = 0x0C88408700000C88ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_bgr24toYOffset) = 0x0008400000084000ULL;
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY1Coeff) = 0x0C88000040870C88ULL;
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY2Coeff) = 0x20DE4087000020DEULL;
DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY1Coeff) = 0x20DE0000408720DEULL;
DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY2Coeff) = 0x0C88408700000C88ULL;
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toYOffset) = 0x0008400000084000ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_bgr24toUV[2][4]) = {
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUV[2][4]) = {
{0x38380000DAC83838ULL, 0xECFFDAC80000ECFFULL, 0xF6E40000D0E3F6E4ULL, 0x3838D0E300003838ULL},
{0xECFF0000DAC8ECFFULL, 0x3838DAC800003838ULL, 0x38380000D0E33838ULL, 0xF6E4D0E30000F6E4ULL},
};
DECLARE_ALIGNED(8, const uint64_t, ff_bgr24toUVOffset)= 0x0040400000404000ULL;
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUVOffset)= 0x0040400000404000ULL;
#endif /* defined(ARCH_X86) */
@ -262,12 +264,12 @@ static unsigned char clip_table[768];
static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b);
const uint8_t __attribute__((aligned(8))) dither_2x2_4[2][8]={
static const uint8_t __attribute__((aligned(8))) dither_2x2_4[2][8]={
{ 1, 3, 1, 3, 1, 3, 1, 3, },
{ 2, 0, 2, 0, 2, 0, 2, 0, },
};
const uint8_t __attribute__((aligned(8))) dither_2x2_8[2][8]={
static const uint8_t __attribute__((aligned(8))) dither_2x2_8[2][8]={
{ 6, 2, 6, 2, 6, 2, 6, 2, },
{ 0, 4, 0, 4, 0, 4, 0, 4, },
};
@ -1059,7 +1061,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
int ret= -1;
#if defined(ARCH_X86)
if (flags & SWS_CPU_CAPS_MMX)
asm volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
#endif
// Note the +1 is for the MMXscaler which reads over the end
@ -1448,7 +1450,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
//code fragment
asm volatile(
__asm__ volatile(
"jmp 9f \n\t"
// Begin
"0: \n\t"
@ -1488,7 +1490,7 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
"=r" (fragmentLengthA)
);
asm volatile(
__asm__ volatile(
"jmp 9f \n\t"
// Begin
"0: \n\t"
@ -1712,11 +1714,46 @@ static int YUV422PToUyvyWrapper(SwsContext *c, uint8_t* src[], int srcStride[],
return srcSliceH;
}
static int pal2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
const enum PixelFormat srcFormat= c->srcFormat;
const enum PixelFormat dstFormat= c->dstFormat;
void (*conv)(const uint8_t *src, uint8_t *dst, long num_pixels,
const uint8_t *palette)=NULL;
int i;
uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
uint8_t *srcPtr= src[0];
if (!usePal(srcFormat))
av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat));
switch(dstFormat){
case PIX_FMT_RGB32 : conv = palette8topacked32; break;
case PIX_FMT_BGR32 : conv = palette8topacked32; break;
case PIX_FMT_BGR32_1: conv = palette8topacked32; break;
case PIX_FMT_RGB32_1: conv = palette8topacked32; break;
case PIX_FMT_RGB24 : conv = palette8topacked24; break;
case PIX_FMT_BGR24 : conv = palette8topacked24; break;
default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat)); break;
}
for (i=0; i<srcSliceH; i++) {
conv(srcPtr, dstPtr, c->srcW, c->pal_rgb);
srcPtr+= srcStride[0];
dstPtr+= dstStride[0];
}
return srcSliceH;
}
/* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
static int rgb2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
const int srcFormat= c->srcFormat;
const int dstFormat= c->dstFormat;
const enum PixelFormat srcFormat= c->srcFormat;
const enum PixelFormat dstFormat= c->dstFormat;
const int srcBpp= (fmt_depth(srcFormat) + 7) >> 3;
const int dstBpp= (fmt_depth(dstFormat) + 7) >> 3;
const int srcId= fmt_depth(srcFormat) >> 2; /* 1:0, 4:1, 8:2, 15:3, 16:4, 24:6, 32:8 */
@ -2101,7 +2138,7 @@ int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int
return 0;
}
static int handle_jpeg(int *format)
static int handle_jpeg(enum PixelFormat *format)
{
switch (*format) {
case PIX_FMT_YUVJ420P:
@ -2121,7 +2158,7 @@ static int handle_jpeg(int *format)
}
}
SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags,
SwsFilter *srcFilter, SwsFilter *dstFilter, double *param){
SwsContext *c;
@ -2132,7 +2169,7 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH
SwsFilter dummyFilter= {NULL, NULL, NULL, NULL};
#if defined(ARCH_X86)
if (flags & SWS_CPU_CAPS_MMX)
asm volatile("emms\n\t"::: "memory");
__asm__ volatile("emms\n\t"::: "memory");
#endif
#if !defined(RUNTIME_CPUDETECT) || !defined (CONFIG_GPL) //ensure that the flags match the compiled variant if cpudetect is off
@ -2306,6 +2343,15 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH
&& (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT))))
c->swScale= rgb2rgbWrapper;
if ((usePal(srcFormat) && (
dstFormat == PIX_FMT_RGB32 ||
dstFormat == PIX_FMT_RGB32_1 ||
dstFormat == PIX_FMT_RGB24 ||
dstFormat == PIX_FMT_BGR32 ||
dstFormat == PIX_FMT_BGR32_1 ||
dstFormat == PIX_FMT_BGR24)))
c->swScale= pal2rgbWrapper;
if (srcFormat == PIX_FMT_YUV422P)
{
if (dstFormat == PIX_FMT_YUYV422)
@ -2659,12 +2705,6 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
int i;
uint8_t* src2[4]= {src[0], src[1], src[2]};
uint32_t pal[256];
int use_pal= c->srcFormat == PIX_FMT_PAL8
|| c->srcFormat == PIX_FMT_BGR4_BYTE
|| c->srcFormat == PIX_FMT_RGB4_BYTE
|| c->srcFormat == PIX_FMT_BGR8
|| c->srcFormat == PIX_FMT_RGB8;
if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) {
av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n");
@ -2674,7 +2714,7 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
if (srcSliceY == 0) c->sliceDir = 1; else c->sliceDir = -1;
}
if (use_pal){
if (usePal(c->srcFormat)){
for (i=0; i<256; i++){
int p, r, g, b,y,u,v;
if(c->srcFormat == PIX_FMT_PAL8){
@ -2702,9 +2742,36 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
y= av_clip_uint8((RY*r + GY*g + BY*b + ( 33<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT);
u= av_clip_uint8((RU*r + GU*g + BU*b + (257<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT);
v= av_clip_uint8((RV*r + GV*g + BV*b + (257<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT);
pal[i]= y + (u<<8) + (v<<16);
c->pal_yuv[i]= y + (u<<8) + (v<<16);
switch(c->dstFormat) {
case PIX_FMT_BGR32:
#ifndef WORDS_BIGENDIAN
case PIX_FMT_RGB24:
#endif
c->pal_rgb[i]= r + (g<<8) + (b<<16);
break;
case PIX_FMT_BGR32_1:
#ifdef WORDS_BIGENDIAN
case PIX_FMT_BGR24:
#endif
c->pal_rgb[i]= (r + (g<<8) + (b<<16)) << 8;
break;
case PIX_FMT_RGB32_1:
#ifdef WORDS_BIGENDIAN
case PIX_FMT_RGB24:
#endif
c->pal_rgb[i]= (b + (g<<8) + (r<<16)) << 8;
break;
case PIX_FMT_RGB32:
#ifndef WORDS_BIGENDIAN
case PIX_FMT_BGR24:
#endif
default:
c->pal_rgb[i]= b + (g<<8) + (r<<16);
}
}
src2[1]= (uint8_t*)pal;
}
// copy strides, so they can safely be modified
@ -2722,7 +2789,7 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int dstStride2[4]= {-dstStride[0], -dstStride[1], -dstStride[2]};
src2[0] += (srcSliceH-1)*srcStride[0];
if (!use_pal)
if (!usePal(c->srcFormat))
src2[1] += ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[1];
src2[2] += ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[2];
@ -3087,8 +3154,8 @@ void sws_freeContext(SwsContext *c){
* asumed to remain valid.
*/
struct SwsContext *sws_getCachedContext(struct SwsContext *context,
int srcW, int srcH, int srcFormat,
int dstW, int dstH, int dstFormat, int flags,
int srcW, int srcH, enum PixelFormat srcFormat,
int dstW, int dstH, enum PixelFormat dstFormat, int flags,
SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
{
static const double default_param[2] = {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT};

View File

@ -71,7 +71,7 @@ typedef struct SwsContext{
int chrSrcW, chrSrcH, chrDstW, chrDstH;
int lumXInc, chrXInc;
int lumYInc, chrYInc;
int dstFormat, srcFormat; ///< format 4:2:0 type is always YV12
enum PixelFormat dstFormat, srcFormat; ///< format 4:2:0 type is always YV12
int origDstFormat, origSrcFormat; ///< format
int chrSrcHSubSample, chrSrcVSubSample;
int chrIntHSubSample, chrIntVSubSample;
@ -80,6 +80,9 @@ typedef struct SwsContext{
int sliceDir;
double param[2];
uint32_t pal_yuv[256];
uint32_t pal_rgb[256];
int16_t **lumPixBuf;
int16_t **chrPixBuf;
int16_t *hLumFilter;

View File

@ -30,7 +30,7 @@
#undef SFENCE
#ifdef HAVE_3DNOW
/* On K6 femms is faster than emms. On K7 femms is directly mapped on emms. */
/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
#define EMMS "femms"
#else
#define EMMS "emms"
@ -71,7 +71,7 @@
#endif
#define YSCALEYUV2YV12X(x, offset, dest, width) \
asm volatile(\
__asm__ volatile(\
"xor %%"REG_a", %%"REG_a" \n\t"\
"movq "VROUNDER_OFFSET"(%0), %%mm3 \n\t"\
"movq %%mm3, %%mm4 \n\t"\
@ -107,7 +107,7 @@
);
#define YSCALEYUV2YV12X_ACCURATE(x, offset, dest, width) \
asm volatile(\
__asm__ volatile(\
"lea " offset "(%0), %%"REG_d" \n\t"\
"xor %%"REG_a", %%"REG_a" \n\t"\
"pxor %%mm4, %%mm4 \n\t"\
@ -207,7 +207,7 @@
: "%eax", "%ebx", "%ecx", "%edx", "%esi"
*/
#define YSCALEYUV2PACKEDX \
asm volatile(\
__asm__ volatile(\
"xor %%"REG_a", %%"REG_a" \n\t"\
ASMALIGN(4)\
"nop \n\t"\
@ -256,7 +256,7 @@
);
#define YSCALEYUV2PACKEDX_ACCURATE \
asm volatile(\
__asm__ volatile(\
"xor %%"REG_a", %%"REG_a" \n\t"\
ASMALIGN(4)\
"nop \n\t"\
@ -1002,7 +1002,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
if (c->flags & SWS_ACCURATE_RND){
while(p--){
asm volatile(
__asm__ volatile(
YSCALEYUV2YV121_ACCURATE
:: "r" (src[p]), "r" (dst[p] + counter[p]),
"g" (-counter[p])
@ -1011,7 +1011,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
}
}else{
while(p--){
asm volatile(
__asm__ volatile(
YSCALEYUV2YV121
:: "r" (src[p]), "r" (dst[p] + counter[p]),
"g" (-counter[p])
@ -1091,9 +1091,9 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
YSCALEYUV2RGBX
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
"paddusb "MANGLE(g5Dither)", %%mm4\n\t"
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
"paddusb "BLUE_DITHER"(%0), %%mm2\n\t"
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
#endif
WRITERGB15(%4, %5, %%REGa)
@ -1104,9 +1104,9 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
YSCALEYUV2RGBX
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2\n\t"
"paddusb "MANGLE(g6Dither)", %%mm4\n\t"
"paddusb "MANGLE(r5Dither)", %%mm5\n\t"
"paddusb "BLUE_DITHER"(%0), %%mm2\n\t"
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
#endif
WRITERGB16(%4, %5, %%REGa)
@ -1151,9 +1151,9 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
YSCALEYUV2RGBX
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%0), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
#endif
WRITERGB15(%4, %5, %%REGa)
@ -1164,9 +1164,9 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
YSCALEYUV2RGBX
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%0), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
#endif
WRITERGB16(%4, %5, %%REGa)
@ -1220,7 +1220,7 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, uint16_t *buf0, uint16_t *
{
#ifdef HAVE_MMX
case PIX_FMT_RGB32:
asm volatile(
__asm__ volatile(
FULL_YSCALEYUV2RGB
@ -1244,7 +1244,7 @@ FULL_YSCALEYUV2RGB
);
break;
case PIX_FMT_BGR24:
asm volatile(
__asm__ volatile(
FULL_YSCALEYUV2RGB
@ -1293,7 +1293,7 @@ FULL_YSCALEYUV2RGB
);
break;
case PIX_FMT_BGR555:
asm volatile(
__asm__ volatile(
FULL_YSCALEYUV2RGB
#ifdef DITHER1XBPP
@ -1326,11 +1326,11 @@ FULL_YSCALEYUV2RGB
);
break;
case PIX_FMT_BGR565:
asm volatile(
__asm__ volatile(
FULL_YSCALEYUV2RGB
#ifdef DITHER1XBPP
"paddusb "MANGLE(g6Dither)", %%mm1 \n\t"
"paddusb "MANGLE(g5Dither)", %%mm1 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm0 \n\t"
"paddusb "MANGLE(b5Dither)", %%mm3 \n\t"
#endif
@ -1434,7 +1434,7 @@ FULL_YSCALEYUV2RGB
{
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
case PIX_FMT_RGB32:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1448,7 +1448,7 @@ FULL_YSCALEYUV2RGB
);
return;
case PIX_FMT_BGR24:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1461,16 +1461,16 @@ FULL_YSCALEYUV2RGB
);
return;
case PIX_FMT_RGB555:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
@ -1482,16 +1482,16 @@ FULL_YSCALEYUV2RGB
);
return;
case PIX_FMT_RGB565:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
@ -1502,7 +1502,7 @@ FULL_YSCALEYUV2RGB
);
return;
case PIX_FMT_YUYV422:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1546,7 +1546,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
switch(dstFormat)
{
case PIX_FMT_RGB32:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1560,7 +1560,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_BGR24:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1574,16 +1574,16 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_RGB555:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
"pop %%"REG_BP" \n\t"
@ -1594,16 +1594,16 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_RGB565:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
@ -1615,7 +1615,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_YUYV422:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1635,7 +1635,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
switch(dstFormat)
{
case PIX_FMT_RGB32:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1649,7 +1649,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_BGR24:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1663,16 +1663,16 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_RGB555:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g5Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
"pop %%"REG_BP" \n\t"
@ -1683,16 +1683,16 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_RGB565:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(g6Dither)", %%mm4 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm5 \n\t"
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
@ -1704,7 +1704,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
);
return;
case PIX_FMT_YUYV422:
asm volatile(
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
@ -1734,7 +1734,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
{
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm2 \n\t"
"mov %0, %%"REG_a" \n\t"
"1: \n\t"
@ -1759,7 +1759,7 @@ static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint3
static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
{
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
"1: \n\t"
@ -1796,7 +1796,7 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1,
static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
{
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"mov %0, %%"REG_a" \n\t"
"1: \n\t"
"movq (%1, %%"REG_a",2), %%mm0 \n\t"
@ -1820,7 +1820,7 @@ static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint3
static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
{
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
"1: \n\t"
@ -1917,20 +1917,20 @@ static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width,
{
if(srcFormat == PIX_FMT_BGR24){
asm volatile(
__asm__ volatile(
"movq "MANGLE(ff_bgr24toY1Coeff)", %%mm5 \n\t"
"movq "MANGLE(ff_bgr24toY2Coeff)", %%mm6 \n\t"
:
);
}else{
asm volatile(
__asm__ volatile(
"movq "MANGLE(ff_rgb24toY1Coeff)", %%mm5 \n\t"
"movq "MANGLE(ff_rgb24toY2Coeff)", %%mm6 \n\t"
:
);
}
asm volatile(
__asm__ volatile(
"movq "MANGLE(ff_bgr24toYOffset)", %%mm4 \n\t"
"mov %2, %%"REG_a" \n\t"
"pxor %%mm7, %%mm7 \n\t"
@ -1968,7 +1968,7 @@ static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width,
static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, long width, int srcFormat)
{
asm volatile(
__asm__ volatile(
"movq 24+%4, %%mm6 \n\t"
"mov %3, %%"REG_a" \n\t"
"pxor %%mm7, %%mm7 \n\t"
@ -2184,7 +2184,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
filter-= counter*2;
filterPos-= counter/2;
dst-= counter/2;
asm volatile(
__asm__ volatile(
#if defined(PIC)
"push %%"REG_b" \n\t"
#endif
@ -2230,7 +2230,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
filter-= counter*4;
filterPos-= counter/2;
dst-= counter/2;
asm volatile(
__asm__ volatile(
#if defined(PIC)
"push %%"REG_b" \n\t"
#endif
@ -2288,7 +2288,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
//filter-= counter*filterSize/2;
filterPos-= counter/2;
dst-= counter/2;
asm volatile(
__asm__ volatile(
"pxor %%mm7, %%mm7 \n\t"
ASMALIGN(4)
"1: \n\t"
@ -2456,7 +2456,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth,
#endif
if (canMMX2BeUsed)
{
asm volatile(
__asm__ volatile(
#if defined(PIC)
"mov %%"REG_b", %5 \n\t"
#endif
@ -2521,7 +2521,7 @@ FUNNY_Y_CODE
long xInc_shr16 = xInc >> 16;
uint16_t xInc_mask = xInc & 0xffff;
//NO MMX just normal asm ...
asm volatile(
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t" // i
"xor %%"REG_d", %%"REG_d" \n\t" // xx
"xorl %%ecx, %%ecx \n\t" // 2*xalpha
@ -2729,7 +2729,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth,
#endif
if (canMMX2BeUsed)
{
asm volatile(
__asm__ volatile(
#if defined(PIC)
"mov %%"REG_b", %6 \n\t"
#endif
@ -2806,7 +2806,7 @@ FUNNY_UV_CODE
#endif /* HAVE_MMX2 */
long xInc_shr16 = (long) (xInc >> 16);
uint16_t xInc_mask = xInc & 0xffff;
asm volatile(
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t" // i
"xor %%"REG_d", %%"REG_d" \n\t" // xx
"xorl %%ecx, %%ecx \n\t" // 2*xalpha
@ -2926,7 +2926,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
const int chrSrcSliceY= srcSliceY >> c->chrSrcVSubSample;
const int chrSrcSliceH= -((-srcSliceH) >> c->chrSrcVSubSample);
int lastDstY;
uint32_t *pal=NULL;
uint32_t *pal=c->pal_yuv;
/* vars which will change and which we need to store back in the context */
int dstY= c->dstY;
@ -2936,7 +2936,6 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
int lastInChrBuf= c->lastInChrBuf;
if (isPacked(c->srcFormat)){
pal= (uint32_t *)src[1];
src[0]=
src[1]=
src[2]= src[0];
@ -2965,12 +2964,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0)
{
static int firstTime=1; //FIXME move this into the context perhaps
if (flags & SWS_PRINT_INFO && firstTime)
static int warnedAlready=0; //FIXME move this into the context perhaps
if (flags & SWS_PRINT_INFO && !warnedAlready)
{
av_log(c, AV_LOG_WARNING, "Warning: dstStride is not aligned!\n"
" ->cannot do aligned memory accesses anymore\n");
firstTime=0;
warnedAlready=1;
}
}
@ -3091,10 +3090,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
}
#ifdef HAVE_MMX
b5Dither= ff_dither8[dstY&1];
g6Dither= ff_dither4[dstY&1];
g5Dither= ff_dither8[dstY&1];
r5Dither= ff_dither8[(dstY+1)&1];
c->blueDither= ff_dither8[dstY&1];
if (c->dstFormat == PIX_FMT_RGB555 || c->dstFormat == PIX_FMT_BGR555)
c->greenDither= ff_dither8[dstY&1];
else
c->greenDither= ff_dither4[dstY&1];
c->redDither= ff_dither8[(dstY+1)&1];
#endif
if (dstY < dstH-2)
{
@ -3255,8 +3256,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
}
#ifdef HAVE_MMX
asm volatile(SFENCE:::"memory");
asm volatile(EMMS:::"memory");
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
/* store changed local vars back in the context */
c->dstY= dstY;

View File

@ -41,8 +41,6 @@
#define DITHER1XBPP // only for MMX
extern const uint8_t dither_2x2_4[2][8];
extern const uint8_t dither_2x2_8[2][8];
extern const uint8_t dither_8x8_32[8][8];
extern const uint8_t dither_8x8_73[8][8];
extern const uint8_t dither_8x8_220[8][8];
@ -54,13 +52,6 @@ DECLARE_ASM_CONST(8, uint64_t, mmx_00ffw) = 0x00ff00ff00ff00ffULL;
DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL;
DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL;
// The volatile is required because gcc otherwise optimizes some writes away
// not knowing that these are read in the ASM block.
static volatile uint64_t attribute_used __attribute__((aligned(8))) b5Dither;
static volatile uint64_t attribute_used __attribute__((aligned(8))) g5Dither;
static volatile uint64_t attribute_used __attribute__((aligned(8))) g6Dither;
static volatile uint64_t attribute_used __attribute__((aligned(8))) r5Dither;
#undef HAVE_MMX
//MMX versions

View File

@ -154,7 +154,7 @@ const vector unsigned char
#define vec_merge3(x2,x1,x0,y0,y1,y2) \
do { \
typeof(x0) o0,o2,o3; \
__typeof__(x0) o0,o2,o3; \
o0 = vec_mergeh (x0,x1); \
y0 = vec_perm (o0, x2, perm_rgb_0); \
o2 = vec_perm (o0, x2, perm_rgb_1); \
@ -165,7 +165,7 @@ do { \
#define vec_mstbgr24(x0,x1,x2,ptr) \
do { \
typeof(x0) _0,_1,_2; \
__typeof__(x0) _0,_1,_2; \
vec_merge3 (x0,x1,x2,_0,_1,_2); \
vec_st (_0, 0, ptr++); \
vec_st (_1, 0, ptr++); \
@ -174,7 +174,7 @@ do { \
#define vec_mstrgb24(x0,x1,x2,ptr) \
do { \
typeof(x0) _0,_1,_2; \
__typeof__(x0) _0,_1,_2; \
vec_merge3 (x2,x1,x0,_0,_1,_2); \
vec_st (_0, 0, ptr++); \
vec_st (_1, 0, ptr++); \
@ -222,12 +222,12 @@ do { \
#define vec_unh(x) \
(vector signed short) \
vec_perm(x,(typeof(x)){0}, \
vec_perm(x,(__typeof__(x)){0}, \
((vector unsigned char){0x10,0x00,0x10,0x01,0x10,0x02,0x10,0x03,\
0x10,0x04,0x10,0x05,0x10,0x06,0x10,0x07}))
#define vec_unl(x) \
(vector signed short) \
vec_perm(x,(typeof(x)){0}, \
vec_perm(x,(__typeof__(x)){0}, \
((vector unsigned char){0x10,0x08,0x10,0x09,0x10,0x0A,0x10,0x0B,\
0x10,0x0C,0x10,0x0D,0x10,0x0E,0x10,0x0F}))
@ -240,7 +240,7 @@ do { \
((vector unsigned short)vec_max (x,((vector signed short) {0})), \
(vector unsigned short)vec_max (y,((vector signed short) {0})))
//#define out_pixels(a,b,c,ptr) vec_mstrgb32(typeof(a),((typeof (a)){0}),a,a,a,ptr)
//#define out_pixels(a,b,c,ptr) vec_mstrgb32(__typeof__(a),((__typeof__ (a)){0}),a,a,a,ptr)
static inline void cvtyuvtoRGB (SwsContext *c,
@ -441,10 +441,10 @@ static int altivec_##name (SwsContext *c, \
}
#define out_abgr(a,b,c,ptr) vec_mstrgb32(typeof(a),((typeof (a)){0}),c,b,a,ptr)
#define out_bgra(a,b,c,ptr) vec_mstrgb32(typeof(a),c,b,a,((typeof (a)){0}),ptr)
#define out_rgba(a,b,c,ptr) vec_mstrgb32(typeof(a),a,b,c,((typeof (a)){0}),ptr)
#define out_argb(a,b,c,ptr) vec_mstrgb32(typeof(a),((typeof (a)){0}),a,b,c,ptr)
#define out_abgr(a,b,c,ptr) vec_mstrgb32(__typeof__(a),((__typeof__ (a)){0}),c,b,a,ptr)
#define out_bgra(a,b,c,ptr) vec_mstrgb32(__typeof__(a),c,b,a,((__typeof__ (a)){0}),ptr)
#define out_rgba(a,b,c,ptr) vec_mstrgb32(__typeof__(a),a,b,c,((__typeof__ (a)){0}),ptr)
#define out_argb(a,b,c,ptr) vec_mstrgb32(__typeof__(a),((__typeof__ (a)){0}),a,b,c,ptr)
#define out_rgb24(a,b,c,ptr) vec_mstrgb24(a,b,c,ptr)
#define out_bgr24(a,b,c,ptr) vec_mstbgr24(a,b,c,ptr)

View File

@ -31,7 +31,7 @@
#undef SFENCE
#ifdef HAVE_3DNOW
/* On K6 femms is faster than emms. On K7 femms is directly mapped on emms. */
/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
#define EMMS "femms"
#else
#define EMMS "emms"
@ -133,8 +133,8 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7;
if(h_size*2 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
//printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&b5Dither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
__asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
//printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
//srcStride[0],srcStride[1],srcStride[2],dstStride[0]);
for (y= 0; y<srcSliceH; y++ ) {
uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
@ -143,13 +143,12 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr
uint8_t *pv = src[2] + (y>>1)*srcStride[2];
long index= -h_size/2;
b5Dither= ff_dither8[y&1];
g6Dither= ff_dither4[y&1];
g5Dither= ff_dither8[y&1];
r5Dither= ff_dither8[(y+1)&1];
c->blueDither= ff_dither8[y&1];
c->greenDither= ff_dither4[y&1];
c->redDither= ff_dither8[(y+1)&1];
/* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */
asm volatile (
__asm__ volatile (
/* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
@ -165,9 +164,9 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr
YUV2RGB
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm0;"
"paddusb "MANGLE(g6Dither)", %%mm2;"
"paddusb "MANGLE(r5Dither)", %%mm1;"
"paddusb "BLUE_DITHER"(%4), %%mm0;"
"paddusb "GREEN_DITHER"(%4), %%mm2;"
"paddusb "RED_DITHER"(%4), %%mm1;"
#endif
/* mask unneeded bits off */
"pand "MANGLE(mmx_redmask)", %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */
@ -211,7 +210,7 @@ YUV2RGB
);
}
asm volatile (EMMS);
__asm__ volatile (EMMS);
return srcSliceH;
}
@ -228,8 +227,8 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7;
if(h_size*2 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
//printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&b5Dither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
__asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
//printf("%X %X %X %X %X %X %X %X %X %X\n", (int)&c->redDither, (int)&c->blueDither, (int)src[0], (int)src[1], (int)src[2], (int)dst[0],
//srcStride[0],srcStride[1],srcStride[2],dstStride[0]);
for (y= 0; y<srcSliceH; y++ ) {
uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
@ -238,13 +237,12 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr
uint8_t *pv = src[2] + (y>>1)*srcStride[2];
long index= -h_size/2;
b5Dither= ff_dither8[y&1];
g6Dither= ff_dither4[y&1];
g5Dither= ff_dither8[y&1];
r5Dither= ff_dither8[(y+1)&1];
c->blueDither= ff_dither8[y&1];
c->greenDither= ff_dither8[y&1];
c->redDither= ff_dither8[(y+1)&1];
/* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */
asm volatile (
__asm__ volatile (
/* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
@ -254,9 +252,9 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr
YUV2RGB
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm0 \n\t"
"paddusb "MANGLE(g5Dither)", %%mm2 \n\t"
"paddusb "MANGLE(r5Dither)", %%mm1 \n\t"
"paddusb "BLUE_DITHER"(%4), %%mm0 \n\t"
"paddusb "GREEN_DITHER"(%4), %%mm2 \n\t"
"paddusb "RED_DITHER"(%4), %%mm1 \n\t"
#endif
/* mask unneeded bits off */
@ -301,7 +299,7 @@ YUV2RGB
);
}
asm volatile (EMMS);
__asm__ volatile (EMMS);
return srcSliceH;
}
@ -317,7 +315,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7;
if(h_size*3 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
__asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
for (y= 0; y<srcSliceH; y++ ) {
uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
@ -328,7 +326,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
/* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */
asm volatile (
__asm__ volatile (
/* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
@ -447,7 +445,7 @@ YUV2RGB
);
}
asm volatile (EMMS);
__asm__ volatile (EMMS);
return srcSliceH;
}
@ -463,7 +461,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr
h_size= (c->dstW+7)&~7;
if(h_size*4 > FFABS(dstStride[0])) h_size-=8;
asm volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
__asm__ volatile ("pxor %mm4, %mm4;" /* zero mm4 */ );
for (y= 0; y<srcSliceH; y++ ) {
uint8_t *image = dst[0] + (y+srcSliceY)*dstStride[0];
@ -474,7 +472,7 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr
/* This MMX assembly code deals with a SINGLE scan line at a time,
* it converts 8 pixels in each iteration. */
asm volatile (
__asm__ volatile (
/* load data for start of next scan line */
"movd (%2, %0), %%mm0;" /* Load 4 Cb 00 00 00 00 u3 u2 u1 u0 */
"movd (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */
@ -533,6 +531,6 @@ YUV2RGB
);
}
asm volatile (EMMS);
__asm__ volatile (EMMS);
return srcSliceH;
}

View File

@ -85,7 +85,7 @@ static int vis_420P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int s
int y, out1, out2, out3, out4, out5, out6;
for(y=0;y < srcSliceH;++y) {
asm volatile (
__asm__ volatile (
YUV2RGB_INIT
"wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
"1: \n\t"
@ -136,7 +136,7 @@ static int vis_422P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int s
int y, out1, out2, out3, out4, out5, out6;
for(y=0;y < srcSliceH;++y) {
asm volatile (
__asm__ volatile (
YUV2RGB_INIT
"wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
"1: \n\t"

View File

@ -84,7 +84,7 @@ If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru.
#define small_memcpy(to,from,n)\
{\
register unsigned long int dummy;\
__asm__ __volatile__(\
__asm__ volatile(\
"rep; movsb"\
:"=&D"(to), "=&S"(from), "=&c"(dummy)\
/* It's most portable way to notify compiler */\
@ -153,7 +153,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
#endif
#ifndef HAVE_ONLY_MMX1
/* PREFETCH has effect even for MOVSB instruction ;) */
__asm__ __volatile__ (
__asm__ volatile (
PREFETCH" (%0)\n"
PREFETCH" 64(%0)\n"
PREFETCH" 128(%0)\n"
@ -188,7 +188,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
/* if SRC is misaligned */
for(; i>0; i--)
{
__asm__ __volatile__ (
__asm__ volatile (
PREFETCH" 320(%0)\n"
"movups (%0), %%xmm0\n"
"movups 16(%0), %%xmm1\n"
@ -210,7 +210,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
*/
for(; i>0; i--)
{
__asm__ __volatile__ (
__asm__ volatile (
PREFETCH" 320(%0)\n"
"movaps (%0), %%xmm0\n"
"movaps 16(%0), %%xmm1\n"
@ -228,7 +228,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
// Align destination at BLOCK_SIZE boundary
for(; ((int)to & (BLOCK_SIZE-1)) && i>0; i--)
{
__asm__ __volatile__ (
__asm__ volatile (
#ifndef HAVE_ONLY_MMX1
PREFETCH" 320(%0)\n"
#endif
@ -256,7 +256,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
// printf(" %d %d\n", (int)from&1023, (int)to&1023);
// Pure Assembly cuz gcc is a bit unpredictable ;)
if(i>=BLOCK_SIZE/64)
asm volatile(
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
ASMALIGN(4)
"1: \n\t"
@ -317,7 +317,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
for(; i>0; i--)
{
__asm__ __volatile__ (
__asm__ volatile (
#ifndef HAVE_ONLY_MMX1
PREFETCH" 320(%0)\n"
#endif
@ -346,11 +346,11 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
#ifdef HAVE_MMX2
/* since movntq is weakly-ordered, a "sfence"
* is needed to become ordered again. */
__asm__ __volatile__ ("sfence":::"memory");
__asm__ volatile ("sfence":::"memory");
#endif
#ifndef HAVE_SSE
/* enables to use FPU */
__asm__ __volatile__ (EMMS:::"memory");
__asm__ volatile (EMMS:::"memory");
#endif
}
/*
@ -405,7 +405,7 @@ static void * RENAME(mem2agpcpy)(void * to, const void * from, size_t len)
*/
for(; i>0; i--)
{
__asm__ __volatile__ (
__asm__ volatile (
PREFETCH" 320(%0)\n"
"movq (%0), %%mm0\n"
"movq 8(%0), %%mm1\n"
@ -430,10 +430,10 @@ static void * RENAME(mem2agpcpy)(void * to, const void * from, size_t len)
#ifdef HAVE_MMX2
/* since movntq is weakly-ordered, a "sfence"
* is needed to become ordered again. */
__asm__ __volatile__ ("sfence":::"memory");
__asm__ volatile ("sfence":::"memory");
#endif
/* enables to use FPU */
__asm__ __volatile__ (EMMS:::"memory");
__asm__ volatile (EMMS:::"memory");
}
/*
* Now do the tail of the block

View File

@ -33,7 +33,7 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
w=w>>1;
#endif
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"pcmpeqb %%mm5, %%mm5\n\t" // F..F
"movq %%mm5, %%mm4\n\t"
"movq %%mm5, %%mm7\n\t"
@ -44,13 +44,13 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
for(y=0;y<h;y++){
register int x;
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
PREFETCH" %2\n\t"
::"m"(*dstbase),"m"(*srca),"m"(*src):"memory");
for(x=0;x<w;x+=8){
asm volatile(
__asm__ volatile(
"movl %1, %%eax\n\t"
"orl 4%1, %%eax\n\t"
" jz 1f\n\t"
@ -92,7 +92,7 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
dstbase+=dststride;
}
#ifdef HAVE_MMX
asm volatile(EMMS:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
return;
}
@ -103,7 +103,7 @@ static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, u
w=w>>1;
#endif
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"pxor %%mm7, %%mm7\n\t"
"pcmpeqb %%mm5, %%mm5\n\t" // F..F
"movq %%mm5, %%mm6\n\t"
@ -115,13 +115,13 @@ static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, u
for(y=0;y<h;y++){
register int x;
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
PREFETCH" %2\n\t"
::"m"(*dstbase),"m"(*srca),"m"(*src));
for(x=0;x<w;x+=4){
asm volatile(
__asm__ volatile(
"movl %1, %%eax\n\t"
"orl %%eax, %%eax\n\t"
" jz 1f\n\t"
@ -164,7 +164,7 @@ static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, u
dstbase+=dststride;
}
#ifdef HAVE_MMX
asm volatile(EMMS:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
return;
}
@ -196,7 +196,7 @@ static inline void RENAME(vo_draw_alpha_uyvy)(int w,int h, unsigned char* src, u
static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
"pxor %%mm7, %%mm7\n\t"
"pcmpeqb %%mm6, %%mm6\n\t" // F..F
::);
@ -206,14 +206,14 @@ static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src,
register int x;
#if defined(ARCH_X86) && (!defined(ARCH_X86_64) || defined(HAVE_MMX))
#ifdef HAVE_MMX
asm volatile(
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
PREFETCH" %2\n\t"
::"m"(*dst),"m"(*srca),"m"(*src):"memory");
for(x=0;x<w;x+=2){
if(srca[x] || srca[x+1])
asm volatile(
__asm__ volatile(
PREFETCHW" 32%0\n\t"
PREFETCH" 32%1\n\t"
PREFETCH" 32%2\n\t"
@ -250,7 +250,7 @@ static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src,
#else /* HAVE_MMX */
for(x=0;x<w;x++){
if(srca[x]){
asm volatile(
__asm__ volatile(
"movzbl (%0), %%ecx\n\t"
"movzbl 1(%0), %%eax\n\t"
@ -296,7 +296,7 @@ static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src,
dstbase+=dststride;
}
#ifdef HAVE_MMX
asm volatile(EMMS:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
return;
}
@ -308,12 +308,12 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
#endif
#ifdef HAVE_MMX
#ifdef HAVE_3DNOW
asm volatile(
__asm__ volatile(
"pxor %%mm7, %%mm7\n\t"
"pcmpeqb %%mm6, %%mm6\n\t" // F..F
::);
#else /* HAVE_3DNOW */
asm volatile(
__asm__ volatile(
"pxor %%mm7, %%mm7\n\t"
"pcmpeqb %%mm5, %%mm5\n\t" // F..F
"movq %%mm5, %%mm4\n\t"
@ -327,14 +327,14 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
#if defined(ARCH_X86) && (!defined(ARCH_X86_64) || defined(HAVE_MMX))
#ifdef HAVE_MMX
#ifdef HAVE_3DNOW
asm volatile(
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
PREFETCH" %2\n\t"
::"m"(*dstbase),"m"(*srca),"m"(*src):"memory");
for(x=0;x<w;x+=2){
if(srca[x] || srca[x+1])
asm volatile(
__asm__ volatile(
PREFETCHW" 32%0\n\t"
PREFETCH" 32%1\n\t"
PREFETCH" 32%2\n\t"
@ -362,13 +362,13 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
:: "m" (dstbase[4*x]), "m" (srca[x]), "m" (src[x]));
}
#else //this is faster for intels crap
asm volatile(
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
PREFETCH" %2\n\t"
::"m"(*dstbase),"m"(*srca),"m"(*src):"memory");
for(x=0;x<w;x+=4){
asm volatile(
__asm__ volatile(
"movl %1, %%eax\n\t"
"orl %%eax, %%eax\n\t"
" jz 1f\n\t"
@ -417,7 +417,7 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
#else /* HAVE_MMX */
for(x=0;x<w;x++){
if(srca[x]){
asm volatile(
__asm__ volatile(
"movzbl (%0), %%ecx\n\t"
"movzbl 1(%0), %%eax\n\t"
"movzbl 2(%0), %%edx\n\t"
@ -461,7 +461,7 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
dstbase+=dststride;
}
#ifdef HAVE_MMX
asm volatile(EMMS:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
return;
}

View File

@ -202,7 +202,7 @@ const struct vo_driver *video_out_drivers[] =
#ifdef CONFIG_X11
&video_out_xvidix,
#endif
#ifdef WIN32
#if defined(__MINGW32__) || defined(__CYGWIN__)
&video_out_winvidix,
#endif
&video_out_cvidix,

View File

@ -81,10 +81,15 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_h
if(vo_screenwidth && vo_screenheight){
if(!vo_geometry)center=1;
}
else mp_msg(MSGT_VO, MSGL_WARN, "vo_cvidix: warn: screenwidth and height not set assuming 640x480\n");
}
if(!vo_screenwidth)vo_screenwidth=640;
if(!vo_screenheight)vo_screenheight=480;
if(!vo_screenwidth){
mp_msg(MSGT_VO, MSGL_WARN, "vo_cvidix: Screen width not set (see -screenw), assuming 640 pixels.\n");
vo_screenwidth = 640;
}
if(!vo_screenheight){
mp_msg(MSGT_VO, MSGL_WARN, "vo_cvidix: Screen height not set (see -screenh), assuming 480 pixels.\n");
vo_screenheight = 480;
}
swidth = width;
sheight = height;
sformat = format;

View File

@ -1273,7 +1273,7 @@ static uint32_t put_image(mp_image_t *mpi){
}
else //packed
{
fast_memcpy( image, mpi->planes[0], image_height * dstride);
mem2agpcpy_pic(image, mpi->planes[0], w * (mpi->bpp / 8), h, dstride, mpi->stride[0]);
}
return VO_TRUE;
}

View File

@ -20,10 +20,7 @@
#include "sub.h"
#include "get_path.h"
#include "libmpdemux/mpeg_packetizer.h"
#ifdef X11_FULLSCREEN
#include "x11_common.h"
#endif
#include <dxr2ioctl.h>

View File

@ -677,6 +677,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
return 0;
}
#ifndef GL_WIN32
static int gl_handlekey(int key)
{
if(key=='a'||key=='A') {
@ -688,6 +689,7 @@ static int gl_handlekey(int key)
}
return 1;
}
#endif
static void check_events(void)
{

View File

@ -1120,7 +1120,7 @@ static void check_events (void)
{
struct sdl_priv_s *priv = &sdl_priv;
SDL_Event event;
SDLKey keypressed = 0;
SDLKey keypressed = SDLK_UNKNOWN;
/* Poll the waiting SDL Events */
while ( SDL_PollEvent(&event) ) {

View File

@ -48,7 +48,6 @@ static int depthonscreen;
static uint32_t image_width;
static uint32_t image_height;
static uint32_t image_format;
static HWND hWnd;
/* Window parameters */
static HWND hWnd=NULL,hWndFS=NULL;
static float window_aspect;

View File

@ -480,7 +480,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
}
while (fmte->mpfmt) {
if (IMGFMT_RGB_DEPTH(fmte->mpfmt) == myximage->bits_per_pixel &&
int depth = IMGFMT_RGB_DEPTH(fmte->mpfmt);
/* bits_per_pixel in X seems to be set to 16 for 15 bit formats
=> force depth to 16 so that only the color masks are used for the format check */
if (depth == 15)
depth = 16;
if (depth == myximage->bits_per_pixel &&
fmte->byte_order == myximage->byte_order &&
fmte->red_mask == myximage->red_mask &&
fmte->green_mask == myximage->green_mask &&

View File

@ -124,44 +124,9 @@ static void set_window(int force_update)
vo_dwidth = drwWidth;
vo_dheight = drwHeight;
#ifdef CONFIG_XINERAMA
if (XineramaIsActive(mDisplay))
{
XineramaScreenInfo *screens;
int num_screens;
int i = 0;
screens = XineramaQueryScreens(mDisplay, &num_screens);
/* find the screen we are on */
while (i < num_screens &&
((screens[i].x_org < drwcX) || (screens[i].y_org < drwcY) ||
(screens[i].x_org + screens[i].width >= drwcX) ||
(screens[i].y_org + screens[i].height >= drwcY)))
{
i++;
}
if (i < num_screens)
{
/* save the screen we are on */
xinerama_screen = i;
} else
{
/* oops.. couldnt find the screen we are on
* because the upper left corner left the
* visual range. assume we are still on the
* same screen
*/
i = xinerama_screen;
}
/* set drwcX and drwcY to the right values */
drwcX = drwcX - screens[i].x_org;
drwcY = drwcY - screens[i].y_org;
XFree(screens);
}
#endif
update_xinerama_info();
drwcX -= xinerama_x;
drwcY -= xinerama_y;
if (vo_panscan > 0.0f && vo_fs)
{

Some files were not shown because too many files have changed in this diff Show More