summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-08 02:46:32 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-08 02:46:32 +0300
commit6dd56815b44471026b4bd7623b4c56dfc98f2731 (patch)
tree829396deeb8d5f35f2d0c483614d5a2735875b01
parent53eeb0e41238699fb11701c357941f904338bb25 (diff)
parent5815029bd2e16832d37f5f8f9c1307accfbdf058 (diff)
downloadmpv-6dd56815b44471026b4bd7623b4c56dfc98f2731.tar.bz2
mpv-6dd56815b44471026b4bd7623b4c56dfc98f2731.tar.xz
Merge svn changes up to r29150
-rw-r--r--DOCS/man/en/mplayer.12
-rw-r--r--DOCS/man/hu/mplayer.127
-rw-r--r--DOCS/man/zh_CN/mplayer.132
-rw-r--r--DOCS/tech/wishlist2
-rw-r--r--Makefile10
-rwxr-xr-xconfigure4
-rw-r--r--etc/input.conf1
-rw-r--r--gui/mplayer/gtk/fs.c5
-rw-r--r--libswscale/swscale.c68
-rw-r--r--libswscale/swscale_internal.h51
-rw-r--r--libswscale/swscale_template.c441
-rwxr-xr-xversion.sh2
12 files changed, 334 insertions, 311 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index db32b3ad5c..931f9264db 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -3494,7 +3494,7 @@ Useful with slow video memory.
.IPs pullup
Try to apply inverse telecine, needs motion adaptive temporal deinterlacing.
.RE
-.PD 1
+.PD 1
.
.TP
.B xvmc (X11 with \-vc ffmpeg12mc only)
diff --git a/DOCS/man/hu/mplayer.1 b/DOCS/man/hu/mplayer.1
index 30771f86d1..361822da37 100644
--- a/DOCS/man/hu/mplayer.1
+++ b/DOCS/man/hu/mplayer.1
@@ -1,4 +1,4 @@
-.\" Synced with r29059
+.\" Synced with r29147
.\" MPlayer (C) 2000-2009 MPlayer Team
.\" Ezt a man oldalt Gabucino, Diego Biurrun s Jonas Jermann kszti/ksztette
.\" Karbantart: Gabrov
@@ -33,7 +33,7 @@
.\" Nv
.\" --------------------------------------------------------------------------
.
-.TH MPlayer 1 "2009. 03. 28." "MPlayer Project" "A film lejtsz"
+.TH MPlayer 1 "2009. 04. 05." "MPlayer Project" "A film lejtsz"
.
.SH NV
mplayer \- film lejtsz
@@ -3131,6 +3131,10 @@ bal fels sarkig mrt tvolsg pixelben, vagy ha egy szzalk jelet
rtk lesz. Tmogatja tovbb a szabvnyos X11 \-geometry formtumot is.
Ha egy kls ablak is meg van adva a \-win opcival, akkor az x s y
koordintk az ablak bal fels sarkhoz viszonyulnak a kperny helyett.
+A \-xineramascreen kapcsolval megadott koordintk a kpernyhz
+viszonytottak, azon vide kimeneti vezrlknl, amelyek teljes mrtkben
+tmogatjk a \-xineramascreen kapcsolt (direct3d, gl, gl2, vdpau, x11, xv, xvmc).
+
.br
.I MEGJEGYZS:
Ezt az opcit csak az x11, xmga, xv, xvmc, xvidix, gl, gl2, directx,
@@ -3306,7 +3310,7 @@ mkdik.
Ez az opci nem alkalmas csak a kezd kperny belltsra (mert
a megadott kpernyn mindig teljes kpernysen jelenik meg), jelenleg
a \-geometry a legalkalmasabb erre a clra.
-A gl, gl2, x11 s az xv vide kimeneti vezrl tmogatja.
+A direct3d, gl, gl2, x11 s az xv vide kimeneti vezrl tmogatja.
.
.TP
.B \-zrbw (csak \-vo zr)
@@ -5089,6 +5093,23 @@ Az sszer rtkek 0.001 krl vannak.
.PD 1
.
.TP
+.B bs2b[=opci1:opci2]
+Bauer trhatsbl kt flesbe trtn transzformls libbs2b-vel.
+Javtja a flhallgatn trtn hallgatst gy, hogy a hangot hasonlv
+teszi, mintha hangszrbl jnne, lehetv tve hogy mindkt fl
+hallja mindkt csatornt figyelembe vve a tvolsg differencit s
+a fej rnykol hatst.
+Csak 2 csatorns audi esetn hasznlhat.
+.PD 0
+.RSs
+.IPs level=<1\-3>
+Belltja az sszemoss szintjt, a nagyobb szint ersebb effektet jelent (alaprtelmezett: 3).
+.IPs profile=<0\-1>
+Kivlasztja az sszemoss profilt, az 1 finomabb hangot ad, mint a 0 (alaprtelmezett: 1).
+.RE
+.PD 1
+.
+.TP
.B hrtf[=flag]
Head-related transfer function: Tbbcsatorns audit konvertl
2 csatornss flhallgats kimenethez, megtartva a hang trbelisgt.
diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1
index 44994bbf50..6d6b31f66b 100644
--- a/DOCS/man/zh_CN/mplayer.1
+++ b/DOCS/man/zh_CN/mplayer.1
@@ -1,4 +1,4 @@
-.\" sync with en/mplayer.1 r29059
+.\" sync with en/mplayer.1 r29133
.\" Encoding: UTF-8
.\" Reminder of hard terms which need better/final solution later:
.\" /capture; playtree in parent list; colorkey; retrace; desync; downmix;
@@ -2920,6 +2920,11 @@ x 和 y 代表从屏幕左上角到显示图像左上角的距离(以像素为
它也支持标准 X11 的 \-geometry 选项格式。
如果使用 \-wid 选项指定了外部窗口,
那么 x 和 y 坐标是相对于窗口而不是屏幕的左上角。
+坐标是相对于 \-xineramascreen 选项给出的屏幕,该屏幕用于完全支持 \-xineramascreen 的
+视频输出的驱动(direct3d、gl、gl2、vdpau、x11、xv、xvmc)。
+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 注意:
此选项仅被 x11、xmga、xv、xvmc、xvidix、
@@ -3079,13 +3084,9 @@ ggi 和 gl2 的都支持此功能。
息),\-1 表示在目前窗口所在的显示屏上全屏幕。
通过 \-geometry 选项设置的初始位置是相对于指定屏幕的。
通常只能与 "\-fstype \-fullscreen" 或 "\-fstype none" 一起工作。
-该选项不适用于仅仅设置启动屏幕(因为其总是在指定的屏幕上以全屏方式显示),\-geometry 是目前可用
-于此目前的最好选项。
-This option is not suitable to only set the startup screen (and not also the
-fullscreen screen), \-geometry is the best that is available for that purpose
-currently.
-Supported by the gl, gl2, x11, and xv video output drivers.
-.
+该选项不适用于仅仅设置启动屏幕(并且也不适合设置全屏屏幕),\-geometry 是目前可用
+于此目的的最好选项。
+至少 direct3d、gl、gl2、x11 和 xv 视频输出驱动支持该选项。
.TP
.B \-zrbw (仅用于 \-vo zr)
黑白显示。
@@ -4746,6 +4747,21 @@ delta 的正弦, 使用非常低的值听此扫听(sweep)。
.PD 1
.
.TP
+.B bs2b[=option1:option2]
+使用 libbs2b 的 Bauer 立体声至双耳声道转换模式。
+通过使声音更类似于如同从扬声器传来以提升耳机的听觉效果。该模式让每个耳朵同时
+听见两个声道,并考虑了声音传播距离的差别及头部回响效果。
+该选项只能应用于 2 个声道的音频。
+.PD 0
+.RSs
+.IPs level=<1\-3>
+设置交叉反馈的级别,级别越高效果越强(默认值:3)。
+.IPs profile=<0\-1>
+选择所选用的交叉反馈配置,配置 1 输出的声音比配置 0 柔和(默认值:1)。
+.RE
+.PD 1
+.
+.TP
.B hrtf[=flag]
头部相关的转变功能: 为头戴式耳机转换多声道音频成双声道输出,
但保留声音的空间感。
diff --git a/DOCS/tech/wishlist b/DOCS/tech/wishlist
index c5fe84b932..fd53e8f660 100644
--- a/DOCS/tech/wishlist
+++ b/DOCS/tech/wishlist
@@ -44,8 +44,6 @@ Small improvements:
* add help suboption to -lavcopts vcodec=/acodec=, -lavfopts format=,
-subcp, and anything else that needs it.
- * ability to set mplayer default/startup volume
-
* ability to cycle switch_aspect
* ability to rename vo_jpeg,vo_gif,vo_png output filename
diff --git a/Makefile b/Makefile
index 5cbea790ef..90022d6b3c 100644
--- a/Makefile
+++ b/Makefile
@@ -916,9 +916,13 @@ install-gui: install-mplayer
$(INSTALL) -m 644 etc/mplayer.xpm $(prefix)/share/pixmaps/
$(INSTALL) -m 644 etc/mplayer.desktop $(prefix)/share/applications/
+install-gui-man: $(foreach lang,$(MAN_LANGS),install-gui-man-$(lang))
install-mencoder-man: $(foreach lang,$(MAN_LANGS),install-mencoder-man-$(lang))
install-mplayer-man: $(foreach lang,$(MAN_LANGS),install-mplayer-man-$(lang))
+install-gui-man-en: install-mplayer-man-en
+ cd $(MANDIR)/man1/ && ln -sf mplayer.1 gmplayer.1
+
install-mencoder-man-en: install-mplayer-man-en
cd $(MANDIR)/man1 && ln -sf mplayer.1 mencoder.1
@@ -926,6 +930,11 @@ install-mplayer-man-en:
if test ! -d $(MANDIR)/man1 ; then $(INSTALL) -d $(MANDIR)/man1 ; fi
$(INSTALL) -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/
+define GUI_MAN_RULE
+install-gui-man-$(lang): install-mplayer-man-$(lang)
+ cd $(MANDIR)/$(lang)/man1/ && ln -sf mplayer.1 gmplayer.1
+endef
+
define MENCODER_MAN_RULE
install-mencoder-man-$(lang): install-mplayer-man-$(lang)
cd $(MANDIR)/$(lang)/man1 && ln -sf mplayer.1 mencoder.1
@@ -937,6 +946,7 @@ install-mplayer-man-$(lang):
$(INSTALL) -m 644 DOCS/man/$(lang)/mplayer.1 $(MANDIR)/$(lang)/man1/
endef
+$(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(GUI_MAN_RULE)))
$(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(MENCODER_MAN_RULE)))
$(foreach lang,$(filter-out en,$(MAN_LANG_ALL)),$(eval $(MPLAYER_MAN_RULE)))
diff --git a/configure b/configure
index d7d8e85f9c..3cfbe09e4b 100755
--- a/configure
+++ b/configure
@@ -797,10 +797,10 @@ for ac_option do
;;
--extra-cflags=*)
- extra_cflags=`echo $ac_option | cut -d '=' -f 2`
+ extra_cflags=`echo $ac_option | cut -d '=' -f 2-`
;;
--extra-ldflags=*)
- extra_ldflags=`echo $ac_option | cut -d '=' -f 2`
+ extra_ldflags=`echo $ac_option | cut -d '=' -f 2-`
;;
--extra-libs=*)
extra_libs=`echo $ac_option | cut -d '=' -f 2`
diff --git a/etc/input.conf b/etc/input.conf
index 32fbbb5e98..6e11b40c76 100644
--- a/etc/input.conf
+++ b/etc/input.conf
@@ -20,6 +20,7 @@ PGDWN seek -600
m mute
# switch_audio # switch audio streams
+ audio_delay 0.100
+= audio_delay 0.100
- audio_delay -0.100
[ speed_mult 0.9091 # scale playback speed
] speed_mult 1.1
diff --git a/gui/mplayer/gtk/fs.c b/gui/mplayer/gtk/fs.c
index fb60fe887d..238697e985 100644
--- a/gui/mplayer/gtk/fs.c
+++ b/gui/mplayer/gtk/fs.c
@@ -69,7 +69,8 @@ char * fsVideoFilterNames[][2] =
{ "OGG Vorbis files (*.ogg)", "*.ogg" },
{ "OGG Media files (*.ogm)", "*.ogm" },
{ "QuickTime files (*.mov,*.qt,*.mp4)", "*.mov,*.qt,*.mp4" },
- { "RealVideo files (*.rm)", "*.rm" },
+ { "RealVideo files (*.rm,*.rmvb)", "*.rm,*.rmvb" },
+ { "Tivo files (*.ty)", "*.ty" },
{ "VCD/SVCD Images (*.bin)", "*.bin" },
{ "VIVO files (*.viv)", "*.viv" },
{ "VOB files (*.vob)", "*.vob" },
@@ -77,7 +78,7 @@ char * fsVideoFilterNames[][2] =
{ "Windows Media Audio (*.wma)", "*.wma" },
{ "Windows Media Video (*.wmv)", "*.wmv" },
{ "Audio files", "*.mp2,*.mp3,*.mka,*.ogg,*.wav,*.wma" },
- { "Video files", "*.asf,*.avi,*.fli,*.flc,*.trp,*.divx,*.mpg,*.mpeg,*.m1v,*.flv,*.mkv,*.nuv,*.ogm,*.mov,*.qt,*.mp4,*.rm,*.bin,*.viv,*.vob,*.wmv" },
+ { "Video files", "*.asf,*.avi,*.fli,*.flc,*.trp,*.divx,*.mpg,*.mpeg,*.m1v,*.flv,*.mkv,*.nuv,*.ogm,*.mov,*.qt,*.mp4,*.rm,*.rmvb,*.ty,*.bin,*.viv,*.vob,*.wmv" },
{ "All files", "*" },
{ NULL,NULL }
};
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 316f4517e4..4799542421 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -472,9 +472,9 @@ 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,
- int16_t **alpSrc, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, int dstW, int chrDstW)
+static inline void yuv2yuvXinC(const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
+ const 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;
@@ -516,8 +516,8 @@ static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilt
}
-static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
- int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
+static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)
{
//FIXME Optimize (just quickly written not optimized..)
@@ -993,17 +993,17 @@ 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,
- int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+static inline void yuv2packedXinC(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
+ const 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,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,
- int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+static inline void yuv2rgbXinC_full(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
{
int i;
int step= fmt_depth(c->dstFormat)/8;
@@ -1094,7 +1094,7 @@ static void fillPlane(uint8_t* plane, int stride, int width, int height, int y,
}
}
-//Note: we have C, X86, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
+//Note: we have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
//Plain C versions
#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL
#define COMPILE_C
@@ -1146,16 +1146,6 @@ static void fillPlane(uint8_t* plane, int stride, int width, int height, int y,
#if ARCH_X86
-//x86 versions
-/*
-#undef RENAME
-#undef HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_AMD3DNOW
-#define ARCH_X86
-#define RENAME(a) a ## _X86
-#include "swscale_template.c"
-*/
//MMX versions
#ifdef COMPILE_MMX
#undef RENAME
@@ -1776,39 +1766,55 @@ static void globalInit(void){
}
}
-static SwsFunc getSwsFunc(int flags){
+static SwsFunc getSwsFunc(SwsContext *c)
+{
+ int flags = c->flags;
#if defined(RUNTIME_CPUDETECT) && CONFIG_GPL
#if ARCH_X86
// ordered per speed fastest first
- if (flags & SWS_CPU_CAPS_MMX2)
+ if (flags & SWS_CPU_CAPS_MMX2) {
+ sws_init_swScale_MMX2(c);
return swScale_MMX2;
- else if (flags & SWS_CPU_CAPS_3DNOW)
+ } else if (flags & SWS_CPU_CAPS_3DNOW) {
+ sws_init_swScale_3DNow(c);
return swScale_3DNow;
- else if (flags & SWS_CPU_CAPS_MMX)
+ } else if (flags & SWS_CPU_CAPS_MMX) {
+ sws_init_swScale_MMX(c);
return swScale_MMX;
- else
+ } else {
+ sws_init_swScale_C(c);
return swScale_C;
+ }
#else
#if ARCH_PPC
- if (flags & SWS_CPU_CAPS_ALTIVEC)
+ if (flags & SWS_CPU_CAPS_ALTIVEC) {
+ sws_init_swScale_altivec(c);
return swScale_altivec;
- else
+ } else {
+ sws_init_swScale_C(c);
return swScale_C;
+ }
#endif
+ sws_init_swScale_C(c);
return swScale_C;
#endif /* ARCH_X86 */
#else //RUNTIME_CPUDETECT
#if HAVE_MMX2
+ sws_init_swScale_MMX2(c);
return swScale_MMX2;
#elif HAVE_AMD3DNOW
+ sws_init_swScale_3DNow(c);
return swScale_3DNow;
#elif HAVE_MMX
+ sws_init_swScale_MMX(c);
return swScale_MMX;
#elif HAVE_ALTIVEC
+ sws_init_swScale_altivec(c);
return swScale_altivec;
#else
+ sws_init_swScale_C(c);
return swScale_C;
#endif
#endif //!RUNTIME_CPUDETECT
@@ -1823,7 +1829,7 @@ static int PlanarToNV12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], i
else
{
int i;
- uint8_t *srcPtr= src[0];
+ const uint8_t *srcPtr= src[0];
uint8_t *dstPtr= dst;
for (i=0; i<srcSliceH; i++)
{
@@ -2929,7 +2935,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
c->chrSrcW, c->chrSrcH, c->chrDstW, c->chrDstH, c->chrXInc, c->chrYInc);
}
- c->swScale= getSwsFunc(flags);
+ c->swScale= getSwsFunc(c);
return c;
}
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 785c00aa3c..070161900b 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -214,6 +214,57 @@ typedef struct SwsContext{
uint64_t sparc_coeffs[10] __attribute__((aligned(8)));
#endif
+ /* function pointers for swScale() */
+ void (*yuv2nv12X )(struct SwsContext *c,
+ const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
+ uint8_t *dest, uint8_t *uDest,
+ int dstW, int chrDstW, int dstFormat);
+ void (*yuv2yuv1 )(struct SwsContext *c,
+ const int16_t *lumSrc, const int16_t *chrSrc, const int16_t *alpSrc,
+ uint8_t *dest,
+ uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
+ long dstW, long chrDstW);
+ void (*yuv2yuvX )(struct SwsContext *c,
+ const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
+ const int16_t **alpSrc,
+ uint8_t *dest,
+ uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
+ long dstW, long chrDstW);
+ void (*yuv2packed1)(struct SwsContext *c,
+ const uint16_t *buf0,
+ const uint16_t *uvbuf0, const uint16_t *uvbuf1,
+ const uint16_t *abuf0,
+ uint8_t *dest,
+ int dstW, int uvalpha, int dstFormat, int flags, int y);
+ void (*yuv2packed2)(struct SwsContext *c,
+ const uint16_t *buf0, const uint16_t *buf1,
+ const uint16_t *uvbuf0, const uint16_t *uvbuf1,
+ const uint16_t *abuf0, const uint16_t *abuf1,
+ uint8_t *dest,
+ int dstW, int yalpha, int uvalpha, int y);
+ void (*yuv2packedX)(struct SwsContext *c,
+ const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest,
+ long dstW, long dstY);
+
+ void (*hyscale_internal)(uint8_t *dst, const uint8_t *src,
+ long width, uint32_t *pal);
+ void (*hcscale_internal)(uint8_t *dstU, uint8_t *dstV,
+ const uint8_t *src1, const uint8_t *src2,
+ long width, uint32_t *pal);
+ void (*hyscale_fast)(struct SwsContext *c,
+ int16_t *dst, int dstWidth,
+ const uint8_t *src, int srcW, int xInc);
+ void (*hcscale_fast)(struct SwsContext *c,
+ int16_t *dst, int dstWidth,
+ const uint8_t *src1, const uint8_t *src2, int srcW, int xInc);
+
+ void (*hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW,
+ int xInc, const int16_t *filter, const int16_t *filterPos, long filterSize);
+
} SwsContext;
//FIXME check init (where 0)
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 4562866b7b..49ce0d32d5 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -901,8 +901,8 @@
#define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
-static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
- int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, int16_t **alpSrc,
+static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize, const int16_t **alpSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, long dstW, long chrDstW)
{
#if HAVE_MMX
@@ -942,8 +942,8 @@ yuv2yuvXinC(lumFilter, lumSrc, lumFilterSize,
#endif //!HAVE_ALTIVEC
}
-static inline void RENAME(yuv2nv12X)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
- int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
+static inline void RENAME(yuv2nv12X)(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)
{
yuv2nv12XinC(lumFilter, lumSrc, lumFilterSize,
@@ -951,7 +951,7 @@ yuv2nv12XinC(lumFilter, lumSrc, lumFilterSize,
dest, uDest, dstW, chrDstW, dstFormat);
}
-static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chrSrc, int16_t *alpSrc,
+static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, const int16_t *chrSrc, const int16_t *alpSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, long dstW, long chrDstW)
{
int i;
@@ -1028,9 +1028,9 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
/**
* vertical scale YV12 to RGB
*/
-static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
- int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
- int16_t **alpSrc, uint8_t *dest, long dstW, long dstY)
+static inline void RENAME(yuv2packedX)(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest, long dstW, long dstY)
{
#if HAVE_MMX
x86_reg dummy=0;
@@ -1214,8 +1214,8 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
/**
* 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,
- uint16_t *abuf0, uint16_t *abuf1, uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
+static inline void RENAME(yuv2packed2)(SwsContext *c, const uint16_t *buf0, const uint16_t *buf1, const uint16_t *uvbuf0, const uint16_t *uvbuf1,
+ const uint16_t *abuf0, const uint16_t *abuf1, uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
{
int yalpha1=4095- yalpha;
int uvalpha1=4095-uvalpha;
@@ -1364,18 +1364,18 @@ YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB2_C, YSCALE_YUV_2_PACKED2_C(void,0), YSCAL
/**
* YV12 to RGB without scaling or interpolating
*/
-static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *uvbuf0, uint16_t *uvbuf1,
- uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int dstFormat, int flags, int y)
+static inline void RENAME(yuv2packed1)(SwsContext *c, const uint16_t *buf0, const uint16_t *uvbuf0, const uint16_t *uvbuf1,
+ const uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int dstFormat, int flags, int y)
{
const int yalpha1=0;
int i;
- uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1
+ const uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1
const int yalpha= 4096; //FIXME ...
if (flags&SWS_FULL_CHR_H_INT)
{
- RENAME(yuv2packed2)(c, buf0, buf0, uvbuf0, uvbuf1, abuf0, abuf0, dest, dstW, 0, uvalpha, y);
+ c->yuv2packed2(c, buf0, buf0, uvbuf0, uvbuf1, abuf0, abuf0, dest, dstW, 0, uvalpha, y);
return;
}
@@ -1611,7 +1611,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
//FIXME yuy2* can read up to 7 samples too much
-static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
+static inline void RENAME(yuy2ToY)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
{
#if HAVE_MMX
__asm__ volatile(
@@ -1636,7 +1636,7 @@ static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint3
#endif
}
-static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
+static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
#if HAVE_MMX
__asm__ volatile(
@@ -1673,7 +1673,7 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1,
/* This is almost identical to the previous, end exists only because
* yuy2ToY/UV)(dst, src+1, ...) would have 100% unaligned accesses. */
-static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
+static inline void RENAME(uyvyToY)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
{
#if HAVE_MMX
__asm__ volatile(
@@ -1697,7 +1697,7 @@ static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint3
#endif
}
-static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
+static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
#if HAVE_MMX
__asm__ volatile(
@@ -1733,14 +1733,14 @@ static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1,
}
#define BGR2Y(type, name, shr, shg, shb, maskr, maskg, maskb, RY, GY, BY, S)\
-static inline void RENAME(name)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)\
+static inline void RENAME(name)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)\
{\
int i;\
for (i=0; i<width; i++)\
{\
- int b= (((type*)src)[i]>>shb)&maskb;\
- int g= (((type*)src)[i]>>shg)&maskg;\
- int r= (((type*)src)[i]>>shr)&maskr;\
+ int b= (((const type*)src)[i]>>shb)&maskb;\
+ int g= (((const type*)src)[i]>>shg)&maskg;\
+ int r= (((const type*)src)[i]>>shr)&maskr;\
\
dst[i]= (((RY)*r + (GY)*g + (BY)*b + (33<<((S)-1)))>>(S));\
}\
@@ -1753,7 +1753,7 @@ 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){
+static inline void RENAME(abgrToA)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused){
int i;
for (i=0; i<width; i++){
dst[i]= src[4*i];
@@ -1761,26 +1761,26 @@ static inline void RENAME(abgrToA)(uint8_t *dst, uint8_t *src, long width, uint3
}
#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)\
+static inline void RENAME(name)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, long width, uint32_t *unused)\
{\
int i;\
for (i=0; i<width; i++)\
{\
- int b= (((type*)src)[i]&maskb)>>shb;\
- int g= (((type*)src)[i]&maskg)>>shg;\
- int r= (((type*)src)[i]&maskr)>>shr;\
+ int b= (((const type*)src)[i]&maskb)>>shb;\
+ int g= (((const type*)src)[i]&maskg)>>shg;\
+ int r= (((const type*)src)[i]&maskr)>>shr;\
\
dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<((S)-1)))>>(S);\
dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\
}\
}\
-static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, uint8_t *dummy, long width, uint32_t *unused)\
+static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, long width, uint32_t *unused)\
{\
int i;\
for (i=0; i<width; i++)\
{\
- int pix0= ((type*)src)[2*i+0];\
- int pix1= ((type*)src)[2*i+1];\
+ int pix0= ((const type*)src)[2*i+0];\
+ int pix1= ((const type*)src)[2*i+1];\
int g= (pix0&~(maskr|maskb))+(pix1&~(maskr|maskb));\
int b= ((pix0+pix1-g)&(maskb|(2*maskb)))>>shb;\
int r= ((pix0+pix1-g)&(maskr|(2*maskr)))>>shr;\
@@ -1801,7 +1801,7 @@ BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU
BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7)
#if HAVE_MMX
-static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width, int srcFormat)
+static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, long width, int srcFormat)
{
if(srcFormat == PIX_FMT_BGR24){
@@ -1854,7 +1854,7 @@ static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width,
);
}
-static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *src, long width, int srcFormat)
+static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, long width, int srcFormat)
{
__asm__ volatile(
"movq 24+%4, %%mm6 \n\t"
@@ -1913,7 +1913,7 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *
}
#endif
-static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
+static inline void RENAME(bgr24ToY)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
{
#if HAVE_MMX
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24);
@@ -1930,7 +1930,7 @@ static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width, uint
#endif /* HAVE_MMX */
}
-static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
+static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
#if HAVE_MMX
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24);
@@ -1949,7 +1949,7 @@ static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1
assert(src1 == src2);
}
-static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
+static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
int i;
for (i=0; i<width; i++)
@@ -1964,7 +1964,7 @@ static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t
assert(src1 == src2);
}
-static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
+static inline void RENAME(rgb24ToY)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
{
#if HAVE_MMX
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);
@@ -1981,7 +1981,7 @@ static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width, uint
#endif
}
-static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
+static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
#if HAVE_MMX
assert(src1==src2);
@@ -2001,7 +2001,7 @@ static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1
#endif
}
-static inline void RENAME(rgb24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
+static inline void RENAME(rgb24ToUV_half)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
int i;
assert(src1==src2);
@@ -2017,7 +2017,7 @@ static inline void RENAME(rgb24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t
}
-static inline void RENAME(palToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *pal)
+static inline void RENAME(palToY)(uint8_t *dst, const uint8_t *src, long width, uint32_t *pal)
{
int i;
for (i=0; i<width; i++)
@@ -2028,7 +2028,9 @@ static inline void RENAME(palToY)(uint8_t *dst, uint8_t *src, long width, uint32
}
}
-static inline void RENAME(palToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *pal)
+static inline void RENAME(palToUV)(uint8_t *dstU, uint8_t *dstV,
+ const uint8_t *src1, const uint8_t *src2,
+ long width, uint32_t *pal)
{
int i;
assert(src1 == src2);
@@ -2041,7 +2043,7 @@ static inline void RENAME(palToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1,
}
}
-static inline void RENAME(monowhite2Y)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
+static inline void RENAME(monowhite2Y)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)
{
int i, j;
for (i=0; i<width/8; i++){
@@ -2051,7 +2053,7 @@ static inline void RENAME(monowhite2Y)(uint8_t *dst, uint8_t *src, long width, u
}
}
-static inline void RENAME(monoblack2Y)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
+static inline void RENAME(monoblack2Y)(uint8_t *dst