1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-11 04:01:31 +00:00

Merge svn changes up to r29117

This commit is contained in:
Uoti Urpala 2009-04-01 02:26:34 +03:00
commit cf9edda1d3
130 changed files with 3057 additions and 2016 deletions

View File

@ -1,8 +1,8 @@
MPlayer (1.0)
rc3: "StillAlive" March 1, 2009
rc3: "BikeshedCounter" March 27, 2009
Decoders:
* support for X8 frame (fixes "J-type picture is not supported" for WMV2)
* support for X8 frames (fixes "J-type picture is not supported" for WMV2)
* support for DTS WAV/DTS-CD passthrough by ad_hwac3
* Apple's raw YUV2 in MOV
* LATM over LOAS AAC decoding via internal libfaad2
@ -10,15 +10,15 @@ MPlayer (1.0)
EA Maxis XA ADPCM audio, RL2 video, Beam Software SIFF video, V.Flash PTX video
* AVOption support for libavcodec-based decoders
* use lavc ADPCM codecs by default
* support for progressive jpeg in ffmjpeg
* ACDSystems mjpeg (ACDV) via binary DLL and lavc
* support for progressive JPEG in ffmjpeg
* ACDSystems MJPEG (ACDV) via binary DLL and lavc
* SIF1 via binary DLL
* wincam screen capture (WCMV) via binary DLL
* Creative Labs Video Blaster Webcam mjpeg (CJPG) via binary DLL and ijpg library
* kensington webcam (AJPG,ABYR) via binary DLL
* Creative Labs Video Blaster Webcam MJPEG (CJPG) via binary DLL and ijpg library
* kensington webcam (AJPG, ABYR) via binary DLL
* centre for wavelets (wavc) via binary DLL
* GeoVision Advanced MPEG-4 (GMP4,GM40) via binary DLL
* Xiricam jpg from Veo PC Camera (XJPG) via binary DLL
* GeoVision Advanced MPEG-4 (GMP4, GM40) via binary DLL
* Xiricam JPEG from Veo PC Camera (XJPG) via binary DLL
* WorldConnect Wavelet Video (SMSV) via binary DLL
* VDOWave 3 advanced (VDO3,VDOM,VDOW) via binary DLL
* VoxWare MetaVoice (format 0x0074) via binary DLL
@ -87,7 +87,7 @@ MPlayer (1.0)
* Linux Media Labs MPEG-4 (LMLM4) demuxer
* AVM2 (Flash 9) SWF muxer
* QT variant of IMA ADPCM encoder
* Ipod/Iphone compatible mp4 muxer
* iPod/iPhone compatible MP4 muxer
* Mimic decoder
* MSN TCP Webcam stream demuxer
* RL2 demuxer / decoder
@ -124,7 +124,7 @@ MPlayer (1.0)
* NC (NC4600) cameras file demuxer
* MXF D-10 muxer
* Generic metadata API
* H.264 speedup and PAFF decoding (install Yasm for faster H264 decoding)
* H.264 speedup and PAFF decoding (install Yasm for faster H.264 decoding)
* correctly decode more of the H.264 conformance testsuite
* VC-1/WMV3 decoder speedup
* VP3 decoder speedup
@ -141,11 +141,11 @@ MPlayer (1.0)
* replace PolypAudio by PulseAudio (-ao pulse)
* add force-pbo suboption for faster output in vo_gl
* add Nintendo Wii/GameCube video driver (-vo wii)
* VIDIX driver for SuperH Mobile VEU hardware block.
* VIDIX driver for SuperH Mobile VEU hardware block
* support -border on vo_gl/gl2 in x11
* Direct3D Windows video output driver added.
* Direct3D Windows video output driver added
* factorize code in vo_wii
* removed unnecessary code from vo x11, xv, xvmc
* remove unnecessary code from vo x11, xv, xvmc
* add OS/2 DART audio driver (-ao dart)
* add VDPAU video output
* add OS/2 KVA video driver (-vo kva)
@ -168,7 +168,7 @@ MPlayer (1.0)
* some new slave commands (check DOCS/tech/slave.txt)
* libdvdcss updated to 1.2.10, now same as upstream version
* fix -endchapter support again for -dump* options
* add startup volume option
* add startup audio volume option
* add option to disable default key binds
* change default OSD and subtitle font size to a smaller default
@ -183,10 +183,10 @@ MPlayer (1.0)
* AC3/DTS passthrough for ao_macosx
* fix frozen OSD on Mac OS X
* vo_gl now works with -wid and nVidia drivers on Windows (this is a hack)
* VIDIX on SuperH.
* VIDIX on SuperH
* workarounds for AltiVec on Apple gcc 3.3 on Mac OS X dropped
* vo_macosx can now be compiled in 64-bits mode
* allow multiple MPlayer instances w/ vo_macosx using buffer_name
* allow multiple MPlayer instances with vo_macosx using buffer_name
* OpenGL support for unmodified MinGW64
SWScaler:

View File

@ -31,7 +31,7 @@
.\" Title
.\" --------------------------------------------------------------------------
.
.TH MPlayer 1 "2009-01-05" "The MPlayer Project" "The Movie Player"
.TH MPlayer 1 "2009-03-25" "The MPlayer Project" "The Movie Player"
.
.SH NAME
mplayer \- movie player
@ -904,7 +904,7 @@ i.e.\& using the shell.
MPlayer uses this command without any checking, it is your responsibility
to ensure it does not cause security problems (e.g.\& make sure to use full
paths if "." is in your path like on Windows).
It also only works when playing video (i.e. not with \-novideo but works with \-vo null).
It also only works when playing video (i.e.\& not with \-novideo but works with \-vo null).
.sp 1
This can be "misused" to disable screensavers that do not support the proper
X API (also see \-stop\-xscreensaver).
@ -960,7 +960,7 @@ Device to be used for Apple IR Remote (default is autodetected, Linux only).
Delay in milliseconds before we start to autorepeat a key (0 to disable).
.IPs ar-rate
Number of key presses to generate per second on autorepeat.
.IPs (no)default-binds
.IPs (no)default-bindings
Use the key bindings that MPlayer ships with by default.
.IPs keylist
Prints all keys that can be bound to commands.
@ -1133,7 +1133,7 @@ by a newline (\\n) from stdin.
.I NOTE:
See \-input cmdlist for a list of slave commands and DOCS/tech/slave.txt
for their description.
Also, this is not intended to disable other inputs, e.g. via the video window,
Also, this is not intended to disable other inputs, e.g.\& via the video window,
use some other method like \-input nodefault\-binds:conf=/dev/null for that.
.
.TP
@ -3119,6 +3119,9 @@ It also supports the standard X11 \-geometry option format.
If an external window is specified using the \-wid option, then the x and
y coordinates are relative to the top-left corner of the window rather
than the screen.
The coordinates are relative to the screen given with \-xineramascreen for
the video output drivers that fully support \-xineramascreen (direct3d, gl, gl2,
vdpau, x11, xv, xvmc).
.br
.I NOTE:
This option is only supported by the x11, xmga, xv, xvmc, xvidix,
@ -3225,7 +3228,7 @@ Use at your own risk!
Change the range of the pan-and-scan functionality (default: 1).
Positive values mean multiples of the default range.
Negative numbers mean you can zoom in up to a factor of \-panscanrange+1.
E.g. \-panscanrange \-3 allows a zoom factor of up to 4.
E.g.\& \-panscanrange \-3 allows a zoom factor of up to 4.
This feature is experimental.
Do not report bugs unless you are using \-vo gl.
.
@ -3455,25 +3458,27 @@ Apply a noise reduction algorithm to the video (default: 0, no noise reduction).
.IPs deint=<0\-4>
Chooses the deinterlacer (default: 0).
All modes > 0 respect \-field\-dominance.
.br
.I NOTE:
Values > 2 delay the video output by one frame.
.RSss
.IPs 0
No deinterlacing.
.IPs 1
Show only first field, similar to \-vf field.
.IPs 2
Bob deinterlacing (current fallback for advanced deinterlacers).
Bob deinterlacing, similar to \-vf tfields=1.
.IPs 3
Motion adaptive temporal deinterlacing (not yet working).
Motion adaptive temporal deinterlacing.
May lead to A/V desync with slow video hardware and/or high resolution.
This is the default if "D" is used to enable deinterlacing.
.IPs 4
Motion adaptive temporal deinterlacing with edge-guided spatial interpolation
(not yet working).
Motion adaptive temporal deinterlacing with edge-guided spatial interpolation.
Needs fast video hardware.
.RE
.IPs chroma\-deint
Makes temporal deinterlacers operate both on luma and chroma (default).
Use nochroma\-deint to solely use luma and speed up advanced deinterlacing.
Useful with slow video memory.
.IPs pullup
Try to apply inverse telecine, needs temporal deinterlacing.
Try to apply inverse telecine, needs motion adaptive temporal deinterlacing.
.RE
.PD 1
.
@ -10050,7 +10055,7 @@ Lower values allow the quantizer value to jump around more,
higher values force it to vary more smoothly.
cplx_blur ensures that each I-frame has quality comparable to the following
P-frames, and ensures that alternating high and low complexity frames
(e.g. low fps animation) do not waste bits on fluctuating quantizer.
(e.g.\& low fps animation) do not waste bits on fluctuating quantizer.
.
.TP
.B qblur=<0\-99> (two pass only)

View File

@ -1,4 +1,4 @@
.\" synced with r28950
.\" synced with r28958
.\" Encoding: iso-8859-1
.\" MPlayer (C) 2000-2009 MPlayer Team
.\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
@ -946,7 +946,8 @@ MPlayer utilise cette commande sans aucune sorte de v
donc de votre responsablité qu'elle ne pose pas de problème de sécurité
(c-à-d que vous devriez spécifier le chemin absolu, surtout si "." est dans
le chemin de recherche $PATH, comme c'est le cas sous Windows).
Cela fonctionne aussi lors de la lecture d'une vidéo (c-à-d. que ça ne fonctionne pas avec \-novideo alors que ça fonctionne avec \-vo null).
Cela fonctionne aussi lors de la lecture d'une vidéo (c-à-d.\& que ça ne
fonctionne pas avec \-novideo alors que ça fonctionne avec \-vo null).
.sp 1
Ceci peut être "détourné" pour désactiver un économiseur d'écran ne gérant par
l'API de X prévu à cet effet (voir aussi \-stop\-xscreensaver).
@ -1009,7 +1010,7 @@ d'une touche
(0 pour désactiver).
.IPs ar-rate
Combien de frappes par seconde pendant la répétition automatique.
.IPs (no)default-binds
.IPs (no)default-bindings
Répond aux touches de contrôle par défaut de MPlayer.
.IPs keylist
Affiche toutes les touches pouvant être attachées.
@ -10598,7 +10599,7 @@ Des valeurs plus faibles permettent au quantum de plus changer d'une
trame à l'autre, des valeurs plus hautes forcent une variation plus douce.
cplx_blur permet de s'assurer que chaque trame-I ait une qualité comparable
aux trames-P suivantes, et garantit qu'une alternance de trames à complexité
forte et faible (par exemple un dessin animé dont la cadence d'animation est
forte et faible (par ex.\& un dessin animé dont la cadence d'animation est
faible) ne gâche pas de bits en faisant fluctuer les quantum.
.
.TP

View File

@ -1,4 +1,4 @@
.\" Synced with r28895
.\" Synced with r29059
.\" MPlayer (C) 2000-2009 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 "2009. 03. 09." "MPlayer Project" "A film lejátszó"
.TH MPlayer 1 "2009. 03. 28." "MPlayer Project" "A film lejátszó"
.
.SH NÉV
mplayer \- film lejátszó
@ -161,7 +161,7 @@ Van X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, libcaca, DirectFB,
Quartz, Mac OS X CoreVideo támogatás, de használhatod a GGI, SDL (és ennek összes
vezérlője), VESA (minden VESA-kompatibilis kártyán, még X11 nélkül is), néhány
alacsony szintű, kártyaspecifikus vezérlő (Matroxhoz, 3dfx-hez és ATI-hoz) és
pár hardveeres MPEG dekódoló lap, mint pl. a Siemens DVB, Hauppauge PVR (IVTV),
pár hardveeres MPEG dekódoló lap, mint pl.\& a Siemens DVB, Hauppauge PVR (IVTV),
DXR2 és DXR3/\:Hollywood+ támogatását is. A legtöbbjük tudja a szoftveres és
harderes nagyítást, így a filmjeidet teljes képernyős módban élvezheted.
.PP
@ -572,7 +572,7 @@ spuaa=20
.SH "PROFILOK"
A különböző konfigurációjú történő munka megkönnyítésére profilokat lehet
definiálni a konfigurációs fájlokban.
Egy profil a négyzetes zárójelbe tett nevével kezdődik, pl. '[en-profilom]'.
Egy profil a négyzetes zárójelbe tett nevével kezdődik, pl.\& '[en-profilom]'.
Az összes ezutáni opció a profil része lesz.
A leírás (melyet a \-profile help mutat) a profile-desc opcióval adható meg.
A profil befejezéséhez kezdj egy újat vagy használd a 'default' profil nevet
@ -644,7 +644,7 @@ Ki
A konzol üzeneteket a megadott kódlapra konvertálja (alapértelmezett: automatikus
felismerés).
A szöveg a a configure \-\-charset opciójával megadott kódolású lesz.
Beállíthatod "noconv"-ra is a konvertálás teljes letiltásához (pl. ha
Beállíthatod "noconv"-ra is a konvertálás teljes letiltásához (pl.\& ha
problémáid vannak az iconv-val).
.br
.I MEGJEGYZÉS:
@ -905,7 +905,7 @@ seg
Az MPlayer ezt a parancsot ellenőrzés nélkül használja, a te felelősséged,
hogy ne okozzon biztonsági problémát (pl.\& győződj meg róla, hogy teljes elérési
utakat használsz, ha a "." benne van az elérési utadban, mint Windows alatt).
Csak videó lejátszás közben működik (pl. a \-novideo kapcsolóval nem, de \-vo null mellett igen).
Csak videó lejátszás közben működik (pl.\& a \-novideo kapcsolóval nem, de \-vo null mellett igen).
.sp 1
Ezt "ki lehet használni" az olyan képernyővédő letiltásához, amely nem
támogatja ehhez a megfelelő X API-kat (lásd még \-stop\-xscreensaver).
@ -958,7 +958,7 @@ Az Apple IR t
Egy gomb automatikus ismétlése előtti késleltetés miliszekundumban (0: kikapcsolás).
.IPs ar-rate
Billentyű/másodperc érték megadása autorepeat használata esetén.
.IPs (no)default-binds
.IPs (no)default-bindings
Az alapértelmezetten MPlayerbe épített billentyű-hozzárendeléseket használja.
.IPs keylist
Az összes használható billentyű listájának kiírása.
@ -1052,7 +1052,7 @@ Kikapcsolja az AppleIR t
Megtiltja az MPlayernek a billentyűzet események olvasását a standard
input-ról. Hasznos, ha a standard input-ról olvasol be adatot.
Ez automatikusan engedélyeződik, ha \- van a parancssorban.
Vannak esetek, amikor kézzel kell beállítanod, pl. \&
Vannak esetek, amikor kézzel kell beállítanod, pl.\&
ha megnyitod a /dev/\:stdin -t (vagy a rendszereden az ennek megfelelőt),
lejátszási listában használod az stdin-t vagy később akarsz olvastatni
az stdin-ről a loadfile vagy loadlist szolga parancsok segítségével.
@ -1136,7 +1136,7 @@ parancsokat olvas az stdin-r
.I MEGJEGYZÉS:
A \-input cmdlist kapcsoló kilistázza a szolga módban használható parancsokat,
a DOCS/tech/slave.txt fájlban megtalálod a leírásukat.
Ez nem a többi, pl. a videó ablakon keresztül érkező input letiltására készült,
Ez nem a többi, pl.\& a videó ablakon keresztül érkező input letiltására készült,
arra használj mást, mint a \-input nodefault\-binds:conf=/dev/null.
.
.TP
@ -1253,7 +1253,7 @@ A lej
Ha léptetést kell végezni az aktuális pozícióból a cache méretének
<százalék>-kal megadott részén belüli pozícióba, az MPlayer
megvárja, hogy a cache feltöltődjön addig a pozícióig
egy folyamban történő ugrás helyett (alapértelmezett: 50).
egy folyamban történő ugrás helyett (alapértelmezett: 50).
.
.TP
.B \-cdda <opció1:opció2> (csak CDDA)
@ -1304,7 +1304,7 @@ Lej
Az MPlayer megmondja a dekódernek hogy annyi csatornán dekódoljon,
amennyit ez az opció megad.
Innentől a dekóderen múlik ennek teljesítése.
Ez akkor fontos ha AC-3-as hanggal ellátott videót nézel (pl. DVD).
Ez akkor fontos ha AC-3-as hanggal ellátott videót nézel (pl.\& DVD).
Ebben alapértelmezésként a liba52 dekódol és lemixeli az audiót a kért
számú csatornára.
A kimeneti csatornák dekódolt csatornák számától független, direkt
@ -1421,7 +1421,7 @@ v
.TP
.B \-dvd\-device <eszköz elérési útja> (csak DVD)
Megadja a DVD eszközt vagy .iso fájlnevet (alapértelmezett: /dev/\:dvd).
Megadhatsz egy könyvtárat is, ami egy előzőleg DVD-ről (pl. vobcopy-val)
Megadhatsz egy könyvtárat is, ami egy előzőleg DVD-ről (pl.\& vobcopy-val)
lemásolt fájlokat tartalmaz.
.
.TP
@ -1483,7 +1483,7 @@ Az indexet a MEncoderrel lehet maradand
.br
.I MEGJEGYZÉS:
Értelemszerűen ez az opció csak akkor használható ha a média tekerhető
(tehát pl. stdin-nel, pipe-al nem).
(tehát pl.\& stdin-nel, pipe-al nem).
.
.TP
.B \-fps <lebegőpontos érték>
@ -1510,7 +1510,7 @@ Hasznos hib
.br
.I MEGJEGYZÉS:
Értelemszerűen ez az opció csak akkor használható ha a média tekerhető
(tehát pl. stdin-nel, pipe-al nem).
(tehát pl.\& stdin-nel, pipe-al nem).
.
.TP
.B \-noidx
@ -1641,7 +1641,7 @@ cbr: Konstans BitR
.REss
.IPs vpeak=<érték>
Megadja a videó kódolási bitrátájának csúcsértékét Mbps-ben
(csak VBR kódolásnál hasznos, alapértelmezett: 9.6).
(csak VBR kódolásnál hasznos, alapértelmezett: 9.6).
.IPs fmt=<érték>
Kiválasztja a kódoláshoz használt MPEG formátumot:
.RSss
@ -2654,13 +2654,13 @@ Az OSS opci
.B vol, pcm, line.
Az opciók teljes listájához lásd a SOUND_DEVICE_NAMES-t a
/usr/\:include/\:linux/\:soundcard.h fájlban.
ALSA-hoz használhatod a neveket, amiket pl. az \& alsamixer
ALSA-hoz használhatod a neveket, amiket pl.\& az \& alsamixer
megjelenít, úgy mint
.B Master, Line, PCM.
.br
.I MEGJEGYZÉS:
Az ALSA mixer csatorna neveit egy szám követi, amit a <név,szám> formában
kell megadni, pl.\& ha a csatorna neve 'PCM 1' az alsamixer-ben,
kell megadni, pl.\& ha a csatorna neve 'PCM 1' az alsamixer-ben,
akkor
.BR PCM,1 .
.
@ -3236,7 +3236,7 @@ Csak saj
Megváltoztatja a pan-and-scan funkcionalítás tartományát (alapértelmezett: 1).
A pozitív értékek az alapértelmezett tartomány többszörösét jelentik.
A negatív számok azt jelentik, hogy \-panscanrange+1 faktorig tudsz nagyítani.
Pl. \-panscanrange \-3 4-es nagyítási faktort enged.
Pl.\& \-panscanrange \-3 4-es nagyítási faktort enged.
Ez a képesség még kísérleti.
Ne jelents hibákat, hacsak nem \-vo gl-t használsz.
.
@ -3474,17 +3474,24 @@ Nincs deinterlace.
.IPs 1
Csak az első mezőt mutatja, hasonló a \-vf field kapcsolóhoz.
.IPs 2
Bob deinterlace (jelenleg erre lép vissz a fejlettebb deinterlacer-ekről).
Bob deinterlace, hasonló a \-vf tfields=1 kapcsolóhoz.
.IPs 3
Mozgás adaptív időbeli deinterlace (még nem működik).
Mozgás adaptív időbeli deinterlace.
A/V deszinkronizációt okozhat lassú videó hardveren és/vagy nagy felbontásnál.
Ez az alapértelmezett, ha a "D" gombbal engedélyezhető a deinterlacing.
.IPs 4
Mozgás adaptív időbeli deinterlace él-vezérelt térbeli interpolációval (még nem működik).
Mozgás adaptív időbeli deinterlace él-vezérelt térbeli interpolációval.
Gyors videó hardver kell hozzá.
.RE
.IPs chroma\-deint
Az időbeli deinterlacer-ek mind a fényerősségen, mint a telítettségen változtatnak (alapértelmezett).
Használd a nochroma\-deint kapcsolót, ha csak a fényerősséget akarod változtatni és gyorsítani
szeretnél a fejlett deinterlacing-en.
Hasznos lassú videó memóriánál.
.IPs pullup
Inverz telecine-t próbál alkalmazni, időbeli deinterlace kell hozzá.
Inverz telecine-t próbál alkalmazni, mozgás adaptív időbeli deinterlace kell hozzá.
.RE
.PD 1
.PD 1
.
.TP
.B xvmc (csak X11 \-vc ffmpeg12mc kapcsolóval)
@ -3607,10 +3614,27 @@ Pr
.PD 1
.
.TP
.B kva (csak OS/2)
Kimeneti videó vezérlő, ami a libkva interfészt használja.
.PD 0
.RSs
.IPs snap
Kényszeríti a SNAP módot.
.IPs wo
Kényszeríti a WarpOverlay! módot.
.IPs dive
Kényszeríti a DIVE módot.
.IPs (no)t23
Engedélyezi/letiltja a T23 laptopokra vonatkozó kódot (alapértelmezett: \-not23).
Próbáld meg engedélyezni ezt az opciót, ha a videó kártyád csak a felméretezést támogatja.
.RE
.PD 1
.
.TP
.B quartz (csak Mac OS X)
Mac OS X Quartz kimeneti videó vezérlő.
Bizonyos esetekben hatékonyabb lehet egy csomagolt YUV kimeneti
formátum kényszerítése, pl. a \& \-vf format=yuy2 kapcsolóval.
formátum kényszerítése, pl.\& a \& \-vf format=yuy2 kapcsolóval.
.PD 0
.RSs
.IPs device_id=<szám>
@ -3943,7 +3967,7 @@ Ez a vez
.RSs
.IPs <aleszköz>
Explicit kiválasztja a használni kívánt Blinkenlights aleszköz vezérlőt.
Valami olyasmi, mint pl. arcade:host=localhost:2323 vagy
Valami olyasmi, mint pl.\& arcade:host=localhost:2323 vagy
hdl:file=name1,file=name2.
Meg kell adnod az aleszközt.
.RE
@ -4167,7 +4191,7 @@ Kimeneti vide
.RSs
.IPs card=<1\-4>
Megadja a használandó eszköz számát, ha több, mint egy kimeneti DVB kártya van
(csak V3 API, mint pl. az 1.x.y sorozatú vezérlők).
(csak V3 API, mint pl.\& az 1.x.y sorozatú vezérlők).
Ha nincs megadva, az MPlayer megkeresi az első használható kártyát.
.IPs <fájlnév>
kimeneti fájl neve (alapértelmezett: ./grab.mpg).
@ -4643,7 +4667,7 @@ A <kihagy
.br
none: Soha ne hagyja ki.
.br
default: Hagyja ki, ha a feldolgozási lépés haszontalan (pl. 0 méretű csomag AVI-ban).
default: Hagyja ki, ha a feldolgozási lépés haszontalan (pl.\& 0 méretű csomag AVI-ban).
.br
nonref: Hagyja ki a nem referencia kockákat (pl.\& nem lesz felhasználva
másik kocka dekódolásánál, a hiba nem tud "tovább épülni").
@ -4894,7 +4918,7 @@ Kikapcsolja a k
.TP
.B "\-zoom\ \ "
A szoftveres méretezést engedélyezi, ha használható.
Ez olyan kimeneti vezérlőkkel (mint pl. x11, fbdev) is engedélyezi a méretezést,
Ez olyan kimeneti vezérlőkkel (mint pl.\& x11, fbdev) is engedélyezi a méretezést,
melyekben nincs támogatás a hardveres méretezéshez, vagy az MPlayer letiltja a
méretezést teljesítménybeli indokok miatt.
.
@ -5320,7 +5344,7 @@ ha sz
.
.TP
.B surround[=késleltetés]
Dekódoló mátrix kódolású térhatású hanghoz, mint pl. a Dolby Surround-hoz.
Dekódoló mátrix kódolású térhatású hanghoz, mint pl.\& a Dolby Surround-hoz.
Sok két csatornás audióval rendelkező fájl tartalmaz mátrixos térhatású
hangot. Legalább négy csatornát támogató hangkártya kell hozzá.
.PD 0
@ -5932,7 +5956,7 @@ A haszn
.PD 0
.RSs
.IPs <fourcc>
formátum név mint pl. rgb15, bgr24, yv12, stb. (alapértelmezett: yuy2)
formátum név mint pl.\& rgb15, bgr24, yv12, stb. (alapértelmezett: yuy2)
.RE
.PD 1
.
@ -5948,7 +5972,7 @@ Az el
.PD 0
.RSs
.IPs <fourcc>
formátum név, mint pl. rgb15, bgr24, yv12, stb. (alapértelmezett: yv12)
formátum név, mint pl.\& rgb15, bgr24, yv12, stb. (alapértelmezett: yv12)
.RE
.PD 1
.
@ -6166,7 +6190,7 @@ Kvant
kvantálási paraméter (QP) változtató szűrő
.RSs
.IPs <egyenlet>
valamilyen egyenlet, pl. "2+2*sin(PI*qp)"
valamilyen egyenlet, pl.\& "2+2*sin(PI*qp)"
.RE
.
.TP
@ -7954,7 +7978,7 @@ maxim
.B mblmin=<0.01\-255.0>
Minimális makroblokk-szintű Lagrange szorzó a ratecontrol-hoz
(alapértelmezett: 2.0).
Ez a paraméter az adaptív kvantálási opciókat érinti, mint pl. a
Ez a paraméter az adaptív kvantálási opciókat érinti, mint pl.\& a
qprd, lumi_mask, stb..
.RE
.
@ -8195,7 +8219,7 @@ N l
elvégzi: először elolvassa a statisztika fájlt, majd felülírja.
Ajánlott a divx2pass.log elmentése, mielőtt ezt megtennéd, ha esély van rá,
hogy meg kell szakítanod a MEncoder-t.
Használhatod mindegyik kódolási opciót, kivéve a nagyon CPU-igényeseket, pl. "qns".
Használhatod mindegyik kódolási opciót, kivéve a nagyon CPU-igényeseket, pl.\& "qns".
.br
Ezt a lépést újra és újra lefuttathatod a kódolás finomítása érdekében.
Minden következő lépés felhasználja az előző lépés statisztikáit a továbblépéshez.
@ -9129,7 +9153,7 @@ Zajcs
0\-600 a hasznos tartomány egy átlagos tartalom esetén, de lehet, hogy kicsit feljebb
kell vinned, ha nagyon zajos az anyagod (alapértelmezett: 0).
Mivel kicsi hatása van a sebességre, inkább ezt ajánlott használni, mint a
zajszűrést a videó szűrőknél, pl. denoise3d vagy hqdn3d-vel.
zajszűrést a videó szűrőknél, pl.\& denoise3d vagy hqdn3d-vel.
.
.TP
.B qns=<0\-3>
@ -9554,7 +9578,7 @@ utols
.TP
.B (no)packed
Ez az opció a kocka-sorrendbeli gondokat oldja meg konténer formátumokba,
pl. AVI-ba történő kódoláskor, ami nem tud megbírkózni a nem sorrendben
pl.\& AVI-ba történő kódoláskor, ami nem tud megbírkózni a nem sorrendben
lévő kockákkal. A gyakorlatban a legtöbb dekódoló (mind szoftveres, mind
hardveres) saját maga is tudja kezelni a kocka-sorrendet és összezavarodhat,
ha ez az opció be van kapcsolva, így nyugodtan kikapcsolva hagyhatod,
@ -9592,7 +9616,7 @@ Az igazi CBR-t nagyon neh
A videó anyagtól függően a bitráta változhat és ezt nehéz előre megjósolni.
Ezért az Xvid egy átlagoló periódust használ, ami alatt garantálja a megadott
bitmennyiséget (minusz egy kis variáció).
Ez a beállítás megadja a "kockák számát", amikre vonatkoztatva az Xvid
Ez a beállítás megadja a "kockák számát", amikre vonatkoztatva az Xvid
átlagol és megpróbálja elérni a CBR-t.
.
.TP
@ -10054,7 +10078,7 @@ Az alacsonyabb
a magasabb értékek finomabb váltásokra kényszerítik.
A cplx_blur biztosítja, hogy minden I-kocka minősége összehasonlítható
az őt követő P-kockával és hogy a váltakozó nagy és kicsi komplexitású
kockák (pl. alacsony fps-ű animáció) nem vesztegetnek biteket egy
kockák (pl.\& alacsony fps-ű animáció) nem vesztegetnek biteket egy
ingadozó kvantálóval.
.
.TP
@ -10290,7 +10314,7 @@ Ink
.B (no)fast_pskip
A P-kockák korai skip detektálásának végrehajtása (alapértelmezett: bekapcsolva).
Ez általában javítja a sebességet, de néha a kevésbé részletes
területeken (pl. ég) mellékhatásokat okoz.
területeken (pl.\& ég) mellékhatásokat okoz.
.
.TP
.B (no)dct_decimate
@ -10307,7 +10331,7 @@ Zajcs
100\-1000 a használandó tartomány egy átlagos tartalomnál, de a nagyon zajos
tartalomnál kicsit felnyomhatod (alapértelmezett: 0).
Tekintve, hogy kicsi a befolyása a sebességre, inkább ez a preferálandó a
zajcsökkentésnél a videó szűrőkkel, mint pl. a denoise3d-vel vagy hqdn3d-vel
zajcsökkentésnél a videó szűrőkkel, mint pl.\& a denoise3d-vel vagy hqdn3d-vel
történő zajcsökkentés helyett.
.
.TP
@ -10409,7 +10433,7 @@ a sz
.B (no)global_header
Az SPS és a PPS csak egyszer fog megjelenni, a bitfolyam elején
(alapértelmezett: letiltva).
Néhány lejátszó, mint pl. a Sony PSP, igényli ezt az opciót.
Néhány lejátszó, mint pl.\& a Sony PSP, igényli ezt az opciót.
Alapértelmezésként az SPS és a PPS minden IDR kocka előtt ismétlődik.
.
.TP
@ -10490,7 +10514,7 @@ A bin
.
.TP
.B compdata=<fájl>
A codec beállításokat tartalmazó fájl neve (pl. firstpass.mcf), melyet a vfw2menc készített.
A codec beállításokat tartalmazó fájl neve (pl.\& firstpass.mcf), melyet a vfw2menc készített.
.
.
.SS MPEG muxer (\-mpegopts)
@ -11171,7 +11195,7 @@ you can directly play it via cdda:// without setting format, hwac3 or hwdts.
mplayer \-rawaudio format=0xff \-demuxer rawaudio \-af pan=2:.32:.32:.39:.06:.06:.39:.17:-.17:-.17:.17:.33:.33 adts_he-aac160_51.aac
.fi
.br
Egy kicsit játszadoznod kell a pan értékekkel (pl. felszorozni az értékeket) a
Egy kicsit játszadoznod kell a pan értékekkel (pl.\& felszorozni az értékeket) a
hangerő növeléséhez vagy a kattogás elkerüléséhez.
.
.PP

View File

@ -2,7 +2,7 @@
.\" This man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
.\" Translated by Vladimir Voroshilov <voroshil@gmail.com>
.\" Encoding: koi8-r
.\" synced with r28895
.\" synced with r28991
.
.\" --------------------------------------------------------------------------
.\" Определения макросов
@ -863,7 +863,7 @@ MPlayer
безопасности лежит под Вашей ответственностью (в частности, убедитесь,
что используются полные пути, если "." присутствует в вашем пути,
например, как в Windows).
Команда работает только при воспроизведении видео (т.е. работает с
Команда работает только при воспроизведении видео (т.е.\& работает с
\-vo null, но не с \-novideo).
.sp 1
Её можно применять для "неправильного" отключения хранителей
@ -922,7 +922,7 @@ mplayer \-heartbeat\-cmd "gnome\-screensaver\-command \-p" file
Задержка в миллисекундах перед началом автоповтора (0 для отключения).
.IPs ar\-rate
Количество клавиш в секунду, генерируемых при автоповторе.
.IPs (no)default-binds
.IPs (no)default-bindings
Использовать привязки клавиш, поставляемые с MPlayer по умолчанию.
.IPs keylist
Выводит все клавиши, которые можно назначить командам.
@ -3435,22 +3435,32 @@ XResetScreenSaver API,
.IPs deint=<0\-4>
Выбирает деинтерлейсер (по умолчанию: 0).
Все режимы > 0 учитывают \-field\-dominance.
.br
.I ЗАМЕЧАНИЕ:
Значения > 2 задерживают вывод видео на один кадр.
.RSss
.IPs 0
Нет деинтерлейсинга.
.IPs 1
Отображает только первое поле, аналогично \-vf field.
.IPs 2
Bob деинтерлейсинг (текущий запасной вариант для передовых
деинтерлейсеров).
Bob деинтерлейсинг, аналогично \-vf tfields=1.
.IPs 3
Адаптивный по движению временной деинтерлейсинг (ещё не работает).
Адаптивный по движению временной деинтерлейсинг.
Может привести к десинхронизации аудио и видео на слабой видео
карте и/или высоком разрешении.
Это значение по умолчанию, если клавиша "D" используется для
включения деинтерлейсинга.
.IPs 4
Адаптивный по движению временной деинтерлейсинг с управляемой по
краям пространственной интерполяцией (ещё не работает).
краям пространственной интерполяцией. Требует быстрой видео карты.
.RE
.IPs chroma\-deint
Позволяет временным деинтерлейсерам оперировать как яркостной, так
и цветностной компонентами (по умолчанию).
Используйте nochroma\-deint для оперирования только цветностной
компонентой и ускорения усовершенствованного деинтерлейсинга.
Полезно с медленной видео памятью.
.IPs pullup
Пробует применить обратный телесин, нуждается во временном
деинтерлейсинге.
@ -3583,6 +3593,24 @@ Windows
.PD 1
.
.TP
.B kva (только OS/2)
Драйвер вывода видео, использующий интерфейс libkva.
.PD 0
.RSs
.IPs snap
Форсирует режим SNAP.
.IPs wo
Форсирует режим WarpOverlay!.
.IPs dive
Форсирует режим DIVE.
.IPs (no)t23
Включает/выключает обходное решение для ноутбука T23 (по умолчанию: \-not23).
Попробуйте включить данную опцию, если Ваша видеокарта поддерживает
только растяжение.
.RE
.PD 1
.
.TP
.B quartz (только Mac OS X)
Драйвер вывода видео Mac OS X Quartz.
В некоторых случаях, форсирование пакованного выходного формата YUV с,
@ -4006,7 +4034,7 @@ MPEG
OSD (по умолчанию: отключено).
.IPs (no)crtc2
Включает TV\-выход на второй "голове" (по умолчанию: включено).
Качество вывода удивительное, т.к. это полностью чересстрочное
Качество вывода удивительное, т.к.\& это полностью чересстрочное
изображение с правильной синхронизацией каждого четного/\:нечетного поля.
.IPs tvnorm=pal|ntsc|auto
Установит TV стандарт Matrox карты без необходимости
@ -4227,7 +4255,7 @@ iTVC16), (Hauppauge WinTV PVR\-150/250/350/500).
.sp 1
.I ЗАМЕЧАНИЕ:
Если вы не указываете никаких опций, то вывод будет прогрессивным
(т.е. нечересстрочным).
(т.е.\& нечересстрочным).
.RE
.
.TP
@ -6016,7 +6044,7 @@ spal: 768x576 (PAL
Подфильтры должны быть отделены '/', и могут быть отключены указанием
перед ними '\-'.
Каждый подфильтр и некоторые опции имеют как короткое, так и длинное
название, которые полностью взаимозаменяемы, т.е. dr/dering \- это
название, которые полностью взаимозаменяемы, т.е.\& dr/dering \- это
одно и то же.
.\" FIXME is translation correct? scope = границы действия
Все подфильтры имеют общие опции, определяющие границы действия:

View File

@ -1,4 +1,4 @@
.\" sync with en/mplayer.1 r28745
.\" sync with en/mplayer.1 r29059
.\" Encoding: UTF-8
.\" Reminder of hard terms which need better/final solution later:
.\" /capture; playtree in parent list; colorkey; retrace; desync; downmix;
@ -43,7 +43,7 @@
.\" 名称
.\" --------------------------------------------------------------------------
.
.TH MPlayer 1 "2009-01-05" "MPlayer 项目" "电影播放器"
.TH MPlayer 1 "2009-03-25" "MPlayer 项目" "电影播放器"
.
.SH 名称
mplayer \- 影视播放器
@ -862,6 +862,7 @@ xv, xvidix 和 dfbmga。
.I 注意:
MPlayer 执行此命令时不加以检查,所以你有责任确保该命令不造成任何安全问题(例
如,如果“.”就像在 Windows 中那样是在你的路径中,则确保使用完整路径)。
并且该选项只有在播放视频时有效(即没有使用 \-novideo但可以使用 \-vo null
.sp 1
该选项可能被“误用”以禁用不提供对于适当的 X API 接口的支持的屏幕保护程序。
如果你觉得这太复杂了,请要求屏幕保护程序的作者提供对于适当的 X API 的支持。
@ -910,6 +911,8 @@ mplayer \-heartbeat\-cmd "gnome\-screensaver\-command \-p" file
在开始自动重复一个键之前等待多少毫秒 (0 代表停用)。
.IPs ar-rate
自动重复数是每秒重复多少次按键。
.IPs (no)default-bindings
默认情况下使用 MPlayer 自带的键位设置。
.IPs keylist
列出所有可以被绑定于命令的键。
.IPs cmdlist
@ -1074,6 +1077,8 @@ MPlayer 从标准输入读取以新行 (\\n) 分隔开的命令行,
.br
.I 注意:
请参见 \-input cmdlist 的命令列表和 DOCS/tech/slave.txt 中的描述。
另外,该选项并非用来禁用其它的输入,例如通过视频窗口。要使用其它方法实现那种效果,例如
\-input nodefault\-binds:conf=/dev/null。
.
.TP
.B \-softsleep
@ -2096,14 +2101,14 @@ SSA/ASS 提供器能在那里放置字幕 (与 \-ass\-use\-margins 组合用)。
如果字幕中的逗号显示在句首而不是在句尾, 就使用它。
.
.TP
.B \-font <文件 font.desc 的路径>
.B \-font <文件 font.desc 的路径字体FreeType的路径字体样式Fontconfig的路径>
在别的目录中寻找 OSD/\:SUB 字体(
默认的普通字体为: ~/\:.mplayer/\:font/\:font.desc,
默认的 FreeType 字体为: ~/.mplayer/\:subfont.ttf)。
.br
.I 注意:
对于 FreeType, 此选项决定文本字体文件的路径。
对于 fontconfig, 此选项决定 fontconfig 的字体名称。
对于 Fontconfig, 此选项决定 Fontconfig 的字体名称。
.sp 1
.I 示例:
.PD 0
@ -2113,6 +2118,8 @@ SSA/ASS 提供器能在那里放置字幕 (与 \-ass\-use\-margins 组合用)。
\-font ~/\:.mplayer/\:arialuni.ttf
.br
\-font 'Bitstream Vera Sans'
.br
\-font 'Bitstream Vera Sans:style=Bold'
.RE
.PD 1
.
@ -2333,9 +2340,9 @@ CC 字幕到目前为止还没有在其它地区码的 DVD 中发现。
\-audiofile 一样, 但用于字幕流(OggDS?)。
.
.TP
.B \-subfont <文件名>仅用于FreeType字体)
设置字幕字体。
如果没有给出\-subfont则使用\-font。
.B \-subfont <字体FreeType的路径字体样式Fontconfig的路径>(仅用于 FreeType 字体)
设置字幕字体(参见 \-font
如果没有给出 \-subfont则使用 \-font。
.
.TP
.B \-subfont\-autoscale <0\-3> (仅用于 FreeType)
@ -2647,6 +2654,18 @@ DirectX DirectSound 音频输出驱动
.PD 1
.
.TP
.B dart仅适用于 OS/2
OS/2 DART 音频输出驱动
.PD 0
.RSs
.IPs (no)share
以共享或独占模式打开 DART 输出。
.IPs bufsize=<大小>
将缓冲大小设为<大小>单位为采样数默认值2048
.RE
.PD 1
.
.TP
.B dxr2 (也请参见 \-dxr2) (仅用于 DXR2)
Creative DXR2 专用的输出驱动
.
@ -3211,24 +3230,30 @@ Supported by the gl, gl2, x11, and xv video output drivers.
使用负数值时则应用模糊算法默认值0
.IPs denoise=<0\-1>
将一种消除噪点的算法应用于视频画面默认值0不消除噪点
.IPs deint=<0\-3>
.IPs deint=<0\-4>
选择反隔行扫描模式的算法默认值0
所有大于 0 的模式服从 \-field\-dominance 选项的设置。
.RSss
.IPs 0
不反隔行扫描。
.IPs 1
只显示一个隔行扫描域,与 \-vf field 作用相类似。
只显示一个隔行扫描域,与 \-vf field 作用相类似。
.IPs 2
跳跃式反隔行扫描(当前高级反隔行扫描算法的退化形式)
跳跃式反隔行扫描,与 \-vf tfields=1 作用相类似
.IPs 3
适应运动画面的瞬间反隔行扫描(还未实现)。
适应运动画面的瞬间反隔行扫描。
可能在低性能视频硬件和/或高分辨率的情况下导致音视频不同步。
这是当“D”用于开启反隔行扫描时的默认值。
.IPs 4
采用边缘导向空间插值算法的适应运动画面的瞬间反隔行扫描
(还未实现)
采用边缘导向空间插值算法的适应运动画面的瞬间反隔行扫描
需要高性能的视频硬件
.RE
.IPs chroma\-deint
使瞬间反隔行扫描算法同时作用于亮度和色度通道上(默认值)。
使用 nochroma\-deint 以使其仅作用于亮度通道,从而加速高级反隔行扫描算法。
对于低速显存很有用。
.IPs pullup
尝试应用反电视电影模式,需要瞬间反隔行扫描。
尝试应用反电视电影模式,需要使用运动自适应的瞬间反隔行扫描算法
.RE
.PD 1
.
@ -3341,6 +3366,23 @@ VIDIX 的 Windows 前台
.PD 1
.
.TP
.B kva仅适用于 OS/2
使用 libkva 接口的视频输出驱动。
.PD 0
.RSs
.IPs snap
强制使用 SNAP 模式。
.IPs wo
强制使用 WarpOverlay! 模式。
.IPs dive
强制使用 DIVE 模式。
.IPs (no)t23
启用/禁用解决 T23 笔记本问题的变通模式(默认值:\-not23
如果你的显卡仅支持画面放大输出,尝试开启这个选项。
.RE
.PD 1
.
.TP
.B quartz (仅用于 Mac OS X)
Mac OS X Quartz 视频输出驱动。
在某些情况下, 锁定打包 YUV 输出格式, 如: \-vf format=yuy2, 可能更有效。

View File

@ -52,14 +52,13 @@ the following features MUST be included in any official binary package:
- XAnim codecs support (*)
* general:
- default font
- FreeType fonts support
- HTML documentation
- large file support
- man page(s)
* input/demuxers:
- DVD(mpdvdkit2)
- DVD(libdvdread4/libdvdnav)
- streaming
- Matroska(internal)
- (S)VCD
@ -108,10 +107,10 @@ for Red Hat and Fedora RPMs I am using FHS-compliant paths:
/etc/mplayer/ system-wide configs
/usr/bin/ binaries
/usr/lib/codecs/ binary codecs
/usr/lib64/codecs/ binary codecs on 64bit Linux
/usr/share/doc/mplayer-version/ docs
/usr/share/man/man1/ man page
/usr/share/man/XX/man1/ translated man page
/usr/share/mplayer/font/ fonts
/usr/share/mplayer/skins/ GUI skins
You MUST NOT include the codecs.conf file in your package. It is useful
@ -134,12 +133,9 @@ mplayer contains MPlayer binary without GUI (mplayer),
config files, man pages and documentation;
required by mplayer-gui
mplayer-codecs-* contain binary codecs available from MPlayer's site
mplayer-font-* contain various bitmap fonts for OSD (obsolete)
mplayer-gui contains MPlayer binary with GUI (gmplayer);
contains default skin (Blue)
mplayer-skin-* contain various MPlayer GUI skins
mplayer-vidix contains VIDIX support library for MPlayer
mplayer-vidix-* contain VIDIX drivers for specific cards, one per package
There is no strict policy for now, just use your common sense.

View File

@ -15,17 +15,12 @@ preparations:
create the release tree:
- tag Subversion with release name
- Add a VERSION file with the release version to the root of the source tree.
- update release.sh script with version number
***the following steps are done automatically by release.sh script***
- checkout the mplayer src tree
- check out FFmpeg subdirs
- remove obsolete DOCS translations, help files
- replace version.sh with this (change version number too...):
============
#!/bin/sh
echo "#define VERSION \"1.0pre5-$1 \"" > version.h
============
- build the HTML docs from XML sources, then clean up:
make html-chunked; make releaseclean
@ -38,9 +33,9 @@ release the tree:
***end of part done by release.sh**
test it (download to your local machine, extract, compile, run)
- compilers: gcc 3, gcc 2.95, mingw, cygwin
- compilers: gcc 4.x, gcc 3.x, gcc 2.95, MinGW, Cygwin
- architectures: PPC, AMD64, x86 with MMX[2], SSE[2], 3DNow
- OS: Linux, BSD, Windows, MacOS X
- OS: Linux, BSD, Windows, Mac OS X
copy to FTP:
cp MPlayer-0.90rc5.tar.bz2 /home/ftp/MPlayer/releases/

View File

@ -13,10 +13,10 @@ If you want to add a codec yourself, read DOCS/tech/codecs.conf.txt.
VFW codecs
VfW codecs
~~~~~~~~~~
VFW (Video for Windows) is the old video API for Windows. Its codecs have
VfW (Video for Windows) is the old video API for Windows. Its codecs have
the '.dll' or (rarely) '.drv' extension. If MPlayer fails at playing your
AVI with this kind of message:
@ -26,7 +26,7 @@ Cannot find codec matching selected -vo and video format 0x55594648.
It means your AVI is encoded with a codec which has the HFYU fourcc (HFYU =
HuffYUV codec, DIV3 = DivX Low Motion, etc.). Now that you know this, you
have to find out which DLL Windows loads in order to play this file.
You can find the vfw codec by searching the internet for e.g. VIDC.HFYU.
You can find the VfW codec by searching the internet for e.g. VIDC.HFYU.
In our case, the 'system.ini' also contains this information in a line that reads:
@ -111,9 +111,9 @@ false hits, but you may get lucky...
Tips:
~~~~~~~
If you get an error loading a new codec, it may need some more files to work.
Start the filemon utility before loading MPlayer to find out which dlls are
Start the filemon utility before loading MPlayer to find out which DLLs are
trying to be loaded.
Your codec may load some external .dll libraries. If the codec is already
Your codec may load some external DLL libraries. If the codec is already
installed in Windows, run listdlls wmplayer.exe while Windows Media
Player is playing your file to find out which.

6
DOCS/xml/configure vendored
View File

@ -186,11 +186,13 @@ then
if test -z "$_fake_chunk_xsl"
then
echo "Found xsltproc. If it works, it's probably the best choice."
# HACK: xslt always need a target file if a doctype is set
_xsltcommand="OUTPUT=\"\$1\"; if test -d \"\$OUTPUT\" ; then OUTPUT=\"\$OUTPUT/dummy.html\" ; fi;"
if test -n "$_catalog"
then
_xsltcommand="xsltproc --catalogs -o \$1 \$2 \$3"
_xsltcommand="$_xsltcommand xsltproc --catalogs -o \$OUTPUT \$2 \$3"
else
_xsltcommand="xsltproc -o \$1 \$2 \$3"
_xsltcommand="$_xsltcommand xsltproc -o \$OUTPUT \$2 \$3"
fi
else
echo "Found xsltproc but no stylesheets on your system."

View File

@ -357,7 +357,7 @@ practice, this means a value high enough so that it poses no limit, like
10000Kbit.) With no real restriction on bitrate, the result is that
the codec will use the lowest
possible quantizer for each macroblock (as specified by
<option>vqmin</option> for
<option>vqmin</option> for
<systemitem class="library">libavcodec</systemitem>, which is 2 by default).
As soon as you specify a
low enough bitrate that the codec
@ -1327,7 +1327,7 @@ With these things in mind, here is our first example:
mencoder <replaceable>capture.avi</replaceable> -mc 0 -oac lavc -ovc lavc -lavcopts \
vcodec=mpeg2video:vbitrate=6000:ilme:ildct:acodec=mp2:abitrate=224
</screen>
Note the <option>ilme</option> and <option>ildct</option> options.
Note the <option>ilme</option> and <option>ildct</option> options.
</para>
</sect2>
@ -1421,7 +1421,7 @@ which widely depend on personal taste and technical constraints.
bugs which have not yet been noticed and which can ruin an encode.
This is simply the tradeoff for using bleeding-edge technology.
</para>
<para>
What is more, beginning to use a new codec requires that you spend some
time becoming familiar with its options, so that you know what
@ -1453,13 +1453,13 @@ which widely depend on personal taste and technical constraints.
However, they may have some very advanced options that, if enabled,
will make the encode really slow for marginal gains.
</para>
<para>
If you are after blazing speed you should stick around the default
settings of the video codec (although you should still try the other
options which are mentioned in other sections of this guide).
</para>
<para>
You may also consider choosing a codec which can do multi-threaded
processing, though this is only useful for users of machines with
@ -1605,7 +1605,7 @@ will encode <replaceable>destination_sound.wav</replaceable> with
the encoding quality 1, which is roughly equivalent to 80Kb/s, and
is the minimum quality at which you should encode if you care about
quality.
Please note that <application>MEncoder</application> currently cannot
Please note that <application>MEncoder</application> currently cannot
mux Vorbis audio tracks
into the output file because it only supports AVI and MPEG
containers as an output, each of which may lead to audio/video
@ -1773,7 +1773,7 @@ only cover its usage.
</para>
<para>
Probably the easiest way to get started with Matroska is to use
Probably the easiest way to get started with Matroska is to use
<application>MMG</application>, the graphical frontend shipped with
<application>mkvtoolnix</application>, and follow the
<ulink url="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge-gui.html">guide to mkvmerge GUI (mmg)</ulink>
@ -2240,7 +2240,7 @@ will be 24000/1001 frames per second.
accurate method available for encoding both telecine and
"mixed progressive and telecine".
<screen>
mencoder dvd://1 -oac copy -vf pullup,softskip
mencoder dvd://1 -oac copy -vf pullup,softskip
-ovc lavc -ofps 24000/1001<!--
--></screen>
</para></listitem>
@ -4006,7 +4006,7 @@ random differences in the achieved bitrate.
This option is for choosing the motion estimation search method.
Altering this option provides a straightforward quality-vs-speed
tradeoff. <option>me=dia</option> is only a few percent faster than
the default search, at a cost of under 0.1dB global PSNR. The
the default search, at a cost of under 0.1dB global PSNR. The
default setting (<option>me=hex</option>) is a reasonable tradeoff
between speed and quality. <option>me=umh</option> gains a little under
0.1dB global PSNR, with a speed penalty that varies depending on
@ -4235,7 +4235,7 @@ random differences in the achieved bitrate.
(understanding that there are diminishing returns which may become
vanishingly low, or even zero). The video stream will still have seekable
points as long as there are some scene changes.
</para></listitem>
</para></listitem>
<listitem>
<para>
<emphasis role="bold">deblock</emphasis>:
@ -4551,17 +4551,17 @@ and other options. This is known to work on x86 on both *NIX and Windows.
</para>
<para>
First you must build the <application>vfw2menc</application> program.
It is located in the <filename class="directory">TOOLS</filename> subdirectory
It is located in the <filename class="directory">TOOLS</filename> subdirectory
of the MPlayer source tree.
To build on Linux, this can be done using <application>Wine</application>:
<screen>winegcc vfw2menc.c -o vfw2menc -lwinmm -lole32</screen>
To build on Windows in <application>MinGW</application> or
To build on Windows in <application>MinGW</application> or
<application>Cygwin</application> use:
<screen>gcc vfw2menc.c -o vfw2menc.exe -lwinmm -lole32</screen>
To build on <application>MSVC</application> you will need getopt.
Getopt can be found in the original <application>vfw2menc</application>
Getopt can be found in the original <application>vfw2menc</application>
archive available at:
The <ulink url="http://oss.netfarm.it/mplayer-win32.php">MPlayer on win32</ulink> project.
</para>
@ -4571,13 +4571,13 @@ Below is an example with the VP6 codec.
<screen>
vfw2menc -f VP62 -d vp6vfw.dll -s firstpass.mcf
</screen>
This will open the VP6 codec dialog window.
This will open the VP6 codec dialog window.
Repeat this step for the second pass
and use <option>-s <replaceable>secondpass.mcf</replaceable></option>.
</para>
</informalexample>
<para>
Windows users can use
Windows users can use
<option>-xvfwopts codec=vp6vfw.dll:compdata=dialog</option> to have
the codec dialog display before encoding starts.
</para>
@ -4882,11 +4882,11 @@ mp4creator -optimize narnia.mp4</screen>
<para>
If you want to add tags to your video that show up in iTunes, you can use
<ulink url="http://atomicparsley.sourceforge.net/">AtomicParsley</ulink>.
<screen>AtomicParsley narnia.mp4 --metaEnema --title "The Chronicles of Narnia" --year 2005 --stik Movie --freefree --overWrite</screen>
The <option>--metaEnema</option> option removes any existing metadata
(<application>mp4creator</application> inserts its name in the
(<application>mp4creator</application> inserts its name in the
"encoding tool" tag), and <option>--freefree</option> reclaims the
space from the deleted metadata.
The <option>--stik</option> option sets the type of video (such as Movie
@ -4954,7 +4954,7 @@ compliant.
<tbody>
<row>
<entry>NTSC DVD</entry>
<entry>720x480, 704x480, 352x480, 352x240</entry>
<entry>720x480, 704x480, 352x480, 352x240</entry>
<entry>MPEG-2</entry>
<entry>9800 kbps</entry>
<entry>48000 Hz</entry>
@ -4967,7 +4967,7 @@ compliant.
<entry>NTSC DVD</entry>
<entry>352x240<footnote id='fn-rare-resolutions'><para>
These resolutions are rarely used for DVDs because
they are fairly low quality.</para></footnote></entry>
they are fairly low quality.</para></footnote></entry>
<entry>MPEG-1</entry>
<entry>1856 kbps</entry>
<entry>48000 Hz</entry>
@ -5062,7 +5062,7 @@ highly bitrate-starved and require effort to obtain acceptable quality.
<title>GOP Size Constraints</title>
<para>
DVD, VCD, and SVCD also constrain you to relatively low
DVD, VCD, and SVCD also constrain you to relatively low
GOP (Group of Pictures) sizes.
For 30 fps material the largest allowed GOP size is 18.
For 25 or 24 fps, the maximum is 15.
@ -5078,7 +5078,7 @@ The GOP size is set using the <option>keyint</option> option.
VCD video is required to be CBR at 1152 kbps.
This highly limiting constraint also comes along with an extremely low vbv
buffer size of 327 kilobits.
SVCD allows varying video bitrates up to 2500 kbps, and a somewhat less
SVCD allows varying video bitrates up to 2500 kbps, and a somewhat less
restrictive vbv buffer size of 917 kilobits is allowed.
DVD video bitrates may range anywhere up to 9800 kbps (though typical
bitrates are about half that), and the vbv buffer size is 1835 kilobits.
@ -5125,7 +5125,7 @@ DVD (with timestamps on every frame, if possible):
<para>
DVD with NTSC Pullup:
<screen>-of mpeg -mpegopts format=dvd:tsaf:telecine -ofps 24000/1001</screen>
This allows 24000/1001 fps progressive content to be encoded at 30000/1001
This allows 24000/1001 fps progressive content to be encoded at 30000/1001
fps whilst maintaining DVD-compliance.
</para>
@ -5191,7 +5191,7 @@ or in the manual page.
<para>
If the audio sample rate in the original file is not the same as
required by the target format, sample rate conversion is required.
This is achieved using the <option>-srate</option> option and
This is achieved using the <option>-srate</option> option and
the <option>-af lavcresample</option> audio filter together.
</para>
@ -5259,7 +5259,7 @@ or DVD:
Used to set the GOP size.
18 for 30fps material, or 15 for 25/24 fps material.
Commercial producers seem to prefer keyframe intervals of 12.
It is possible to make this much larger and still retain compatibility
It is possible to make this much larger and still retain compatibility
with most players.
A <option>keyint</option> of 25 should never cause any problems.
</para></listitem>

View File

@ -608,7 +608,7 @@ mencoder mf://<replaceable>frame001.jpg,frame002.jpg</replaceable> -mf w=800:h=6
Creating an MPEG-4 file from explicit list of JPEG files (list.txt in current
directory contains the list of files to use as source, one per line):
<screen>
mencoder mf://<replaceable>@list.txt</replaceable> -mf w=800:h=600:fps=25:type=jpg \
mencoder mf://<replaceable>@list.txt</replaceable> -mf w=800:h=600:fps=25:type=jpg \
-ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o <replaceable>output.avi</replaceable>
</screen>
</para>

View File

@ -52,7 +52,7 @@ Here are just a few tips:
<listitem><para>
Choose some sane image dimensions. The dimensions of the resulting image
should be divisible by 16.
</para></listitem>
</para></listitem>
<listitem>
<para>
If you capture the video with the vertical resolution higher than half
@ -88,7 +88,7 @@ Here are just a few tips:
time. If you have a large capture buffer, <application>MEncoder</application>
can survive an overload for few seconds but nothing more. It's better to
turn off the 3D OpenGL screensavers and similar stuff.
</para></listitem>
</para></listitem>
<listitem><para>
Don't mess with the system clock. <application>MEncoder</application> uses the
system clock for doing A/V sync. If you adjust the system clock (especially
@ -118,7 +118,7 @@ Here are just a few tips:
<filename>linux/Documentation/sound/btaudio</filename> file (in the kernel
tree, not <application>MPlayer</application>'s) for some instructions on using
this driver.
</para></listitem>
</para></listitem>
<listitem><para>
If <application>MEncoder</application> cannot open the audio device, make
sure that it is really available. There can be some trouble with the sound
@ -251,7 +251,7 @@ Here is an example for Russian:
</row>
<row>
<entry>C</entry>
<entry>Cycle through teletext rendering modes (opaque, transparent, inverted opaque,
<entry>Cycle through teletext rendering modes (opaque, transparent, inverted opaque,
inverted transparent</entry>
</row>
<row>

View File

@ -602,11 +602,11 @@ is specified.
<title>MPEG audio Passthrough</title>
<para>
Digital TV transmissions (such as DVB and ATSC) and some DVDs usually have
Digital TV transmissions (such as DVB and ATSC) and some DVDs usually have
MPEG audio streams (in particular MP2).
Some MPEG hardware decoders such as full-featured DVB cards and DXR2
adapters can natively decode this format.
<application>MPlayer</application> can be configured to relay the audio data
Some MPEG hardware decoders such as full-featured DVB cards and DXR2
adapters can natively decode this format.
<application>MPlayer</application> can be configured to relay the audio data
without decoding it.
</para>

View File

@ -2007,7 +2007,7 @@ the native OSD feature of DVB cards.
<application>MPlayer</application> supports hardware accelerated playback
with the Creative DXR2 card.
</para>
<para>
First of all you will need properly installed DXR2 drivers. You can find
the drivers and installation instructions at the

View File

@ -167,7 +167,7 @@ nevezett értelmetlen korlátozást.
Szégyen, hogy a DVD meghajtókat arra kényszerítik, hogy a hat különböző
régióból, amire a világot felosztották, csak az egyikben gyártott lemezeket
fogadják el. Hogy egy asztal körül ülő pár ember hogy állhatott elő egy ilyen
ötlettel és hogyan várhatják el, hogy a 21. században elfogadnak egy ilyen
ötlettel és hogyan várhatják el, hogy a 21. században elfogadnak egy ilyen
ötletet, az minden képzeletet felülmúl.
</para>

View File

@ -63,7 +63,7 @@ Az <application>MPlayer</application> egy Linuxon működő videolejátszó (fut
számos más Unix-on és nem-x86 processzorokon is, lásd <xref linkend="ports"/>).
Le tudja játszani a legtöbb MPEG, VOB, AVI, Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4,
FLI, RM, NuppelVideo, yuv4mpeg, FILM, RoQ, PVA, és Matroska file-t, és ezekhez
felsorakoztat jónéhány natív, XAnim, RealPlayer és Win32 DLL codecet. Nézhetsz vele
felsorakoztat jónéhány natív, XAnim, RealPlayer és Win32 DLL codecet. Nézhetsz vele
Video CD-t, SVCD-t, DVD-t, 3ivx, RealMedia, Sorenson, Theora
és MPEG-4 (DivX) filmet is. Az <application>MPlayer</application>
másik nagy előnye a megjelenítési módok széles választékában rejlik.
@ -73,7 +73,7 @@ az SDL/GGI drivereit is), és néhány alacsony szintű kártyaspecifikus vezér
(Matrox, 3dfx, Radeon, Mach64, Permedia3) is használható!
Legtöbbjük támogat szoftveres vagy hardveres nagyítást, így a teljesképernyős
mód is elérhető. Az <application>MPlayer</application> támogat továbbá hardveres
MPEG kártyákkal történő dekódolást/megjelenítést, így például a
MPEG kártyákkal történő dekódolást/megjelenítést, így például a
<link linkend="dvb">DVB</link> és <link linkend="dxr3">DXR3/Hollywood+</link>
kártyákon!
És még nem is szóltam a szép, élsímított, árnyékolt feliratozásról

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- synced with r28510 -->
<!-- synced with r28984 -->
<chapter id="encoding-guide">
<title>Kódolás a <application>MEncoder</application>rel</title>
@ -1429,13 +1429,13 @@ a személyes igények és a technikai korlátok határoznak meg.
Azonban van néhány nagyon fejlett opció, amit ha engedélyezel, nagyon
nagy mértékben lelassítják a kódolást csekély javulást produkálva.
</para>
<para>
Ha a fantasztikus sebességet keresed, a codec alapértelmezett beállításai
körül nézelődj (azonban így is ajánlott kipróbálni egyéb opciókat,
amiket ezen leírás más fejezetei említenek).
</para>
<para>
Megfontolandó olyan codec-et választani, ami több-szálas módban
dolgozza fel a forrást, azonban ez csak a több processzoros géppel
@ -1681,7 +1681,7 @@ megy.
</para>
<para>
Ezen hatalmas hátrány mellett az AVI-nak a következő fő korlátai vannak:
Ezen hatalmas hátrány mellett az AVI-nak a következő fő korlátai vannak:
</para>
<orderedlist>
@ -2364,7 +2364,7 @@ Az időtartam/hely alapján kell döntened.
</listitem>
<listitem><formalpara>
<title>A kódolási paraméterekről és a minőségről:</title>
<title>A kódolási paraméterekről és a minőségről:</title>
<para>
Csak mert itt javasoltam az <option>mbd=2</option>-t, nem jelenti
azt, hogy máshol ne lehetne használni. A <option>trell</option>-lel
@ -3902,7 +3902,7 @@ elért bitráta különbségből adódik.
globális PSNR növelést jelent, változó 15%-33%-os sebességveszteség árán.
Mivel a kódolási idő vs. minőség arány eléggé rossz, csak akkor ajánlott
használni, ha minden egyes bit fontos és a kódolási idő nem számít.
</para>
</para>
</listitem>
<listitem>
<para>
@ -3954,7 +3954,7 @@ elért bitráta különbségből adódik.
Ezek legtöbbször ritka, szélsőséges esetek, de ha teljesen biztos
akarsz lenni, gondolkozz el rajta, hogy van-e a videódban teljes
képernyős ismétlődő, csillogó minta vagy nagyon nagy ideiglenes
elzáródás, ami kikényszeríthet egy I-kockát.
elzáródás, ami kikényszeríthet egy I-kockát.
Az első lépés <option>frameref</option>-jét úgy állítsd be, hogy
elég nagy legyen ahhoz, hogy tartalmazza a villódzási ciklust
(vagy az elzárást). Például ha a jelenet oda-vissza ugrál két kép
@ -4197,7 +4197,7 @@ elért bitráta különbségből adódik.
azt, hogy egyre csökkenő hasznot hoz, mely végül szinte észrevehetetlenül
kicsi vagy akár nulla lesz). A videó folyam még így is fog tartalmazni
kereshető pontokat, amíg van benne jelenet váltás.
</para></listitem>
</para></listitem>
<listitem>
<para>
<emphasis role="bold">deblock</emphasis>:
@ -4255,7 +4255,7 @@ elért bitráta különbségből adódik.
Ez <emphasis role="bold">még</emphasis> nem igazolja a deblocking
szűrő erősségének csökkentését.
Általában jobb zajminőséget érhetsz el az utófeldolgozással.
Ha a H.264 kódolásod túl foltos vagy maszatos, próbáld meg
Ha a H.264 kódolásod túl foltos vagy maszatos, próbáld meg
lejátszani a <option>-vf noise</option> kapcsolóval.
A <option>-vf noise=8a:4a</option>-nak a gyenge mellékhatásokat
el kell tüntetnie.
@ -4409,7 +4409,7 @@ opciókat, ha a codec hibázik vagy rossz kimenetet ad.
<entry>jp2avi.dll</entry>
<entry>ImagePower MJPEG2000 (IPJ2)</entry>
<entry>d860a11766da0d0ea064672c6833768b</entry>
<entry><option>-vf flip</option></entry>
<entry><option>-vf flip</option></entry>
</row>
<row>
<entry>m3jp2k32.dll</entry>
@ -4845,7 +4845,7 @@ mp4creator -optimize narnia.mp4</screen>
<para>
Ha tag-eket akarsz hozzáfűzni a videódhoz, amiket az iTunes megjelnít, használhatod az
<ulink url="http://atomicparsley.sourceforge.net/">AtomicParsley</ulink>-t.
<screen>AtomicParsley narnia.mp4 --metaEnema --title "The Chronicles of Narnia" --year 2005 --stik Movie --freefree --overWrite</screen>
A <option>--metaEnema</option> opció eltávolít minden meglévő metadata-t
@ -4879,7 +4879,7 @@ mp4creator -optimize narnia.mp4</screen>
A <application>MEncoder</application> képes VCD, SCVD és DVD formátumú
MPEG fájlok létrehozására a
<systemitem class="library">libavcodec</systemitem> könyvtár segítségével.
Ezek a fájlok a
Ezek a fájlok a
<ulink url="http://www.gnu.org/software/vcdimager/vcdimager.html">vcdimager</ulink>-rel
vagy a
<ulink url="http://dvdauthor.sourceforge.net/">dvdauthor</ulink>-ral
@ -4918,7 +4918,7 @@ legyen.
<tbody>
<row>
<entry>NTSC DVD</entry>
<entry>720x480, 704x480, 352x480, 352x240</entry>
<entry>720x480, 704x480, 352x480, 352x240</entry>
<entry>MPEG-2</entry>
<entry>9800 kbps</entry>
<entry>48000 Hz</entry>
@ -4931,7 +4931,7 @@ legyen.
<entry>NTSC DVD</entry>
<entry>352x240<footnote id='fn-rare-resolutions'><para>
Ezek a felbontások ritkán használatosak a DVD-ken, mert elég
alacsony minőségűek.</para></footnote></entry>
alacsony minőségűek.</para></footnote></entry>
<entry>MPEG-1</entry>
<entry>1856 kbps</entry>
<entry>48000 Hz</entry>

View File

@ -466,7 +466,7 @@ Letöltöttem egy videót egy P2P hálózatról és nem megy!
</para></question>
<answer><para>
A fájlod valószínűleg sérült vagy fake. Ha egy ismerőstől kaptad és ő
azt mondja, hogy működik, hasonlítsd össze az
azt mondja, hogy működik, hasonlítsd össze az
<application>md5sum</application> hash-eket.
</para></answer>
</qandaentry>

View File

@ -373,7 +373,7 @@ mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 \
<para>
A <application>MEncoder</application> támogatja a Sony PSP videó formátumába
történő kódolást, de a PSP szoftverének változatától függően különböző
történő kódolást, de a PSP szoftverének változatától függően különböző
korlátok vannak.
Nyugodt lehetsz, ha a következő korlátokat figyelembe veszed:
<itemizedlist>
@ -610,7 +610,7 @@ mencoder mf://<replaceable>frame001.jpg,frame002.jpg</replaceable> -mf w=800:h=6
Egy MPEG-4 fájl létrehozása JPEG fájlok explicit listájából (az aktuális könyvtárban
lévő lista.txt tartalmazza a forrásként felhasználandó fájlokat, soronként egyet):
<screen>
mencoder mf://<replaceable>@lista.txt</replaceable> -mf w=800:h=600:fps=25:type=jpg \
mencoder mf://<replaceable>@lista.txt</replaceable> -mf w=800:h=600:fps=25:type=jpg \
-ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o <replaceable>kimenet.avi</replaceable>
</screen>
</para>

View File

@ -527,7 +527,7 @@ levelezési listát is segítéségért és a legfrissebb információkért.
A hivatalos Windows-os binárisok megtalálhatóak a
<ulink url="http://www.mplayerhq.hu/design7/dload.html">letöltési oldalon</ulink>.
A külső forrásból származó telepítő csomagokat és egyszerű GUI frontend-eket
összegyűjtöttük a
összegyűjtöttük a
<ulink url="http://www.mplayerhq.hu/design7/projects.html#windows">kapcsolódó projektek oldal</ulink>
Windows-os részében.
</para>
@ -616,7 +616,7 @@ is segíthet. Ha a lejátszás szaggatott, próbáld meg a
<option>-autosync 100</option> opciót. Ha ezek közül bármelyik segít, írd
be a konfigurációs fájlodba.
</para>
<note>
<para>
Ha Pentium 4-ed van és fagyásokat tapasztalsz a RealPlayer
@ -670,7 +670,7 @@ alaphelyzetben nincs benne a <application>MinGW</application>-ben.
Állítsd be a <option>--prefix=/mingw</option> kapcsolóval és
telepítsd, mielőtt az <application>MPlayer</application>t fordítanád.
</para>
<para>
Az <application>MPlayer</application> és a szükséges függvénykönyvtárak
elkészítésének módját elolvashatod az
@ -824,7 +824,7 @@ Lehet, hogy szerkesztened kell a <filename>config.mak</filename> fájlt és
<para>
Folytasd a
<screen>make</screen>
paranccsal, majd menj a mplayerosx könyvtárba és írd be
paranccsal, majd menj a mplayerosx könyvtárba és írd be
<screen>make dist</screen>
Ez egy tömörített <systemitem>.dmg</systemitem> archívot hoz létre
egy használatra kész binárissal.

View File

@ -92,13 +92,13 @@ aktiválható).
és <emphasis>címkék</emphasis>.
Minden egyes elemnek meg kell adnod a pozícióját és a méretét.
</para>
<para>
Egy <emphasis role="bold">gomb</emphasis>nak három állása van (lenyomott,
felengedett, letiltott), így a képe függőlegesen három részre van osztva.
Lásd a <link linkend="skin-button">gomb</link> elemet a részletekért.
</para>
<para>
Egy <emphasis role="bold">potmeter</emphasis>nek (főként a kereső sáv és a
hangerő/balansz állító) bármennyi fázisa lehet a képének egymás alatti
@ -106,7 +106,7 @@ aktiválható).
<link linkend="skin-hpotmeter">hpotmeter</link>t és
<link linkend="skin-potmeter">potmeter</link>t a részletekért.
</para>
<para>
A <emphasis role="bold">címkék</emphasis> egy kicsit különlegesek: A
megrajzolásukhoz szükséges karaktereket egy kép fájlból nyerjük és
@ -781,7 +781,7 @@ Ahol az <literal><replaceable>image</replaceable></literal> a betűhöz használ
kép fájl neve (nem kell megadnod a kiterjesztést).
<anchor id="skin-font-char"/>
<programlisting>"char" = X, Y, width, height</programlisting>
Itt az <literal>X</literal> és az <literal>Y</literal> a
Itt az <literal>X</literal> és az <literal>Y</literal> a
<literal>char</literal> karakter pozícióját adja meg a képen (<literal>0,0</literal>
a bal felső sarok). A <literal>width</literal> és a <literal>height</literal>
a karakter méretei pixelben.

View File

@ -2020,7 +2020,7 @@ lejátszást a Creative DXR2 kártyával.
<para>
Mindenek előtt megfelelően telepített DXR2 vezérlő kell. A vezérlőt és
a telepítési útmutatót megtalálhatod a
a telepítési útmutatót megtalálhatod a
<ulink url="http://dxr2.sf.net/">DXR2 Resource Center</ulink> oldalán.
</para>

File diff suppressed because it is too large Load Diff

438
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -44,20 +44,15 @@ static void check_os_katmai_support( void );
// return TRUE if cpuid supported
static int has_cpuid(void)
{
long a, c;
// code from libavcodec:
#if ARCH_X86_64
#define PUSHF "pushfq\n\t"
#define POPF "popfq\n\t"
return 1;
#else
#define PUSHF "pushfl\n\t"
#define POPF "popfl\n\t"
#endif
long a, c;
__asm__ volatile (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
PUSHF
"pushfl\n\t"
"pop %0\n\t"
"mov %0, %1\n\t"
@ -65,19 +60,18 @@ static int has_cpuid(void)
/* to the EFLAGS reg */
"xor $0x200000, %0\n\t"
"push %0\n\t"
POPF
"popfl\n\t"
/* ... Get the (hopefully modified) EFLAGS */
PUSHF
"pushfl\n\t"
"pop %0\n\t"
: "=a" (a), "=c" (c)
:
: "cc"
);
#undef PUSHF
#undef POPF
return a != c;
#endif
}
static void
@ -277,7 +271,7 @@ static void sigill_handler_sse( int signal, struct sigcontext sc )
}
#endif /* __linux__ && _POSIX_SOURCE */
#if defined(__MINGW32__) || defined(__CYGWIN__)
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && !ARCH_X86_64
LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
{
if(ep->ExceptionRecord->ExceptionCode==EXCEPTION_ILLEGAL_INSTRUCTION){

View File

@ -8,33 +8,7 @@
#define CPUTYPE_I586 5
#define CPUTYPE_I686 6
#if ARCH_X86_64
# define REGa rax
# define REGb rbx
# define REGBP rbp
# define REGSP rsp
# define REG_a "rax"
# define REG_b "rbx"
# define REG_c "rcx"
# define REG_d "rdx"
# define REG_S "rsi"
# define REG_D "rdi"
# define REG_SP "rsp"
# define REG_BP "rbp"
#else
# define REGa eax
# define REGb ebx
# define REGBP ebp
# define REGSP esp
# define REG_a "eax"
# define REG_b "ebx"
# define REG_c "ecx"
# define REG_d "edx"
# define REG_S "esi"
# define REG_D "edi"
# define REG_SP "esp"
# define REG_BP "ebp"
#endif
#include "libavutil/x86_cpu.h"
typedef struct cpucaps_s {
int cpuType;

View File

@ -8,15 +8,6 @@
#include <string.h>
#include <unistd.h>
#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;
ftime( &timebuffer );
t->tv_sec=timebuffer.time;
t->tv_usec=1000*timebuffer.millitm;
}
#endif
#ifdef __MINGW32__
#define MISSING_USLEEP
#include <windows.h>
@ -195,6 +186,8 @@ main(void)
char *desc;
} cap2[] = {
CPUID_FEATURE_DEF(0, "pni", "SSE3 Extensions"),
CPUID_FEATURE_DEF(1, "pclmulqdq", "Carryless Multiplication"),
CPUID_FEATURE_DEF(2, "dtes64", "64-bit Debug Store"),
CPUID_FEATURE_DEF(3, "monitor", "MONITOR/MWAIT"),
CPUID_FEATURE_DEF(4, "ds_cpl", "CPL Qualified Debug Store"),
CPUID_FEATURE_DEF(5, "vmx", "Virtual Machine Extensions"),
@ -203,13 +196,20 @@ main(void)
CPUID_FEATURE_DEF(8, "tm2", "Thermal Monitor 2"),
CPUID_FEATURE_DEF(9, "ssse3", "Supplemental SSE3"),
CPUID_FEATURE_DEF(10, "cid", "L1 Context ID"),
CPUID_FEATURE_DEF(12, "fma", "Fused Multiply Add"),
CPUID_FEATURE_DEF(13, "cx16", "CMPXCHG16B Available"),
CPUID_FEATURE_DEF(14, "xtpr", "xTPR Disable"),
CPUID_FEATURE_DEF(15, "pdcm", "Perf/Debug Capability MSR"),
CPUID_FEATURE_DEF(18, "dca", "Direct Cache Access"),
CPUID_FEATURE_DEF(19, "sse4_1", "SSE4.1 Extensions"),
CPUID_FEATURE_DEF(20, "sse4_2", "SSE4.2 Extensions"),
CPUID_FEATURE_DEF(21, "x2apic", "x2APIC Feature"),
CPUID_FEATURE_DEF(22, "movbe", "MOVBE Instruction"),
CPUID_FEATURE_DEF(23, "popcnt", "Pop Count Instruction"),
CPUID_FEATURE_DEF(25, "aes", "AES Instruction"),
CPUID_FEATURE_DEF(26, "xsave", "XSAVE/XRSTOR Extensions"),
CPUID_FEATURE_DEF(27, "osxsave", "XSAVE/XRSTOR Enabled in the OS"),
CPUID_FEATURE_DEF(28, "avx", "Advanced Vector Extension"),
{ -1 }
};
static struct {
@ -236,7 +236,7 @@ main(void)
CPUID_FEATURE_DEF(1, "cmp_legacy", "Chip Multi-Core"),
CPUID_FEATURE_DEF(2, "svm", "Secure Virtual Machine"),
CPUID_FEATURE_DEF(3, "extapic", "Extended APIC Space"),
CPUID_FEATURE_DEF(4, "cr8legacy", "CR8 Available in Legacy Mode"),
CPUID_FEATURE_DEF(4, "cr8_legacy", "CR8 Available in Legacy Mode"),
CPUID_FEATURE_DEF(5, "abm", "Advanced Bit Manipulation"),
CPUID_FEATURE_DEF(6, "sse4a", "SSE4A Extensions"),
CPUID_FEATURE_DEF(7, "misalignsse", "Misaligned SSE Mode"),
@ -290,11 +290,11 @@ main(void)
have to check the family, model and stepping instead. */
if (strstr(idstr, "AMD") &&
family == 5 &&
(model >= 9 || model == 8 && stepping >= 8))
(model >= 9 || (model == 8 && stepping >= 8)))
printf(" %s", "k6_mtrr");
/* similar for cyrix_arr. */
if (strstr(idstr, "Cyrix") &&
(family == 5 && model < 4 || family == 6))
(family == 5 && (model < 4 || family == 6)))
printf(" %s", "cyrix_arr");
/* as well as centaur_mcr. */
if (strstr(idstr, "Centaur") &&

2
debian/control vendored
View File

@ -7,7 +7,7 @@ Build-Depends: libgtk1.2-dev | libgtk2.0-dev, libpng12-dev, zlib1g-dev, x11proto
Package: mplayer
Architecture: any
Depends: ${shlibs:Depends},debconf,libconfhelper-perl
Depends: ${shlibs:Depends},debconf
Description: The Ultimate Movie Player
MPlayer is a movie player for LINUX (runs on many other Unices, and non-x86
CPUs, see the ports section). It plays most MPEG, VOB, AVI, OGG/OGM, VIVO,

58
debian/postinst vendored
View File

@ -1,58 +0,0 @@
#!/usr/bin/perl -w
# mplayer postinst
require ConfHelper;
use Debconf::Client::ConfModule qw(:all);
use IO::Handle;
use Fcntl;
my $version = version(2.0);
my $didupgrade = 0;
dealwithupgrades();
my $mcfg = new ConfHelper('mplayer', "/etc/mplayer/mplayer.conf");
my $dcarea = "" ;
my $font = scalar(get("mplayer/ttfont")) ;
$dcarea .= "#truetype font\nfont=" . $font . "\n" if $font;
$mcfg->setconfarea($dcarea);
sub dealwithupgrades {
open(OLDCONF, "</etc/mplayer/mplayer.conf") || return 1;
close OLDCONF;
my $mconf = new ConfHelper("mplayer", "/etc/mplayer/mplayer.conf");
return 1 if ($mconf->hasconfarea());
undef $mconf;
if ((get('mplayer/replace-existing-files') eq 'true') &&
(fget('mplayer/replace-existing-files', 'isdefault') eq 'false')) {
$didupgrade = 1;
for my $file ("/etc/mplayer/mplayer.conf" ) {
debug("Moving away $file");
rename($file,$file . ".old");
}
} else {
debug("Upgrade refused, exiting");
exit 0;
}
}
sub debug {
print STDERR @_, "\n";
}
# pass control to debhelper scripts..
#
my $temp="set -e\nset -- @ARGV\n" . << 'DEBHELPER_EOF_';
#DEBHELPER#
DEBHELPER_EOF_
system ($temp) / 256 == 0
or die "Problem with debhelper scripts: $!";

View File

@ -46,7 +46,7 @@ void set_default_mplayer_options(struct MPOpts *opts)
#else
.use_ar = 0,
#endif
.default_binds = 1,
.default_bindings = 1,
}
};
}

View File

@ -1520,24 +1520,11 @@ videocodec indeo3xa
; DV: qdv is more stable... libdv is slow, mcdv is unstable
videocodec qdv
info "Sony Digital Video (DV)"
status working
fourcc dvsl,dvsd,dvhd ; ????
fourcc DVSD dvsd ; pal .avi
fourcc "dvcp" dvsd ; pal .mov
fourcc "dvc " dvsd ; ntsc .mov
driver dshow
dll "qdv.dll"
guid 0xB1B77C00, 0xC3E4, 0x11CF, 0xAF, 0x79, 0x00, 0xAA, 0x00, 0xB6, 0x7A, 0x42
out YUY2
out UYVY
out BGR24,BGR16,BGR15 ; BGR32 is buggy, at least with one sample
videocodec ffdv
info "FFmpeg DV"
status working
fourcc CDVC,cdvc
fourcc CDVH,cdvh ; Canopus DVCPRO HD
fourcc DVSD,dvsd ; PAL
fourcc DVCS,dvcs ; NTSC ?
fourcc "dvcp" ; PAL DV in .mov
@ -1554,6 +1541,20 @@ videocodec ffdv
dll dvvideo
out 411P,422P,YV12
videocodec qdv
info "Sony Digital Video (DV)"
status working
fourcc dvsl,dvsd,dvhd ; ????
fourcc DVSD dvsd ; pal .avi
fourcc "dvcp" dvsd ; pal .mov
fourcc "dvc " dvsd ; ntsc .mov
driver dshow
dll "qdv.dll"
guid 0xB1B77C00, 0xC3E4, 0x11CF, 0xAF, 0x79, 0x00, 0xAA, 0x00, 0xB6, 0x7A, 0x42
out YUY2
out UYVY
out BGR24,BGR16,BGR15 ; BGR32 is buggy, at least with one sample
videocodec libdv
info "Raw DV (libdv)"
status working
@ -3036,6 +3037,7 @@ audiocodec ffqclp
info "FFmpeg QCLP audio"
status buggy
format 0x706C6351 ; "Qclp"
format 0x70637173 ; "sqcp"
driver ffmpeg
dll "qcelp"

View File

@ -28,6 +28,7 @@ static const struct {
{IMGFMT_BGR32, PIX_FMT_RGB32},
{IMGFMT_BGR24, PIX_FMT_BGR24},
{IMGFMT_BGR16, PIX_FMT_RGB565},
{IMGFMT_BGR15, PIX_FMT_RGB555},
{IMGFMT_BGR8, PIX_FMT_RGB8},
{IMGFMT_BGR4, PIX_FMT_RGB4},
{IMGFMT_BGR1, PIX_FMT_MONOBLACK},

View File

@ -2,7 +2,7 @@
// Dmitry Baryshkov <mitya@school.ioffe.ru>
// Reworked by: Andrew Savchenko aka Bircoph <Bircoph[at]list[dot]ru>
// Synced with help_mp-en.h: r28122
// Synced with help_mp-en.h: r28860
// ========================= MPlayer help ===========================

View File

@ -583,7 +583,7 @@ struct input_ctx {
unsigned int num_key_down;
unsigned int last_key_down;
bool default_binds;
bool default_bindings;
// List of command binding sections
mp_cmd_bind_section_t *cmd_bind_sections;
// Name of currently used command section
@ -623,8 +623,8 @@ static const m_option_t input_conf[] = {
OPT_STRING("js-dev", input.js_dev, CONF_GLOBAL),
OPT_STRING("ar-dev", input.ar_dev, CONF_GLOBAL),
OPT_STRING("file", input.in_file, CONF_GLOBAL),
OPT_FLAG_ON("default-binds", input.default_binds, CONF_GLOBAL),
OPT_FLAG_OFF("nodefault-binds", input.default_binds, CONF_GLOBAL),
OPT_FLAG_ON("default-bindings", input.default_bindings, CONF_GLOBAL),
OPT_FLAG_OFF("nodefault-bindings", input.default_bindings, CONF_GLOBAL),
{ NULL, NULL, 0, 0, 0, 0, NULL}
};
@ -1063,7 +1063,7 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, int n, int *keys,
cmd = find_bind_for_key(ictx->cmd_binds, n, keys);
if (ictx->cmd_binds_default && cmd == NULL)
cmd = find_bind_for_key(ictx->cmd_binds_default, n, keys);
if (ictx->default_binds && cmd == NULL)
if (ictx->default_bindings && cmd == NULL)
cmd = find_bind_for_key(def_cmd_binds,n,keys);
if(cmd == NULL) {
@ -1698,7 +1698,7 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf, int use_gui)
.ar_state = -1,
.ar_delay = input_conf->ar_delay,
.ar_rate = input_conf->ar_rate,
.default_binds = input_conf->default_binds,
.default_bindings = input_conf->default_bindings,
};
char* file;

View File

@ -91,9 +91,6 @@ static af_info_t* filter_list[]={
NULL
};
// Message printing
af_msg_cfg_t af_msg_cfg={0,NULL,NULL};
// CPU speed
int* af_cpu_speed = NULL;
@ -107,7 +104,7 @@ static af_info_t* af_find(char*name)
return filter_list[i];
i++;
}
af_msg(AF_MSG_ERROR,"Couldn't find audio filter '%s'\n",name);
mp_msg(MSGT_AFILTER, MSGL_ERR, "Couldn't find audio filter '%s'\n",name);
return NULL;
}
@ -135,7 +132,7 @@ static af_instance_t* af_create(af_stream_t* s, const char* name_with_cmd)
// Allocate space for the new filter and reset all pointers
af_instance_t* new=malloc(sizeof(af_instance_t));
if (!name || !new) {
af_msg(AF_MSG_ERROR,"[libaf] Could not allocate memory\n");
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Could not allocate memory\n");
goto err_out;
}
memset(new,0,sizeof(af_instance_t));
@ -151,13 +148,13 @@ static af_instance_t* af_create(af_stream_t* s, const char* name_with_cmd)
non-reentrant */
if(new->info->flags & AF_FLAGS_NOT_REENTRANT){
if(af_get(s,name)){
af_msg(AF_MSG_ERROR,"[libaf] There can only be one instance of"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] There can only be one instance of"
" the filter '%s' in each stream\n",name);
goto err_out;
}
}
af_msg(AF_MSG_VERBOSE,"[libaf] Adding filter %s \n",name);
mp_msg(MSGT_AFILTER, MSGL_V, "[libaf] Adding filter %s \n",name);
// Initialize the new filter
if(AF_OK == new->info->open(new) &&
@ -172,7 +169,7 @@ static af_instance_t* af_create(af_stream_t* s, const char* name_with_cmd)
err_out:
free(new);
af_msg(AF_MSG_ERROR,"[libaf] Couldn't create or open audio filter '%s'\n",
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Couldn't create or open audio filter '%s'\n",
name);
free(name);
return NULL;
@ -232,7 +229,7 @@ void af_remove(af_stream_t* s, af_instance_t* af)
if(!af) return;
// Print friendly message
af_msg(AF_MSG_VERBOSE,"[libaf] Removing filter %s \n",af->info->name);
mp_msg(MSGT_AFILTER, MSGL_V, "[libaf] Removing filter %s \n",af->info->name);
// Notify filter before changing anything
af->control(af,AF_CONTROL_PRE_DESTROY,0);
@ -321,14 +318,14 @@ static int af_reinit(af_stream_t* s, af_instance_t* af)
return rv;
}
if(!new){ // Should _never_ happen
af_msg(AF_MSG_ERROR,"[libaf] Unable to correct audio format. "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Unable to correct audio format. "
"This error should never uccur, please send bugreport.\n");
return AF_ERROR;
}
af=new->next;
}
else {
af_msg(AF_MSG_ERROR, "[libaf] Automatic filter insertion disabled "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Automatic filter insertion disabled "
"but formats do not match. Giving up.\n");
return AF_ERROR;
}
@ -347,7 +344,7 @@ static int af_reinit(af_stream_t* s, af_instance_t* af)
break;
}
default:
af_msg(AF_MSG_ERROR,"[libaf] Reinitialization did not work, audio"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Reinitialization did not work, audio"
" filter '%s' returned error code %i\n",af->info->name,rv);
return AF_ERROR;
}
@ -498,7 +495,7 @@ int af_init(af_stream_t* s)
(s->last->data->nch != s->output.nch) ||
(s->last->data->rate != s->output.rate)) {
// Something is stuffed audio out will not work
af_msg(AF_MSG_ERROR,"[libaf] Unable to setup filter system can not"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Unable to setup filter system can not"
" meet sound-card demands, please send bugreport. \n");
af_uninit(s);
return -1;
@ -589,7 +586,7 @@ int af_resize_local_buffer(af_instance_t* af, af_data_t* data)
{
// Calculate new length
register int len = af_lencalc(af->mul,data);
af_msg(AF_MSG_VERBOSE,"[libaf] Reallocating memory in module %s, "
mp_msg(MSGT_AFILTER, MSGL_V, "[libaf] Reallocating memory in module %s, "
"old len = %i, new len = %i\n",af->info->name,af->data->len,len);
// If there is a buffer free it
if(af->data->audio)
@ -597,7 +594,7 @@ int af_resize_local_buffer(af_instance_t* af, af_data_t* data)
// Create new buffer and check that it is OK
af->data->audio = malloc(len);
if(!af->data->audio){
af_msg(AF_MSG_FATAL,"[libaf] Could not allocate memory \n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[libaf] Could not allocate memory \n");
return AF_ERROR;
}
af->data->len=len;
@ -619,12 +616,12 @@ af_instance_t *af_control_any_rev (af_stream_t* s, int cmd, void* arg) {
void af_help (void) {
int i = 0;
af_msg(AF_MSG_INFO, "Available audio filters:\n");
mp_msg(MSGT_AFILTER, MSGL_INFO, "Available audio filters:\n");
while (filter_list[i]) {
if (filter_list[i]->comment && filter_list[i]->comment[0])
af_msg(AF_MSG_INFO, " %-15s: %s (%s)\n", filter_list[i]->name, filter_list[i]->info, filter_list[i]->comment);
mp_msg(MSGT_AFILTER, MSGL_INFO, " %-15s: %s (%s)\n", filter_list[i]->name, filter_list[i]->info, filter_list[i]->comment);
else
af_msg(AF_MSG_INFO, " %-15s: %s\n", filter_list[i]->name, filter_list[i]->info);
mp_msg(MSGT_AFILTER, MSGL_INFO, " %-15s: %s\n", filter_list[i]->name, filter_list[i]->info);
i++;
}
}

View File

@ -22,9 +22,18 @@
#include <stdio.h>
#include "config.h"
#include "af_mp.h"
#include "control.h"
#include "af_format.h"
#include "control.h"
#include "cpudetect.h"
#include "mp_msg.h"
/* Set the initialization type from mplayers cpudetect */
#ifdef AF_INIT_TYPE
#undef AF_INIT_TYPE
#define AF_INIT_TYPE \
((gCpuCaps.has3DNow || gCpuCaps.hasSSE)?AF_INIT_FAST:AF_INIT_SLOW)
#endif
struct af_instance_s;
@ -342,34 +351,4 @@ void af_fix_parameters(af_data_t *data);
#define lrnd(a,b) ((b)((a)>=0.0?(a)+0.5:(a)-0.5))
#endif
/* Error messages */
typedef struct af_msg_cfg_s
{
int level; /* Message level for debug and error messages max = 2
min = -2 default = 0 */
FILE* err; // Stream to print error messages to
FILE* msg; // Stream to print information messages to
}af_msg_cfg_t;
extern af_msg_cfg_t af_msg_cfg; // Message
//! \addtogroup af_filter
//! \{
#define AF_MSG_FATAL -3 ///< Fatal error exit immediately
#define AF_MSG_ERROR -2 ///< Error return gracefully
#define AF_MSG_WARN -1 ///< Print warning but do not exit (can be suppressed)
#define AF_MSG_INFO 0 ///< Important information
#define AF_MSG_VERBOSE 1 ///< Print this if verbose is enabled
#define AF_MSG_DEBUG0 2 ///< Print if very verbose
#define AF_MSG_DEBUG1 3 ///< Print if very very verbose
//! Macro for printing error messages
#ifndef af_msg
#define af_msg(lev, args... ) \
(((lev)<AF_MSG_WARN)?(fprintf(af_msg_cfg.err?af_msg_cfg.err:stderr, ## args )): \
(((lev)<=af_msg_cfg.level)?(fprintf(af_msg_cfg.msg?af_msg_cfg.msg:stdout, ## args )):0))
#endif
//! \}
#endif /* MPLAYER_AF_H */

View File

@ -62,7 +62,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
case AF_CONTROL_CENTER_CH | AF_CONTROL_SET: // Requires reinit
// Sanity check
if((*(int*)arg >= AF_NCH) || (*(int*)arg < 0)){
af_msg(AF_MSG_ERROR,"[sub] Center channel number must be between "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[sub] Center channel number must be between "
" 0 and %i current value is %i\n", AF_NCH-1, *(int*)arg);
return AF_ERROR;
}

View File

@ -108,7 +108,7 @@ static void copy(void* in, void* out, int ins, int inos,int outs, int outos, int
break;
}
default:
af_msg(AF_MSG_ERROR,"[channels] Unsupported number of bytes/sample: %i"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[channels] Unsupported number of bytes/sample: %i"
" please report this error on the MPlayer mailing list. \n",bps);
}
}
@ -118,14 +118,14 @@ static int check_routes(af_channels_t* s, int nin, int nout)
{
int i;
if((s->nr < 1) || (s->nr > AF_NCH)){
af_msg(AF_MSG_ERROR,"[channels] The number of routing pairs must be"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[channels] The number of routing pairs must be"
" between 1 and %i. Current value is %i\n",AF_NCH,s->nr);
return AF_ERROR;
}
for(i=0;i<s->nr;i++){
if((s->route[i][FR] >= nin) || (s->route[i][TO] >= nout)){
af_msg(AF_MSG_ERROR,"[channels] Invalid routing in pair nr. %i.\n", i);
mp_msg(MSGT_AFILTER, MSGL_ERR, "[channels] Invalid routing in pair nr. %i.\n", i);
return AF_ERROR;
}
}
@ -180,14 +180,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
int ch = 0;
// Sanity check
if((s->nr < 1) || (s->nr > AF_NCH)){
af_msg(AF_MSG_ERROR,"[channels] The number of routing pairs must be"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[channels] The number of routing pairs must be"
" between 1 and %i. Current value is %i\n",AF_NCH,s->nr);
}
s->router = 1;
// Scan for pairs on commandline
while((*cp == ':') && (ch < s->nr)){
sscanf(cp, ":%i:%i%n" ,&s->route[ch][FR], &s->route[ch][TO], &n);
af_msg(AF_MSG_VERBOSE,"[channels] Routing from channel %i to"
mp_msg(MSGT_AFILTER, MSGL_V, "[channels] Routing from channel %i to"
" channel %i\n",s->route[ch][FR],s->route[ch][TO]);
cp = &cp[n];
ch++;
@ -203,14 +203,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Sanity check
if(((int*)arg)[0] <= 0 || ((int*)arg)[0] > AF_NCH){
af_msg(AF_MSG_ERROR,"[channels] The number of output channels must be"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[channels] The number of output channels must be"
" between 1 and %i. Current value is %i\n",AF_NCH,((int*)arg)[0]);
return AF_ERROR;
}
af->data->nch=((int*)arg)[0];
if(!s->router)
af_msg(AF_MSG_VERBOSE,"[channels] Changing number of channels"
mp_msg(MSGT_AFILTER, MSGL_V, "[channels] Changing number of channels"
" to %i\n",af->data->nch);
return AF_OK;
case AF_CONTROL_CHANNELS | AF_CONTROL_GET:

View File

@ -63,7 +63,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
for(i=0;i<af->data->nch;i++){
s->q[i] = calloc(L,af->data->bps);
if(NULL == s->q[i])
af_msg(AF_MSG_FATAL,"[delay] Out of memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[delay] Out of memory\n");
}
return control(af,AF_CONTROL_DELAY_LEN | AF_CONTROL_SET,s->d);
@ -87,9 +87,9 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
return AF_ERROR;
s->ri = 0;
for(i=0;i<AF_NCH;i++){
af_msg(AF_MSG_DEBUG0,"[delay] Channel %i delayed by %0.3fms\n",
mp_msg(MSGT_AFILTER, MSGL_DBG2, "[delay] Channel %i delayed by %0.3fms\n",
i,clamp(s->d[i],0.0,1000.0));
af_msg(AF_MSG_DEBUG1,"[delay] Channel %i delayed by %i samples\n",
mp_msg(MSGT_AFILTER, MSGL_DBG3, "[delay] Channel %i delayed by %i samples\n",
i,s->wi[i]);
}
return AF_OK;

View File

@ -31,7 +31,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
switch(cmd){
case AF_CONTROL_REINIT:
memcpy(af->data,(af_data_t*)arg,sizeof(af_data_t));
af_msg(AF_MSG_VERBOSE,"[dummy] Was reinitialized: %iHz/%ich/%s\n",
mp_msg(MSGT_AFILTER, MSGL_V, "[dummy] Was reinitialized: %iHz/%ich/%s\n",
af->data->rate,af->data->nch,af_fmt2str_short(af->data->format));
return AF_OK;
}
@ -50,7 +50,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
{
// Do something necessary to get rid of annoying warning during compile
if(!af)
af_msg(AF_MSG_ERROR,"EEEK: Argument af == NULL in af_dummy.c play().");
mp_msg(MSGT_AFILTER, MSGL_ERR, "EEEK: Argument af == NULL in af_dummy.c play().");
return data;
}

View File

@ -107,7 +107,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
s->K--;
if(s->K != KM)
af_msg(AF_MSG_INFO,"[equalizer] Limiting the number of filters to"
mp_msg(MSGT_AFILTER, MSGL_INFO, "[equalizer] Limiting the number of filters to"
" %i due to low sample rate.\n",s->K);
// Generate filter taps

View File

@ -96,15 +96,15 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Allocate new buffers (as one continuous block)
s->buf[0] = calloc(s->sz*af->data->nch, af->data->bps);
if(NULL == s->buf[0])
af_msg(AF_MSG_FATAL, "[export] Out of memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[export] Out of memory\n");
for(i = 1; i < af->data->nch; i++)
s->buf[i] = s->buf[0] + i*s->sz*af->data->bps;
// Init memory mapping
s->fd = open(s->filename, O_RDWR | O_CREAT | O_TRUNC, 0640);
af_msg(AF_MSG_INFO, "[export] Exporting to file: %s\n", s->filename);
mp_msg(MSGT_AFILTER, MSGL_INFO, "[export] Exporting to file: %s\n", s->filename);
if(s->fd < 0)
af_msg(AF_MSG_FATAL, "[export] Could not open/create file: %s\n",
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[export] Could not open/create file: %s\n",
s->filename);
// header + buffer
@ -119,8 +119,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// mmap size
s->mmap_area = mmap(0, mapsize, PROT_READ|PROT_WRITE,MAP_SHARED, s->fd, 0);
if(s->mmap_area == NULL)
af_msg(AF_MSG_FATAL, "[export] Could not mmap file %s\n", s->filename);
af_msg(AF_MSG_INFO, "[export] Memory mapped to file: %s (%p)\n",
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[export] Could not mmap file %s\n", s->filename);
mp_msg(MSGT_AFILTER, MSGL_INFO, "[export] Memory mapped to file: %s (%p)\n",
s->filename, s->mmap_area);
// Initialize header
@ -160,7 +160,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
case AF_CONTROL_EXPORT_SZ | AF_CONTROL_SET:
s->sz = * (int *) arg;
if((s->sz <= 0) || (s->sz > 2048))
af_msg( AF_MSG_ERROR, "[export] Buffer size must be between"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[export] Buffer size must be between"
" 1 and 2048\n" );
return AF_OK;

View File

@ -62,7 +62,7 @@ static af_data_t* play_s16_float(struct af_instance_s* af, af_data_t* data);
static int check_bps(int bps)
{
if(bps != 4 && bps != 3 && bps != 2 && bps != 1){
af_msg(AF_MSG_ERROR,"[format] The number of bytes per sample"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[format] The number of bytes per sample"
" must be 1, 2, 3 or 4. Current value is %i \n",bps);
return AF_ERROR;
}
@ -77,7 +77,7 @@ static int check_format(int format)
case(AF_FORMAT_IMA_ADPCM):
case(AF_FORMAT_MPEG2):
case(AF_FORMAT_AC3):
af_msg(AF_MSG_ERROR,"[format] Sample format %s not yet supported \n",
mp_msg(MSGT_AFILTER, MSGL_ERR, "[format] Sample format %s not yet supported \n",
af_fmt2str(format,buf,256));
return AF_ERROR;
}
@ -105,7 +105,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
(AF_OK != check_format(af->data->format)))
return AF_ERROR;
af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %s to %s\n",
mp_msg(MSGT_AFILTER, MSGL_V, "[format] Changing sample format from %s to %s\n",
af_fmt2str(data->format,buf1,256),
af_fmt2str(af->data->format,buf2,256));
@ -119,13 +119,13 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
if ((af->data->format & ~AF_FORMAT_END_MASK) ==
(data->format & ~AF_FORMAT_END_MASK))
{
af_msg(AF_MSG_VERBOSE,"[format] Accelerated endianness conversion only\n");
mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated endianness conversion only\n");
af->play = play_swapendian;
}
if ((data->format == AF_FORMAT_FLOAT_NE) &&
(af->data->format == AF_FORMAT_S16_NE))
{
af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n",
mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n",
af_fmt2str(data->format,buf1,256),
af_fmt2str(af->data->format,buf2,256));
af->play = play_float_s16;
@ -133,7 +133,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
if ((data->format == AF_FORMAT_S16_NE) &&
(af->data->format == AF_FORMAT_FLOAT_NE))
{
af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n",
mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n",
af_fmt2str(data->format,buf1,256),
af_fmt2str(af->data->format,buf2,256));
af->play = play_s16_float;
@ -143,7 +143,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
case AF_CONTROL_COMMAND_LINE:{
int format = af_str2fmt_short(arg);
if (format == -1) {
af_msg(AF_MSG_ERROR, "[format] %s is not a valid format\n", (char *)arg);
mp_msg(MSGT_AFILTER, MSGL_ERR, "[format] %s is not a valid format\n", (char *)arg);
return AF_ERROR;
}
if(AF_OK != af->control(af,AF_CONTROL_FORMAT_FMT | AF_CONTROL_SET,&format))

View File

@ -293,7 +293,7 @@ static int control(struct af_instance_s *af, int cmd, void* arg)
if(af->data->rate != 48000) {
// automatic samplerate adjustment in the filter chain
// is not yet supported.
af_msg(AF_MSG_ERROR,
mp_msg(MSGT_AFILTER, MSGL_ERR,
"[hrtf] ERROR: Sampling rate is not 48000 Hz (%d)!\n",
af->data->rate);
return AF_ERROR;
@ -331,7 +331,7 @@ static int control(struct af_instance_s *af, int cmd, void* arg)
s->matrix_mode = 0;
break;
default:
af_msg(AF_MSG_ERROR,
mp_msg(MSGT_AFILTER, MSGL_ERR,
"[hrtf] Mode is neither 'm', 's', nor '0' (%c).\n",
mode);
return AF_ERROR;
@ -409,29 +409,29 @@ static af_data_t* play(struct af_instance_s *af, af_data_t *data)
s->print_flag = 0;
switch (s->decode_mode) {
case HRTF_MIX_51:
af_msg(AF_MSG_INFO,
mp_msg(MSGT_AFILTER, MSGL_INFO,
"[hrtf] Using HRTF to mix %s discrete surround into "
"L, R channels\n", s->matrix_mode ? "5+1" : "5");
break;
case HRTF_MIX_STEREO:
af_msg(AF_MSG_INFO,
mp_msg(MSGT_AFILTER, MSGL_INFO,
"[hrtf] Using HRTF to mix stereo into "
"L, R channels\n");
break;
case HRTF_MIX_MATRIX2CH:
af_msg(AF_MSG_INFO,
mp_msg(MSGT_AFILTER, MSGL_INFO,
"[hrtf] Using active matrix to decode 2 channel "
"input, HRTF to mix %s matrix surround into "
"L, R channels\n", "3/2");
break;
default:
af_msg(AF_MSG_WARN,
mp_msg(MSGT_AFILTER, MSGL_WARN,
"[hrtf] bogus decode_mode: %d\n", s->decode_mode);
break;
}
if(s->matrix_mode)
af_msg(AF_MSG_INFO,
mp_msg(MSGT_AFILTER, MSGL_INFO,
"[hrtf] Using active matrix to decode rear center "
"channel\n");
}
@ -636,7 +636,7 @@ static int af_open(af_instance_t* af)
s->print_flag = 1;
if (allocate(s) != 0) {
af_msg(AF_MSG_ERROR, "[hrtf] Memory allocation error.\n");
mp_msg(MSGT_AFILTER, MSGL_ERR, "[hrtf] Memory allocation error.\n");
return AF_ERROR;
}
@ -655,13 +655,13 @@ static int af_open(af_instance_t* af)
s->cr_ir = cr_filt + (s->cr_o = pulse_detect(cr_filt));
if((s->ba_ir = malloc(s->basslen * sizeof(float))) == NULL) {
af_msg(AF_MSG_ERROR, "[hrtf] Memory allocation error.\n");
mp_msg(MSGT_AFILTER, MSGL_ERR, "[hrtf] Memory allocation error.\n");
return AF_ERROR;
}
fc = 2.0 * BASSFILTFREQ / (float)af->data->rate;
if(af_filter_design_fir(s->basslen, s->ba_ir, &fc, LP | KAISER, 4 * M_PI) ==
-1) {
af_msg(AF_MSG_ERROR, "[hrtf] Unable to design low-pass "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[hrtf] Unable to design low-pass "
"filter.\n");
return AF_ERROR;
}

View File

@ -1,5 +1,5 @@
/*
* af_ladspa.c, LADSPA plugin loader
* LADSPA plugin loader
*
* Written by Ivo van Poorten <ivop@euronet.nl>
* Copyright (C) 2004, 2005
@ -212,30 +212,30 @@ static int af_ladspa_parse_plugin(af_ladspa_t *setup) {
}
if (setup->ninputs == 0) {
af_msg(AF_MSG_WARN, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_WARN, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_WarnNoInputs);
} else if (setup->ninputs == 1) {
af_msg(AF_MSG_VERBOSE, "%s: this is a mono effect\n", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: this is a mono effect\n", setup->myname);
} else if (setup->ninputs == 2) {
af_msg(AF_MSG_VERBOSE, "%s: this is a stereo effect\n", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: this is a stereo effect\n", setup->myname);
} else {
af_msg(AF_MSG_VERBOSE, "%s: this is a %i-channel effect, "
mp_msg(MSGT_AFILTER, MSGL_V, "%s: this is a %i-channel effect, "
"support is experimental\n", setup->myname, setup->ninputs);
}
if (setup->noutputs == 0) {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrNoOutputs);
return AF_ERROR;
}
if (setup->noutputs != setup->ninputs ) {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrInOutDiff);
return AF_ERROR;
}
af_msg(AF_MSG_VERBOSE, "%s: this plugin has %d input control(s)\n",
mp_msg(MSGT_AFILTER, MSGL_V, "%s: this plugin has %d input control(s)\n",
setup->myname, setup->ninputcontrols);
/* Print list of controls and its range of values it accepts */
@ -243,18 +243,18 @@ static int af_ladspa_parse_plugin(af_ladspa_t *setup) {
for (i=0; i<setup->ninputcontrols; i++) {
p = setup->inputcontrolsmap[i];
hint = pdes->PortRangeHints[p];
af_msg(AF_MSG_VERBOSE, " --- %d %s [", i, pdes->PortNames[p]);
mp_msg(MSGT_AFILTER, MSGL_V, " --- %d %s [", i, pdes->PortNames[p]);
if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor)) {
af_msg(AF_MSG_VERBOSE, "%0.2f , ", hint.LowerBound);
mp_msg(MSGT_AFILTER, MSGL_V, "%0.2f , ", hint.LowerBound);
} else {
af_msg(AF_MSG_VERBOSE, "... , ");
mp_msg(MSGT_AFILTER, MSGL_V, "... , ");
}
if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor)) {
af_msg(AF_MSG_VERBOSE, "%0.2f]\n", hint.UpperBound);
mp_msg(MSGT_AFILTER, MSGL_V, "%0.2f]\n", hint.UpperBound);
} else {
af_msg(AF_MSG_VERBOSE, "...]\n");
mp_msg(MSGT_AFILTER, MSGL_V, "...]\n");
}
}
@ -300,9 +300,9 @@ static void* mydlopen(const char *filename, int flag) {
/* 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 "
mp_msg(MSGT_AFILTER, MSGL_V, "\ton windows, only absolute pathnames "
"are supported\n");
af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", filename);
mp_msg(MSGT_AFILTER, MSGL_V, "\ttrying %s\n", filename);
return dlopen(filename, flag);
#endif
@ -343,7 +343,7 @@ static void* mydlopen(const char *filename, int flag) {
}
strcpy(buf+needslash+(end-start), filename);
af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", buf);
mp_msg(MSGT_AFILTER, MSGL_V, "\ttrying %s\n", buf);
result=dlopen(buf, flag);
free(buf);
@ -357,7 +357,7 @@ static void* mydlopen(const char *filename, int flag) {
} /* end if there's a ladspapath */
/* last resort, just open it again, so the dlerror() message is correct */
af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", filename);
mp_msg(MSGT_AFILTER, MSGL_V, "\ttrying %s\n", filename);
return dlopen(filename,flag);
}
@ -384,18 +384,18 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) {
int i;
/* load library */
af_msg(AF_MSG_VERBOSE, "%s: loading ladspa plugin library %s\n",
mp_msg(MSGT_AFILTER, MSGL_V, "%s: loading ladspa plugin library %s\n",
setup->myname, setup->file);
setup->libhandle = mydlopen(setup->file, RTLD_NOW);
if (!setup->libhandle) {
af_msg(AF_MSG_ERROR, "%s: %s %s\n\t%s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s %s\n\t%s\n", setup->myname,
MSGTR_AF_LADSPA_ErrFailedToLoad, setup->file, dlerror() );
return AF_ERROR;
}
af_msg(AF_MSG_VERBOSE, "%s: library found.\n", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: library found.\n", setup->myname);
/* find descriptor function */
dlerror();
@ -403,7 +403,7 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) {
"ladspa_descriptor");
if (!descriptor_function) {
af_msg(AF_MSG_ERROR, "%s: %s\n\t%s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n\t%s\n", setup->myname,
MSGTR_AF_LADSPA_ErrNoDescriptor, dlerror());
return AF_ERROR;
}
@ -411,33 +411,33 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) {
/* if label == help, list all labels in library and exit */
if (strcmp(setup->label, "help") == 0) {
af_msg(AF_MSG_INFO, "%s: %s %s:\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_INFO, "%s: %s %s:\n", setup->myname,
MSGTR_AF_LADSPA_AvailableLabels, setup->file);
for (i=0; ; i++) {
ladspa_descriptor = descriptor_function(i);
if (ladspa_descriptor == NULL) {
return AF_ERROR;
}
af_msg(AF_MSG_INFO, " %-16s - %s (%lu)\n",
mp_msg(MSGT_AFILTER, MSGL_INFO, " %-16s - %s (%lu)\n",
ladspa_descriptor->Label,
ladspa_descriptor->Name,
ladspa_descriptor->UniqueID);
}
}
af_msg(AF_MSG_VERBOSE, "%s: looking for label\n", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: looking for label\n", setup->myname);
/* find label in library */
for (i=0; ; i++) {
ladspa_descriptor = descriptor_function(i);
if (ladspa_descriptor == NULL) {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrLabelNotFound);
return AF_ERROR;
}
if (strcmp(ladspa_descriptor->Label, setup->label) == 0) {
setup->plugin_descriptor = ladspa_descriptor;
af_msg(AF_MSG_VERBOSE, "%s: %s found\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_V, "%s: %s found\n", setup->myname,
setup->label);
return AF_OK;
}
@ -458,7 +458,7 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) {
*/
static int af_ladspa_malloc_failed(char *myname) {
af_msg(AF_MSG_ERROR, "%s: %s", myname, MSGTR_MemAllocFailed);
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s", myname, MSGTR_MemAllocFailed);
return AF_ERROR;
}
@ -493,7 +493,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
switch(cmd) {
case AF_CONTROL_REINIT:
af_msg(AF_MSG_VERBOSE, "%s: (re)init\n", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: (re)init\n", setup->myname);
if (!arg) return AF_ERROR;
@ -512,14 +512,14 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
case AF_CONTROL_COMMAND_LINE: {
char *buf;
af_msg(AF_MSG_VERBOSE, "%s: parse suboptions\n", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: parse suboptions\n", setup->myname);
/* suboption parser here!
* format is (ladspa=)file:label:controls....
*/
if (!arg) {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrNoSuboptions);
return AF_ERROR;
}
@ -531,7 +531,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
buf[0] = '\0';
sscanf(arg, "%[^:]", buf);
if (buf[0] == '\0') {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrNoLibFile);
free(buf);
return AF_ERROR;
@ -539,7 +539,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
arg += strlen(buf);
setup->file = strdup(buf);
if (!setup->file) return af_ladspa_malloc_failed(setup->myname);
af_msg(AF_MSG_VERBOSE, "%s: file --> %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_V, "%s: file --> %s\n", setup->myname,
setup->file);
if (*(char*)arg != '\0') arg++; /* read ':' */
@ -547,7 +547,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
buf[0] = '\0';
sscanf(arg, "%[^:]", buf);
if (buf[0] == '\0') {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrNoLabel);
free(buf);
return AF_ERROR;
@ -555,7 +555,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
arg += strlen(buf);
setup->label = strdup(buf);
if (!setup->label) return af_ladspa_malloc_failed(setup->myname);
af_msg(AF_MSG_VERBOSE, "%s: label --> %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_V, "%s: label --> %s\n", setup->myname,
setup->label);
/* if (*(char*)arg != '0') arg++; */ /* read ':' */
@ -583,14 +583,14 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
for(i=0; i<setup->ninputcontrols; i++) {
if (!arg || (*(char*)arg != ':') ) {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrNotEnoughControls);
return AF_ERROR;
}
arg++;
r = sscanf(arg, "%f", &val);
if (r!=1) {
af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname,
mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname,
MSGTR_AF_LADSPA_ErrNotEnoughControls);
return AF_ERROR;
}
@ -598,16 +598,16 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
arg = strchr(arg, ':');
}
af_msg(AF_MSG_VERBOSE, "%s: input controls: ", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: input controls: ", setup->myname);
for(i=0; i<setup->ninputcontrols; i++) {
af_msg(AF_MSG_VERBOSE, "%0.4f ",
mp_msg(MSGT_AFILTER, MSGL_V, "%0.4f ",
setup->inputcontrols[setup->inputcontrolsmap[i]]);
}
af_msg(AF_MSG_VERBOSE, "\n");
mp_msg(MSGT_AFILTER, MSGL_V, "\n");
/* check boundaries of inputcontrols */
af_msg(AF_MSG_VERBOSE, "%s: checking boundaries of input controls\n",
mp_msg(MSGT_AFILTER, MSGL_V, "%s: checking boundaries of input controls\n",
setup->myname);
for(i=0; i<setup->ninputcontrols; i++) {
int p = setup->inputcontrolsmap[i];
@ -617,18 +617,18 @@ static int control(struct af_instance_s *af, int cmd, void *arg) {
if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor) &&
val < hint.LowerBound) {
af_msg(AF_MSG_ERROR, MSGTR_AF_LADSPA_ErrControlBelow,
mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlBelow,
setup->myname, i, hint.LowerBound);
return AF_ERROR;
}
if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor) &&
val > hint.UpperBound) {
af_msg(AF_MSG_ERROR, MSGTR_AF_LADSPA_ErrControlAbove,
mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlAbove,
setup->myname, i, hint.UpperBound);
return AF_ERROR;
}
}
af_msg(AF_MSG_VERBOSE, "%s: all controls have sane values\n",
mp_msg(MSGT_AFILTER, MSGL_V, "%s: all controls have sane values\n",
setup->myname);
/* All is well! */
@ -660,7 +660,7 @@ static void uninit(struct af_instance_s *af) {
const LADSPA_Descriptor *pdes = setup->plugin_descriptor;
if (setup->myname) {
af_msg(AF_MSG_VERBOSE, "%s: cleaning up\n", setup->myname);
mp_msg(MSGT_AFILTER, MSGL_V, "%s: cleaning up\n", setup->myname);
free(setup->myname);
}
@ -750,7 +750,7 @@ static af_data_t* play(struct af_instance_s *af, af_data_t *data) {
*/
if (setup->nch != 0) {
af_msg(AF_MSG_DEBUG1, "%s: bufsize change; free old buffer\n",
mp_msg(MSGT_AFILTER, MSGL_DBG3, "%s: bufsize change; free old buffer\n",
setup->myname);
if(setup->inbufs) {
@ -775,7 +775,7 @@ static af_data_t* play(struct af_instance_s *af, af_data_t *data) {
setup->inbufs = calloc(nch, sizeof(float*));
setup->outbufs = calloc(nch, sizeof(float*));
af_msg(AF_MSG_DEBUG1, "%s: bufsize = %d\n",
mp_msg(MSGT_AFILTER, MSGL_DBG3, "%s: bufsize = %d\n",
setup->myname, setup->bufsize);
for(i=0; i<nch; i++) {

View File

@ -68,7 +68,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
else
af->mul = (double)AC3_MAX_CODED_FRAME_SIZE / s->expect_len;
af_msg(AF_MSG_DEBUG0, "af_lavcac3enc reinit: %d, %d, %f, %d.\n",
mp_msg(MSGT_AFILTER, MSGL_DBG2, "af_lavcac3enc reinit: %d, %d, %f, %d.\n",
data->nch, data->rate, af->mul, s->expect_len);
af->data->format = AF_FORMAT_S16_NE;
@ -98,7 +98,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
s->lavc_actx->bit_rate = bit_rate;
if(avcodec_open(s->lavc_actx, s->lavc_acodec) < 0) {
af_msg(AF_MSG_ERROR, MSGTR_CouldntOpenCodec, "ac3", bit_rate);
mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntOpenCodec, "ac3", bit_rate);
return AF_ERROR;
}
}
@ -106,7 +106,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
af->data->nch = 2;
return test_output_res;
case AF_CONTROL_COMMAND_LINE:
af_msg(AF_MSG_DEBUG0, "af_lavcac3enc cmdline: %s.\n", (char*)arg);
mp_msg(MSGT_AFILTER, MSGL_DBG2, "af_lavcac3enc cmdline: %s.\n", (char*)arg);
s->bit_rate = 0;
s->min_channel_num = 0;
s->add_iec61937_header = 0;
@ -119,7 +119,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
if (ff_ac3_bitrate_tab[i] * 1000 == s->bit_rate)
break;
if (i >= 19) {
af_msg(AF_MSG_WARN, "af_lavcac3enc unable set unsupported "
mp_msg(MSGT_AFILTER, MSGL_WARN, "af_lavcac3enc unable set unsupported "
"bitrate %d, use default bitrate (check manpage to see "
"supported bitrates).\n", s->bit_rate);
s->bit_rate = 0;
@ -127,7 +127,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
}
if (s->min_channel_num == 0)
s->min_channel_num = 5;
af_msg(AF_MSG_VERBOSE, "af_lavcac3enc config spdif:%d, bitrate:%d, "
mp_msg(MSGT_AFILTER, MSGL_V, "af_lavcac3enc config spdif:%d, bitrate:%d, "
"minchnum:%d.\n", s->add_iec61937_header, s->bit_rate,
s->min_channel_num);
return AF_OK;
@ -171,13 +171,13 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
max_output_len = AC3_MAX_CODED_FRAME_SIZE * frame_num;
if (af->data->len < max_output_len) {
af_msg(AF_MSG_VERBOSE,"[libaf] Reallocating memory in module %s, "
mp_msg(MSGT_AFILTER, MSGL_V, "[libaf] Reallocating memory in module %s, "
"old len = %i, new len = %i\n", af->info->name, af->data->len,
max_output_len);
free(af->data->audio);
af->data->audio = malloc(max_output_len);
if (!af->data->audio) {
af_msg(AF_MSG_FATAL,"[libaf] Could not allocate memory \n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[libaf] Could not allocate memory \n");
return NULL;
}
af->data->len = max_output_len;
@ -231,7 +231,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
src += s->expect_len;
left -= s->expect_len;
}
af_msg(AF_MSG_DEBUG0, "avcodec_encode_audio got %d, pending %d.\n",
mp_msg(MSGT_AFILTER, MSGL_DBG2, "avcodec_encode_audio got %d, pending %d.\n",
len, s->pending_len);
if (s->add_iec61937_header) {
@ -269,7 +269,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
c->nch = 2;
c->bps = 2;
c->len = outsize;
af_msg(AF_MSG_DEBUG0, "play return size %d, pending %d\n",
mp_msg(MSGT_AFILTER, MSGL_DBG2, "play return size %d, pending %d\n",
outsize, s->pending_len);
return c;
}
@ -295,13 +295,13 @@ static int af_open(af_instance_t* af){
s->lavc_acodec = avcodec_find_encoder_by_name("ac3");
if (!s->lavc_acodec) {
af_msg(AF_MSG_ERROR, MSGTR_LavcAudioCodecNotFound, "ac3");
mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_LavcAudioCodecNotFound, "ac3");
return AF_ERROR;
}
s->lavc_actx = avcodec_alloc_context();
if (!s->lavc_actx) {
af_msg(AF_MSG_ERROR, MSGTR_CouldntAllocateLavcContext);
mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntAllocateLavcContext);
return AF_ERROR;
}

View File

@ -1,40 +0,0 @@
/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* Include file for mplayer specific defines and includes */
#ifndef MPLAYER_AF_MP_H
#define MPLAYER_AF_MP_H
#include "config.h"
#include "mp_msg.h"
#include "cpudetect.h"
/* Set the initialization type from mplayers cpudetect */
#ifdef AF_INIT_TYPE
#undef AF_INIT_TYPE
#define AF_INIT_TYPE \
((gCpuCaps.has3DNow || gCpuCaps.hasSSE)?AF_INIT_FAST:AF_INIT_SLOW)
#endif
#ifdef af_msg
#undef af_msg
#endif
#define af_msg(lev, args... ) \
mp_msg(MSGT_AFILTER,(((lev)<0)?((lev)+3):(((lev)==0)?MSGL_INFO:((lev)+5))), ##args )
#endif /* MPLAYER_AF_MP_H */

View File

@ -72,7 +72,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
j = 0; k = 0;
while((*cp == ':') && (k < AF_NCH)){
sscanf(cp, ":%f%n" , &s->level[j][k], &n);
af_msg(AF_MSG_VERBOSE,"[pan] Pan level from channel %i to"
mp_msg(MSGT_AFILTER, MSGL_V, "[pan] Pan level from channel %i to"
" channel %i = %f\n",k,j,s->level[j][k]);
cp =&cp[n];
j++;
@ -108,7 +108,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Sanity check
if(((int*)arg)[0] <= 0 || ((int*)arg)[0] > AF_NCH){
af_msg(AF_MSG_ERROR,"[pan] The number of output channels must be"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[pan] The number of output channels must be"
" between 1 and %i. Current value is %i\n",AF_NCH,((int*)arg)[0]);
return AF_ERROR;
}

View File

@ -139,7 +139,7 @@ static int set_types(struct af_instance_s* af, af_data_t* data)
s->setup = (s->setup & ~RSMP_MASK) | RSMP_LIN;
af->data->format = AF_FORMAT_S16_NE;
af->data->bps = 2;
af_msg(AF_MSG_VERBOSE,"[resample] Using linear interpolation. \n");
mp_msg(MSGT_AFILTER, MSGL_V, "[resample] Using linear interpolation. \n");
}
else{
/* If the input format is float or if float is explicitly selected
@ -155,7 +155,7 @@ static int set_types(struct af_instance_s* af, af_data_t* data)
af->data->format = AF_FORMAT_S16_NE;
af->data->bps = 2;
}
af_msg(AF_MSG_VERBOSE,"[resample] Using %s processing and %s frequecy"
mp_msg(MSGT_AFILTER, MSGL_V, "[resample] Using %s processing and %s frequecy"
" conversion.\n",
((s->setup & RSMP_MASK) == RSMP_FLOAT)?"floating point":"integer",
((s->setup & FREQ_MASK) == FREQ_SLOPPY)?"inexact":"exact");
@ -193,7 +193,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
if((s->setup & RSMP_MASK) == RSMP_LIN){
s->pt=0LL;
s->step=((uint64_t)n->rate<<STEPACCURACY)/(uint64_t)af->data->rate+1LL;
af_msg(AF_MSG_DEBUG0,"[resample] Linear interpolation step: 0x%016"PRIX64".\n",
mp_msg(MSGT_AFILTER, MSGL_DBG2, "[resample] Linear interpolation step: 0x%016"PRIX64".\n",
s->step);
af->mul = (double)af->data->rate / n->rate;
return rv;
@ -243,7 +243,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Design prototype filter type using Kaiser window with beta = 10
if(NULL == w || NULL == s->w ||
-1 == af_filter_design_fir(s->up*L, w, &fc, LP|KAISER , 10.0)){
af_msg(AF_MSG_ERROR,"[resample] Unable to design prototype filter.\n");
mp_msg(MSGT_AFILTER, MSGL_ERR, "[resample] Unable to design prototype filter.\n");
return AF_ERROR;
}
// Copy data from prototype to polyphase filter
@ -260,7 +260,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
}
free(w);
af_msg(AF_MSG_VERBOSE,"[resample] New filter designed up: %i "
mp_msg(MSGT_AFILTER, MSGL_V, "[resample] New filter designed up: %i "
"down: %i\n", s->up, s->dn);
}
@ -288,14 +288,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Sanity check
if(((int*)arg)[0] < 8000 || ((int*)arg)[0] > 192000){
af_msg(AF_MSG_ERROR,"[resample] The output sample frequency "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[resample] The output sample frequency "
"must be between 8kHz and 192kHz. Current value is %i \n",
((int*)arg)[0]);
return AF_ERROR;
}
af->data->rate=((int*)arg)[0];
af_msg(AF_MSG_VERBOSE,"[resample] Changing sample rate "
mp_msg(MSGT_AFILTER, MSGL_V, "[resample] Changing sample rate "
"to %iHz\n",af->data->rate);
return AF_OK;
}

View File

@ -232,11 +232,11 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
// RESIZE_LOCAL_BUFFER - can't use macro
max_bytes_out = ((int)(data->len / s->bytes_stride_scaled) + 1) * s->bytes_stride;
if (max_bytes_out > af->data->len) {
af_msg(AF_MSG_VERBOSE, "[libaf] Reallocating memory in module %s, "
mp_msg(MSGT_AFILTER, MSGL_V, "[libaf] Reallocating memory in module %s, "
"old len = %i, new len = %i\n",af->info->name,af->data->len,max_bytes_out);
af->data->audio = realloc(af->data->audio, max_bytes_out);
if (!af->data->audio) {
af_msg(AF_MSG_FATAL, "[libaf] Could not allocate memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[libaf] Could not allocate memory\n");
return NULL;
}
af->data->len = max_bytes_out;
@ -296,7 +296,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
int frames_stride, frames_overlap;
int i, j;
af_msg(AF_MSG_VERBOSE,
mp_msg(MSGT_AFILTER, MSGL_V,
"[scaletempo] %.3f speed * %.3f scale_nominal = %.3f\n",
s->speed, s->scale_nominal, s->scale);
@ -339,7 +339,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
s->buf_overlap = realloc(s->buf_overlap, s->bytes_overlap);
s->table_blend = realloc(s->table_blend, s->bytes_overlap * 4);
if(!s->buf_overlap || !s->table_blend) {
af_msg(AF_MSG_FATAL, "[scaletempo] Out of memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[scaletempo] Out of memory\n");
return AF_ERROR;
}
memset(s->buf_overlap, 0, s->bytes_overlap);
@ -377,7 +377,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
s->buf_pre_corr = realloc(s->buf_pre_corr, s->bytes_overlap * 2 + UNROLL_PADDING);
s->table_window = realloc(s->table_window, s->bytes_overlap * 2 - nch * bps * 2);
if(!s->buf_pre_corr || !s->table_window) {
af_msg(AF_MSG_FATAL, "[scaletempo] Out of memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[scaletempo] Out of memory\n");
return AF_ERROR;
}
memset((char *)s->buf_pre_corr + s->bytes_overlap * 2, 0, UNROLL_PADDING);
@ -394,7 +394,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
s->buf_pre_corr = realloc(s->buf_pre_corr, s->bytes_overlap);
s->table_window = realloc(s->table_window, s->bytes_overlap - nch * bps);
if(!s->buf_pre_corr || !s->table_window) {
af_msg(AF_MSG_FATAL, "[scaletempo] Out of memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[scaletempo] Out of memory\n");
return AF_ERROR;
}
pw = s->table_window;
@ -415,11 +415,11 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
= (s->frames_search + frames_stride + frames_overlap) * bps * nch;
s->buf_queue = realloc(s->buf_queue, s->bytes_queue + UNROLL_PADDING);
if(!s->buf_queue) {
af_msg(AF_MSG_FATAL, "[scaletempo] Out of memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[scaletempo] Out of memory\n");
return AF_ERROR;
}
af_msg (AF_MSG_DEBUG0, "[scaletempo] "
mp_msg (MSGT_AFILTER, MSGL_DBG2, "[scaletempo] "
"%.2f stride_in, %i stride_out, %i standing, "
"%i overlap, %i search, %i queue, %s mode\n",
s->frames_stride_scaled,
@ -470,25 +470,25 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
return AF_ERROR;
}
if (s->scale_nominal <= 0) {
af_msg(AF_MSG_ERROR, "[scaletempo] "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] "
MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange
": scale > 0\n");
return AF_ERROR;
}
if (s->ms_stride <= 0) {
af_msg(AF_MSG_ERROR, "[scaletempo] "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] "
MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange
": stride > 0\n");
return AF_ERROR;
}
if (s->percent_overlap < 0 || s->percent_overlap > 1) {
af_msg(AF_MSG_ERROR, "[scaletempo] "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] "
MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange
": 0 <= overlap <= 1\n");
return AF_ERROR;
}
if (s->ms_search < 0) {
af_msg(AF_MSG_ERROR, "[scaletempo] "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] "
MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange
": search >= 0\n");
return AF_ERROR;
@ -507,14 +507,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
s->speed_tempo = 1;
s->speed_pitch = 1;
} else {
af_msg(AF_MSG_ERROR, "[scaletempo] "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] "
MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange
": speed=[pitch|tempo|none|both]\n");
return AF_ERROR;
}
}
s->scale = s->speed * s->scale_nominal;
af_msg(AF_MSG_DEBUG0, "[scaletempo] %6.3f scale, %6.2f stride, %6.2f overlap, %6.2f search, speed = %s\n", s->scale_nominal, s->ms_stride, s->percent_overlap, s->ms_search, (s->speed_tempo?(s->speed_pitch?"tempo and speed":"tempo"):(s->speed_pitch?"pitch":"none")));
mp_msg(MSGT_AFILTER, MSGL_DBG2, "[scaletempo] %6.3f scale, %6.2f stride, %6.2f overlap, %6.2f search, speed = %s\n", s->scale_nominal, s->ms_stride, s->percent_overlap, s->ms_search, (s->speed_tempo?(s->speed_pitch?"tempo and speed":"tempo"):(s->speed_pitch?"pitch":"none")));
return AF_OK;
}
}

View File

@ -130,7 +130,7 @@ static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data)
s->pos += 2 * M_PI * s->freq / data->rate;
}
af_msg(AF_MSG_VERBOSE,"[sinesuppress] f:%8.2f: amp:%8.2f\n", s->freq, sqrt(s->real*s->real + s->imag*s->imag) / s->ref);
mp_msg(MSGT_AFILTER, MSGL_V, "[sinesuppress] f:%8.2f: amp:%8.2f\n", s->freq, sqrt(s->real*s->real + s->imag*s->imag) / s->ref);
return data;
}

View File

@ -94,7 +94,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
case AF_CONTROL_SUB_CH | AF_CONTROL_SET: // Requires reinit
// Sanity check
if((*(int*)arg >= AF_NCH) || (*(int*)arg < 0)){
af_msg(AF_MSG_ERROR,"[sub] Subwoofer channel number must be between "
mp_msg(MSGT_AFILTER, MSGL_ERR, "[sub] Subwoofer channel number must be between "
" 0 and %i current value is %i\n", AF_NCH-1, *(int*)arg);
return AF_ERROR;
}
@ -106,7 +106,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
case AF_CONTROL_SUB_FC | AF_CONTROL_SET: // Requires reinit
// Sanity check
if((*(float*)arg > 300) || (*(float*)arg < 20)){
af_msg(AF_MSG_ERROR,"[sub] Cutoff frequency must be between 20Hz and"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[sub] Cutoff frequency must be between 20Hz and"
" 300Hz current value is %0.2f",*(float*)arg);
return AF_ERROR;
}

View File

@ -98,13 +98,13 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
af->data->bps = 4;
if (af->data->nch != 4){
af_msg(AF_MSG_ERROR,"[surround] Only stereo input is supported.\n");
mp_msg(MSGT_AFILTER, MSGL_ERR, "[surround] Only stereo input is supported.\n");
return AF_DETACH;
}
// Surround filer coefficients
fc = 2.0 * 7000.0/(float)af->data->rate;
if (-1 == af_filter_design_fir(L, s->w, &fc, LP|HAMMING, 0)){
af_msg(AF_MSG_ERROR,"[surround] Unable to design low-pass filter.\n");
mp_msg(MSGT_AFILTER, MSGL_ERR, "[surround] Unable to design low-pass filter.\n");
return AF_ERROR;
}
@ -117,7 +117,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
s->dl = calloc(LD,af->data->bps);
s->dr = calloc(LD,af->data->bps);
if((NULL == s->dl) || (NULL == s->dr))
af_msg(AF_MSG_FATAL,"[delay] Out of memory\n");
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[delay] Out of memory\n");
// Initialize delay queue index
if(AF_OK != af_from_ms(1, &s->d, &s->wi, af->data->rate, 0.0, 1000.0))
@ -137,7 +137,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
float d = 0;
sscanf((char*)arg,"%f",&d);
if ((d < 0) || (d > 1000)){
af_msg(AF_MSG_ERROR,"[surround] Invalid delay time, valid time values"
mp_msg(MSGT_AFILTER, MSGL_ERR, "[surround] Invalid delay time, valid time values"
" are 0ms to 1000ms current value is %0.3f ms\n",d);
return AF_ERROR;
}

View File

@ -78,7 +78,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
float x = 2.0*M_PI*15.0/(float)af->data->rate;
float t = 2.0-cos(x);
s->time = 1.0 - (t - sqrt(t*t - 1));
af_msg(AF_MSG_DEBUG0,"[volume] Forgetting factor = %0.5f\n",s->time);
mp_msg(MSGT_AFILTER, MSGL_DBG2, "[volume] Forgetting factor = %0.5f\n",s->time);
af->data->format = AF_FORMAT_FLOAT_NE;
af->data->bps = 4;
}
@ -122,7 +122,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
for(i=0;i<AF_NCH;i++)
m=max(m,s->max[i]);
af_to_dB(1, &m, &m, 10.0);
af_msg(AF_MSG_INFO,"[volume] The maximum volume was %0.2fdB \n", m);
mp_msg(MSGT_AFILTER, MSGL_INFO, "[volume] The maximum volume was %0.2fdB \n", m);
}
return AF_OK;
}

View File

@ -37,10 +37,10 @@
static const ao_info_t info =
{
"RAW PCM/WAVE file writer audio output",
"pcm",
"Atmosfear",
""
"RAW PCM/WAVE file writer audio output",
"pcm",
"Atmosfear",
""
};
LIBAO_EXTERN(pcm)
@ -60,23 +60,24 @@ static int fast = 0;
struct WaveHeader
{
uint32_t riff;
uint32_t file_length;
uint32_t wave;
uint32_t fmt;
uint32_t fmt_length;
uint16_t fmt_tag;
uint16_t channels;
uint32_t sample_rate;
uint32_t bytes_per_second;
uint16_t block_align;
uint16_t bits;
uint32_t data;
uint32_t data_length;
uint32_t riff;
uint32_t file_length;
uint32_t wave;
uint32_t fmt;
uint32_t fmt_length;
uint16_t fmt_tag;
uint16_t channels;
uint32_t sample_rate;
uint32_t bytes_per_second;
uint16_t block_align;
uint16_t bits;
uint32_t data;
uint32_t data_length;
};
/* init with default values */
static struct WaveHeader wavhdr;
static uint64_t data_length;
static FILE *fp = NULL;
@ -88,102 +89,107 @@ static int control(int cmd,void *arg){
// open & setup audio device
// return: 1=success 0=fail
static int init(int rate,int channels,int format,int flags){
int bits;
opt_t subopts[] = {
{"waveheader", OPT_ARG_BOOL, &ao_pcm_waveheader, NULL},
{"file", OPT_ARG_MSTRZ, &ao_outputfilename, NULL},
{"fast", OPT_ARG_BOOL, &fast, NULL},
{NULL}
};
// set defaults
ao_pcm_waveheader = 1;
int bits;
opt_t subopts[] = {
{"waveheader", OPT_ARG_BOOL, &ao_pcm_waveheader, NULL},
{"file", OPT_ARG_MSTRZ, &ao_outputfilename, NULL},
{"fast", OPT_ARG_BOOL, &fast, NULL},
{NULL}
};
// set defaults
ao_pcm_waveheader = 1;
if (subopt_parse(ao_subdevice, subopts) != 0) {
return 0;
}
if (!ao_outputfilename){
ao_outputfilename =
strdup(ao_pcm_waveheader?"audiodump.wav":"audiodump.pcm");
}
if (subopt_parse(ao_subdevice, subopts) != 0) {
return 0;
}
if (!ao_outputfilename){
ao_outputfilename =
strdup(ao_pcm_waveheader?"audiodump.wav":"audiodump.pcm");
}
bits=8;
switch(format){
case AF_FORMAT_S32_BE:
format=AF_FORMAT_S32_LE;
case AF_FORMAT_S32_LE:
bits=32;
break;
case AF_FORMAT_FLOAT_BE:
format=AF_FORMAT_FLOAT_LE;
case AF_FORMAT_FLOAT_LE:
bits=32;
break;
case AF_FORMAT_S8:
format=AF_FORMAT_U8;
case AF_FORMAT_U8:
break;
case AF_FORMAT_AC3:
bits=16;
break;
default:
format=AF_FORMAT_S16_LE;
bits=16;
break;
}
bits=8;
switch(format){
case AF_FORMAT_S32_BE:
format=AF_FORMAT_S32_LE;
case AF_FORMAT_S32_LE:
bits=32;
break;
case AF_FORMAT_FLOAT_BE:
format=AF_FORMAT_FLOAT_LE;
case AF_FORMAT_FLOAT_LE:
bits=32;
break;
case AF_FORMAT_S8:
format=AF_FORMAT_U8;
case AF_FORMAT_U8:
break;
case AF_FORMAT_AC3:
bits=16;
break;
default:
format=AF_FORMAT_S16_LE;
bits=16;
break;
}
ao_data.outburst = 65536;
ao_data.buffersize= 2*65536;
ao_data.channels=channels;
ao_data.samplerate=rate;
ao_data.format=format;
ao_data.bps=channels*rate*(bits/8);
ao_data.outburst = 65536;
ao_data.buffersize= 2*65536;
ao_data.channels=channels;
ao_data.samplerate=rate;
ao_data.format=format;
ao_data.bps=channels*rate*(bits/8);
wavhdr.riff = le2me_32(WAV_ID_RIFF);
wavhdr.wave = le2me_32(WAV_ID_WAVE);
wavhdr.fmt = le2me_32(WAV_ID_FMT);
wavhdr.fmt_length = le2me_32(16);
wavhdr.fmt_tag = le2me_16(format == AF_FORMAT_FLOAT_LE ? WAV_ID_FLOAT_PCM : WAV_ID_PCM);
wavhdr.channels = le2me_16(ao_data.channels);
wavhdr.sample_rate = le2me_32(ao_data.samplerate);
wavhdr.bytes_per_second = le2me_32(ao_data.bps);
wavhdr.bits = le2me_16(bits);
wavhdr.block_align = le2me_16(ao_data.channels * (bits / 8));
wavhdr.data = le2me_32(WAV_ID_DATA);
wavhdr.data_length=le2me_32(0x7ffff000);
wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
wavhdr.riff = le2me_32(WAV_ID_RIFF);
wavhdr.wave = le2me_32(WAV_ID_WAVE);
wavhdr.fmt = le2me_32(WAV_ID_FMT);
wavhdr.fmt_length = le2me_32(16);
wavhdr.fmt_tag = le2me_16(format == AF_FORMAT_FLOAT_LE ? WAV_ID_FLOAT_PCM : WAV_ID_PCM);
wavhdr.channels = le2me_16(ao_data.channels);
wavhdr.sample_rate = le2me_32(ao_data.samplerate);
wavhdr.bytes_per_second = le2me_32(ao_data.bps);
wavhdr.bits = le2me_16(bits);
wavhdr.block_align = le2me_16(ao_data.channels * (bits / 8));
wavhdr.data = le2me_32(WAV_ID_DATA);
wavhdr.data_length=le2me_32(0x7ffff000);
wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename,
(ao_pcm_waveheader?"WAVE":"RAW PCM"), rate,
(channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format));
mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo);
mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename,
(ao_pcm_waveheader?"WAVE":"RAW PCM"), rate,
(channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format));
mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo);
fp = fopen(ao_outputfilename, "wb");
if(fp) {
if(ao_pcm_waveheader){ /* Reserve space for wave header */
fwrite(&wavhdr,sizeof(wavhdr),1,fp);
wavhdr.file_length=wavhdr.data_length=0;
}
return 1;
}
mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_PCM_CantOpenOutputFile,
fp = fopen(ao_outputfilename, "wb");
if(fp) {
if(ao_pcm_waveheader){ /* Reserve space for wave header */
fwrite(&wavhdr,sizeof(wavhdr),1,fp);
}
return 1;
}
mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_PCM_CantOpenOutputFile,
ao_outputfilename);
return 0;
return 0;
}
// close audio device
static void uninit(int immed){
if(ao_pcm_waveheader && fseek(fp, 0, SEEK_SET) == 0){ /* Write wave header */
wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
wavhdr.file_length = le2me_32(wavhdr.file_length);
wavhdr.data_length = le2me_32(wavhdr.data_length);
fwrite(&wavhdr,sizeof(wavhdr),1,fp);
}
fclose(fp);
if (ao_outputfilename)
free(ao_outputfilename);
ao_outputfilename = NULL;
if(ao_pcm_waveheader){ /* Rewrite wave header */
if (fseek(fp, 0, SEEK_SET) != 0)
mp_msg(MSGT_AO, MSGL_ERR, "Could not seek to start, WAV size headers not updated!\n");
else if (data_length > 0x7ffff000)
mp_msg(MSGT_AO, MSGL_ERR, "File larger than allowed for WAV files, may play truncated!\n");
else {
wavhdr.file_length = data_length + sizeof(wavhdr) - 8;
wavhdr.file_length = le2me_32(wavhdr.file_length);
wavhdr.data_length = le2me_32(data_length);
fwrite(&wavhdr,sizeof(wavhdr),1,fp);
}
}
fclose(fp);
if (ao_outputfilename)
free(ao_outputfilename);
ao_outputfilename = NULL;
}
// stop playing and empty buffers (for seeking/pause)
@ -207,7 +213,7 @@ static void audio_resume(void)
static int get_space(void){
if(vo_pts)
return ao_data.pts < vo_pts + fast * 30000 ? ao_data.outburst : 0;
return ao_data.pts < vo_pts + fast * 30000 ? ao_data.outburst : 0;
return ao_data.outburst;
}
@ -219,31 +225,31 @@ static int play(void* data,int len,int flags){
// let libaf to do the conversion...
#if 0
//#ifdef WORDS_BIGENDIAN
if (ao_data.format == AFMT_S16_LE) {
unsigned short *buffer = (unsigned short *) data;
register int i;
for(i = 0; i < len/2; ++i) {
buffer[i] = le2me_16(buffer[i]);
}
}
if (ao_data.format == AFMT_S16_LE) {
unsigned short *buffer = (unsigned short *) data;
register int i;
for(i = 0; i < len/2; ++i) {
buffer[i] = le2me_16(buffer[i]);
}
}
#endif
if (ao_data.channels == 6 || ao_data.channels == 5) {
int frame_size = le2me_16(wavhdr.bits) / 8;
len -= len % (frame_size * ao_data.channels);
reorder_channel_nch(data, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT,
AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT,
ao_data.channels,
len / frame_size, frame_size);
}
if (ao_data.channels == 6 || ao_data.channels == 5) {
int frame_size = le2me_16(wavhdr.bits) / 8;
len -= len % (frame_size * ao_data.channels);
reorder_channel_nch(data, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT,
AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT,
ao_data.channels,
len / frame_size, frame_size);
}
//printf("PCM: Writing chunk!\n");
fwrite(data,len,1,fp);
//printf("PCM: Writing chunk!\n");
fwrite(data,len,1,fp);
if(ao_pcm_waveheader)
wavhdr.data_length += len;
return len;
if(ao_pcm_waveheader)
data_length += len;
return len;
}
// return: delay in seconds between first and last sample in buffer

View File

@ -160,11 +160,13 @@ static char* _select_font(fc_instance_t* priv, const char* family, int treat_fam
goto error;
#if (FC_VERSION >= 20297)
// Remove all extra family names from original pattern.
// After this, FcFontRenderPrepare will select the most relevant family
// name in case there are more than one of them.
for (; family_cnt > 1; --family_cnt)
FcPatternRemove(pat, FC_FAMILY, family_cnt - 1);
if (!treat_family_as_pattern) {
// Remove all extra family names from original pattern.
// After this, FcFontRenderPrepare will select the most relevant family
// name in case there are more than one of them.
for (; family_cnt > 1; --family_cnt)
FcPatternRemove(pat, FC_FAMILY, family_cnt - 1);
}
#endif
rpat = FcFontRenderPrepare(priv->config, pat, fset->fonts[curf]);

View File

@ -455,6 +455,7 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h
cur_top = top-by;
// Query cache
memset(&hk, 0, sizeof(hk));
memcpy(&hk.a, last_hash, sizeof(*last_hash));
memcpy(&hk.b, hash, sizeof(*hash));
hk.aw = aw;
@ -1432,6 +1433,7 @@ static void get_outline_glyph(int symbol, glyph_info_t* info, FT_Vector* advance
int error;
glyph_hash_val_t* val;
glyph_hash_key_t key;
memset(&key, 0, sizeof(key));
key.font = render_context.font;
key.size = render_context.font_size;
key.ch = symbol;
@ -1876,6 +1878,7 @@ static void transform_3d(FT_Vector shift, FT_Glyph* glyph, FT_Glyph* glyph2, dou
/**
* \brief Main ass rendering function, glues everything together
* \param event event to render
* \param event_images struct containing resulting images, will also be initialized
* Process event, appending resulting ass_image_t's to images_root.
*/
static int ass_render_event(ass_event_t* event, event_images_t* event_images)
@ -2169,6 +2172,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images)
for (i = 0; i < text_info.length; ++i)
get_bitmap_glyph(text_info.glyphs + i);
memset(event_images, 0, sizeof(*event_images));
event_images->top = device_y - d6_to_int(text_info.lines[0].asc);
event_images->height = d6_to_int(text_info.height);
event_images->detect_collisions = render_context.detect_collisions;

View File

@ -1,6 +1,4 @@
/*
ad.c - audio decoder interface
*/
/* audio decoder interface */
#include <stdio.h>
#include <stdlib.h>

View File

@ -112,6 +112,15 @@ static int init(sh_audio_t *sh_audio)
sh_audio->channels=lavc_context->channels;
sh_audio->samplerate=lavc_context->sample_rate;
sh_audio->i_bps=lavc_context->bit_rate/8;
switch (lavc_context->sample_fmt) {
case SAMPLE_FMT_U8: sh_audio->sample_format = AF_FORMAT_U8; break;
case SAMPLE_FMT_S16: sh_audio->sample_format = AF_FORMAT_S16_NE; break;
case SAMPLE_FMT_S32: sh_audio->sample_format = AF_FORMAT_S32_NE; break;
case SAMPLE_FMT_FLT: sh_audio->sample_format = AF_FORMAT_FLOAT_NE; break;
default:
mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Unsupported sample format\n");
return 0;
}
if(sh_audio->wf){
// If the decoder uses the wrong number of channels all is lost anyway.
// sh_audio->channels=sh_audio->wf->nChannels;
@ -120,7 +129,7 @@ static int init(sh_audio_t *sh_audio)
if (sh_audio->wf->nAvgBytesPerSec)
sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec;
}
sh_audio->samplesize=2;
sh_audio->samplesize=af_fmt2bits(sh_audio->sample_format)/ 8;
return 1;
}

View File

@ -248,6 +248,7 @@ int mpae_init_lavc(audio_encoder_t *encoder)
}
encoder->decode_buffer_size = lavc_actx->frame_size * 2 * encoder->params.channels;
while (encoder->decode_buffer_size < 1024) encoder->decode_buffer_size *= 2;
encoder->bind = bind_lavc;
encoder->get_frame_size = get_frame_size;
encoder->encode = encode_lavc;

View File

@ -54,8 +54,6 @@
// buffer type was printed (do NOT set this flag - it's for INTERNAL USE!!!)
#define MP_IMGFLAG_TYPE_DISPLAYED 0x8000
// set if it can not be reused yet (for MP_IMGTYPE_NUMBERED)
#define MP_IMGFLAG_IN_USE 0x10000
// codec doesn't support any form of direct rendering - it has own buffer
// allocation. so we just export its buffer pointers:
@ -101,6 +99,7 @@ typedef struct mp_image {
int chroma_height;
int chroma_x_shift; // horizontal
int chroma_y_shift; // vertical
int usage_count;
/* for private use by filter or vo driver (to store buffer id or dmpi) */
void* priv;
} mp_image_t;

View File

@ -434,7 +434,7 @@ static void draw_slice(struct AVCodecContext *s,
const AVFrame *src, int offset[4],
int y, int type, int height){
sh_video_t *sh = s->opaque;
uint8_t *source[3]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
#if 0
int start=0, i;
int width= s->width;
@ -703,7 +703,7 @@ static void release_buffer(struct AVCodecContext *avctx, AVFrame *pic){
}
#endif
// release mpi (in case MPI_IMGTYPE_NUMBERED is used, e.g. for VDPAU)
mpi->flags &= ~MP_IMGFLAG_IN_USE;
mpi->usage_count--;
}
if(pic->type!=FF_BUFFER_TYPE_USER){

View File

@ -125,14 +125,12 @@ static void draw_slice (void * _sh, uint8_t * const * src, unsigned int y){
vd_libmpeg2_ctx_t *context = sh->context;
mpeg2dec_t* mpeg2dec = context->mpeg2dec;
const mpeg2_info_t * info = mpeg2_info (mpeg2dec);
int stride[3];
int stride[MP_MAX_PLANES] = {mpeg2dec->decoder.stride, mpeg2dec->decoder.uv_stride, mpeg2dec->decoder.uv_stride};
uint8_t *srcs[MP_MAX_PLANES] = {src[0], src[1], src[2]};
// printf("draw_slice() y=%d \n",y);
stride[0]=mpeg2dec->decoder.stride;
stride[1]=stride[2]=mpeg2dec->decoder.uv_stride;
mpcodecs_draw_slice(sh, (uint8_t **)src,
mpcodecs_draw_slice(sh, srcs,
stride, info->sequence->picture_width,
(y+16<=info->sequence->picture_height) ? 16 :
info->sequence->picture_height-y,

View File

@ -303,7 +303,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
if (number == -1) {
int i;
for (i = 0; i < NUM_NUMBERED_MPI; i++)
if (!vf->imgctx.numbered_images[i] || !(vf->imgctx.numbered_images[i]->flags & MP_IMGFLAG_IN_USE))
if (!vf->imgctx.numbered_images[i] || !vf->imgctx.numbered_images[i]->usage_count)
break;
number = i;
}
@ -430,7 +430,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
mpi->qscale = NULL;
}
mpi->flags |= MP_IMGFLAG_IN_USE;
mpi->usage_count++;
// printf("\rVF_MPI: %p %p %p %d %d %d \n",
// mpi->planes[0],mpi->planes[1],mpi->planes[2],
// mpi->stride[0],mpi->stride[1],mpi->stride[2]);

View File

@ -1,5 +1,5 @@
/*
* vf_bmovl.c v0.9.1 - BitMap OVerLay video filter for MPlayer
* BitMap OVerLay video filter for MPlayer
*
* (C) 2002 Per Wigren <wigren@home.se>
*

View File

@ -422,7 +422,7 @@ block_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs,
"paddusw %%mm2, %%mm7\n\t" \
"paddusw %%mm1, %%mm7\n\t" \
: "=r" (a), "=r" (b) \
: "r"((long)as), "r"((long)bs), "m" (ones), "0"(a), "1"(b), "X"(*a), "X"(*b) \
: "r"((x86_reg)as), "r"((x86_reg)bs), "m" (ones), "0"(a), "1"(b), "X"(*a), "X"(*b) \
); \
} while (--lines);
@ -464,8 +464,8 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_mmx2: internal error\n");
#else
static const unsigned long long ones = 0x0101010101010101ull;
unsigned long interlaced;
unsigned long prefetch_line = (((long)a>>3) & 7) + 10;
x86_reg interlaced;
x86_reg prefetch_line = (((long)a>>3) & 7) + 10;
#ifdef DEBUG
struct frame_stats ts = *s;
#endif
@ -631,7 +631,7 @@ dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
"por %%mm3, %%mm1 \n\t" /* avg if >= threshold */
"movq %%mm1, (%2,%4) \n\t"
: /* no output */
: "r" (a), "r" (bos), "r" (dst), "r" ((long)ss), "r" ((long)ds), "r" (cos)
: "r" (a), "r" ((x86_reg)bos), "r" ((x86_reg)dst), "r" ((x86_reg)ss), "r" ((x86_reg)ds), "r" ((x86_reg)cos)
);
a += 8;
dst += 8;

View File

@ -1,6 +1,5 @@
/*
* vf_fstep.c - filter to ouput only 1 every n frame, or only the I (key)
* frame
* filter to ouput only 1 every n frame, or only the I (key)frame
*
* The parameters are:
*

View File

@ -187,7 +187,7 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
:
: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
#if ARCH_X86_64
"d" ((long)us), "r" ((long)vs)
"d" ((x86_reg)us), "r" ((x86_reg)vs)
#else
"d" (&us)
#endif
@ -299,7 +299,7 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
:
: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
#if ARCH_X86_64
"d" ((long)us), "r" ((long)vs)
"d" ((x86_reg)us), "r" ((x86_reg)vs)
#else
"d" (&us)
#endif

View File

@ -147,7 +147,7 @@ static int8_t *initNoise(FilterParam *fp){
#if HAVE_MMX
static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
long mmx_len= len&(~7);
x86_reg mmx_len= len&(~7);
noise+=shift;
__asm__ volatile(
@ -176,7 +176,7 @@ static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int
//duplicate of previous except movntq
#if HAVE_MMX2
static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
long mmx_len= len&(~7);
x86_reg mmx_len= len&(~7);
noise+=shift;
__asm__ volatile(
@ -218,7 +218,7 @@ static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int le
#if HAVE_MMX
static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
long mmx_len= len&(~7);
x86_reg mmx_len= len&(~7);
__asm__ volatile(
"mov %5, %%"REG_a" \n\t"

View File

@ -174,10 +174,10 @@ static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride,
int x, y;
FilterParam f= *fp;
const int radius= f.distWidth/2;
uint8_t *srcArray[3]= {src, NULL, NULL};
uint8_t *dstArray[3]= {f.preFilterBuf, NULL, NULL};
int srcStrideArray[3]= {srcStride, 0, 0};
int dstStrideArray[3]= {f.preFilterStride, 0, 0};
uint8_t *srcArray[MP_MAX_PLANES]= {src};
uint8_t *dstArray[MP_MAX_PLANES]= {f.preFilterBuf};
int srcStrideArray[MP_MAX_PLANES]= {srcStride};
int dstStrideArray[MP_MAX_PLANES]= {f.preFilterStride};
// f.preFilterContext->swScale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
sws_scale(f.preFilterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);

View File

@ -318,9 +318,9 @@ static void start_slice(struct vf_instance* vf, mp_image_t *mpi){
vf->priv->w, vf->priv->h);
}
static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[3], int src_stride[3], int y, int h,
uint8_t *dst[3], int dst_stride[3], int interlaced){
uint8_t *src2[3]={src[0], src[1], src[2]};
static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[MP_MAX_PLANES], int src_stride[MP_MAX_PLANES],
int y, int h, uint8_t *dst[MP_MAX_PLANES], int dst_stride[MP_MAX_PLANES], int interlaced){
uint8_t *src2[MP_MAX_PLANES]={src[0], src[1], src[2]};
#ifdef WORDS_BIGENDIAN
uint32_t pal2[256];
if (src[1] && !src[2]){
@ -333,9 +333,9 @@ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src
if(interlaced){
int i;
uint8_t *dst2[3]={dst[0], dst[1], dst[2]};
int src_stride2[3]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2]};
int dst_stride2[3]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2]};
uint8_t *dst2[MP_MAX_PLANES]={dst[0], dst[1], dst[2]};
int src_stride2[MP_MAX_PLANES]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2]};
int dst_stride2[MP_MAX_PLANES]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2]};
sws_scale_ordered(sws1, src2, src_stride2, y>>1, h>>1, dst2, dst_stride2);
for(i=0; i<3; i++){

View File

@ -108,16 +108,14 @@ static void gen_fname(struct vf_priv_s* priv)
static void scale_image(struct vf_priv_s* priv, mp_image_t *mpi)
{
uint8_t *dst[3];
int dst_stride[3];
uint8_t *dst[MP_MAX_PLANES] = {NULL};
int dst_stride[MP_MAX_PLANES] = {0};
dst_stride[0] = priv->stride;
dst_stride[1] = dst_stride[2] = 0;
if (!priv->buffer)
priv->buffer = memalign(16, dst_stride[0]*priv->dh);
dst[0] = priv->buffer;
dst[1] = dst[2] = 0;
sws_scale_ordered(priv->ctx, mpi->planes, mpi->stride, 0, priv->dh, dst, dst_stride);
}
@ -137,12 +135,10 @@ static void draw_slice(struct vf_instance* vf, unsigned char** src,
int* stride, int w,int h, int x, int y)
{
if (vf->priv->store_slices) {
uint8_t *dst[3];
int dst_stride[3];
uint8_t *dst[MP_MAX_PLANES] = {NULL};
int dst_stride[MP_MAX_PLANES] = {0};
dst_stride[0] = vf->priv->stride;
dst_stride[1] = dst_stride[2] = 0;
dst[0] = vf->priv->buffer;
dst[1] = dst[2] = 0;
sws_scale_ordered(vf->priv->ctx, src, stride, y, h, dst, dst_stride);
}
vf_next_draw_slice(vf,src,stride,w,h,x,y);

View File

@ -132,10 +132,10 @@ static void uninit(struct vf_instance* vf){
static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, FilterParam *fp){
int x, y;
FilterParam f= *fp;
uint8_t *srcArray[3]= {src, NULL, NULL};
uint8_t *dstArray[3]= {dst, NULL, NULL};
int srcStrideArray[3]= {srcStride, 0, 0};
int dstStrideArray[3]= {dstStride, 0, 0};
uint8_t *srcArray[MP_MAX_PLANES]= {src};
uint8_t *dstArray[MP_MAX_PLANES]= {dst};
int srcStrideArray[MP_MAX_PLANES]= {srcStride};
int dstStrideArray[MP_MAX_PLANES]= {dstStride};
sws_scale(f.filterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);

View File

@ -1,5 +1,5 @@
/*
* vf_tile.c - filter to tile a serie of image in a single, bigger, image
* filter to tile a serie of image in a single, bigger, image
*
* The parameters are:
*

View File

@ -248,8 +248,8 @@ static void filter_line_mmx2(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, u
:[prev] "r"(prev),\
[cur] "r"(cur),\
[next] "r"(next),\
[prefs]"r"((long)refs),\
[mrefs]"r"((long)-refs),\
[prefs]"r"((x86_reg)refs),\
[mrefs]"r"((x86_reg)-refs),\
[pw1] "m"(pw_1),\
[pb1] "m"(pb_1),\
[mode] "g"(mode)\

View File

@ -58,6 +58,8 @@ static int demux_mf_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds){
return 1;
}
// force extension/type to have a fourcc
static const struct {
const char *type;
uint32_t format;
@ -65,6 +67,9 @@ static const struct {
{ "bmp", mmioFOURCC('b', 'm', 'p', ' ') },
{ "jpeg", mmioFOURCC('I', 'J', 'P', 'G') },
{ "jpg", mmioFOURCC('I', 'J', 'P', 'G') },
{ "jls", mmioFOURCC('I', 'J', 'P', 'G') },
{ "thm", mmioFOURCC('I', 'J', 'P', 'G') },
{ "db", mmioFOURCC('I', 'J', 'P', 'G') },
{ "pcx", mmioFOURCC('p', 'c', 'x', ' ') },
{ "png", mmioFOURCC('M', 'P', 'N', 'G') },
{ "ptx", mmioFOURCC('p', 't', 'x', ' ') },

View File

@ -260,6 +260,10 @@ sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid)
sh->opts = demuxer->opts;
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", sid);
}
if (sid == demuxer->opts->sub_id) {
demuxer->sub->id = id;
demuxer->sub->sh = demuxer->s_streams[id];
}
return demuxer->s_streams[id];
}

View File

@ -59,6 +59,7 @@ static const AVCodecTag mp_wav_override_tags[] = {
{ CODEC_ID_PCM_S16BE, MKTAG('t', 'w', 'o', 's')},
{ CODEC_ID_PCM_S16LE, 1},
{ CODEC_ID_PCM_S24BE, MKTAG('i', 'n', '2', '4')},
{ CODEC_ID_PCM_S24LE, 1},
{ 0, 0 },
};

View File

@ -27,7 +27,7 @@ typedef struct __attribute__((__packed__)) mpeglayer3waveformat_tag {
#endif /* _MPEGLAYER3WAVEFORMAT_ */
/* windows.h #includes wingdi.h on MinGW. */
#if !defined(_BITMAPINFOHEADER_) && !defined(_WINGDI_H)
#if !defined(_BITMAPINFOHEADER_) && !defined(_WINGDI_)
#define _BITMAPINFOHEADER_
typedef struct __attribute__((__packed__))
{

View File

@ -7,18 +7,25 @@ HEADERS = swscale.h
OBJS = rgb2rgb.o swscale.o swscale_avoption.o yuv2rgb.o
OBJS-$(ARCH_BFIN) += internal_bfin.o swscale_bfin.o yuv2rgb_bfin.o
OBJS-$(CONFIG_MLIB) += yuv2rgb_mlib.o
OBJS-$(HAVE_ALTIVEC) += yuv2rgb_altivec.o
OBJS-$(HAVE_VIS) += yuv2rgb_vis.o
OBJS-$(ARCH_BFIN) += bfin/internal_bfin.o \
bfin/swscale_bfin.o \
bfin/yuv2rgb_bfin.o
OBJS-$(CONFIG_MLIB) += mlib/yuv2rgb_mlib.o
OBJS-$(HAVE_ALTIVEC) += ppc/yuv2rgb_altivec.o
OBJS-$(HAVE_VIS) += sparc/yuv2rgb_vis.o
TESTS = cs_test swscale-example
MMX-OBJS-$(CONFIG_GPL) += x86/yuv2rgb_mmx.o \
CLEANFILES = cs_test swscale-example
OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
EXAMPLES = swscale
TESTPROGS = colorspace
DIRS = bfin mlib ppc sparc x86
include $(SUBDIR)../subdir.mak
$(SUBDIR)cs_test: $(SUBDIR)cs_test.o $(SUBDIR)$(LIBNAME)
$(SUBDIR)colorspace-test$(EXESUF): $(SUBDIR)colorspace-test.o $(SUBDIR)$(LIBNAME)
$(SUBDIR)swscale-example: $(SUBDIR)swscale-example.o $(SUBDIR)$(LIBNAME)
$(SUBDIR)swscale-example: EXTRALIBS += -lm
$(SUBDIR)swscale-example$(EXESUF): $(SUBDIR)swscale-example.o $(SUBDIR)$(LIBNAME)
$(SUBDIR)swscale-example$(EXESUF): EXTRALIBS += -lm

View File

@ -27,9 +27,9 @@
#include <assert.h>
#include "config.h"
#include <unistd.h>
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"
#include "libswscale/rgb2rgb.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#ifdef __FDPIC__
#define L1CODE __attribute__ ((l1_text))
@ -37,16 +37,16 @@
#define L1CODE
#endif
int ff_bfin_uyvytoyv12 (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride) L1CODE;
int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride) L1CODE;
int ff_bfin_yuyvtoyv12 (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride) L1CODE;
int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride) L1CODE;
static int uyvytoyv12_unscaled (SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[])
static int uyvytoyv12_unscaled(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[])
{
uint8_t *dsty = dst[0] + dstStride[0]*srcSliceY;
uint8_t *dstu = dst[1] + dstStride[1]*srcSliceY/2;
@ -54,13 +54,14 @@ static int uyvytoyv12_unscaled (SwsContext *c, uint8_t* src[], int srcStride[],
uint8_t *ip = src[0] + srcStride[0]*srcSliceY;
int w = dstStride[0];
ff_bfin_uyvytoyv12 (ip, dsty, dstu, dstv, w, srcSliceH, dstStride[0], dstStride[1], srcStride[0]);
ff_bfin_uyvytoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
dstStride[0], dstStride[1], srcStride[0]);
return srcSliceH;
}
static int yuyvtoyv12_unscaled (SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[])
static int yuyvtoyv12_unscaled(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[])
{
uint8_t *dsty = dst[0] + dstStride[0]*srcSliceY;
uint8_t *dstu = dst[1] + dstStride[1]*srcSliceY/2;
@ -68,13 +69,14 @@ static int yuyvtoyv12_unscaled (SwsContext *c, uint8_t* src[], int srcStride[],
uint8_t *ip = src[0] + srcStride[0]*srcSliceY;
int w = dstStride[0];
ff_bfin_yuyvtoyv12 (ip, dsty, dstu, dstv, w, srcSliceH, dstStride[0], dstStride[1], srcStride[0]);
ff_bfin_yuyvtoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
dstStride[0], dstStride[1], srcStride[0]);
return srcSliceH;
}
void ff_bfin_get_unscaled_swscale (SwsContext *c)
void ff_bfin_get_unscaled_swscale(SwsContext *c)
{
SwsFunc swScale = c->swScale;
if (c->flags & SWS_CPU_CAPS_BFIN)

View File

@ -28,9 +28,9 @@
#include <assert.h>
#include "config.h"
#include <unistd.h>
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"
#include "libswscale/rgb2rgb.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#ifdef __FDPIC__
#define L1CODE __attribute__ ((l1_text))
@ -38,20 +38,20 @@
#define L1CODE
#endif
void ff_bfin_yuv2rgb555_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) L1CODE;
void ff_bfin_yuv2rgb565_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) L1CODE;
void ff_bfin_yuv2rgb24_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out,
void ff_bfin_yuv2rgb555_line(uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) L1CODE;
void ff_bfin_yuv2rgb565_line(uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) L1CODE;
void ff_bfin_yuv2rgb24_line(uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs) L1CODE;
typedef void (* ltransform)(uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out,
int w, uint32_t *coeffs);
static void bfin_prepare_coefficients (SwsContext *c, int rgb, int masks)
static void bfin_prepare_coefficients(SwsContext *c, int rgb, int masks)
{
int oy;
oy = c->yOffset&0xffff;
@ -88,18 +88,18 @@ static void bfin_prepare_coefficients (SwsContext *c, int rgb, int masks)
}
}
static int core_yuv420_rgb (SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides,
ltransform lcscf, int rgb, int masks)
static int core_yuv420_rgb(SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides,
ltransform lcscf, int rgb, int masks)
{
uint8_t *py,*pu,*pv,*op;
int w = instrides[0];
int h2 = srcSliceH>>1;
int i;
bfin_prepare_coefficients (c, rgb, masks);
bfin_prepare_coefficients(c, rgb, masks);
py = in[0];
pu = in[1+(1^rgb)];
@ -109,12 +109,12 @@ static int core_yuv420_rgb (SwsContext *c,
for (i=0;i<h2;i++) {
lcscf (py, pu, pv, op, w, &c->oy);
lcscf(py, pu, pv, op, w, &c->oy);
py += instrides[0];
op += outstrides[0];
lcscf (py, pu, pv, op, w, &c->oy);
lcscf(py, pu, pv, op, w, &c->oy);
py += instrides[0];
pu += instrides[1];
@ -126,62 +126,62 @@ static int core_yuv420_rgb (SwsContext *c,
}
static int bfin_yuv420_rgb555 (SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides,
ff_bfin_yuv2rgb555_line, 1, 555);
}
static int bfin_yuv420_bgr555 (SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides,
ff_bfin_yuv2rgb555_line, 0, 555);
}
static int bfin_yuv420_rgb24 (SwsContext *c,
static int bfin_yuv420_rgb555(SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides,
ff_bfin_yuv2rgb24_line, 1, 888);
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb555_line, 1, 555);
}
static int bfin_yuv420_bgr24 (SwsContext *c,
static int bfin_yuv420_bgr555(SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides,
ff_bfin_yuv2rgb24_line, 0, 888);
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb555_line, 0, 555);
}
static int bfin_yuv420_rgb565 (SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
static int bfin_yuv420_rgb24(SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides,
ff_bfin_yuv2rgb565_line, 1, 565);
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb24_line, 1, 888);
}
static int bfin_yuv420_bgr565 (SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
static int bfin_yuv420_bgr24(SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides,
ff_bfin_yuv2rgb565_line, 0, 565);
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb24_line, 0, 888);
}
static int bfin_yuv420_rgb565(SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb565_line, 1, 565);
}
static int bfin_yuv420_bgr565(SwsContext *c,
uint8_t **in, int *instrides,
int srcSliceY, int srcSliceH,
uint8_t **oplanes, int *outstrides)
{
return core_yuv420_rgb(c, in, instrides, srcSliceY, srcSliceH, oplanes,
outstrides, ff_bfin_yuv2rgb565_line, 0, 565);
}
SwsFunc ff_bfin_yuv2rgb_get_func_ptr (SwsContext *c)
SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c)
{
SwsFunc f;

View File

@ -28,7 +28,7 @@
#include <stdlib.h>
#include <assert.h>
#include "swscale.h"
#include "libswscale/swscale.h"
static int mlib_YUV2ARGB420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
@ -73,7 +73,7 @@ static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], in
}
SwsFunc sws_yuv2rgb_init_mlib(SwsContext *c)
SwsFunc ff_yuv2rgb_init_mlib(SwsContext *c)
{
switch(c->dstFormat){
case PIX_FMT_RGB24: return mlib_YUV2RGB420_24;

View File

@ -6,18 +6,18 @@
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FFmpeg; if not, write to the Free Software
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

View File

@ -91,9 +91,9 @@ adjustment.
#include <inttypes.h>
#include <assert.h>
#include "config.h"
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"
#include "libswscale/rgb2rgb.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#undef PROFILE_THE_BEAST
#undef INC_SCALING
@ -690,7 +690,7 @@ static int altivec_uyvy_rgb32 (SwsContext *c,
So we just fall back to the C codes for this.
*/
SwsFunc sws_yuv2rgb_init_altivec (SwsContext *c)
SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c)
{
if (!(c->flags & SWS_CPU_CAPS_ALTIVEC))
return NULL;
@ -750,7 +750,7 @@ SwsFunc sws_yuv2rgb_init_altivec (SwsContext *c)
return NULL;
}
void sws_yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)
void ff_yuv2rgb_init_tables_altivec(SwsContext *c, const int inv_table[4], int brightness, int contrast, int saturation)
{
union {
signed short tmp[8] __attribute__ ((aligned(16)));
@ -786,7 +786,7 @@ void sws_yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int
void
altivec_yuv2packedX (SwsContext *c,
ff_yuv2packedX_altivec(SwsContext *c,
int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, int dstW, int dstY)

View File

@ -87,6 +87,19 @@ void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *sr
long width, long height,
long srcStride1, long srcStride2,
long srcStride3, long dstStride);
void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
#if ARCH_X86 && CONFIG_GPL
DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0x0000000000000000ULL;

View File

@ -142,6 +142,20 @@ extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint
long srcStride1, long srcStride2,
long srcStride3, long dstStride);
extern void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
extern void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
extern void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
extern void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride);
void sws_rgb2rgb_init(int flags);
#endif /* SWSCALE_RGB2RGB_H */

View File

@ -1339,7 +1339,7 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_
static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size)
{
long idx = 15 - src_size;
x86_reg idx = 15 - src_size;
const uint8_t *s = src-idx;
uint8_t *d = dst-idx;
#if HAVE_MMX
@ -1405,7 +1405,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s
{
unsigned i;
#if HAVE_MMX
long mmx_size= 23 - src_size;
x86_reg mmx_size= 23 - src_size;
__asm__ volatile (
"test %%"REG_a", %%"REG_a" \n\t"
"jns 2f \n\t"
@ -1476,7 +1476,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
{
long y;
const long chromWidth= width>>1;
const x86_reg chromWidth= width>>1;
for (y=0; y<height; y++)
{
#if HAVE_MMX
@ -1628,7 +1628,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
{
long y;
const long chromWidth= width>>1;
const x86_reg chromWidth= width>>1;
for (y=0; y<height; y++)
{
#if HAVE_MMX
@ -1758,7 +1758,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= width>>1;
const x86_reg chromWidth= width>>1;
for (y=0; y<height; y+=2)
{
#if HAVE_MMX
@ -1900,7 +1900,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi
for (y=1; y<srcHeight; y++){
#if HAVE_MMX2 || HAVE_AMD3DNOW
const long mmxSize= srcWidth&~15;
const x86_reg mmxSize= srcWidth&~15;
__asm__ volatile(
"mov %4, %%"REG_a" \n\t"
"1: \n\t"
@ -1944,7 +1944,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi
);
#else
const long mmxSize=1;
const x86_reg mmxSize=1;
#endif
dst[0 ]= (3*src[0] + src[srcStride])>>2;
dst[dstStride]= ( src[0] + 3*src[srcStride])>>2;
@ -1996,7 +1996,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= width>>1;
const x86_reg chromWidth= width>>1;
for (y=0; y<height; y+=2)
{
#if HAVE_MMX
@ -2123,7 +2123,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= width>>1;
const x86_reg chromWidth= width>>1;
#if HAVE_MMX
for (y=0; y<height-2; y+=2)
{
@ -2196,7 +2196,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
MOVNTQ" %%mm0, (%1, %%"REG_a") \n\t"
"add $8, %%"REG_a" \n\t"
" js 1b \n\t"
: : "r" (src+width*3), "r" (ydst+width), "g" (-width)
: : "r" (src+width*3), "r" (ydst+width), "g" ((x86_reg)-width)
: "%"REG_a, "%"REG_d
);
ydst += lumStride;
@ -2440,7 +2440,7 @@ static void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
"add $16, %%"REG_a" \n\t"
"cmp %3, %%"REG_a" \n\t"
" jb 1b \n\t"
::"r"(dest), "r"(src1), "r"(src2), "r" (width-15)
::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15)
: "memory", "%"REG_a""
);
#else
@ -2466,7 +2466,7 @@ static void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
"add $16, %%"REG_a" \n\t"
"cmp %3, %%"REG_a" \n\t"
" jb 1b \n\t"
::"r"(dest), "r"(src1), "r"(src2), "r" (width-15)
::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15)
: "memory", "%"REG_a
);
#endif
@ -2501,7 +2501,8 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
long srcStride1, long srcStride2,
long dstStride1, long dstStride2)
{
long y,x,w,h;
x86_reg y;
long x,w,h;
w=width/2; h=height/2;
#if HAVE_MMX
__asm__ volatile(
@ -2604,7 +2605,8 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
long srcStride1, long srcStride2,
long srcStride3, long dstStride)
{
long y,x,w,h;
x86_reg x;
long y,w,h;
w=width/2; h=height;
for (y=0;y<h;y++){
const uint8_t* yp=src1+srcStride1*y;
@ -2689,6 +2691,354 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
#endif
}
static void RENAME(extract_even)(const uint8_t *src, uint8_t *dst, x86_reg count)
{
dst += count;
src += 2*count;
count= - count;
#if HAVE_MMX
if(count <= -16){
count += 15;
__asm__ volatile(
"pcmpeqw %%mm7, %%mm7 \n\t"
"psrlw $8, %%mm7 \n\t"
"1: \n\t"
"movq -30(%1, %0, 2), %%mm0 \n\t"
"movq -22(%1, %0, 2), %%mm1 \n\t"
"movq -14(%1, %0, 2), %%mm2 \n\t"
"movq -6(%1, %0, 2), %%mm3 \n\t"
"pand %%mm7, %%mm0 \n\t"
"pand %%mm7, %%mm1 \n\t"
"pand %%mm7, %%mm2 \n\t"
"pand %%mm7, %%mm3 \n\t"
"packuswb %%mm1, %%mm0 \n\t"
"packuswb %%mm3, %%mm2 \n\t"
MOVNTQ" %%mm0,-15(%2, %0) \n\t"
MOVNTQ" %%mm2,- 7(%2, %0) \n\t"
"add $16, %0 \n\t"
" js 1b \n\t"
: "+r"(count)
: "r"(src), "r"(dst)
);
count -= 15;
}
#endif
while(count<0){
dst[count]= src[2*count];
count++;
}
}
static void RENAME(extract_even2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count)
{
dst0+= count;
dst1+= count;
src += 4*count;
count= - count;
#if HAVE_MMX
if(count <= -8){
count += 7;
__asm__ volatile(
"pcmpeqw %%mm7, %%mm7 \n\t"
"psrlw $8, %%mm7 \n\t"
"1: \n\t"
"movq -28(%1, %0, 4), %%mm0 \n\t"
"movq -20(%1, %0, 4), %%mm1 \n\t"
"movq -12(%1, %0, 4), %%mm2 \n\t"
"movq -4(%1, %0, 4), %%mm3 \n\t"
"pand %%mm7, %%mm0 \n\t"
"pand %%mm7, %%mm1 \n\t"
"pand %%mm7, %%mm2 \n\t"
"pand %%mm7, %%mm3 \n\t"
"packuswb %%mm1, %%mm0 \n\t"
"packuswb %%mm3, %%mm2 \n\t"
"movq %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm3 \n\t"
"psrlw $8, %%mm0 \n\t"
"psrlw $8, %%mm2 \n\t"
"pand %%mm7, %%mm1 \n\t"
"pand %%mm7, %%mm3 \n\t"
"packuswb %%mm2, %%mm0 \n\t"
"packuswb %%mm3, %%mm1 \n\t"
MOVNTQ" %%mm0,- 7(%3, %0) \n\t"
MOVNTQ" %%mm1,- 7(%2, %0) \n\t"
"add $8, %0 \n\t"
" js 1b \n\t"
: "+r"(count)
: "r"(src), "r"(dst0), "r"(dst1)
);
count -= 7;
}
#endif
while(count<0){
dst0[count]= src[4*count+0];
dst1[count]= src[4*count+2];
count++;
}
}
static void RENAME(extract_even2avg)(const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
{
dst0 += count;
dst1 += count;
src0 += 4*count;
src1 += 4*count;
count= - count;
#ifdef PAVGB
if(count <= -8){
count += 7;
__asm__ volatile(
"pcmpeqw %%mm7, %%mm7 \n\t"
"psrlw $8, %%mm7 \n\t"
"1: \n\t"
"movq -28(%1, %0, 4), %%mm0 \n\t"
"movq -20(%1, %0, 4), %%mm1 \n\t"
"movq -12(%1, %0, 4), %%mm2 \n\t"
"movq -4(%1, %0, 4), %%mm3 \n\t"
PAVGB" -28(%2, %0, 4), %%mm0 \n\t"
PAVGB" -20(%2, %0, 4), %%mm1 \n\t"
PAVGB" -12(%2, %0, 4), %%mm2 \n\t"
PAVGB" - 4(%2, %0, 4), %%mm3 \n\t"
"pand %%mm7, %%mm0 \n\t"
"pand %%mm7, %%mm1 \n\t"
"pand %%mm7, %%mm2 \n\t"
"pand %%mm7, %%mm3 \n\t"
"packuswb %%mm1, %%mm0 \n\t"
"packuswb %%mm3, %%mm2 \n\t"
"movq %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm3 \n\t"
"psrlw $8, %%mm0 \n\t"
"psrlw $8, %%mm2 \n\t"
"pand %%mm7, %%mm1 \n\t"
"pand %%mm7, %%mm3 \n\t"
"packuswb %%mm2, %%mm0 \n\t"
"packuswb %%mm3, %%mm1 \n\t"
MOVNTQ" %%mm0,- 7(%4, %0) \n\t"
MOVNTQ" %%mm1,- 7(%3, %0) \n\t"
"add $8, %0 \n\t"
" js 1b \n\t"
: "+r"(count)
: "r"(src0), "r"(src1), "r"(dst0), "r"(dst1)
);
count -= 7;
}
#endif
while(count<0){
dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1;
dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1;
count++;
}
}
static void RENAME(extract_odd2)(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count)
{
dst0+= count;
dst1+= count;
src += 4*count;
count= - count;
#if HAVE_MMX
if(count <= -8){
count += 7;
__asm__ volatile(
"pcmpeqw %%mm7, %%mm7 \n\t"
"psrlw $8, %%mm7 \n\t"
"1: \n\t"
"movq -28(%1, %0, 4), %%mm0 \n\t"
"movq -20(%1, %0, 4), %%mm1 \n\t"
"movq -12(%1, %0, 4), %%mm2 \n\t"
"movq -4(%1, %0, 4), %%mm3 \n\t"
"psrlw $8, %%mm0 \n\t"
"psrlw $8, %%mm1 \n\t"
"psrlw $8, %%mm2 \n\t"
"psrlw $8, %%mm3 \n\t"
"packuswb %%mm1, %%mm0 \n\t"
"packuswb %%mm3, %%mm2 \n\t"
"movq %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm3 \n\t"
"psrlw $8, %%mm0 \n\t"
"psrlw $8, %%mm2 \n\t"
"pand %%mm7, %%mm1 \n\t"
"pand %%mm7, %%mm3 \n\t"
"packuswb %%mm2, %%mm0 \n\t"
"packuswb %%mm3, %%mm1 \n\t"
MOVNTQ" %%mm0,- 7(%3, %0) \n\t"
MOVNTQ" %%mm1,- 7(%2, %0) \n\t"
"add $8, %0 \n\t"
" js 1b \n\t"
: "+r"(count)
: "r"(src), "r"(dst0), "r"(dst1)
);
count -= 7;
}
#endif
src++;
while(count<0){
dst0[count]= src[4*count+0];
dst1[count]= src[4*count+2];
count++;
}
}
static void RENAME(extract_odd2avg)(const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
{
dst0 += count;
dst1 += count;
src0 += 4*count;
src1 += 4*count;
count= - count;
#ifdef PAVGB
if(count <= -8){
count += 7;
__asm__ volatile(
"pcmpeqw %%mm7, %%mm7 \n\t"
"psrlw $8, %%mm7 \n\t"
"1: \n\t"
"movq -28(%1, %0, 4), %%mm0 \n\t"
"movq -20(%1, %0, 4), %%mm1 \n\t"
"movq -12(%1, %0, 4), %%mm2 \n\t"
"movq -4(%1, %0, 4), %%mm3 \n\t"
PAVGB" -28(%2, %0, 4), %%mm0 \n\t"
PAVGB" -20(%2, %0, 4), %%mm1 \n\t"
PAVGB" -12(%2, %0, 4), %%mm2 \n\t"
PAVGB" - 4(%2, %0, 4), %%mm3 \n\t"
"psrlw $8, %%mm0 \n\t"
"psrlw $8, %%mm1 \n\t"
"psrlw $8, %%mm2 \n\t"
"psrlw $8, %%mm3 \n\t"
"packuswb %%mm1, %%mm0 \n\t"
"packuswb %%mm3, %%mm2 \n\t"
"movq %%mm0, %%mm1 \n\t"
"movq %%mm2, %%mm3 \n\t"
"psrlw $8, %%mm0 \n\t"
"psrlw $8, %%mm2 \n\t"
"pand %%mm7, %%mm1 \n\t"
"pand %%mm7, %%mm3 \n\t"
"packuswb %%mm2, %%mm0 \n\t"
"packuswb %%mm3, %%mm1 \n\t"
MOVNTQ" %%mm0,- 7(%4, %0) \n\t"
MOVNTQ" %%mm1,- 7(%3, %0) \n\t"
"add $8, %0 \n\t"
" js 1b \n\t"
: "+r"(count)
: "r"(src0), "r"(src1), "r"(dst0), "r"(dst1)
);
count -= 7;
}
#endif
src0++;
src1++;
while(count<0){
dst0[count]= (src0[4*count+0]+src1[4*count+0])>>1;
dst1[count]= (src0[4*count+2]+src1[4*count+2])>>1;
count++;
}
}
static void RENAME(yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= -((-width)>>1);
for (y=0; y<height; y++){
RENAME(extract_even)(src, ydst, width);
if(y&1){
RENAME(extract_odd2avg)(src-srcStride, src, udst, vdst, chromWidth);
udst+= chromStride;
vdst+= chromStride;
}
src += srcStride;
ydst+= lumStride;
}
#if HAVE_MMX
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"
);
#endif
}
static void RENAME(yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= -((-width)>>1);
for (y=0; y<height; y++){
RENAME(extract_even)(src, ydst, width);
RENAME(extract_odd2)(src, udst, vdst, chromWidth);
src += srcStride;
ydst+= lumStride;
udst+= chromStride;
vdst+= chromStride;
}
#if HAVE_MMX
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"
);
#endif
}
static void RENAME(uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= -((-width)>>1);
for (y=0; y<height; y++){
RENAME(extract_even)(src+1, ydst, width);
if(y&1){
RENAME(extract_even2avg)(src-srcStride, src, udst, vdst, chromWidth);
udst+= chromStride;
vdst+= chromStride;
}
src += srcStride;
ydst+= lumStride;
}
#if HAVE_MMX
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"
);
#endif
}
static void RENAME(uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
long width, long height,
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= -((-width)>>1);
for (y=0; y<height; y++){
RENAME(extract_even)(src+1, ydst, width);
RENAME(extract_even2)(src, udst, vdst, chromWidth);
src += srcStride;
ydst+= lumStride;
udst+= chromStride;
vdst+= chromStride;
}
#if HAVE_MMX
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"
);
#endif
}
static inline void RENAME(rgb2rgb_init)(void){
rgb15to16 = RENAME(rgb15to16);
rgb15tobgr24 = RENAME(rgb15tobgr24);
@ -2713,11 +3063,15 @@ static inline void RENAME(rgb2rgb_init)(void){
yuv422ptoyuy2 = RENAME(yuv422ptoyuy2);
yuv422ptouyvy = RENAME(yuv422ptouyvy);
yuy2toyv12 = RENAME(yuy2toyv12);
// uyvytoyv12 = RENAME(uyvytoyv12);
// yvu9toyv12 = RENAME(yvu9toyv12);
planar2x = RENAME(planar2x);
rgb24toyv12 = RENAME(rgb24toyv12);
interleaveBytes = RENAME(interleaveBytes);
vu9_to_vu12 = RENAME(vu9_to_vu12);
yvu9_to_yuy2 = RENAME(yvu9_to_yuy2);
uyvytoyuv420 = RENAME(uyvytoyuv420);
uyvytoyuv422 = RENAME(uyvytoyuv422);
yuyvtoyuv420 = RENAME(yuyvtoyuv420);
yuyvtoyuv422 = RENAME(yuyvtoyuv422);
}

View File

@ -22,8 +22,8 @@
#include <inttypes.h>
#include <stdlib.h>
#include "swscale.h"
#include "swscale_internal.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#define YUV2RGB_INIT \
"wr %%g0, 0x10, %%gsr \n\t" \
@ -184,7 +184,7 @@ static int vis_422P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int s
return srcSliceH;
}
SwsFunc sws_yuv2rgb_init_vis(SwsContext *c) {
SwsFunc ff_yuv2rgb_init_vis(SwsContext *c){
c->sparc_coeffs[5]=c->yCoeff;
c->sparc_coeffs[6]=c->vgCoeff;
c->sparc_coeffs[7]=c->vrCoeff;

View File

@ -26,6 +26,7 @@
#undef HAVE_AV_CONFIG_H
#include "libavutil/avutil.h"
#include "libavutil/lfg.h"
#include "swscale.h"
#include "swscale_internal.h"
@ -48,19 +49,20 @@ static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, i
// test by ref -> src -> dst -> out & compare out against ref
// ref & out are YV12
static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat, int dstFormat,
static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, int srcFormat, int dstFormat,
int srcW, int srcH, int dstW, int dstH, int flags){
uint8_t *src[3];
uint8_t *dst[3];
uint8_t *out[3];
int srcStride[3], dstStride[3];
uint8_t *src[4] = {0};
uint8_t *dst[4] = {0};
uint8_t *out[4] = {0};
int srcStride[4], dstStride[4];
int i;
uint64_t ssdY, ssdU, ssdV;
struct SwsContext *srcContext, *dstContext, *outContext;
uint64_t ssdY, ssdU, ssdV, ssdA=0;
struct SwsContext *srcContext = NULL, *dstContext = NULL,
*outContext = NULL;
int res;
res = 0;
for (i=0; i<3; i++){
for (i=0; i<4; i++){
// avoid stride % bpp != 0
if (srcFormat==PIX_FMT_RGB24 || srcFormat==PIX_FMT_BGR24)
srcStride[i]= srcW*3;
@ -83,11 +85,10 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
}
}
dstContext = outContext = NULL;
srcContext= sws_getContext(w, h, PIX_FMT_YUV420P, srcW, srcH, srcFormat, flags, NULL, NULL, NULL);
srcContext= sws_getContext(w, h, PIX_FMT_YUVA420P, srcW, srcH, srcFormat, flags, NULL, NULL, NULL);
if (!srcContext) {
fprintf(stderr, "Failed to get %s ---> %s\n",
sws_format_name(PIX_FMT_YUV420P),
sws_format_name(PIX_FMT_YUVA420P),
sws_format_name(srcFormat));
res = -1;
@ -102,11 +103,11 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
goto end;
}
outContext= sws_getContext(dstW, dstH, dstFormat, w, h, PIX_FMT_YUV420P, flags, NULL, NULL, NULL);
outContext= sws_getContext(dstW, dstH, dstFormat, w, h, PIX_FMT_YUVA420P, flags, NULL, NULL, NULL);
if (!outContext) {
fprintf(stderr, "Failed to get %s ---> %s\n",
sws_format_name(dstFormat),
sws_format_name(PIX_FMT_YUV420P));
sws_format_name(PIX_FMT_YUVA420P));
res = -1;
goto end;
@ -121,17 +122,20 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
ssdY= getSSD(ref[0], out[0], refStride[0], refStride[0], w, h);
ssdU= getSSD(ref[1], out[1], refStride[1], refStride[1], (w+1)>>1, (h+1)>>1);
ssdV= getSSD(ref[2], out[2], refStride[2], refStride[2], (w+1)>>1, (h+1)>>1);
if (isALPHA(srcFormat) && isALPHA(dstFormat))
ssdA= getSSD(ref[3], out[3], refStride[3], refStride[3], w, h);
if (srcFormat == PIX_FMT_GRAY8 || dstFormat==PIX_FMT_GRAY8) ssdU=ssdV=0; //FIXME check that output is really gray
ssdY/= w*h;
ssdU/= w*h/4;
ssdV/= w*h/4;
ssdA/= w*h;
printf(" %s %dx%d -> %s %4dx%4d flags=%2d SSD=%5lld,%5lld,%5lld\n",
printf(" %s %dx%d -> %s %4dx%4d flags=%2d SSD=%5"PRId64",%5"PRId64",%5"PRId64",%5"PRId64"\n",
sws_format_name(srcFormat), srcW, srcH,
sws_format_name(dstFormat), dstW, dstH,
flags, ssdY, ssdU, ssdV);
flags, ssdY, ssdU, ssdV, ssdA);
fflush(stdout);
end:
@ -140,7 +144,7 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
sws_freeContext(dstContext);
sws_freeContext(outContext);
for (i=0; i<3; i++){
for (i=0; i<4; i++){
free(src[i]);
free(dst[i]);
free(out[i]);
@ -149,7 +153,7 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
return res;
}
static void selfTest(uint8_t *src[3], int stride[3], int w, int h){
static void selfTest(uint8_t *src[4], int stride[4], int w, int h){
enum PixelFormat srcFormat, dstFormat;
int srcW, srcH, dstW, dstH;
int flags;
@ -189,17 +193,20 @@ int main(int argc, char **argv){
uint8_t *rgb_data = malloc (W*H*4);
uint8_t *rgb_src[3]= {rgb_data, NULL, NULL};
int rgb_stride[3]={4*W, 0, 0};
uint8_t *data = malloc (3*W*H);
uint8_t *src[3]= {data, data+W*H, data+W*H*2};
int stride[3]={W, W, W};
uint8_t *data = malloc (4*W*H);
uint8_t *src[4]= {data, data+W*H, data+W*H*2, data+W*H*3};
int stride[4]={W, W, W, W};
int x, y;
struct SwsContext *sws;
AVLFG rand;
sws= sws_getContext(W/12, H/12, PIX_FMT_RGB32, W, H, PIX_FMT_YUV420P, 2, NULL, NULL, NULL);
sws= sws_getContext(W/12, H/12, PIX_FMT_RGB32, W, H, PIX_FMT_YUVA420P, 2, NULL, NULL, NULL);
av_lfg_init(&rand, 1);
for (y=0; y<H; y++){
for (x=0; x<W*4; x++){
rgb_data[ x + y*4*W]= random();
rgb_data[ x + y*4*W]= av_lfg_get(&rand);
}
}
sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);

View File

@ -68,6 +68,10 @@ untested special converters
#define MAP_ANONYMOUS MAP_ANON
#endif
#endif
#if HAVE_VIRTUALALLOC
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include "swscale.h"
#include "swscale_internal.h"
#include "rgb2rgb.h"
@ -133,6 +137,7 @@ unsigned swscale_version(void)
)
#define isSupportedOut(x) ( \
(x)==PIX_FMT_YUV420P \
|| (x)==PIX_FMT_YUVA420P \
|| (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_YUV444P \
@ -469,7 +474,7 @@ const char *sws_format_name(enum PixelFormat format)
static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW)
int16_t **alpSrc, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, int dstW, int chrDstW)
{
//FIXME Optimize (just quickly written not optimized..)
int i;
@ -498,6 +503,17 @@ static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilt
uDest[i]= av_clip_uint8(u>>19);
vDest[i]= av_clip_uint8(v>>19);
}
if (CONFIG_SWSCALE_ALPHA && aDest)
for (i=0; i<dstW; i++){
int val=1<<18;
int j;
for (j=0; j<lumFilterSize; j++)
val += alpSrc[j][i] * lumFilter[j];
aDest[i]= av_clip_uint8(val>>19);
}
}
static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
@ -551,13 +567,14 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
}
}
#define YSCALE_YUV_2_PACKEDX_NOCLIP_C(type) \
#define YSCALE_YUV_2_PACKEDX_NOCLIP_C(type,alpha) \
for (i=0; i<(dstW>>1); i++){\
int j;\
int Y1 = 1<<18;\
int Y2 = 1<<18;\
int U = 1<<18;\
int V = 1<<18;\
int av_unused A1, A2;\
type av_unused *r, *b, *g;\
const int i2= 2*i;\
\
@ -575,9 +592,19 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
Y2>>=19;\
U >>=19;\
V >>=19;\
if (alpha){\
A1 = 1<<18;\
A2 = 1<<18;\
for (j=0; j<lumFilterSize; j++){\
A1 += alpSrc[j][i2 ] * lumFilter[j];\
A2 += alpSrc[j][i2+1] * lumFilter[j];\
}\
A1>>=19;\
A2>>=19;\
}\
#define YSCALE_YUV_2_PACKEDX_C(type) \
YSCALE_YUV_2_PACKEDX_NOCLIP_C(type)\
#define YSCALE_YUV_2_PACKEDX_C(type,alpha) \
YSCALE_YUV_2_PACKEDX_NOCLIP_C(type,alpha)\
if ((Y1|Y2|U|V)&256)\
{\
if (Y1>255) Y1=255; \
@ -588,14 +615,19 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
else if (U<0) U=0; \
if (V>255) V=255; \
else if (V<0) V=0; \
}\
if (alpha && ((A1|A2)&256)){\
A1=av_clip_uint8(A1);\
A2=av_clip_uint8(A2);\
}
#define YSCALE_YUV_2_PACKEDX_FULL_C \
#define YSCALE_YUV_2_PACKEDX_FULL_C(rnd,alpha) \
for (i=0; i<dstW; i++){\
int j;\
int Y = 0;\
int U = -128<<19;\
int V = -128<<19;\
int av_unused A;\
int R,G,B;\
\
for (j=0; j<lumFilterSize; j++){\
@ -608,9 +640,17 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
Y >>=10;\
U >>=10;\
V >>=10;\
if (alpha){\
A = rnd;\
for (j=0; j<lumFilterSize; j++)\
A += alpSrc[j][i ] * lumFilter[j];\
A >>=19;\
if (A&256)\
A = av_clip_uint8(A);\
}\
#define YSCALE_YUV_2_RGBX_FULL_C(rnd) \
YSCALE_YUV_2_PACKEDX_FULL_C\
#define YSCALE_YUV_2_RGBX_FULL_C(rnd,alpha) \
YSCALE_YUV_2_PACKEDX_FULL_C(rnd>>3,alpha)\
Y-= c->yuv2rgb_y_offset;\
Y*= c->yuv2rgb_y_coeff;\
Y+= rnd;\
@ -652,19 +692,25 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
else if (Y2<0)Y2=0; \
}
#define YSCALE_YUV_2_RGBX_C(type) \
YSCALE_YUV_2_PACKEDX_C(type) /* FIXME fix tables so that clipping is not needed and then use _NOCLIP*/\
#define YSCALE_YUV_2_RGBX_C(type,alpha) \
YSCALE_YUV_2_PACKEDX_C(type,alpha) /* FIXME fix tables so that clipping is not needed and then use _NOCLIP*/\
r = (type *)c->table_rV[V]; \
g = (type *)(c->table_gU[U] + c->table_gV[V]); \
b = (type *)c->table_bU[U]; \
#define YSCALE_YUV_2_PACKED2_C \
#define YSCALE_YUV_2_PACKED2_C(type,alpha) \
for (i=0; i<(dstW>>1); i++){ \
const int i2= 2*i; \
int Y1= (buf0[i2 ]*yalpha1+buf1[i2 ]*yalpha)>>19; \
int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>19; \
int U= (uvbuf0[i ]*uvalpha1+uvbuf1[i ]*uvalpha)>>19; \
int V= (uvbuf0[i+VOFW]*uvalpha1+uvbuf1[i+VOFW]*uvalpha)>>19; \
type av_unused *r, *b, *g; \
int av_unused A1, A2; \
if (alpha){\
A1= (abuf0[i2 ]*yalpha1+abuf1[i2 ]*yalpha)>>19; \
A2= (abuf0[i2+1]*yalpha1+abuf1[i2+1]*yalpha)>>19; \
}\
#define YSCALE_YUV_2_GRAY16_2_C \
for (i=0; i<(dstW>>1); i++){ \
@ -672,20 +718,25 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
int Y1= (buf0[i2 ]*yalpha1+buf1[i2 ]*yalpha)>>11; \
int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>11; \
#define YSCALE_YUV_2_RGB2_C(type) \
YSCALE_YUV_2_PACKED2_C\
type *r, *b, *g;\
#define YSCALE_YUV_2_RGB2_C(type,alpha) \
YSCALE_YUV_2_PACKED2_C(type,alpha)\
r = (type *)c->table_rV[V];\
g = (type *)(c->table_gU[U] + c->table_gV[V]);\
b = (type *)c->table_bU[U];\
#define YSCALE_YUV_2_PACKED1_C \
#define YSCALE_YUV_2_PACKED1_C(type,alpha) \
for (i=0; i<(dstW>>1); i++){\
const int i2= 2*i;\
int Y1= buf0[i2 ]>>7;\
int Y2= buf0[i2+1]>>7;\
int U= (uvbuf1[i ])>>7;\
int V= (uvbuf1[i+VOFW])>>7;\
type av_unused *r, *b, *g;\
int av_unused A1, A2;\
if (alpha){\
A1= abuf0[i2 ]>>7;\
A2= abuf0[i2+1]>>7;\
}\
#define YSCALE_YUV_2_GRAY16_1_C \
for (i=0; i<(dstW>>1); i++){\
@ -693,24 +744,28 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
int Y1= buf0[i2 ]<<1;\
int Y2= buf0[i2+1]<<1;\
#define YSCALE_YUV_2_RGB1_C(type) \
YSCALE_YUV_2_PACKED1_C\
type *r, *b, *g;\
#define YSCALE_YUV_2_RGB1_C(type,alpha) \
YSCALE_YUV_2_PACKED1_C(type,alpha)\
r = (type *)c->table_rV[V];\
g = (type *)(c->table_gU[U] + c->table_gV[V]);\
b = (type *)c->table_bU[U];\
#define YSCALE_YUV_2_PACKED1B_C \
#define YSCALE_YUV_2_PACKED1B_C(type,alpha) \
for (i=0; i<(dstW>>1); i++){\
const int i2= 2*i;\
int Y1= buf0[i2 ]>>7;\
int Y2= buf0[i2+1]>>7;\
int U= (uvbuf0[i ] + uvbuf1[i ])>>8;\
int V= (uvbuf0[i+VOFW] + uvbuf1[i+VOFW])>>8;\
type av_unused *r, *b, *g;\
int av_unused A1, A2;\
if (alpha){\
A1= abuf0[i2 ]>>7;\
A2= abuf0[i2+1]>>7;\
}\
#define YSCALE_YUV_2_RGB1B_C(type) \
YSCALE_YUV_2_PACKED1B_C\
type *r, *b, *g;\
#define YSCALE_YUV_2_RGB1B_C(type,alpha) \
YSCALE_YUV_2_PACKED1B_C(type,alpha)\
r = (type *)c->table_rV[V];\
g = (type *)(c->table_gU[U] + c->table_gV[V]);\
b = (type *)c->table_bU[U];\
@ -768,17 +823,52 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
#define YSCALE_YUV_2_ANYRGB_C(func, func2, func_g16, func_monoblack)\
switch(c->dstFormat)\
{\
case PIX_FMT_RGB32:\
case PIX_FMT_BGR32:\
case PIX_FMT_RGB32_1:\
case PIX_FMT_BGR32_1:\
func(uint32_t)\
((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1];\
((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2];\
case PIX_FMT_RGBA:\
case PIX_FMT_BGRA:\
if (CONFIG_SMALL){\
int needAlpha = CONFIG_SWSCALE_ALPHA && c->alpPixBuf;\
func(uint32_t,needAlpha)\
((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1] + (needAlpha ? (A1<<24) : 0);\
((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2] + (needAlpha ? (A2<<24) : 0);\
}\
}else{\
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){\
func(uint32_t,1)\
((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1] + (A1<<24);\
((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2] + (A2<<24);\
}\
}else{\
func(uint32_t,0)\
((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1];\
((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2];\
}\
}\
}\
break;\
case PIX_FMT_ARGB:\
case PIX_FMT_ABGR:\
if (CONFIG_SMALL){\
int needAlpha = CONFIG_SWSCALE_ALPHA && c->alpPixBuf;\
func(uint32_t,needAlpha)\
((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1] + (needAlpha ? A1 : 0);\
((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2] + (needAlpha ? A2 : 0);\
}\
}else{\
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){\
func(uint32_t,1)\
((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1] + A1;\
((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2] + A2;\
}\
}else{\
func(uint32_t,0)\
((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1];\
((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2];\
}\
}\
} \
break;\
case PIX_FMT_RGB24:\
func(uint8_t)\
func(uint8_t,0)\
((uint8_t*)dest)[0]= r[Y1];\
((uint8_t*)dest)[1]= g[Y1];\
((uint8_t*)dest)[2]= b[Y1];\
@ -789,7 +879,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
}\
break;\
case PIX_FMT_BGR24:\
func(uint8_t)\
func(uint8_t,0)\
((uint8_t*)dest)[0]= b[Y1];\
((uint8_t*)dest)[1]= g[Y1];\
((uint8_t*)dest)[2]= r[Y1];\
@ -808,7 +898,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
const int dr2= dither_2x2_8[y&1 ][1];\
const int dg2= dither_2x2_4[y&1 ][1];\
const int db2= dither_2x2_8[(y&1)^1][1];\
func(uint16_t)\
func(uint16_t,0)\
((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];\
((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];\
}\
@ -823,7 +913,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
const int dr2= dither_2x2_8[y&1 ][1];\
const int dg2= dither_2x2_8[y&1 ][0];\
const int db2= dither_2x2_8[(y&1)^1][1];\
func(uint16_t)\
func(uint16_t,0)\
((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];\
((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];\
}\
@ -834,7 +924,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
{\
const uint8_t * const d64= dither_8x8_73[y&7];\
const uint8_t * const d32= dither_8x8_32[y&7];\
func(uint8_t)\
func(uint8_t,0)\
((uint8_t*)dest)[i2+0]= r[Y1+d32[(i2+0)&7]] + g[Y1+d32[(i2+0)&7]] + b[Y1+d64[(i2+0)&7]];\
((uint8_t*)dest)[i2+1]= r[Y2+d32[(i2+1)&7]] + g[Y2+d32[(i2+1)&7]] + b[Y2+d64[(i2+1)&7]];\
}\
@ -845,7 +935,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
{\
const uint8_t * const d64= dither_8x8_73 [y&7];\
const uint8_t * const d128=dither_8x8_220[y&7];\
func(uint8_t)\
func(uint8_t,0)\
((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]\
+ ((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4);\
}\
@ -856,7 +946,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
{\
const uint8_t * const d64= dither_8x8_73 [y&7];\
const uint8_t * const d128=dither_8x8_220[y&7];\
func(uint8_t)\
func(uint8_t,0)\
((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\
((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]];\
}\
@ -905,15 +995,15 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, int dstW, int y)
int16_t **alpSrc, uint8_t *dest, int dstW, int y)
{
int i;
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGBX_C, YSCALE_YUV_2_PACKEDX_C(void), YSCALE_YUV_2_GRAY16_C, YSCALE_YUV_2_MONOX_C)
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGBX_C, YSCALE_YUV_2_PACKEDX_C(void,0), YSCALE_YUV_2_GRAY16_C, YSCALE_YUV_2_MONOX_C)
}
static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, int dstW, int y)
int16_t **alpSrc, uint8_t *dest, int dstW, int y)
{
int i;
int step= fmt_depth(c->dstFormat)/8;
@ -926,12 +1016,33 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
case PIX_FMT_RGB24:
aidx--;
case PIX_FMT_RGBA:
YSCALE_YUV_2_RGBX_FULL_C(1<<21)
dest[aidx]= 255;
dest[0]= R>>22;
dest[1]= G>>22;
dest[2]= B>>22;
dest+= step;
if (CONFIG_SMALL){
int needAlpha = CONFIG_SWSCALE_ALPHA && c->alpPixBuf;
YSCALE_YUV_2_RGBX_FULL_C(1<<21, needAlpha)
dest[aidx]= needAlpha ? A : 255;
dest[0]= R>>22;
dest[1]= G>>22;
dest[2]= B>>22;
dest+= step;
}
}else{
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
YSCALE_YUV_2_RGBX_FULL_C(1<<21, 1)
dest[aidx]= A;
dest[0]= R>>22;
dest[1]= G>>22;
dest[2]= B>>22;
dest+= step;
}
}else{
YSCALE_YUV_2_RGBX_FULL_C(1<<21, 0)
dest[aidx]= 255;
dest[0]= R>>22;
dest[1]= G>>22;
dest[2]= B>>22;
dest+= step;
}
}
}
break;
case PIX_FMT_ABGR:
@ -940,12 +1051,33 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
case PIX_FMT_BGR24:
aidx--;
case PIX_FMT_BGRA:
YSCALE_YUV_2_RGBX_FULL_C(1<<21)
dest[aidx]= 255;
dest[0]= B>>22;
dest[1]= G>>22;
dest[2]= R>>22;
dest+= step;
if (CONFIG_SMALL){
int needAlpha = CONFIG_SWSCALE_ALPHA && c->alpPixBuf;
YSCALE_YUV_2_RGBX_FULL_C(1<<21, needAlpha)
dest[aidx]= needAlpha ? A : 255;
dest[0]= B>>22;
dest[1]= G>>22;
dest[2]= R>>22;
dest+= step;
}
}else{
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
YSCALE_YUV_2_RGBX_FULL_C(1<<21, 1)
dest[aidx]= A;
dest[0]= B>>22;
dest[1]= G>>22;
dest[2]= R>>22;
dest+= step;
}
}else{
YSCALE_YUV_2_RGBX_FULL_C(1<<21, 0)
dest[aidx]= 255;
dest[0]= B>>22;
dest[1]= G>>22;
dest[2]= R>>22;
dest+= step;
}
}
}
break;
default:
@ -953,6 +1085,15 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
}
}
static void fillPlane(uint8_t* plane, int stride, int width, int height, int y, uint8_t val){
int i;
uint8_t *ptr = plane + stride*y;
for (i=0; i<height; i++){
memset(ptr, val, width);
ptr += stride;
}
}
//Note: we have C, X86, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
//Plain C versions
#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL
@ -1457,13 +1598,13 @@ error:
static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *filter, int32_t *filterPos, int numSplits)
{
uint8_t *fragmentA;
long imm8OfPShufW1A;
long imm8OfPShufW2A;
long fragmentLengthA;
x86_reg imm8OfPShufW1A;
x86_reg imm8OfPShufW2A;
x86_reg fragmentLengthA;
uint8_t *fragmentB;
long imm8OfPShufW1B;
long imm8OfPShufW2B;
long fragmentLengthB;
x86_reg imm8OfPShufW1B;
x86_reg imm8OfPShufW2B;
x86_reg fragmentLengthB;
int fragmentPos;
int xpos, i;
@ -1736,6 +1877,56 @@ static int YUV422PToUyvyWrapper(SwsContext *c, uint8_t* src[], int srcStride[],
return srcSliceH;
}
static int YUYV2YUV420Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dstParam[], int dstStride[]){
uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY/2;
uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY/2;
yuyvtoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]);
if (dstParam[3])
fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
return srcSliceH;
}
static int YUYV2YUV422Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dstParam[], int dstStride[]){
uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY;
uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY;
yuyvtoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]);
return srcSliceH;
}
static int UYVY2YUV420Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dstParam[], int dstStride[]){
uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY/2;
uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY/2;
uyvytoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]);
if (dstParam[3])
fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
return srcSliceH;
}
static int UYVY2YUV422Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dstParam[], int dstStride[]){
uint8_t *ydst=dstParam[0] + dstStride[0]*srcSliceY;
uint8_t *udst=dstParam[1] + dstStride[1]*srcSliceY;
uint8_t *vdst=dstParam[2] + dstStride[2]*srcSliceY;
uyvytoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], dstStride[1], srcStride[0]);
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;
@ -1862,6 +2053,8 @@ static int bgr24toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], in
dst[2]+(srcSliceY>>1)*dstStride[2],
c->srcW, srcSliceH,
dstStride[0], dstStride[1], srcStride[0]);
if (dst[3])
fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
return srcSliceH;
}
@ -1884,13 +2077,15 @@ static int yvu9toyv12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int
}
}
if (c->dstFormat==PIX_FMT_YUV420P){
if (c->dstFormat==PIX_FMT_YUV420P || c->dstFormat==PIX_FMT_YUVA420P){
planar2x(src[1], dst[1], c->chrSrcW, c->chrSrcH, srcStride[1], dstStride[1]);
planar2x(src[2], dst[2], c->chrSrcW, c->chrSrcH, srcStride[2], dstStride[2]);
}else{
planar2x(src[1], dst[2], c->chrSrcW, c->chrSrcH, srcStride[1], dstStride[2]);
planar2x(src[2], dst[1], c->chrSrcW, c->chrSrcH, srcStride[2], dstStride[1]);
}
if (dst[3])
fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255);
return srcSliceH;
}
@ -1926,17 +2121,17 @@ static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
int srcSliceH, uint8_t* dst[], int dstStride[])
{
int plane;
for (plane=0; plane<3; plane++)
for (plane=0; plane<4; plane++)
{
int length= plane==0 ? c->srcW : -((-c->srcW )>>c->chrDstHSubSample);
int y= plane==0 ? srcSliceY: -((-srcSliceY)>>c->chrDstVSubSample);
int height= plane==0 ? srcSliceH: -((-srcSliceH)>>c->chrDstVSubSample);
int length= (plane==0 || plane==3) ? c->srcW : -((-c->srcW )>>c->chrDstHSubSample);
int y= (plane==0 || plane==3) ? srcSliceY: -((-srcSliceY)>>c->chrDstVSubSample);
int height= (plane==0 || plane==3) ? srcSliceH: -((-srcSliceH)>>c->chrDstVSubSample);
if ((isGray(c->srcFormat) || isGray(c->dstFormat)) && plane>0)
{
if (!isGray(c->dstFormat))
memset(dst[plane], 128, dstStride[plane]*height);
}
if (!dst[plane]) continue;
// ignore palette for GRAY8
if (plane == 1 && !dst[2]) continue;
if (!src[plane] || (plane == 1 && !src[2]))
fillPlane(dst[plane], dstStride[plane], length, height, y, (plane==3) ? 255 : 128);
else
{
if (dstStride[plane]==srcStride[plane] && srcStride[plane] > 0)
@ -1980,6 +2175,8 @@ static int gray16togray(SwsContext *c, uint8_t* src[], int srcStride[], int srcS
srcPtr+= srcStride[0];
dstPtr+= dstStride[0];
}
if (dst[3])
fillPlane(dst[3], dstStride[3], length, height, y, 255);
return srcSliceH;
}
@ -2133,12 +2330,12 @@ int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange
c->yuv2rgb_u2g_coeff= (int16_t)roundToInt16(cgu<<13);
c->yuv2rgb_u2b_coeff= (int16_t)roundToInt16(cbu<<13);
sws_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, contrast, saturation);
ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, contrast, saturation);
//FIXME factorize
#ifdef COMPILE_ALTIVEC
if (c->flags & SWS_CPU_CAPS_ALTIVEC)
sws_yuv2rgb_altivec_init_tables (c, inv_table, brightness, contrast, saturation);
ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness, contrast, saturation);
#endif
return 0;
}
@ -2335,16 +2532,16 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P || srcFormat==PIX_FMT_YUVA420P) && (isBGR(dstFormat) || isRGB(dstFormat))
&& !(flags & SWS_ACCURATE_RND) && !(dstH&1))
{
c->swScale= sws_yuv2rgb_get_func_ptr(c);
c->swScale= ff_yuv2rgb_get_func_ptr(c);
}
if (srcFormat==PIX_FMT_YUV410P && dstFormat==PIX_FMT_YUV420P && !(flags & SWS_BITEXACT))
if (srcFormat==PIX_FMT_YUV410P && (dstFormat==PIX_FMT_YUV420P || dstFormat==PIX_FMT_YUVA420P) && !(flags & SWS_BITEXACT))
{
c->swScale= yvu9toyv12Wrapper;
}
/* bgr24toYV12 */
if (srcFormat==PIX_FMT_BGR24 && dstFormat==PIX_FMT_YUV420P && !(flags & SWS_ACCURATE_RND))
if (srcFormat==PIX_FMT_BGR24 && (dstFormat==PIX_FMT_YUV420P || dstFormat==PIX_FMT_YUVA420P) && !(flags & SWS_ACCURATE_RND))
c->swScale= bgr24toyv12Wrapper;
/* RGB/BGR -> RGB/BGR (no dither needed forms) */
@ -2391,6 +2588,14 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
c->swScale= PlanarToUyvyWrapper;
}
}
if(srcFormat == PIX_FMT_YUYV422 && (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P))
c->swScale= YUYV2YUV420Wrapper;
if(srcFormat == PIX_FMT_UYVY422 && (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P))
c->swScale= UYVY2YUV420Wrapper;
if(srcFormat == PIX_FMT_YUYV422 && dstFormat == PIX_FMT_YUV422P)
c->swScale= YUYV2YUV422Wrapper;
if(srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P)
c->swScale= UYVY2YUV422Wrapper;
#ifdef COMPILE_ALTIVEC
if ((c->flags & SWS_CPU_CAPS_ALTIVEC) &&
@ -2407,6 +2612,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
/* simple copy */
if ( srcFormat == dstFormat
|| (srcFormat == PIX_FMT_YUVA420P && dstFormat == PIX_FMT_YUV420P)
|| (srcFormat == PIX_FMT_YUV420P && dstFormat == PIX_FMT_YUVA420P)
|| (isPlanarYUV(srcFormat) && isGray(dstFormat))
|| (isPlanarYUV(dstFormat) && isGray(srcFormat)))
{
@ -2502,10 +2708,13 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
if (c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR))
{
#ifdef MAP_ANONYMOUS
c->funnyYCode = (uint8_t*)mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
c->funnyUVCode = (uint8_t*)mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
c->funnyYCode = mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
c->funnyUVCode = mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
#elif HAVE_VIRTUALALLOC
c->funnyYCode = VirtualAlloc(NULL, MAX_FUNNY_CODE_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
c->funnyUVCode = VirtualAlloc(NULL, MAX_FUNNY_CODE_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
#else
c->funnyYCode = av_malloc(MAX_FUNNY_CODE_SIZE);
c->funnyYCode = av_malloc(MAX_FUNNY_CODE_SIZE);
c->funnyUVCode = av_malloc(MAX_FUNNY_CODE_SIZE);
#endif
@ -2578,12 +2787,17 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
// allocate pixbufs (we use dynamic allocation because otherwise we would need to
c->lumPixBuf= av_malloc(c->vLumBufSize*2*sizeof(int16_t*));
c->chrPixBuf= av_malloc(c->vChrBufSize*2*sizeof(int16_t*));
if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat) && isALPHA(c->dstFormat))
c->alpPixBuf= av_malloc(c->vLumBufSize*2*sizeof(int16_t*));
//Note we need at least one pixel more at the end because of the MMX code (just in case someone wanna replace the 4000/8000)
/* align at 16 bytes for AltiVec */
for (i=0; i<c->vLumBufSize; i++)
c->lumPixBuf[i]= c->lumPixBuf[i+c->vLumBufSize]= av_mallocz(VOF+1);
for (i=0; i<c->vChrBufSize; i++)
c->chrPixBuf[i]= c->chrPixBuf[i+c->vChrBufSize]= av_malloc((VOF+1)*2);
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
for (i=0; i<c->vLumBufSize; i++)
c->alpPixBuf[i]= c->alpPixBuf[i+c->vLumBufSize]= av_mallocz(VOF+1);
//try to avoid drawing green stuff between the right end and the stride end
for (i=0; i<c->vChrBufSize; i++) memset(c->chrPixBuf[i], 64, (VOF+1)*2);
@ -3134,6 +3348,12 @@ void sws_freeContext(SwsContext *c){
av_freep(&c->chrPixBuf);
}
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
for (i=0; i<c->vLumBufSize; i++)
av_freep(&c->alpPixBuf[i]);
av_freep(&c->alpPixBuf);
}
av_freep(&c->vLumFilter);
av_freep(&c->vChrFilter);
av_freep(&c->hLumFilter);
@ -3150,10 +3370,13 @@ void sws_freeContext(SwsContext *c){
#if ARCH_X86 && CONFIG_GPL
#ifdef MAP_ANONYMOUS
if (c->funnyYCode) munmap(c->funnyYCode, MAX_FUNNY_CODE_SIZE);
if (c->funnyYCode ) munmap(c->funnyYCode , MAX_FUNNY_CODE_SIZE);
if (c->funnyUVCode) munmap(c->funnyUVCode, MAX_FUNNY_CODE_SIZE);
#elif HAVE_VIRTUALALLOC
if (c->funnyYCode ) VirtualFree(c->funnyYCode , MAX_FUNNY_CODE_SIZE, MEM_RELEASE);
if (c->funnyUVCode) VirtualFree(c->funnyUVCode, MAX_FUNNY_CODE_SIZE, MEM_RELEASE);
#else
av_free(c->funnyYCode);
av_free(c->funnyYCode );
av_free(c->funnyUVCode);
#endif
c->funnyYCode=NULL;

View File

@ -87,6 +87,7 @@ typedef struct SwsContext{
int16_t **lumPixBuf;
int16_t **chrPixBuf;
int16_t **alpPixBuf;
int16_t *hLumFilter;
int16_t *hLumFilterPos;
int16_t *hChrFilter;
@ -156,6 +157,8 @@ typedef struct SwsContext{
#define VROUNDER_OFFSET "11*8+4*4*256*2+16"
#define U_TEMP "11*8+4*4*256*2+24"
#define V_TEMP "11*8+4*4*256*2+32"
#define Y_TEMP "11*8+4*4*256*2+40"
#define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48"
uint64_t redDither __attribute__((aligned(8)));
uint64_t greenDither __attribute__((aligned(8)));
@ -176,6 +179,8 @@ typedef struct SwsContext{
uint64_t vRounder __attribute__((aligned(8)));
uint64_t u_temp __attribute__((aligned(8)));
uint64_t v_temp __attribute__((aligned(8)));
uint64_t y_temp __attribute__((aligned(8)));
int32_t alpMmxFilter[4*MAX_FILTER_SIZE];
#if HAVE_ALTIVEC
@ -212,12 +217,17 @@ typedef struct SwsContext{
} SwsContext;
//FIXME check init (where 0)
SwsFunc sws_yuv2rgb_get_func_ptr (SwsContext *c);
int sws_yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation);
SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c);
int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation);
void sws_yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation);
SwsFunc sws_yuv2rgb_init_altivec (SwsContext *c);
void altivec_yuv2packedX (SwsContext *c,
void ff_yuv2rgb_init_tables_altivec(SwsContext *c, const int inv_table[4], int brightness, int contrast, int saturation);
SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c);
SwsFunc ff_yuv2rgb_init_vis(SwsContext *c);
SwsFunc ff_yuv2rgb_init_mlib(SwsContext *c);
SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c);
SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c);
void ff_bfin_get_unscaled_swscale(SwsContext *c);
void ff_yuv2packedX_altivec(SwsContext *c,
int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, int dstW, int dstY);

View File

@ -67,7 +67,7 @@
#define MOVNTQ(a,b) REAL_MOVNTQ(a,b)
#if HAVE_ALTIVEC
#include "swscale_altivec_template.c"
#include "ppc/swscale_altivec_template.c"
#endif
#define YSCALEYUV2YV12X(x, offset, dest, width) \
@ -644,6 +644,14 @@
#define YSCALEYUV2RGB1b(index, c) REAL_YSCALEYUV2RGB1b(index, c)
#define REAL_YSCALEYUV2RGB1_ALPHA(index) \
"movq (%1, "#index", 2), %%mm7 \n\t" /* abuf0[index ] */\
"movq 8(%1, "#index", 2), %%mm1 \n\t" /* abuf0[index+4] */\
"psraw $7, %%mm7 \n\t" /* abuf0[index ] >>7 */\
"psraw $7, %%mm1 \n\t" /* abuf0[index+4] >>7 */\
"packuswb %%mm1, %%mm7 \n\t"
#define YSCALEYUV2RGB1_ALPHA(index) REAL_YSCALEYUV2RGB1_ALPHA(index)
#define REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) \
"movq "#b", "#q2" \n\t" /* B */\
"movq "#r", "#t" \n\t" /* R */\
@ -909,8 +917,8 @@
static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW)
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, int16_t **alpSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, long dstW, long chrDstW)
{
#if HAVE_MMX
if(!(c->flags & SWS_BITEXACT)){
@ -919,6 +927,9 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t *
YSCALEYUV2YV12X_ACCURATE( "0", CHR_MMX_FILTER_OFFSET, uDest, chrDstW)
YSCALEYUV2YV12X_ACCURATE(AV_STRINGIFY(VOF), CHR_MMX_FILTER_OFFSET, vDest, chrDstW)
}
if (CONFIG_SWSCALE_ALPHA && aDest){
YSCALEYUV2YV12X_ACCURATE( "0", ALP_MMX_FILTER_OFFSET, aDest, dstW)
}
YSCALEYUV2YV12X_ACCURATE("0", LUM_MMX_FILTER_OFFSET, dest, dstW)
}else{
@ -926,6 +937,9 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t *
YSCALEYUV2YV12X( "0", CHR_MMX_FILTER_OFFSET, uDest, chrDstW)
YSCALEYUV2YV12X(AV_STRINGIFY(VOF), CHR_MMX_FILTER_OFFSET, vDest, chrDstW)
}
if (CONFIG_SWSCALE_ALPHA && aDest){
YSCALEYUV2YV12X( "0", ALP_MMX_FILTER_OFFSET, aDest, dstW)
}
YSCALEYUV2YV12X("0", LUM_MMX_FILTER_OFFSET, dest, dstW)
}
@ -939,7 +953,7 @@ yuv2yuvX_altivec_real(lumFilter, lumSrc, lumFilterSize,
#else //HAVE_ALTIVEC
yuv2yuvXinC(lumFilter, lumSrc, lumFilterSize,
chrFilter, chrSrc, chrFilterSize,
dest, uDest, vDest, dstW, chrDstW);
alpSrc, dest, uDest, vDest, aDest, dstW, chrDstW);
#endif //!HAVE_ALTIVEC
}
@ -952,34 +966,38 @@ yuv2nv12XinC(lumFilter, lumSrc, lumFilterSize,
dest, uDest, dstW, chrDstW, dstFormat);
}
static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chrSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW)
static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chrSrc, int16_t *alpSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, long dstW, long chrDstW)
{
int i;
#if HAVE_MMX
if(!(c->flags & SWS_BITEXACT)){
long p= uDest ? 3 : 1;
uint8_t *src[3]= {lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW};
uint8_t *dst[3]= {dest, uDest, vDest};
long counter[3] = {dstW, chrDstW, chrDstW};
long p= 4;
uint8_t *src[4]= {alpSrc + dstW, lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW};
uint8_t *dst[4]= {aDest, dest, uDest, vDest};
x86_reg counter[4]= {dstW, dstW, chrDstW, chrDstW};
if (c->flags & SWS_ACCURATE_RND){
while(p--){
__asm__ volatile(
YSCALEYUV2YV121_ACCURATE
:: "r" (src[p]), "r" (dst[p] + counter[p]),
"g" (-counter[p])
: "%"REG_a
);
if (dst[p]){
__asm__ volatile(
YSCALEYUV2YV121_ACCURATE
:: "r" (src[p]), "r" (dst[p] + counter[p]),
"g" (-counter[p])
: "%"REG_a
);
}
}
}else{
while(p--){
__asm__ volatile(
YSCALEYUV2YV121
:: "r" (src[p]), "r" (dst[p] + counter[p]),
"g" (-counter[p])
: "%"REG_a
);
if (dst[p]){
__asm__ volatile(
YSCALEYUV2YV121
:: "r" (src[p]), "r" (dst[p] + counter[p]),
"g" (-counter[p])
: "%"REG_a
);
}
}
}
return;
@ -1013,6 +1031,12 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
uDest[i]= u;
vDest[i]= v;
}
if (CONFIG_SWSCALE_ALPHA && aDest)
for (i=0; i<dstW; i++){
int val= (alpSrc[i]+64)>>7;
aDest[i]= av_clip_uint8(val);
}
}
@ -1021,20 +1045,36 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
*/
static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, long dstW, long dstY)
int16_t **alpSrc, uint8_t *dest, long dstW, long dstY)
{
#if HAVE_MMX
long dummy=0;
x86_reg dummy=0;
if(!(c->flags & SWS_BITEXACT)){
if (c->flags & SWS_ACCURATE_RND){
switch(c->dstFormat){
case PIX_FMT_RGB32:
YSCALEYUV2PACKEDX_ACCURATE
YSCALEYUV2RGBX
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
YSCALEYUV2PACKEDX_ACCURATE
YSCALEYUV2RGBX
"movq %%mm2, "U_TEMP"(%0) \n\t"
"movq %%mm4, "V_TEMP"(%0) \n\t"
"movq %%mm5, "Y_TEMP"(%0) \n\t"
YSCALEYUV2PACKEDX_ACCURATE_YA(ALP_MMX_FILTER_OFFSET)
"movq "Y_TEMP"(%0), %%mm5 \n\t"
"psraw $3, %%mm1 \n\t"
"psraw $3, %%mm7 \n\t"
"packuswb %%mm7, %%mm1 \n\t"
WRITEBGR32(%4, %5, %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
YSCALEYUV2PACKEDX_END
YSCALEYUV2PACKEDX_END
}else{
YSCALEYUV2PACKEDX_ACCURATE
YSCALEYUV2RGBX
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
YSCALEYUV2PACKEDX_END
}
return;
case PIX_FMT_BGR24:
YSCALEYUV2PACKEDX_ACCURATE
@ -1095,11 +1135,22 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
switch(c->dstFormat)
{
case PIX_FMT_RGB32:
YSCALEYUV2PACKEDX
YSCALEYUV2RGBX
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
YSCALEYUV2PACKEDX_END
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
YSCALEYUV2PACKEDX
YSCALEYUV2RGBX
YSCALEYUV2PACKEDX_YA(ALP_MMX_FILTER_OFFSET, %%mm0, %%mm3, %%mm6, %%mm1, %%mm7)
"psraw $3, %%mm1 \n\t"
"psraw $3, %%mm7 \n\t"
"packuswb %%mm7, %%mm1 \n\t"
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
YSCALEYUV2PACKEDX_END
}else{
YSCALEYUV2PACKEDX
YSCALEYUV2RGBX
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
YSCALEYUV2PACKEDX_END
}
return;
case PIX_FMT_BGR24:
YSCALEYUV2PACKEDX
@ -1160,26 +1211,26 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
#endif /* HAVE_MMX */
#if HAVE_ALTIVEC
/* The following list of supported dstFormat values should
match what's found in the body of altivec_yuv2packedX() */
if (!(c->flags & SWS_BITEXACT) &&
match what's found in the body of ff_yuv2packedX_altivec() */
if (!(c->flags & SWS_BITEXACT) && !c->alpPixBuf &&
(c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA ||
c->dstFormat==PIX_FMT_BGR24 || c->dstFormat==PIX_FMT_RGB24 ||
c->dstFormat==PIX_FMT_RGBA || c->dstFormat==PIX_FMT_ARGB))
altivec_yuv2packedX (c, lumFilter, lumSrc, lumFilterSize,
chrFilter, chrSrc, chrFilterSize,
dest, dstW, dstY);
ff_yuv2packedX_altivec(c, lumFilter, lumSrc, lumFilterSize,
chrFilter, chrSrc, chrFilterSize,
dest, dstW, dstY);
else
#endif
yuv2packedXinC(c, lumFilter, lumSrc, lumFilterSize,
chrFilter, chrSrc, chrFilterSize,
dest, dstW, dstY);
alpSrc, dest, dstW, dstY);
}
/**
* vertical bilinear scale YV12 to RGB
*/
static inline void RENAME(yuv2packed2)(SwsContext *c, uint16_t *buf0, uint16_t *buf1, uint16_t *uvbuf0, uint16_t *uvbuf1,
uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
uint16_t *abuf0, uint16_t *abuf1, uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
{
int yalpha1=4095- yalpha;
int uvalpha1=4095-uvalpha;
@ -1191,19 +1242,62 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, uint16_t *buf0, uint16_t *
{
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
case PIX_FMT_RGB32:
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
#if ARCH_X86_64
__asm__ volatile(
YSCALEYUV2RGB(%%REGBP, %5)
YSCALEYUV2RGB_YA(%%REGBP, %5, %6, %7)
"psraw $3, %%mm1 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
"psraw $3, %%mm7 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
"packuswb %%mm7, %%mm1 \n\t"
WRITEBGR32(%4, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "r" (dest),
"a" (&c->redDither)
,"r" (abuf0), "r" (abuf1)
: "%"REG_BP
);
#else
*(uint16_t **)(&c->u_temp)=abuf0;
*(uint16_t **)(&c->v_temp)=abuf1;
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB(%%REGBP, %5)
"push %0 \n\t"
"push %1 \n\t"
"mov "U_TEMP"(%5), %0 \n\t"
"mov "V_TEMP"(%5), %1 \n\t"
YSCALEYUV2RGB_YA(%%REGBP, %5, %0, %1)
"psraw $3, %%mm1 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
"psraw $3, %%mm7 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
"packuswb %%mm7, %%mm1 \n\t"
"pop %1 \n\t"
"pop %0 \n\t"
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
#endif
}else{
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
}
return;
case PIX_FMT_BGR24:
__asm__ volatile(
@ -1279,14 +1373,14 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, uint16_t *buf0, uint16_t *
}
}
#endif //HAVE_MMX
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB2_C, YSCALE_YUV_2_PACKED2_C, YSCALE_YUV_2_GRAY16_2_C, YSCALE_YUV_2_MONO2_C)
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB2_C, YSCALE_YUV_2_PACKED2_C(void,0), YSCALE_YUV_2_GRAY16_2_C, YSCALE_YUV_2_MONO2_C)
}
/**
* YV12 to RGB without scaling or interpolating
*/
static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *uvbuf0, uint16_t *uvbuf1,
uint8_t *dest, int dstW, int uvalpha, int dstFormat, int flags, int y)
uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int dstFormat, int flags, int y)
{
const int yalpha1=0;
int i;
@ -1296,7 +1390,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
if (flags&SWS_FULL_CHR_H_INT)
{
RENAME(yuv2packed2)(c, buf0, buf0, uvbuf0, uvbuf1, dest, dstW, 0, uvalpha, y);
RENAME(yuv2packed2)(c, buf0, buf0, uvbuf0, uvbuf1, abuf0, abuf0, dest, dstW, 0, uvalpha, y);
return;
}
@ -1307,19 +1401,35 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
switch(dstFormat)
{
case PIX_FMT_RGB32:
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
YSCALEYUV2RGB1_ALPHA(%%REGBP)
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
:: "c" (buf0), "d" (abuf0), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
}else{
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
}
return;
case PIX_FMT_BGR24:
__asm__ volatile(
@ -1400,19 +1510,35 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
switch(dstFormat)
{
case PIX_FMT_RGB32:
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf){
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
YSCALEYUV2RGB1_ALPHA(%%REGBP)
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
:: "c" (buf0), "d" (abuf0), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
}else{
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5)
"pcmpeqd %%mm7, %%mm7 \n\t"
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest),
"a" (&c->redDither)
);
}
return;
case PIX_FMT_BGR24:
__asm__ volatile(
@ -1492,9 +1618,9 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
#endif /* HAVE_MMX */
if (uvalpha < 2048)
{
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB1_C, YSCALE_YUV_2_PACKED1_C, YSCALE_YUV_2_GRAY16_1_C, YSCALE_YUV_2_MONO2_C)
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB1_C, YSCALE_YUV_2_PACKED1_C(void,0), YSCALE_YUV_2_GRAY16_1_C, YSCALE_YUV_2_MONO2_C)
}else{
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB1B_C, YSCALE_YUV_2_PACKED1B_C, YSCALE_YUV_2_GRAY16_1_C, YSCALE_YUV_2_MONO2_C)
YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB1B_C, YSCALE_YUV_2_PACKED1B_C(void,0), YSCALE_YUV_2_GRAY16_1_C, YSCALE_YUV_2_MONO2_C)
}
}
@ -1515,7 +1641,7 @@ static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint3
"movq %%mm0, (%2, %%"REG_a") \n\t"
"add $8, %%"REG_a" \n\t"
" js 1b \n\t"
: : "g" (-width), "r" (src+width*2), "r" (dst+width)
: : "g" ((x86_reg)-width), "r" (src+width*2), "r" (dst+width)
: "%"REG_a
);
#else
@ -1546,7 +1672,7 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1,
"movd %%mm1, (%2, %%"REG_a") \n\t"
"add $4, %%"REG_a" \n\t"
" js 1b \n\t"
: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)
: : "g" ((x86_reg)-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)
: "%"REG_a
);
#else
@ -1576,7 +1702,7 @@ static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint3
"movq %%mm0, (%2, %%"REG_a") \n\t"
"add $8, %%"REG_a" \n\t"
" js 1b \n\t"
: : "g" (-width), "r" (src+width*2), "r" (dst+width)
: : "g" ((x86_reg)-width), "r" (src+width*2), "r" (dst+width)
: "%"REG_a
);
#else
@ -1607,7 +1733,7 @@ static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1,
"movd %%mm1, (%2, %%"REG_a") \n\t"
"add $4, %%"REG_a" \n\t"
" js 1b \n\t"
: : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)
: : "g" ((x86_reg)-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width)
: "%"REG_a
);
#else
@ -1642,6 +1768,13 @@ BGR2Y(uint16_t, bgr15ToY, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RY<<10, GY<<5, BY
BGR2Y(uint16_t, rgb16ToY, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RY , GY<<5, BY<<11, RGB2YUV_SHIFT+8)
BGR2Y(uint16_t, rgb15ToY, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RY , GY<<5, BY<<10, RGB2YUV_SHIFT+7)
static inline void RENAME(abgrToA)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused){
int i;
for (i=0; i<width; i++){
dst[i]= src[4*i];
}
}
#define BGR2UV(type, name, shr, shg, shb, maska, maskr, maskg, maskb, RU, GU, BU, RV, GV, BV, S)\
static inline void RENAME(name)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, uint8_t *dummy, long width, uint32_t *unused)\
{\
@ -1731,7 +1864,7 @@ static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width,
"add $4, %%"REG_a" \n\t"
" js 1b \n\t"
: "+r" (src)
: "r" (dst+width), "g" (-width)
: "r" (dst+width), "g" ((x86_reg)-width)
: "%"REG_a
);
}
@ -1789,7 +1922,7 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *
"add $4, %%"REG_a" \n\t"
" js 1b \n\t"
: "+r" (src)
: "r" (dstU+width), "r" (dstV+width), "g" (-width), "m"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24][0])
: "r" (dstU+width), "r" (dstV+width), "g" ((x86_reg)-width), "m"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24][0])
: "%"REG_a
);
}
@ -1951,7 +2084,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
assert(filterSize % 4 == 0 && filterSize>0);
if (filterSize==4) // Always true for upscaling, sometimes for down, too.
{
long counter= -2*dstW;
x86_reg counter= -2*dstW;
filter-= counter*2;
filterPos-= counter/2;
dst-= counter/2;
@ -1997,7 +2130,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
}
else if (filterSize==8)
{
long counter= -2*dstW;
x86_reg counter= -2*dstW;
filter-= counter*4;
filterPos-= counter/2;
dst-= counter/2;
@ -2055,7 +2188,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
else
{
uint8_t *offset = src+filterSize;
long counter= -2*dstW;
x86_reg counter= -2*dstW;
//filter-= counter*filterSize/2;
filterPos-= counter/2;
dst-= counter/2;
@ -2098,7 +2231,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
: "+r" (counter), "+r" (filter)
: "m" (filterPos), "m" (dst), "m"(offset),
"m" (src), "r" (filterSize*2)
"m" (src), "r" ((x86_reg)filterSize*2)
: "%"REG_a, "%"REG_c, "%"REG_d
);
}
@ -2130,7 +2263,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth,
int flags, int canMMX2BeUsed, int16_t *hLumFilter,
int16_t *hLumFilterPos, int hLumFilterSize, void *funnyYCode,
int srcFormat, uint8_t *formatConvBuffer, int16_t *mmx2Filter,
int32_t *mmx2FilterPos, uint32_t *pal)
int32_t *mmx2FilterPos, uint32_t *pal, int isAlpha)
{
if (srcFormat==PIX_FMT_YUYV422 || srcFormat==PIX_FMT_GRAY16BE)
{
@ -2144,12 +2277,18 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth,
}
else if (srcFormat==PIX_FMT_RGB32)
{
RENAME(bgr32ToY)(formatConvBuffer, src, srcW, pal);
if (isAlpha)
RENAME(abgrToA)(formatConvBuffer, src+3, srcW, pal);
else
RENAME(bgr32ToY)(formatConvBuffer, src, srcW, pal);
src= formatConvBuffer;
}
else if (srcFormat==PIX_FMT_RGB32_1)
{
RENAME(bgr32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
if (isAlpha)
RENAME(abgrToA)(formatConvBuffer, src, srcW, pal);
else
RENAME(bgr32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
src= formatConvBuffer;
}
else if (srcFormat==PIX_FMT_BGR24)
@ -2169,12 +2308,18 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth,
}
else if (srcFormat==PIX_FMT_BGR32)
{
RENAME(rgb32ToY)(formatConvBuffer, src, srcW, pal);
if (isAlpha)
RENAME(abgrToA)(formatConvBuffer, src+3, srcW, pal);
else
RENAME(rgb32ToY)(formatConvBuffer, src, srcW, pal);
src= formatConvBuffer;
}
else if (srcFormat==PIX_FMT_BGR32_1)
{
RENAME(rgb32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
if (isAlpha)
RENAME(abgrToA)(formatConvBuffer, src, srcW, pal);
else
RENAME(rgb32ToY)(formatConvBuffer, src+ALT32_CORR, srcW, pal);
src= formatConvBuffer;
}
else if (srcFormat==PIX_FMT_RGB24)
@ -2289,7 +2434,7 @@ FUNNY_Y_CODE
else
{
#endif /* HAVE_MMX2 */
long xInc_shr16 = xInc >> 16;
x86_reg xInc_shr16 = xInc >> 16;
uint16_t xInc_mask = xInc & 0xffff;
//NO MMX just normal asm ...
__asm__ volatile(
@ -2347,7 +2492,7 @@ FUNNY_Y_CODE
#endif /* ARCH_X86 */
}
if(c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))){
if(!isAlpha && c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))){
int i;
//FIXME all pal and rgb srcFormats could do this convertion as well
//FIXME all scalers more complex than bilinear could do half of this transform
@ -2575,7 +2720,7 @@ FUNNY_UV_CODE
else
{
#endif /* HAVE_MMX2 */
long xInc_shr16 = (long) (xInc >> 16);
x86_reg xInc_shr16 = (x86_reg) (xInc >> 16);
uint16_t xInc_mask = xInc & 0xffff;
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t" // i
@ -2613,9 +2758,9 @@ FUNNY_UV_CODE
/* GCC 3.3 makes MPlayer crash on IA-32 machines when using "g" operand here,
which is needed to support GCC 4.0. */
#if ARCH_X86_64 && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
:: "m" (src1), "m" (dst), "g" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
:: "m" (src1), "m" (dst), "g" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
#else
:: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
:: "m" (src1), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
#endif
"r" (src2)
: "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi"
@ -2683,12 +2828,14 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
int16_t *hChrFilter= c->hChrFilter;
int32_t *lumMmxFilter= c->lumMmxFilter;
int32_t *chrMmxFilter= c->chrMmxFilter;
int32_t *alpMmxFilter= c->alpMmxFilter;
const int vLumFilterSize= c->vLumFilterSize;
const int vChrFilterSize= c->vChrFilterSize;
const int hLumFilterSize= c->hLumFilterSize;
const int hChrFilterSize= c->hChrFilterSize;
int16_t **lumPixBuf= c->lumPixBuf;
int16_t **chrPixBuf= c->chrPixBuf;
int16_t **alpPixBuf= c->alpPixBuf;
const int vLumBufSize= c->vLumBufSize;
const int vChrBufSize= c->vChrBufSize;
uint8_t *funnyYCode= c->funnyYCode;
@ -2709,10 +2856,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
if (isPacked(c->srcFormat)){
src[0]=
src[1]=
src[2]= src[0];
src[2]=
src[3]= src[0];
srcStride[0]=
srcStride[1]=
srcStride[2]= srcStride[0];
srcStride[2]=
srcStride[3]= srcStride[0];
}
srcStride[1]<<= c->vChrDrop;
srcStride[2]<<= c->vChrDrop;
@ -2733,7 +2882,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
//printf("sws Strides:%d %d %d -> %d %d %d\n", srcStride[0],srcStride[1],srcStride[2],
//dstStride[0],dstStride[1],dstStride[2]);
if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0)
if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0 || dstStride[3]%8 != 0)
{
static int warnedAlready=0; //FIXME move this into the context perhaps
if (flags & SWS_PRINT_INFO && !warnedAlready)
@ -2762,6 +2911,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
const int chrDstY= dstY>>c->chrDstVSubSample;
unsigned char *uDest=dst[1]+dstStride[1]*chrDstY;
unsigned char *vDest=dst[2]+dstStride[2]*chrDstY;
unsigned char *aDest=(CONFIG_SWSCALE_ALPHA && alpPixBuf) ? dst[3]+dstStride[3]*dstY : NULL;
const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input
const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input
@ -2783,17 +2933,23 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
//Do horizontal scaling
while(lastInLumBuf < lastLumSrcY)
{
uint8_t *s= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3];
lumBufIndex++;
//printf("%d %d %d %d\n", lumBufIndex, vLumBufSize, lastInLumBuf, lastLumSrcY);
assert(lumBufIndex < 2*vLumBufSize);
assert(lastInLumBuf + 1 - srcSliceY < srcSliceH);
assert(lastInLumBuf + 1 - srcSliceY >= 0);
//printf("%d %d\n", lumBufIndex, vLumBufSize);
RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, s, srcW, lumXInc,
RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, src1, srcW, lumXInc,
flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
funnyYCode, c->srcFormat, formatConvBuffer,
c->lumMmx2Filter, c->lumMmx2FilterPos, pal);
c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 0);
if (CONFIG_SWSCALE_ALPHA && alpPixBuf)
RENAME(hyscale)(c, alpPixBuf[ lumBufIndex ], dstW, src2, srcW, lumXInc,
flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
funnyYCode, c->srcFormat, formatConvBuffer,
c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 1);
lastInLumBuf++;
}
while(lastInChrBuf < lastChrSrcY)
@ -2827,15 +2983,21 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
//Do horizontal scaling
while(lastInLumBuf+1 < srcSliceY + srcSliceH)
{
uint8_t *s= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0];
uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3];
lumBufIndex++;
assert(lumBufIndex < 2*vLumBufSize);
assert(lastInLumBuf + 1 - srcSliceY < srcSliceH);
assert(lastInLumBuf + 1 - srcSliceY >= 0);
RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, s, srcW, lumXInc,
RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, src1, srcW, lumXInc,
flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
funnyYCode, c->srcFormat, formatConvBuffer,
c->lumMmx2Filter, c->lumMmx2FilterPos, pal);
c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 0);
if (CONFIG_SWSCALE_ALPHA && alpPixBuf)
RENAME(hyscale)(c, alpPixBuf[ lumBufIndex ], dstW, src2, srcW, lumXInc,
flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize,
funnyYCode, c->srcFormat, formatConvBuffer,
c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 1);
lastInLumBuf++;
}
while(lastInChrBuf+1 < (chrSrcSliceY + chrSrcSliceH))
@ -2872,6 +3034,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
{
int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL;
#if HAVE_MMX
int i;
if (flags & SWS_ACCURATE_RND){
@ -2882,6 +3045,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
lumMmxFilter[s*i+APCK_COEF/4 ]=
lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i ]
+ (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1]<<16 : 0);
if (CONFIG_SWSCALE_ALPHA && alpPixBuf){
*(void**)&alpMmxFilter[s*i ]= alpSrcPtr[i ];
*(void**)&alpMmxFilter[s*i+APCK_PTR2/4 ]= alpSrcPtr[i+(vLumFilterSize>1)];
alpMmxFilter[s*i+APCK_COEF/4 ]=
alpMmxFilter[s*i+APCK_COEF/4+1]= lumMmxFilter[s*i+APCK_COEF/4 ];
}
}
for (i=0; i<vChrFilterSize; i+=2){
*(void**)&chrMmxFilter[s*i ]= chrSrcPtr[i ];
@ -2898,6 +3067,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
lumMmxFilter[4*i+2]=
lumMmxFilter[4*i+3]=
((uint16_t)vLumFilter[dstY*vLumFilterSize + i])*0x10001;
if (CONFIG_SWSCALE_ALPHA && alpPixBuf){
alpMmxFilter[4*i+0]= (int32_t)alpSrcPtr[i];
alpMmxFilter[4*i+1]= (uint64_t)alpSrcPtr[i] >> 32;
alpMmxFilter[4*i+2]=
alpMmxFilter[4*i+3]= lumMmxFilter[4*i+2];
}
}
for (i=0; i<vChrFilterSize; i++)
{
@ -2925,14 +3100,15 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
{
int16_t *lumBuf = lumPixBuf[0];
int16_t *chrBuf= chrPixBuf[0];
RENAME(yuv2yuv1)(c, lumBuf, chrBuf, dest, uDest, vDest, dstW, chrDstW);
int16_t *alpBuf= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpPixBuf[0] : NULL;
RENAME(yuv2yuv1)(c, lumBuf, chrBuf, alpBuf, dest, uDest, vDest, aDest, dstW, chrDstW);
}
else //General YV12
{
RENAME(yuv2yuvX)(c,
vLumFilter+dstY*vLumFilterSize , lumSrcPtr, vLumFilterSize,
vChrFilter+chrDstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, uDest, vDest, dstW, chrDstW);
alpSrcPtr, dest, uDest, vDest, aDest, dstW, chrDstW);
}
}
else
@ -2946,9 +3122,10 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
yuv2rgbXinC_full(c, //FIXME write a packed1_full function
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstY);
alpSrcPtr, dest, dstW, dstY);
}else{
RENAME(yuv2packed1)(c, *lumSrcPtr, *chrSrcPtr, *(chrSrcPtr+1),
alpPixBuf ? *alpSrcPtr : NULL,
dest, dstW, chrAlpha, dstFormat, flags, dstY);
}
}
@ -2964,9 +3141,10 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
yuv2rgbXinC_full(c, //FIXME write a packed2_full function
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstY);
alpSrcPtr, dest, dstW, dstY);
}else{
RENAME(yuv2packed2)(c, *lumSrcPtr, *(lumSrcPtr+1), *chrSrcPtr, *(chrSrcPtr+1),
alpPixBuf ? *alpSrcPtr : NULL, alpPixBuf ? *(alpSrcPtr+1) : NULL,
dest, dstW, lumAlpha, chrAlpha, dstY);
}
}
@ -2976,12 +3154,12 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
yuv2rgbXinC_full(c,
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstY);
alpSrcPtr, dest, dstW, dstY);
}else{
RENAME(yuv2packedX)(c,
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstY);
alpSrcPtr, dest, dstW, dstY);
}
}
}
@ -2990,6 +3168,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
{
int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL;
if (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21){
const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
if (dstY&chrSkipMask) uDest= NULL; //FIXME split functions in lumi / chromi
@ -3005,7 +3184,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
yuv2yuvXinC(
vLumFilter+dstY*vLumFilterSize , lumSrcPtr, vLumFilterSize,
vChrFilter+chrDstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, uDest, vDest, dstW, chrDstW);
alpSrcPtr, dest, uDest, vDest, aDest, dstW, chrDstW);
}
else
{
@ -3015,17 +3194,20 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
yuv2rgbXinC_full(c,
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstY);
alpSrcPtr, dest, dstW, dstY);
}else{
yuv2packedXinC(c,
vLumFilter+dstY*vLumFilterSize, lumSrcPtr, vLumFilterSize,
vChrFilter+dstY*vChrFilterSize, chrSrcPtr, vChrFilterSize,
dest, dstW, dstY);
alpSrcPtr, dest, dstW, dstY);
}
}
}
}
if ((dstFormat == PIX_FMT_YUVA420P) && !alpPixBuf)
fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255);
#if HAVE_MMX
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");

View File

@ -0,0 +1,89 @@
/*
* software YUV to RGB converter
*
* Copyright (C) 2009 Konstantin Shishkov
*
* MMX/MMX2 template stuff (needed for fast movntq support),
* 1,4,8bpp support and context / deglobalize stuff
* by Michael Niedermayer (michaelni@gmx.at)
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <assert.h>
#include "config.h"
#include "libswscale/rgb2rgb.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#include "libavutil/x86_cpu.h"
#define DITHER1XBPP // only for MMX
/* hope these constant values are cache line aligned */
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;
//MMX versions
#undef RENAME
#undef HAVE_MMX2
#undef HAVE_AMD3DNOW
#define HAVE_MMX2 0
#define HAVE_AMD3DNOW 0
#define RENAME(a) a ## _MMX
#include "yuv2rgb_template.c"
//MMX2 versions
#undef RENAME
#undef HAVE_MMX2
#define HAVE_MMX2 1
#define RENAME(a) a ## _MMX2
#include "yuv2rgb_template.c"
SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
{
if (c->flags & SWS_CPU_CAPS_MMX2) {
switch (c->dstFormat) {
case PIX_FMT_RGB32:
if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P){
if (HAVE_7REGS) return yuva420_rgb32_MMX2;
break;
}else return yuv420_rgb32_MMX2;
case PIX_FMT_BGR24: return yuv420_rgb24_MMX2;
case PIX_FMT_RGB565: return yuv420_rgb16_MMX2;
case PIX_FMT_RGB555: return yuv420_rgb15_MMX2;
}
}
if (c->flags & SWS_CPU_CAPS_MMX) {
switch (c->dstFormat) {
case PIX_FMT_RGB32:
if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P){
if (HAVE_7REGS) return yuva420_rgb32_MMX;
break;
}else return yuv420_rgb32_MMX;
case PIX_FMT_BGR24: return yuv420_rgb24_MMX;
case PIX_FMT_RGB565: return yuv420_rgb16_MMX;
case PIX_FMT_RGB555: return yuv420_rgb15_MMX;
}
}
return NULL;
}

View File

@ -137,7 +137,7 @@
uint8_t *py = src[0] + y*srcStride[0]; \
uint8_t *pu = src[1] + (y>>1)*srcStride[1]; \
uint8_t *pv = src[2] + (y>>1)*srcStride[2]; \
long index= -h_size/2; \
x86_reg index= -h_size/2; \
#define YUV2RGB_INIT \
/* This MMX assembly code deals with a SINGLE scan line at a time, \
@ -162,7 +162,8 @@
"add $"AV_STRINGIFY(depth*8)", %1 \n\t" \
"add $4, %0 \n\t" \
" js 1b \n\t" \
\
#define YUV2RGB_OPERANDS \
: "+r" (index), "+r" (image) \
: "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index) \
); \
@ -170,6 +171,14 @@
__asm__ volatile (EMMS); \
return srcSliceH; \
#define YUV2RGB_OPERANDS_ALPHA \
: "+r" (index), "+r" (image) \
: "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), "r" (pa - 2*index) \
); \
} \
__asm__ volatile (EMMS); \
return srcSliceH; \
static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
int y, h_size;
@ -223,6 +232,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStr
MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */
YUV2RGB_ENDLOOP(2)
YUV2RGB_OPERANDS
}
static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
@ -280,6 +290,7 @@ static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStr
MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */
YUV2RGB_ENDLOOP(2)
YUV2RGB_OPERANDS
}
static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
@ -394,6 +405,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
#endif
YUV2RGB_ENDLOOP(3)
YUV2RGB_OPERANDS
}
#define RGB_PLANAR2PACKED32 \
@ -450,4 +462,23 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStr
RGB_PLANAR2PACKED32
YUV2RGB_ENDLOOP(4)
YUV2RGB_OPERANDS
}
static inline int RENAME(yuva420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
#if HAVE_7REGS
int y, h_size;
YUV2RGB_LOOP(4)
uint8_t *pa = src[3] + y*srcStride[3];
YUV2RGB_INIT
YUV2RGB
"movq (%6, %0, 2), %%mm3;" /* Load 8 A A7 A6 A5 A4 A3 A2 A1 A0 */
RGB_PLANAR2PACKED32
YUV2RGB_ENDLOOP(4)
YUV2RGB_OPERANDS_ALPHA
#endif
}

View File

@ -3,7 +3,6 @@
*
* Copyright (C) 2009 Konstantin Shishkov
*
* MMX/MMX2 template stuff (needed for fast movntq support),
* 1,4,8bpp support and context / deglobalize stuff
* by Michael Niedermayer (michaelni@gmx.at)
*
@ -33,38 +32,12 @@
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"
#define DITHER1XBPP // only for MMX
#include "libavutil/x86_cpu.h"
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];
#if HAVE_MMX && CONFIG_GPL
/* hope these constant values are cache line aligned */
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;
//MMX versions
#undef RENAME
#undef HAVE_MMX2
#undef HAVE_AMD3DNOW
#define HAVE_MMX2 0
#define HAVE_AMD3DNOW 0
#define RENAME(a) a ## _MMX
#include "yuv2rgb_template.c"
//MMX2 versions
#undef RENAME
#undef HAVE_MMX2
#define HAVE_MMX2 1
#define RENAME(a) a ## _MMX2
#include "yuv2rgb_template.c"
#endif /* HAVE_MMX && CONFIG_GPL */
const int32_t ff_yuv2rgb_coeffs[8][4] = {
{117504, 138453, 13954, 34903}, /* no sequence_display_extension */
{117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */
@ -101,12 +74,18 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = {
Y = src[2*i+1]; \
dst[6*i+3] = b[Y]; dst[6*i+4] = g[Y]; dst[6*i+5] = r[Y];
#define YUV2RGBFUNC(func_name, dst_type) \
#define PUTRGBA(dst,ysrc,asrc,i,o,s) \
Y = ysrc[2*i+o]; \
dst[2*i ] = r[Y] + g[Y] + b[Y] + (asrc[2*i ]<<s); \
Y = ysrc[2*i+1-o]; \
dst[2*i+1] = r[Y] + g[Y] + b[Y] + (asrc[2*i+1]<<s);
#define YUV2RGBFUNC(func_name, dst_type, alpha) \
static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, \
int srcSliceH, uint8_t* dst[], int dstStride[]){\
int y;\
\
if (c->srcFormat == PIX_FMT_YUV422P) {\
if (!alpha && c->srcFormat == PIX_FMT_YUV422P) {\
srcStride[1] *= 2;\
srcStride[2] *= 2;\
}\
@ -119,7 +98,12 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic
uint8_t *py_2 = py_1 + srcStride[0];\
uint8_t *pu = src[1] + (y>>1)*srcStride[1];\
uint8_t *pv = src[2] + (y>>1)*srcStride[2];\
uint8_t av_unused *pa_1, *pa_2;\
unsigned int h_size = c->dstW>>3;\
if (alpha){\
pa_1 = src[3] + y*srcStride[3];\
pa_2 = pa_1 + srcStride[3];\
}\
while (h_size--) {\
int av_unused U, V;\
int Y;\
@ -145,7 +129,7 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic
ENDYUV2RGBLINE(dst_delta)\
ENDYUV2RGBFUNC()
YUV2RGBFUNC(yuv2rgb_c_32, uint32_t)
YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0)
LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1);
@ -174,7 +158,69 @@ ENDYUV2RGBLINE(8)
PUTRGB(dst_1,py_1,1,0);
ENDYUV2RGBFUNC()
YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t)
YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1)
LOADCHROMA(0);
PUTRGBA(dst_1,py_1,pa_1,0,0,24);
PUTRGBA(dst_2,py_2,pa_2,0,1,24);
LOADCHROMA(1);
PUTRGBA(dst_2,py_2,pa_1,1,1,24);
PUTRGBA(dst_1,py_1,pa_2,1,0,24);
LOADCHROMA(1);
PUTRGBA(dst_2,py_2,pa_1,1,1,24);
PUTRGBA(dst_1,py_1,pa_2,1,0,24);
LOADCHROMA(2);
PUTRGBA(dst_1,py_1,pa_1,2,0,24);
PUTRGBA(dst_2,py_2,pa_2,2,1,24);
LOADCHROMA(3);
PUTRGBA(dst_2,py_2,pa_1,3,1,24);
PUTRGBA(dst_1,py_1,pa_2,3,0,24);
pa_1 += 8;\
pa_2 += 8;\
ENDYUV2RGBLINE(8)
LOADCHROMA(0);
PUTRGBA(dst_1,py_1,pa_1,0,0,24);
PUTRGBA(dst_2,py_2,pa_2,0,1,24);
LOADCHROMA(1);
PUTRGBA(dst_2,py_2,pa_1,1,1,24);
PUTRGBA(dst_1,py_1,pa_2,1,0,24);
ENDYUV2RGBFUNC()
YUV2RGBFUNC(yuva2argb_c, uint32_t, 1)
LOADCHROMA(0);
PUTRGBA(dst_1,py_1,pa_1,0,0,0);
PUTRGBA(dst_2,py_2,pa_2,0,1,0);
LOADCHROMA(1);
PUTRGBA(dst_2,py_2,pa_2,1,1,0);
PUTRGBA(dst_1,py_1,pa_1,1,0,0);
LOADCHROMA(1);
PUTRGBA(dst_2,py_2,pa_2,1,1,0);
PUTRGBA(dst_1,py_1,pa_1,1,0,0);
LOADCHROMA(2);
PUTRGBA(dst_1,py_1,pa_1,2,0,0);
PUTRGBA(dst_2,py_2,pa_2,2,1,0);
LOADCHROMA(3);
PUTRGBA(dst_2,py_2,pa_2,3,1,0);
PUTRGBA(dst_1,py_1,pa_1,3,0,0);
pa_1 += 8;\
pa_2 += 8;\
ENDYUV2RGBLINE(8)
LOADCHROMA(0);
PUTRGBA(dst_1,py_1,pa_1,0,0,0);
PUTRGBA(dst_2,py_2,pa_2,0,1,0);
LOADCHROMA(1);
PUTRGBA(dst_2,py_2,pa_2,1,1,0);
PUTRGBA(dst_1,py_1,pa_1,1,0,0);
ENDYUV2RGBFUNC()
YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0)
LOADCHROMA(0);
PUTRGB24(dst_1,py_1,0);
PUTRGB24(dst_2,py_2,0);
@ -201,7 +247,7 @@ ENDYUV2RGBLINE(24)
ENDYUV2RGBFUNC()
// only trivial mods from yuv2rgb_c_24_rgb
YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0)
LOADCHROMA(0);
PUTBGR24(dst_1,py_1,0);
PUTBGR24(dst_2,py_2,0);
@ -229,7 +275,7 @@ ENDYUV2RGBFUNC()
// This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_16, uint16_t)
YUV2RGBFUNC(yuv2rgb_c_16, uint16_t, 0)
LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1);
@ -249,7 +295,7 @@ CLOSEYUV2RGBFUNC(8)
// This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_8, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_8, uint8_t, 0)
LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1);
@ -268,7 +314,7 @@ YUV2RGBFUNC(yuv2rgb_c_8, uint8_t)
CLOSEYUV2RGBFUNC(8)
// r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0)
const uint8_t *d32 = dither_8x8_32[y&7];
const uint8_t *d64 = dither_8x8_73[y&7];
#define PUTRGB8(dst,src,i,o) \
@ -297,7 +343,7 @@ CLOSEYUV2RGBFUNC(8)
// This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_4, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_4, uint8_t, 0)
int acc;
#define PUTRGB4(dst,src,i) \
Y = src[2*i]; \
@ -323,7 +369,7 @@ YUV2RGBFUNC(yuv2rgb_c_4, uint8_t)
PUTRGB4(dst_1,py_1,3);
CLOSEYUV2RGBFUNC(4)
YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0)
const uint8_t *d64 = dither_8x8_73[y&7];
const uint8_t *d128 = dither_8x8_220[y&7];
int acc;
@ -354,7 +400,7 @@ CLOSEYUV2RGBFUNC(4)
// This is exactly the same code as yuv2rgb_c_32 except for the types of
// r, g, b, dst_1, dst_2
YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t, 0)
LOADCHROMA(0);
PUTRGB(dst_1,py_1,0,0);
PUTRGB(dst_2,py_2,0,1);
@ -372,7 +418,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t)
PUTRGB(dst_1,py_1,3,0);
CLOSEYUV2RGBFUNC(8)
YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0)
const uint8_t *d64 = dither_8x8_73[y&7];
const uint8_t *d128 = dither_8x8_220[y&7];
@ -399,7 +445,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t)
PUTRGB4DB(dst_1,py_1,3,6);
CLOSEYUV2RGBFUNC(8)
YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t)
YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0)
const uint8_t *d128 = dither_8x8_220[y&7];
char out_1 = 0, out_2 = 0;
g= c->table_gU[128] + c->table_gV[128];
@ -426,41 +472,26 @@ YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t)
dst_2[0]= out_2;
CLOSEYUV2RGBFUNC(1)
SwsFunc sws_yuv2rgb_get_func_ptr(SwsContext *c)
SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
{
SwsFunc t = NULL;
#if (HAVE_MMX2 || HAVE_MMX) && CONFIG_GPL
if (c->flags & SWS_CPU_CAPS_MMX2) {
switch (c->dstFormat) {
case PIX_FMT_RGB32: return yuv420_rgb32_MMX2;
case PIX_FMT_BGR24: return yuv420_rgb24_MMX2;
case PIX_FMT_RGB565: return yuv420_rgb16_MMX2;
case PIX_FMT_RGB555: return yuv420_rgb15_MMX2;
}
}
if (c->flags & SWS_CPU_CAPS_MMX) {
switch (c->dstFormat) {
case PIX_FMT_RGB32: return yuv420_rgb32_MMX;
case PIX_FMT_BGR24: return yuv420_rgb24_MMX;
case PIX_FMT_RGB565: return yuv420_rgb16_MMX;
case PIX_FMT_RGB555: return yuv420_rgb15_MMX;
}
}
t = ff_yuv2rgb_init_mmx(c);
#endif
#if HAVE_VIS
t = sws_yuv2rgb_init_vis(c);
t = ff_yuv2rgb_init_vis(c);
#endif
#if CONFIG_MLIB
t = sws_yuv2rgb_init_mlib(c);
t = ff_yuv2rgb_init_mlib(c);
#endif
#if HAVE_ALTIVEC && CONFIG_GPL
if (c->flags & SWS_CPU_CAPS_ALTIVEC)
t = sws_yuv2rgb_init_altivec(c);
t = ff_yuv2rgb_init_altivec(c);
#endif
#if ARCH_BFIN
if (c->flags & SWS_CPU_CAPS_BFIN)
t = sws_ff_bfin_yuv2rgb_get_func_ptr(c);
t = ff_yuv2rgb_get_func_ptr_bfin(c);
#endif
if (t)
@ -469,10 +500,10 @@ SwsFunc sws_yuv2rgb_get_func_ptr(SwsContext *c)
av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found.\n");
switch (c->dstFormat) {
case PIX_FMT_BGR32_1:
case PIX_FMT_RGB32_1:
case PIX_FMT_BGR32:
case PIX_FMT_RGB32: return yuv2rgb_c_32;
case PIX_FMT_ARGB:
case PIX_FMT_ABGR: if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P) return yuva2argb_c;
case PIX_FMT_RGBA:
case PIX_FMT_BGRA: return (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P) ? yuva2rgba_c : yuv2rgb_c_32;
case PIX_FMT_RGB24: return yuv2rgb_c_24_rgb;
case PIX_FMT_BGR24: return yuv2rgb_c_24_bgr;
case PIX_FMT_RGB565:
@ -517,8 +548,8 @@ static void fill_gv_table(int table[256], const int elemsize, const int inc)
}
}
av_cold int sws_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange,
int brightness, int contrast, int saturation)
av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange,
int brightness, int contrast, int saturation)
{
const int isRgb = c->dstFormat==PIX_FMT_RGB32
|| c->dstFormat==PIX_FMT_RGB32_1
@ -533,7 +564,7 @@ av_cold int sws_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int
uint8_t *y_table;
uint16_t *y_table16;
uint32_t *y_table32;
int i, base, rbase, gbase, bbase, abase;
int i, base, rbase, gbase, bbase, abase, needAlpha;
const int yoffs = fullRange ? 384 : 326;
int64_t crv = inv_table[0];
@ -659,13 +690,15 @@ av_cold int sws_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int
rbase = base + (isRgb ? 16 : 0);
gbase = base + 8;
bbase = base + (isRgb ? 0 : 16);
abase = (base + 24) & 31;
needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
if (!needAlpha)
abase = (base + 24) & 31;
c->yuvTable = av_malloc(1024*3*4);
y_table32 = c->yuvTable;
yb = -(384<<16) - oy;
for (i = 0; i < 1024; i++) {
uint8_t yval = av_clip_uint8((yb + 0x8000) >> 16);
y_table32[i ] = (yval << rbase) + (255 << abase);
y_table32[i ] = (yval << rbase) + (needAlpha ? 0 : (255 << abase));
y_table32[i+1024] = yval << gbase;
y_table32[i+2048] = yval << bbase;
yb += cy;

View File

@ -33,9 +33,6 @@
//Feel free to fine-tune the above 2, it might be possible to get some speedup with them :)
//#define STATISTICS
#if ARCH_X86
#define CAN_COMPILE_X86_ASM
#endif
//Note: we have MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one
//Plain C versions
@ -43,7 +40,7 @@
//#define COMPILE_C
//#endif
#ifdef CAN_COMPILE_X86_ASM
#if ARCH_X86
#if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
#define COMPILE_MMX
@ -155,14 +152,14 @@
#include "aclib_template.c"
#endif
#endif // CAN_COMPILE_X86_ASM
#endif /* ARCH_X86 */
#undef fast_memcpy
void * fast_memcpy(void * to, const void * from, size_t len)
{
#ifdef RUNTIME_CPUDETECT
#ifdef CAN_COMPILE_X86_ASM
#if ARCH_X86
// ordered per speed fasterst first
if(gCpuCaps.hasSSE2)
fast_memcpy_SSE(to, from, len);
@ -173,7 +170,7 @@ void * fast_memcpy(void * to, const void * from, size_t len)
else if(gCpuCaps.hasMMX)
fast_memcpy_MMX(to, from, len);
else
#endif //CAN_COMPILE_X86_ASM
#endif
memcpy(to, from, len); // prior to mmx we use the standart memcpy
#else
#if HAVE_SSE2
@ -196,7 +193,7 @@ void * fast_memcpy(void * to, const void * from, size_t len)
void * mem2agpcpy(void * to, const void * from, size_t len)
{
#ifdef RUNTIME_CPUDETECT
#ifdef CAN_COMPILE_X86_ASM
#if ARCH_X86
// ordered per speed fasterst first
if(gCpuCaps.hasSSE2)
mem2agpcpy_SSE(to, from, len);
@ -207,7 +204,7 @@ void * mem2agpcpy(void * to, const void * from, size_t len)
else if(gCpuCaps.hasMMX)
mem2agpcpy_MMX(to, from, len);
else
#endif //CAN_COMPILE_X86_ASM
#endif
memcpy(to, from, len); // prior to mmx we use the standart memcpy
#else
#if HAVE_SSE2

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