From 46974cdb45230919540581ea85c9a239c4002c93 Mon Sep 17 00:00:00 2001 From: Gabrov Date: Mon, 13 Jul 2009 13:05:00 +0000 Subject: synced with r39413 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29418 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/hu/mplayer.1 | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/DOCS/man/hu/mplayer.1 b/DOCS/man/hu/mplayer.1 index 6d49d7fd92..a63c5af287 100644 --- a/DOCS/man/hu/mplayer.1 +++ b/DOCS/man/hu/mplayer.1 @@ -1,4 +1,4 @@ -.\" Synced with r29305 +.\" Synced with r29413 .\" 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. 05. 24." "MPlayer Project" "A film lejátszó" +.TH MPlayer 1 "2009. 07. 13." "MPlayer Project" "A film lejátszó" . .SH NÉV mplayer \- film lejátszó @@ -7361,6 +7361,26 @@ A pixelek sz Határérték, mely alatt egy pixel feketének minősül (alapértelmezett: 32). .RE . +.TP +.B gradfun[=erősség[:sugár]] +Megszünteti a banding mellékhatásait, amik néha a színmélység 8 bitre történő +csökkentésekor jelentkeznek a sima területeken. +Interpolálja a szögeket, amik a sávok helyére kell, hogy kerüljenek és +árnyalja őket. +.sp 1 +Ez a szűrő a lejátszáshoz lett tervezve. +Ne használd veszteséges tömörítés előtt, mert a tömörítés elveszti az +árnyalást és visszahozza a sávokat. +.RSs +.IPs +A maximum érték, amennyivel a szűrő megváltoztat egy pixelt. +Valamint ez a küszöbérték a majdnem sima területek azonosításához is (alapértelmezett: 1.2). +.IPs +A szomszédság, melyhez a szögnek illeszkednie kell. +A nagyobb sugár simább szögeket ad, de megakadályozza a szűrőt a részletesebb +területek közelében lévő pixelek módosításában (alapértelmezett: 16). +.RE +. . . .SH "ÁLTALÁNOS KÓDOLÁSI OPCIÓK (CSAK MENCODER)" -- cgit v1.2.3 From 7f6cfb7935cd8317a3a850e413f307dfb8ed9f7c Mon Sep 17 00:00:00 2001 From: cehoyos Date: Fri, 17 Jul 2009 09:55:23 +0000 Subject: Assume HAVE_ATTRIBUTE_PACKED. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29419 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index c8d076612c..8e164f36db 100755 --- a/configure +++ b/configure @@ -8864,6 +8864,7 @@ $def_yasm #define HAVE_POLL_H 1 #define HAVE_PPC4XX 0 #define HAVE_VIRTUALALLOC 0 +#define HAVE_ATTRIBUTE_PACKED 1 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */ #define CONFIG_AANDCT 1 -- cgit v1.2.3 From 4ce671eb4457f9ce23b86ab7e57242df904d6a3c Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 17 Jul 2009 13:58:07 +0000 Subject: Remove CONFIG_LIBAMR_NB_FIXED #define, which no longer exists in FFmpeg. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29420 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 8e164f36db..2d5f25b57d 100755 --- a/configure +++ b/configure @@ -8851,7 +8851,6 @@ $def_yasm #define CONFIG_GPL 1 #define CONFIG_GRAY 0 #define CONFIG_HARDCODED_TABLES 0 -#define CONFIG_LIBAMR_NB_FIXED 0 #define CONFIG_LIBVORBIS 0 #define CONFIG_POWERPC_PERF 0 #define CONFIG_SMALL 0 -- cgit v1.2.3 From c266aa7c21d736b23b6fa31886b577ac22149be4 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Fri, 17 Jul 2009 17:43:08 +0000 Subject: Restore alphabetic order for HAVE_ defines. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29421 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 2d5f25b57d..f4fab73de9 100755 --- a/configure +++ b/configure @@ -8857,13 +8857,13 @@ $def_yasm #define CONFIG_SWSCALE 1 #define CONFIG_SWSCALE_ALPHA 1 +#define HAVE_ATTRIBUTE_PACKED 1 #define HAVE_GETHRTIME 0 #define HAVE_INLINE_ASM 0 #define HAVE_LDBRX 0 #define HAVE_POLL_H 1 #define HAVE_PPC4XX 0 #define HAVE_VIRTUALALLOC 0 -#define HAVE_ATTRIBUTE_PACKED 1 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */ #define CONFIG_AANDCT 1 -- cgit v1.2.3 From b96296d6afadb73d8e79a8310770f99868eacd38 Mon Sep 17 00:00:00 2001 From: jrash Date: Sat, 18 Jul 2009 04:31:55 +0000 Subject: sync with en/mplayer.1 r29413 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29422 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/zh_CN/mplayer.1 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1 index 78a0e2bbcc..874548068e 100644 --- a/DOCS/man/zh_CN/mplayer.1 +++ b/DOCS/man/zh_CN/mplayer.1 @@ -1,4 +1,4 @@ -.\" sync with en/mplayer.1 r29252 +.\" sync with en/mplayer.1 r29413 .\" Encoding: UTF-8 .\" Reminder of hard terms which need better/final solution later: .\" /capture; playtree in parent list; colorkey; retrace; desync; downmix; @@ -6852,6 +6852,23 @@ h参数值。 决定像素值低于多少就被认作是黑色的阈值(默认值:32)。 .RE . +.TP +.B gradfun[=strength[:radius]] +消除有时候因为将色深降至 8 比特后,在颜色近似不变的区域造成的带状损伤。 +通过插值在带状区域产生变化坡度,从而使其颜色产生抖动效果。 +.sp 1 +设计该滤镜仅为播放目的。 +不要在有损压缩步骤前使用该滤镜,因为压缩过程容易丢失抖动效果,从而恢复带状损伤。 +.RSs +.IPs +滤镜改变单个像素的最大程度。 +同时也是侦测颜色近似不变区域的阈值(默认值:1.2)。 +.IPs +应用变化坡度的周边区域大小。 +较大的 radius 值带来较平缓的变化坡度,但同时使滤镜不能修改靠近颜色变化丰富区域 +的像素(默认值:16)。 +.RE. +. . . .SH "通用编码选项(仅用于MENCODER)" -- cgit v1.2.3 From 9dc9f1a77ddc29524d9e0a91649f20a0e054896e Mon Sep 17 00:00:00 2001 From: eugeni Date: Sat, 18 Jul 2009 11:32:58 +0000 Subject: Fix read after the end of allocated buffer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29423 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass.h | 2 ++ libass/ass_render.c | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/libass/ass.h b/libass/ass.h index e98b4264b7..12f16fef5d 100644 --- a/libass/ass.h +++ b/libass/ass.h @@ -34,6 +34,8 @@ typedef struct ass_image_s { int w, h; // bitmap width/height int stride; // bitmap stride unsigned char* bitmap; // 1bpp stride*h alpha buffer + // Actual bitmap size may be as low as + // stride * (h-1) + w uint32_t color; // RGBA int dst_x, dst_y; // bitmap placement inside the video frame diff --git a/libass/ass_render.c b/libass/ass_render.c index f13f76661e..ae54a0f1bc 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -407,6 +407,21 @@ static ass_image_t** render_glyph(bitmap_t* bm, int dst_x, int dst_y, uint32_t c return tail; } +/** + * \brief Replaces the bitmap buffer in ass_image_t with its copy. + * + * @param img Image to operate on. + * @return Address of the old buffer. + */ +static unsigned char* clone_bitmap_data(ass_image_t* img) +{ + unsigned char* old_bitmap = img->bitmap; + int size = img->stride * (img->h - 1) + img->w; + img->bitmap = malloc(size); + memcpy(img->bitmap, old_bitmap, size); + return old_bitmap; +} + /** * \brief Calculate overlapping area of two consecutive bitmaps and in case they * overlap, composite them together @@ -474,12 +489,8 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h } // Allocate new bitmaps and copy over data - a = (*last_tail)->bitmap; - b = (*tail)->bitmap; - (*last_tail)->bitmap = malloc(as*ah); - (*tail)->bitmap = malloc(bs*bh); - memcpy((*last_tail)->bitmap, a, as*ah); - memcpy((*tail)->bitmap, b, bs*bh); + a = clone_bitmap_data(*last_tail); + b = clone_bitmap_data(*tail); // Composite overlapping area for (y=0; y Date: Sat, 18 Jul 2009 11:33:00 +0000 Subject: Cosmetics: make some variables constant to signify their intended use and, therefore, improve code readability. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29424 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index ae54a0f1bc..f64908c8a0 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -346,19 +346,18 @@ static ass_image_t** render_glyph(bitmap_t* bm, int dst_x, int dst_y, uint32_t c // color = color left of brk // color2 = color right of brk int b_x0, b_y0, b_x1, b_y1; // visible part of the bitmap - int clip_x0, clip_y0, clip_x1, clip_y1; int tmp; ass_image_t* img; + const int clip_x0 = render_context.clip_x0; + const int clip_y0 = render_context.clip_y0; + const int clip_x1 = render_context.clip_x1; + const int clip_y1 = render_context.clip_y1; + dst_x += bm->left; dst_y += bm->top; brk -= bm->left; - // clipping - clip_x0 = render_context.clip_x0; - clip_y0 = render_context.clip_y0; - clip_x1 = render_context.clip_x1; - clip_y1 = render_context.clip_y1; b_x0 = 0; b_y0 = 0; b_x1 = bm->w; -- cgit v1.2.3 From bad51c711f9d10f567732a5665e7e88d2a675150 Mon Sep 17 00:00:00 2001 From: eugeni Date: Sat, 18 Jul 2009 11:33:03 +0000 Subject: Make sure clip coordinates are inside the screen area. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29425 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 11 +++++++++++ libmpcodecs/vf_ass.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/libass/ass_render.c b/libass/ass_render.c index f64908c8a0..e4c06f7885 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -317,6 +317,11 @@ static ass_image_t* my_draw_bitmap(unsigned char* bitmap, int bitmap_w, int bitm { ass_image_t* img = calloc(1, sizeof(ass_image_t)); + assert(dst_x >= 0); + assert(dst_y >= 0); + assert(dst_x + bitmap_w < frame_context.width); + assert(dst_y + bitmap_h < frame_context.height); + img->w = bitmap_w; img->h = bitmap_h; img->stride = stride; @@ -598,6 +603,7 @@ static double x2scr_pos(double x) { return x*frame_context.orig_width / frame_context.track->PlayResX + global_settings->left_margin; } + /** * \brief Mapping between script and screen coordinates */ @@ -2148,6 +2154,11 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) render_context.clip_y1 = y2scr_pos(render_context.clip_y1); } + render_context.clip_x0 = FFMIN(FFMAX(render_context.clip_x0, 0), frame_context.width); + render_context.clip_x1 = FFMIN(FFMAX(render_context.clip_x1, 0), frame_context.width); + render_context.clip_y0 = FFMIN(FFMAX(render_context.clip_y0, 0), frame_context.height); + render_context.clip_y1 = FFMIN(FFMAX(render_context.clip_y1, 0), frame_context.height); + // calculate rotation parameters { FT_Vector center; diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index b88e7b37df..2068383926 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -219,6 +219,10 @@ static void copy_from_image(struct vf_instance_s* vf, int first_row, int last_ro last_row += (last_row % 2); chroma_rows = (last_row - first_row) / 2; + assert(first_row >= 0); + assert(first_row <= last_row); + assert(last_row < vf->priv->outh); + for (pl = 1; pl < 3; ++pl) { int dst_stride = vf->priv->outw; int src_stride = vf->dmpi->stride[pl]; -- cgit v1.2.3 From e2ae312a37f5dffe7ac66346299eaaea9e2a3386 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 18 Jul 2009 15:07:26 +0000 Subject: Change libamr support to libopencore-amr support. libamr support was removed from FFmpeg. based on a patch by Andrew Wason, rectalogic rectalogic com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29426 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 98 +++++++++++++++++++++++++++------------------------------ etc/codecs.conf | 4 +-- 2 files changed, 49 insertions(+), 53 deletions(-) diff --git a/configure b/configure index f4fab73de9..48b15232ad 100755 --- a/configure +++ b/configure @@ -341,8 +341,8 @@ Codecs: --disable-liba52-internal disable builtin liba52 [autodetect] --disable-libmpeg2 disable builtin libmpeg2 [autodetect] --disable-musepack disable musepack support [autodetect] - --disable-libamr_nb disable libamr narrowband [autodetect] - --disable-libamr_wb disable libamr wideband [autodetect] + --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect] + --disable-libopencore_amrwb disable libopencore_amr wideband [autodetect] --disable-decoder=DECODER disable specified FFmpeg decoder --enable-decoder=DECODER enable specified FFmpeg decoder --disable-encoder=ENCODER disable specified FFmpeg encoder @@ -535,8 +535,8 @@ _prefix="/usr/local" _libavutil_a=auto _libavutil_so=auto _libavcodec_a=auto -_libamr_nb=auto -_libamr_wb=auto +_libopencore_amrnb=auto +_libopencore_amrwb=auto _libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') _libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//) _libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') @@ -1145,10 +1145,10 @@ for ac_option do --disable-libavcodec_a) _libavcodec_a=no ;; --enable-libavcodec_so) _libavcodec_so=yes ;; --disable-libavcodec_so) _libavcodec_so=no ;; - --enable-libamr_nb) _libamr_nb=yes ;; - --disable-libamr_nb) _libamr_nb=no ;; - --enable-libamr_wb) _libamr_wb=yes ;; - --disable-libamr_wb) _libamr_wb=no ;; + --enable-libopencore_amrnb) _libopencore_amrnb=yes ;; + --disable-libopencore_amrnb) _libopencore_amrnb=no ;; + --enable-libopencore_amrwb) _libopencore_amrwb=yes ;; + --disable-libopencore_amrwb) _libopencore_amrwb=no ;; --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2)" ;; --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2)//g") ;; --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2)" ;; @@ -7061,60 +7061,58 @@ test "$_libswscale_so" = yes \ && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1' echores "$_libswscale" -echocheck "libamr narrowband" -if test "$_libamr_nb" = auto ; then - _libamr_nb=no +echocheck "libopencore_amr narrowband" +if test "$_libopencore_amrnb" = auto ; then + _libopencore_amrnb=no cat > $TMPC << EOF -#include -int main(void) { Speech_Decode_Frame_init(); return 0; } +#include +int main(void) { Decoder_Interface_init(); return 0; } EOF - cc_check -lamrnb && _libamr_nb=yes + cc_check -lopencore-amrnb && _libopencore_amrnb=yes if test "$_libavcodec_a" != yes ; then - _libamr_nb=no - _res_comment="libavcodec (static) is required by libamr_nb, sorry" + _libopencore_amrnb=no + _res_comment="libavcodec (static) is required by libopencore_amrnb, sorry" fi fi -if test "$_libamr_nb" = yes ; then - _libamr=yes - extra_ldflags="$extra_ldflags -lamrnb" - def_libamr='#define CONFIG_LIBAMR 1' - def_libamr_nb='#define CONFIG_LIBAMR_NB 1' - _libavdecoders="$_libavdecoders LIBAMR_NB_DECODER" - _libavencoders="$_libavencoders LIBAMR_NB_ENCODER" - _codecmodules="libamr_nb $_codecmodules" +if test "$_libopencore_amrnb" = yes ; then + _libopencore_amr=yes + extra_ldflags="$extra_ldflags -lopencore-amrnb" + def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1' + _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER" + _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_DECODER" + _codecmodules="libopencore_amrnb $_codecmodules" else - def_libamr_nb='#define CONFIG_LIBAMR_NB 0' - _nocodecmodules="libamr_nb $_nocodecmodules" + def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0' + _nocodecmodules="libopencore_amrnb $_nocodecmodules" fi -echores "$_libamr_nb" +echores "$_libopencore_amrnb" -echocheck "libamr wideband" -if test "$_libamr_wb" = auto ; then - _libamr_wb=no +echocheck "libopencore_amr wideband" +if test "$_libopencore_amrwb" = auto ; then + _libopencore_amrwb=no cat > $TMPC << EOF -#include +#include int main(void) { D_IF_init(); return 0; } EOF - cc_check -lamrwb && _libamr_wb=yes + cc_check -lopencore-amrwb && _libopencore_amrwb=yes if test "$_libavcodec_a" != yes ; then - _libamr_wb=no - _res_comment="libavcodec (static) is required by libamr_wb, sorry" + _libopencore_amrwb=no + _res_comment="libavcodec (static) is required by libopencore_amrwb, sorry" fi fi -if test "$_libamr_wb" = yes ; then - _libamr=yes - extra_ldflags="$extra_ldflags -lamrwb" - def_libamr='#define CONFIG_LIBAMR 1' - def_libamr_wb='#define CONFIG_LIBAMR_WB 1' - _libavdecoders="$_libavdecoders LIBAMR_WB_DECODER" - _libavencoders="$_libavencoders LIBAMR_WB_ENCODER" - _codecmodules="libamr_wb $_codecmodules" +if test "$_libopencore_amrwb" = yes ; then + _libopencore_amr=yes + extra_ldflags="$extra_ldflags -lopencore-amrwb" + def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1' + _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER" + _libavencoders="$_libavencoders LIBOPENCORE_AMRWB_DECODER" + _codecmodules="libopencore_amrwb $_codecmodules" else - def_libamr_wb='#define CONFIG_LIBAMR_WB 0' - _nocodecmodules="libamr_wb $_nocodecmodules" + def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0' + _nocodecmodules="libopencore_amrwb $_nocodecmodules" fi -echores "$_libamr_wb" +echores "$_libopencore_amrwb" echocheck "libdv-0.9.5+" if test "$_libdv" = auto ; then @@ -8393,12 +8391,11 @@ CONFIG_RDFT=yes CONFIG_BZLIB=$bzlib CONFIG_ENCODERS=yes CONFIG_GPL=yes -CONFIG_LIBAMR=$_libamr -CONFIG_LIBAMR_NB=$_libamr_nb -CONFIG_LIBAMR_WB=$_libamr_wb CONFIG_LIBDIRAC=$_libdirac_lavc CONFIG_LIBFAAC=$_faac_lavc CONFIG_LIBMP3LAME=$_mp3lame_lavc +CONFIG_LIBOPENCORE_AMRNB=$_libopencore_amrnb +CONFIG_LIBOPENCORE_AMRWB=$_libopencore_amrwb CONFIG_LIBSCHROEDINGER=$_libschroedinger_lavc CONFIG_LIBVORBIS=$_libvorbis CONFIG_LIBX264=$_x264_lavc @@ -8882,10 +8879,9 @@ $def_yasm /* External libraries used through libavcodec. */ $def_faac_lavc -$def_libamr -$def_libamr_nb -$def_libamr_wb $def_libdirac_lavc +$def_libopencore_amrnb +$def_libopencore_amrwb $def_libschroedinger_lavc $def_mp3lame_lavc $def_x264_lavc diff --git a/etc/codecs.conf b/etc/codecs.conf index f5aeee3eea..103955c322 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -3840,7 +3840,7 @@ audiocodec ffamrnb fourcc samr format 0x57 ;amr in avi driver ffmpeg - dll "libamr_nb" + dll "libopencore_amrnb" audiocodec ffamrwb info "AMR Wideband" @@ -3848,7 +3848,7 @@ audiocodec ffamrwb fourcc sawb format 0x58 ;amr in avi driver ffmpeg - dll "libamr_wb" + dll "libopencore_amrwb" audiocodec ffadcpmswf info "FFmpeg's ADPCM Flash-variant" -- cgit v1.2.3 From f6c25fd5c50bf1048f7c280312f6b920fe822edf Mon Sep 17 00:00:00 2001 From: iive Date: Sun, 19 Jul 2009 09:55:29 +0000 Subject: Fix 24bit audio playback. The reordering channels code had reoccurring bug where in switch(samplesize) block the case 3 (3 bytes) doesn't end with break; leading to execution of the next case 4 too. This mangles the already processed data and causes massive memory corruption. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29427 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/reorder_ch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libaf/reorder_ch.c b/libaf/reorder_ch.c index 1ef05f4838..fa0c2373bb 100644 --- a/libaf/reorder_ch.c +++ b/libaf/reorder_ch.c @@ -453,6 +453,7 @@ static int reorder_self_3(void *src, unsigned int samples, src_8[i+s2*3+1] = tmp1; src_8[i+s2*3+2] = tmp2; } + break; } case 4: { @@ -547,6 +548,7 @@ static int reorder_self_4_step_1(void *src, unsigned int samples, src_8[i+s3*3+1] = tmp1; src_8[i+s3*3+2] = tmp2; } + break; } case 4: { @@ -695,6 +697,7 @@ static int reorder_self_5_step_1(void *src, unsigned int samples, src_8[i+s4*3+1] = tmp1; src_8[i+s4*3+2] = tmp2; } + break; } case 4: { @@ -787,6 +790,7 @@ static int reorder_self_2_3(void *src, unsigned int samples, src_8[i+s4*3+1] = tmp1; src_8[i+s4*3+2] = tmp2; } + break; } case 4: { @@ -873,6 +877,7 @@ static int reorder_self_3_3(void *src, unsigned int samples, src_8[i+s5*3+1] = tmp1; src_8[i+s5*3+2] = tmp2; } + break; } case 4: { @@ -959,6 +964,7 @@ static int reorder_self_2_4(void *src, unsigned int samples, src_8[i+s5*3+1] = tmp1; src_8[i+s5*3+2] = tmp2; } + break; } case 4: { -- cgit v1.2.3 From 968a51cfef19c0dd390001de742d775410ef3071 Mon Sep 17 00:00:00 2001 From: iive Date: Sun, 19 Jul 2009 10:26:48 +0000 Subject: Handle 24bit audio formats natively by ALSA. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29428 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 5e848446f2..581fb36c29 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -392,6 +392,18 @@ static int init(int rate_hz, int channels, int format, int flags) case AF_FORMAT_S32_BE: alsa_format = SND_PCM_FORMAT_S32_BE; break; + case AF_FORMAT_U24_LE: + alsa_format = SND_PCM_FORMAT_U24_LE; + break; + case AF_FORMAT_U24_BE: + alsa_format = SND_PCM_FORMAT_U24_BE; + break; + case AF_FORMAT_S24_LE: + alsa_format = SND_PCM_FORMAT_S24_LE; + break; + case AF_FORMAT_S24_BE: + alsa_format = SND_PCM_FORMAT_S24_BE; + break; case AF_FORMAT_FLOAT_LE: alsa_format = SND_PCM_FORMAT_FLOAT_LE; break; -- cgit v1.2.3 From e696ba4ba07fe01886dd91fe96ac0250cd58071c Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 19 Jul 2009 17:03:28 +0000 Subject: The ivtv vo driver and the ivtv VIDIX driver are unrelated; do not disable the VIDIX driver when the ivtv vo driver has been disabled. patch by Martin Dauskardt, martin.dauskardt gmx de git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29429 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 48b15232ad..177a1dce2e 100755 --- a/configure +++ b/configure @@ -4525,7 +4525,6 @@ if test "$_vidix" = yes ; then def_vidix='#define CONFIG_VIDIX 1' _vomodules="cvidix $_vomodules" test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" - test $_ivtv = "yes" || _vidix_drivers=$(echo $_vidix_drivers | sed s/ivtv//) # some vidix drivers are architecture and os specific, discard them elsewhere x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//) -- cgit v1.2.3 From 944f7811c5d85d59a12858286eec3dde0df39180 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 19 Jul 2009 17:05:42 +0000 Subject: Remove redundant ivtv VIDIX driver variable declarations. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29430 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure b/configure index 177a1dce2e..06ea5d1f13 100755 --- a/configure +++ b/configure @@ -4487,8 +4487,6 @@ def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE' _vidix_drv_cyberblade=no def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV' _vidix_drv_ivtv=no -def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV' -_vidix_drv_ivtv=no def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64' _vidix_drv_mach64=no def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA' -- cgit v1.2.3 From b91c49e4b0adee6625314b0a0230b68856c56e07 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 19 Jul 2009 20:59:32 +0000 Subject: Move some variable declarations up to avoid the warnings: vidix/ivtv_vid.c: In function 'ivtv_probe': vidix/ivtv_vid.c:305: warning: ISO C90 forbids mixed declarations and code vidix/ivtv_vid.c: In function 'ivtv_query_fourcc': vidix/ivtv_vid.c:405: warning: ISO C90 forbids mixed declarations and code git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29431 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/ivtv_vid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vidix/ivtv_vid.c b/vidix/ivtv_vid.c index 5cfc7a7e19..16e44928af 100644 --- a/vidix/ivtv_vid.c +++ b/vidix/ivtv_vid.c @@ -231,6 +231,8 @@ int ivtv_probe(int verbose, int force) pciinfo_t lst[MAX_PCI_DEVICES]; int err = 0; unsigned int i, num_pci = 0; + unsigned char yuv_device_number = 48, yuv_device = 48 + fb_number; + char yuv_device_name[] = "/dev/videoXXX\0"; if(verbose) printf(IVTV_MSG"probe\n"); @@ -302,9 +304,6 @@ card_found: } /* Try to find YUV device */ - unsigned char yuv_device_number = 48, yuv_device = 48 + fb_number; - char yuv_device_name[] = "/dev/videoXXX\0"; - do { sprintf(yuv_device_name, "/dev/video%u", yuv_device); yuvdev = open(yuv_device_name, O_RDWR); @@ -399,10 +398,11 @@ int ivtv_get_caps(vidix_capability_t *to) int ivtv_query_fourcc(vidix_fourcc_t *to) { + int supports = 0; + if(ivtv_verbose) printf(IVTV_MSG"query fourcc (%x)\n", to->fourcc); - int supports = 0; switch(to->fourcc) { case IMGFMT_YV12: -- cgit v1.2.3 From bcd7541f4e9d646a140aa9020d4daa64b7764d25 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 19 Jul 2009 21:09:00 +0000 Subject: The Makefile variable names for external libraries in FFmpeg changed. Adapt their names in config.mak, closes Bugzilla #1513. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29432 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 06ea5d1f13..d225730e1e 100755 --- a/configure +++ b/configure @@ -8388,15 +8388,18 @@ CONFIG_RDFT=yes CONFIG_BZLIB=$bzlib CONFIG_ENCODERS=yes CONFIG_GPL=yes -CONFIG_LIBDIRAC=$_libdirac_lavc -CONFIG_LIBFAAC=$_faac_lavc -CONFIG_LIBMP3LAME=$_mp3lame_lavc -CONFIG_LIBOPENCORE_AMRNB=$_libopencore_amrnb -CONFIG_LIBOPENCORE_AMRWB=$_libopencore_amrwb -CONFIG_LIBSCHROEDINGER=$_libschroedinger_lavc -CONFIG_LIBVORBIS=$_libvorbis -CONFIG_LIBX264=$_x264_lavc -CONFIG_LIBXVID=$_xvid_lavc +CONFIG_LIBDIRAC_DECODER=$_libdirac_lavc +CONFIG_LIBDIRAC_ENCODER=$_libdirac_lavc +CONFIG_LIBFAAC_ENCODER=$_faac_lavc +CONFIG_LIBMP3LAME_ENCODER=$_mp3lame_lavc +CONFIG_LIBOPENCORE_AMRNB_DECODER=$_libopencore_amrnb +CONFIG_LIBOPENCORE_AMRNB_ENCODER=$_libopencore_amrnb +CONFIG_LIBOPENCORE_AMRWB_DECODER=$_libopencore_amrwb +CONFIG_LIBSCHROEDINGER_DECODER=$_libschroedinger_lavc +CONFIG_LIBSCHROEDINGER_ENCODER=$_libschroedinger_lavc +CONFIG_LIBVORBIS_ENCODER=$_libvorbis +CONFIG_LIBX264_ENCODER=$_x264_lavc +CONFIG_LIBXVID_ENCODER=$_xvid_lavc CONFIG_MLIB = $_mlib CONFIG_MUXERS=$_mencoder CONFIG_POSTPROC = yes -- cgit v1.2.3 From 4593633f5896bbd7d55a0bbfafc8adbfaa4a62ba Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 19 Jul 2009 21:24:45 +0000 Subject: Bandaid compilation fix: Disable ivtv VIDIX driver until a proper test exists. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29433 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d225730e1e..41cc989538 100755 --- a/configure +++ b/configure @@ -4522,7 +4522,9 @@ echores "$_vidix" if test "$_vidix" = yes ; then def_vidix='#define CONFIG_VIDIX 1' _vomodules="cvidix $_vomodules" - test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" + # FIXME: ivtv driver temporarily disabled until we have a proper test + #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" + test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" # some vidix drivers are architecture and os specific, discard them elsewhere x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//) -- cgit v1.2.3 From dc8bb7837a122ed2cd99adb76c98a59160abc728 Mon Sep 17 00:00:00 2001 From: cladisch Date: Tue, 21 Jul 2009 08:20:22 +0000 Subject: Use correct ALSA sample format for 24-bit samples packed in three bytes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29434 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 581fb36c29..3bb10eddd0 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -393,16 +393,16 @@ static int init(int rate_hz, int channels, int format, int flags) alsa_format = SND_PCM_FORMAT_S32_BE; break; case AF_FORMAT_U24_LE: - alsa_format = SND_PCM_FORMAT_U24_LE; + alsa_format = SND_PCM_FORMAT_U24_3LE; break; case AF_FORMAT_U24_BE: - alsa_format = SND_PCM_FORMAT_U24_BE; + alsa_format = SND_PCM_FORMAT_U24_3BE; break; case AF_FORMAT_S24_LE: - alsa_format = SND_PCM_FORMAT_S24_LE; + alsa_format = SND_PCM_FORMAT_S24_3LE; break; case AF_FORMAT_S24_BE: - alsa_format = SND_PCM_FORMAT_S24_BE; + alsa_format = SND_PCM_FORMAT_S24_3BE; break; case AF_FORMAT_FLOAT_LE: alsa_format = SND_PCM_FORMAT_FLOAT_LE; -- cgit v1.2.3 From 3490d7cbfa13ae61720dbba47105ec92f0d6262f Mon Sep 17 00:00:00 2001 From: ramiro Date: Tue, 21 Jul 2009 20:17:15 +0000 Subject: Remove unused variables. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29435 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 3 --- libswscale/swscale_internal.h | 1 - 2 files changed, 4 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 31cf36ae05..64c4e2b63e 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2683,9 +2683,6 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d c->param[1] = SWS_PARAM_DEFAULT; } - c->chrIntHSubSample= c->chrDstHSubSample; - c->chrIntVSubSample= c->chrSrcVSubSample; - // Note the -((-x)>>y) is so that we always round toward +inf. c->chrSrcW= -((-srcW) >> c->chrSrcHSubSample); c->chrSrcH= -((-srcH) >> c->chrSrcVSubSample); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 871575e437..50cf304b1f 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -82,7 +82,6 @@ typedef struct SwsContext{ enum PixelFormat dstFormat, srcFormat; ///< format 4:2:0 type is always YV12 int origDstFormat, origSrcFormat; ///< format int chrSrcHSubSample, chrSrcVSubSample; - int chrIntHSubSample, chrIntVSubSample; int chrDstHSubSample, chrDstVSubSample; int vChrDrop; int sliceDir; -- cgit v1.2.3 From b1666a747d6497651d4d7a4684e97902fd0e69c8 Mon Sep 17 00:00:00 2001 From: ptt Date: Wed, 22 Jul 2009 19:32:17 +0000 Subject: grammar and sentence fix git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29436 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/it/mplayer.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOCS/man/it/mplayer.1 b/DOCS/man/it/mplayer.1 index 3d942fee2b..7232894625 100644 --- a/DOCS/man/it/mplayer.1 +++ b/DOCS/man/it/mplayer.1 @@ -1280,7 +1280,7 @@ Disabilita la cache. . .TP .B \-cache\-min -La riproduzione comincerŕ appena la cache verrŕ riempirŕ almeno a +La riproduzione comincerŕ appena la cache sarŕ piena fino alla del totale. . .TP -- cgit v1.2.3 From 623a2c32b98afeff9f513aeb531f250cd719608a Mon Sep 17 00:00:00 2001 From: mru Date: Thu, 23 Jul 2009 15:23:03 +0000 Subject: Remove unnecessary #include git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29437 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 64c4e2b63e..bbeef61dba 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -59,7 +59,6 @@ untested special converters #include #include #include -#include #include "config.h" #include #if HAVE_SYS_MMAN_H -- cgit v1.2.3 From de3d544c4362f04e46f1e85283a3b7d7401229e3 Mon Sep 17 00:00:00 2001 From: cladisch Date: Fri, 24 Jul 2009 10:35:22 +0000 Subject: Use the correct OSS format, where possible, for mplayer's packed 24-bit format (AFMT_x24_xE would be 32-bit aligned). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29438 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_oss.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index 4666c400e9..a28d5d9ad6 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -70,17 +70,8 @@ static int format2oss(int format) case AF_FORMAT_U16_BE: return AFMT_U16_BE; case AF_FORMAT_S16_LE: return AFMT_S16_LE; case AF_FORMAT_S16_BE: return AFMT_S16_BE; -#ifdef AFMT_U24_LE - case AF_FORMAT_U24_LE: return AFMT_U24_LE; -#endif -#ifdef AFMT_U24_BE - case AF_FORMAT_U24_BE: return AFMT_U24_BE; -#endif -#ifdef AFMT_S24_LE - case AF_FORMAT_S24_LE: return AFMT_S24_LE; -#endif -#ifdef AFMT_S24_BE - case AF_FORMAT_S24_BE: return AFMT_S24_BE; +#ifdef AFMT_S24_PACKED + case AF_FORMAT_S24_LE: return AFMT_S24_PACKED; #endif #ifdef AFMT_U32_LE case AF_FORMAT_U32_LE: return AFMT_U32_LE; @@ -122,17 +113,8 @@ static int oss2format(int format) case AFMT_U16_BE: return AF_FORMAT_U16_BE; case AFMT_S16_LE: return AF_FORMAT_S16_LE; case AFMT_S16_BE: return AF_FORMAT_S16_BE; -#ifdef AFMT_U24_LE - case AFMT_U24_LE: return AF_FORMAT_U24_LE; -#endif -#ifdef AFMT_U24_BE - case AFMT_U24_BE: return AF_FORMAT_U24_BE; -#endif -#ifdef AFMT_S24_LE - case AFMT_S24_LE: return AF_FORMAT_S24_LE; -#endif -#ifdef AFMT_S24_BE - case AFMT_S24_BE: return AF_FORMAT_S24_BE; +#ifdef AFMT_S24_PACKED + case AFMT_S24_PACKED: return AF_FORMAT_S24_LE; #endif #ifdef AFMT_U32_LE case AFMT_U32_LE: return AF_FORMAT_U32_LE; -- cgit v1.2.3 From b3186ed071dc514391e06e85e9dd6c96d1295aea Mon Sep 17 00:00:00 2001 From: mru Date: Sun, 26 Jul 2009 12:26:32 +0000 Subject: Replace WORDS_BIGENDIAN with HAVE_BIGENDIAN git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29439 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/rgb2rgb.c | 8 ++++---- libswscale/rgb2rgb_template.c | 12 ++++++------ libswscale/swscale.c | 9 ++++----- libswscale/swscale_internal.h | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c index 59b8e30a63..7aeb2a3ac2 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -275,7 +275,7 @@ void rgb32to24(const uint8_t *src, uint8_t *dst, long src_size) long num_pixels = src_size >> 2; for (i=0; i BGR24 (= B,G,R) */ dst[3*i + 0] = src[4*i + 1]; dst[3*i + 1] = src[4*i + 2]; @@ -293,7 +293,7 @@ void rgb24to32(const uint8_t *src, uint8_t *dst, long src_size) long i; for (i=0; 3*i BGR32 (= A,R,G,B) */ dst[4*i + 0] = 255; dst[4*i + 1] = src[3*i + 0]; @@ -318,7 +318,7 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size) { register uint16_t bgr; bgr = *s++; - #ifdef WORDS_BIGENDIAN + #if HAVE_BIGENDIAN *d++ = 255; *d++ = (bgr&0x1F)<<3; *d++ = (bgr&0x7E0)>>3; @@ -382,7 +382,7 @@ void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size) { register uint16_t bgr; bgr = *s++; - #ifdef WORDS_BIGENDIAN + #if HAVE_BIGENDIAN *d++ = 255; *d++ = (bgr&0x1F)<<3; *d++ = (bgr&0x3E0)>>2; diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c index 56c9426430..cd7fbae292 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -115,7 +115,7 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long s #endif while (s < end) { - #ifdef WORDS_BIGENDIAN + #if HAVE_BIGENDIAN /* RGB24 (= R,G,B) -> RGB32 (= A,B,G,R) */ *dest++ = 255; *dest++ = s[2]; @@ -201,7 +201,7 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long s #endif while (s < end) { -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN /* RGB32 (= A,B,G,R) -> RGB24 (= R,G,B) */ s++; dest[2] = *s++; @@ -1264,7 +1264,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_ #else register uint16_t bgr; bgr = *s++; -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN *d++ = 255; *d++ = (bgr&0x7C00)>>7; *d++ = (bgr&0x3E0)>>2; @@ -1321,7 +1321,7 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_ { register uint16_t bgr; bgr = *s++; -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN *d++ = 255; *d++ = (bgr&0xF800)>>8; *d++ = (bgr&0x7E0)>>3; @@ -1581,7 +1581,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u int i, *idst = (int32_t *) dst; const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; for (i = 0; i < chromWidth; i++){ -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN *idst++ = (yc[0] << 24)+ (uc[0] << 16) + (yc[1] << 8) + (vc[0] << 0); #else @@ -1687,7 +1687,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u int i, *idst = (int32_t *) dst; const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc; for (i = 0; i < chromWidth; i++){ -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN *idst++ = (uc[0] << 24)+ (yc[0] << 16) + (vc[0] << 8) + (yc[1] << 0); #else diff --git a/libswscale/swscale.c b/libswscale/swscale.c index bbeef61dba..b1592dadf8 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -89,7 +89,6 @@ unsigned swscale_version(void) //#define HAVE_AMD3DNOW //#undef HAVE_MMX //#undef ARCH_X86 -//#define WORDS_BIGENDIAN #define DITHER1XBPP #define FAST_BGR2YV12 // use 7 bit coefficients instead of 15 bit @@ -3161,25 +3160,25 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, switch(c->dstFormat) { case PIX_FMT_BGR32: -#ifndef WORDS_BIGENDIAN +#if !HAVE_BIGENDIAN case PIX_FMT_RGB24: #endif c->pal_rgb[i]= r + (g<<8) + (b<<16); break; case PIX_FMT_BGR32_1: -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN case PIX_FMT_BGR24: #endif c->pal_rgb[i]= (r + (g<<8) + (b<<16)) << 8; break; case PIX_FMT_RGB32_1: -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN case PIX_FMT_RGB24: #endif c->pal_rgb[i]= (b + (g<<8) + (r<<16)) << 8; break; case PIX_FMT_RGB32: -#ifndef WORDS_BIGENDIAN +#if !HAVE_BIGENDIAN case PIX_FMT_BGR24: #endif default: diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 50cf304b1f..85e07c0af1 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -41,7 +41,7 @@ #define VOF (VOFW*2) -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN #define ALT32_CORR (-1) #else #define ALT32_CORR 1 -- cgit v1.2.3 From 06c122f00190a40969501ad7bc79c4b7d095136a Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sun, 26 Jul 2009 14:40:05 +0000 Subject: Replace WORDS_BIGENDIAN with HAVE_BIGENDIAN. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29440 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 41cc989538..24eb4b4c64 100755 --- a/configure +++ b/configure @@ -2361,10 +2361,10 @@ EOF fi if test "$_big_endian" = yes ; then _byte_order='big-endian' - def_words_endian='#define WORDS_BIGENDIAN 1' + def_words_endian='#define HAVE_BIGENDIAN 1' else _byte_order='little-endian' - def_words_endian='#undef WORDS_BIGENDIAN' + def_words_endian='#define HAVE_BIGENDIAN 0' fi echores "$_byte_order" -- cgit v1.2.3 From f9dcd2a235817781fefdbd1eda809b4d3386e4f0 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 26 Jul 2009 17:43:06 +0000 Subject: Set both HAVE_BIGENDIAN and WORDS_BIGENDIAN. Both definitions are used in different places. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29441 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 24eb4b4c64..1795e08d68 100755 --- a/configure +++ b/configure @@ -2361,10 +2361,12 @@ EOF fi if test "$_big_endian" = yes ; then _byte_order='big-endian' - def_words_endian='#define HAVE_BIGENDIAN 1' + def_words_endian='#define WORDS_BIGENDIAN 1' + def_bigendian='#define HAVE_BIGENDIAN 1' else _byte_order='little-endian' - def_words_endian='#define HAVE_BIGENDIAN 0' + def_words_endian='#undef WORDS_BIGENDIAN' + def_bigendian='#define HAVE_BIGENDIAN 0' fi echores "$_byte_order" @@ -8582,6 +8584,7 @@ $def_pthread_cache /* CPU stuff */ #define __CPU__ $iproc $def_words_endian +$def_bigendian $(ff_config_enable "$_arch_all" "$_arch" "ARCH") $(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE") -- cgit v1.2.3 From c242fdbfd9242873aae85be9f841f1f3caf9633f Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 26 Jul 2009 19:38:22 +0000 Subject: Make diff apply cleanly to our tree again. The GPL modification notices were dropped, same as for the other diffs we store. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29442 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libfaad2/local_changes.diff | 96 ++++++--------------------------------------- 1 file changed, 12 insertions(+), 84 deletions(-) diff --git a/libfaad2/local_changes.diff b/libfaad2/local_changes.diff index 56d584093e..11610c6e8a 100644 --- a/libfaad2/local_changes.diff +++ b/libfaad2/local_changes.diff @@ -1,16 +1,5 @@ --- libfaad2.orig/bits.h 2006-03-16 20:15:04.000000000 +0100 +++ libfaad2/bits.h 2006-03-16 20:37:21.000000000 +0100 -@@ -22,7 +22,10 @@ - ** Commercial non-GPL licensing of this software is possible. - ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. - ** -+** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 - ** $Id: bits.h,v 1.40 2004/09/04 14:56:27 menno Exp $ -+** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ -+** local_changes.diff contains the exact changes to this file. - **/ - - #ifndef __BITS_H__ @@ -58,7 +61,7 @@ #if defined (_WIN32) && !defined(_WIN32_WCE) && !defined(__MINGW32__) @@ -22,18 +11,7 @@ #define BSWAP(a) \ --- libfaad2.orig/common.h 2006-03-16 20:15:04.000000000 +0100 +++ libfaad2/common.h 2006-03-16 20:56:56.000000000 +0100 -@@ -22,7 +22,10 @@ - ** Commercial non-GPL licensing of this software is possible. - ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. - ** -+** Initially modified for use with MPlayer by Arpad Gereöffy on 2003/08/30 - ** $Id: common.h,v 1.65 2004/09/08 09:43:11 gcp Exp $ -+** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ -+** local_changes.diff contains the exact changes to this file. - **/ - - #ifndef __COMMON_H__ -@@ -32,8 +35,13 @@ +@@ -32,8 +37,13 @@ #ifdef HAVE_CONFIG_H # include "../config.h" @@ -47,7 +25,7 @@ #define INLINE __inline #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) #define ALIGN __declspec(align(16)) -@@ -61,7 +67,7 @@ +@@ -61,7 +69,7 @@ /* Use if target platform has address generators with autoincrement */ //#define PREFER_POINTERS @@ -56,7 +34,7 @@ #define FIXED_POINT #endif -@@ -117,6 +123,9 @@ +@@ -117,6 +125,9 @@ # ifdef MAIN_DEC # undef MAIN_DEC # endif @@ -66,7 +44,7 @@ #endif // FIXED_POINT #ifdef DRM -@@ -151,6 +160,7 @@ +@@ -151,6 +162,7 @@ #include @@ -74,7 +52,7 @@ typedef unsigned __int64 uint64_t; typedef unsigned __int32 uint32_t; typedef unsigned __int16 uint16_t; -@@ -159,5 +169,9 @@ +@@ -159,5 +171,9 @@ typedef __int32 int32_t; typedef __int16 int16_t; typedef __int8 int8_t; @@ -84,7 +62,7 @@ + typedef float float32_t; -@@ -289,7 +319,7 @@ +@@ -289,7 +305,7 @@ } @@ -93,7 +71,7 @@ #define HAS_LRINTF static INLINE int lrintf(float f) { -@@ -301,7 +331,7 @@ +@@ -301,7 +317,7 @@ } return i; } @@ -102,17 +80,17 @@ #define HAS_LRINTF // from http://www.stereopsis.com/FPU.html static INLINE int lrintf(float f) -@@ -330,7 +360,7 @@ +@@ -330,6 +346,8 @@ #else +#include + -#ifdef HAVE_LRINTF --#if HAVE_LRINTF ++#if HAVE_LRINTF # define HAS_LRINTF # define _ISOC9X_SOURCE 1 -@@ -338,8 +370,6 @@ +@@ -338,8 +356,6 @@ # define __USE_ISOC99 1 #endif @@ -123,20 +101,6 @@ #error --- libfaad2.orig/output.c 2006-03-16 20:15:04.000000000 +0100 +++ libfaad2/output.c 2006-04-18 19:50:26.000000000 +0200 -@@ -19,10 +19,9 @@ - ** Any non-GPL usage of this software or parts of this software is strictly - ** forbidden. - ** --** Commercial non-GPL licensing of this software is possible. --** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. --** --** $Id: output.c,v 1.42 2004/09/04 14:56:28 menno Exp $ -+** Initially modified for use with MPlayer by Rich Felker on 2005/03/29 -+** $Id: output.c,v 1.11 2005/04/05 05:43:41 rfelker Exp $ -+** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ - **/ - - #include "common.h" @@ -463,7 +462,7 @@ } } @@ -200,17 +164,6 @@ #endif --- libfaad2.orig/ps_dec.c 2006-03-16 20:15:04.000000000 +0100 +++ libfaad2/ps_dec.c 2006-04-18 20:29:38.000000000 +0200 -@@ -22,7 +22,10 @@ - ** Commercial non-GPL licensing of this software is possible. - ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. - ** -+** Initially modified for use with MPlayer on 2005/12/05 - ** $Id: ps_dec.c,v 1.10 2004/09/04 14:56:28 menno Exp $ -+** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ -+** local_changes.diff contains the exact changes to this file. - **/ - - #include "common.h" @@ -159,7 +162,7 @@ /* static function declarations */ @@ -242,17 +195,6 @@ ps_data_decode(ps); --- libfaad2.orig/sbr_dec.c 2006-03-16 20:15:04.000000000 +0100 +++ libfaad2/sbr_dec.c 2006-04-18 20:33:57.000000000 +0200 -@@ -22,7 +22,10 @@ - ** Commercial non-GPL licensing of this software is possible. - ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. - ** -+** Initially modified for use with MPlayer on 2005/12/05 - ** $Id: sbr_dec.c,v 1.39 2004/09/04 14:56:28 menno Exp $ -+** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ -+** local_changes.diff contains the exact changes to this file. - **/ - - @@ -526,8 +529,8 @@ uint8_t l, k; uint8_t dont_process = 0; @@ -266,20 +208,6 @@ return 20; --- libfaad2.orig/specrec.c 2006-03-16 20:15:04.000000000 +0100 +++ libfaad2/specrec.c 2006-04-18 20:38:09.000000000 +0200 -@@ -19,10 +19,10 @@ - ** Any non-GPL usage of this software or parts of this software is strictly - ** forbidden. - ** --** Commercial non-GPL licensing of this software is possible. --** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. --** -+** Initially modified for use with MPlayer on 2006/04/18 - ** $Id: specrec.c,v 1.56 2004/09/08 09:43:11 gcp Exp $ -+** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ -+** local_changes.diff contains the exact changes to this file. - **/ - - /* @@ -673,29 +673,19 @@ /* MAIN object type prediction */ if (hDecoder->object_type == MAIN) @@ -386,7 +314,7 @@ retval = allocate_single_channel(hDecoder, sce->channel, output_channels); if (retval > 0) return retval; -@@ -1026,11 +994,10 @@ +@@ -1026,11 +995,10 @@ { return 23; } @@ -399,7 +327,7 @@ { uint8_t ele = hDecoder->fr_ch_ele; uint8_t ch = sce->channel; -@@ -1040,6 +1007,7 @@ +@@ -1040,6 +1008,7 @@ memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size); } #endif -- cgit v1.2.3 From e5751ced4f16fe75f835b70e37ecf48a2032506b Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 26 Jul 2009 19:53:00 +0000 Subject: Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/colorspaces.txt | 2 +- gui/bitmap.c | 2 +- gui/wm/ws.c | 2 +- liba52/bitstream.h | 2 +- liba52/liba52_changes.diff | 2 +- libaf/af_format.c | 4 ++-- libaf/af_format.h | 4 ++-- libaf/af_lavcac3enc.c | 2 +- libao2/ao_alsa.c | 4 ++-- libao2/ao_alsa5.c | 4 ++-- libao2/ao_coreaudio.c | 4 ++-- libao2/ao_dxr2.c | 2 +- libao2/ao_oss.c | 2 +- libao2/ao_pcm.c | 2 +- libfaad2/common.h | 2 +- libfaad2/local_changes.diff | 9 +++++++++ libmpcodecs/ad_hwac3.c | 4 ++-- libmpcodecs/img_format.h | 2 +- libmpcodecs/vd_ffmpeg.c | 2 +- libmpcodecs/vf.c | 2 +- libmpcodecs/vf_scale.c | 2 +- libmpdemux/asf.h | 6 +++--- libmpdemux/aviheader.h | 4 ++-- libmpdemux/demux_xmms.c | 2 +- libmpdemux/demuxer.h | 2 +- libmpdemux/ms_hdr.h | 2 +- libvo/osd_template.c | 2 +- libvo/vo_svga.c | 2 +- libvo/vo_tga.c | 2 +- libvo/vo_x11.c | 4 ++-- mp3lib/decod386.c | 4 ++-- stream/stream_cdda.c | 2 +- tremor/misc.h | 2 +- tremor/tremor.diff | 2 +- vidix/radeon_vid.c | 2 +- 35 files changed, 54 insertions(+), 45 deletions(-) diff --git a/DOCS/tech/colorspaces.txt b/DOCS/tech/colorspaces.txt index dc00fd388d..291a435f30 100644 --- a/DOCS/tech/colorspaces.txt +++ b/DOCS/tech/colorspaces.txt @@ -154,5 +154,5 @@ order followed by the number 32, the portable way to access it is to load the pixel into an integer and use bitmasks. When the above portable access methods are not used, you will need to write -2 versions of your code, and use #ifdef WORDS_BIGENDIAN to choose the correct +2 versions of your code, and use #if HAVE_BIGENDIAN to choose the correct one. diff --git a/gui/bitmap.c b/gui/bitmap.c index 6cf7d35d60..148998865a 100644 --- a/gui/bitmap.c +++ b/gui/bitmap.c @@ -108,7 +108,7 @@ static int conv24to32( txSample * bf ) static void Normalize( txSample * bf ) { int i; -#ifndef WORDS_BIGENDIAN +#if !HAVE_BIGENDIAN for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0; #else for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i]=0; diff --git a/gui/wm/ws.c b/gui/wm/ws.c index 27749be53b..8133baab09 100644 --- a/gui/wm/ws.c +++ b/gui/wm/ws.c @@ -1082,7 +1082,7 @@ int wsGetDepthOnScreen( void ) wsRedMask=mXImage->red_mask; wsGreenMask=mXImage->green_mask; wsBlueMask=mXImage->blue_mask; -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN wsNonNativeOrder = mXImage->byte_order == LSBFirst; #else wsNonNativeOrder = mXImage->byte_order == MSBFirst; diff --git a/liba52/bitstream.h b/liba52/bitstream.h index e894f16781..76f5556ea9 100644 --- a/liba52/bitstream.h +++ b/liba52/bitstream.h @@ -62,7 +62,7 @@ static inline uint32_t unaligned32(const void *v) { #endif /* (stolen from the kernel) */ -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN # define swab32(x) (x) diff --git a/liba52/liba52_changes.diff b/liba52/liba52_changes.diff index 1b3574f043..e44b84a84d 100644 --- a/liba52/liba52_changes.diff +++ b/liba52/liba52_changes.diff @@ -116,7 +116,7 @@ +#endif + /* (stolen from the kernel) */ - #ifdef WORDS_BIGENDIAN + #if HAVE_BIGENDIAN @@ -28,7 +68,7 @@ diff --git a/libaf/af_format.c b/libaf/af_format.c index faeae02efc..64acbbb9b6 100644 --- a/libaf/af_format.c +++ b/libaf/af_format.c @@ -332,7 +332,7 @@ af_info_t af_info_format = { }; static inline uint32_t load24bit(void* data, int pos) { -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN return (((uint32_t)((uint8_t*)data)[3*pos])<<24) | (((uint32_t)((uint8_t*)data)[3*pos+1])<<16) | (((uint32_t)((uint8_t*)data)[3*pos+2])<<8); @@ -344,7 +344,7 @@ static inline uint32_t load24bit(void* data, int pos) { } static inline void store24bit(void* data, int pos, uint32_t expanded_value) { -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN ((uint8_t*)data)[3*pos]=expanded_value>>24; ((uint8_t*)data)[3*pos+1]=expanded_value>>16; ((uint8_t*)data)[3*pos+2]=expanded_value>>8; diff --git a/libaf/af_format.h b/libaf/af_format.h index 553d18d962..66a74c901e 100644 --- a/libaf/af_format.h +++ b/libaf/af_format.h @@ -30,7 +30,7 @@ #define AF_FORMAT_LE (1<<0) // Little Endian #define AF_FORMAT_END_MASK (1<<0) -#ifdef WORDS_BIGENDIAN // Native endian of cpu +#if HAVE_BIGENDIAN // Native endian of cpu #define AF_FORMAT_NE AF_FORMAT_BE #else #define AF_FORMAT_NE AF_FORMAT_LE @@ -83,7 +83,7 @@ #define AF_FORMAT_FLOAT_LE (AF_FORMAT_F|AF_FORMAT_32BIT|AF_FORMAT_LE) #define AF_FORMAT_FLOAT_BE (AF_FORMAT_F|AF_FORMAT_32BIT|AF_FORMAT_BE) -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN #define AF_FORMAT_U16_NE AF_FORMAT_U16_BE #define AF_FORMAT_S16_NE AF_FORMAT_S16_BE #define AF_FORMAT_U24_NE AF_FORMAT_U24_BE diff --git a/libaf/af_lavcac3enc.c b/libaf/af_lavcac3enc.c index 36a19dad60..f89302f4a6 100644 --- a/libaf/af_lavcac3enc.c +++ b/libaf/af_lavcac3enc.c @@ -238,7 +238,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data) int16_t *out = (int16_t *)buf; int bsmod = dest[5] & 0x7; -#ifndef WORDS_BIGENDIAN +#if !HAVE_BIGENDIAN int i; char tmp; for (i = 0; i < len; i += 2) { diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 3bb10eddd0..cc80b0ded3 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -368,13 +368,13 @@ static int init(int rate_hz, int channels, int format, int flags) case AF_FORMAT_U16_BE: alsa_format = SND_PCM_FORMAT_U16_BE; break; -#ifndef WORDS_BIGENDIAN +#if !HAVE_BIGENDIAN case AF_FORMAT_AC3: #endif case AF_FORMAT_S16_LE: alsa_format = SND_PCM_FORMAT_S16_LE; break; -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN case AF_FORMAT_AC3: #endif case AF_FORMAT_S16_BE: diff --git a/libao2/ao_alsa5.c b/libao2/ao_alsa5.c index feb2919f1d..96c951a92a 100644 --- a/libao2/ao_alsa5.c +++ b/libao2/ao_alsa5.c @@ -101,13 +101,13 @@ static int init(int rate_hz, int channels, int format, int flags) case AF_FORMAT_U16_BE: alsa_format.format = SND_PCM_SFMT_U16_BE; break; -#ifndef WORDS_BIGENDIAN +#if !HAVE_BIGENDIAN case AF_FORMAT_AC3: #endif case AF_FORMAT_S16_LE: alsa_format.format = SND_PCM_SFMT_S16_LE; break; -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN case AF_FORMAT_AC3: #endif case AF_FORMAT_S16_BE: diff --git a/libao2/ao_coreaudio.c b/libao2/ao_coreaudio.c index 76cb9174be..ad17773fbd 100644 --- a/libao2/ao_coreaudio.c +++ b/libao2/ao_coreaudio.c @@ -345,7 +345,7 @@ int b_alive; } if ((format & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_AC3) { // Currently ac3 input (comes from hwac3) is always in native byte-order. -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN inDesc.mFormatFlags |= kAudioFormatFlagIsBigEndian; #endif } @@ -669,7 +669,7 @@ static int OpenSPDIF(void) /* FIXME: If output stream is not native byte-order, we need change endian somewhere. */ /* Although there's no such case reported. */ -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN if (!(ao->stream_format.mFormatFlags & kAudioFormatFlagIsBigEndian)) #else if (ao->stream_format.mFormatFlags & kAudioFormatFlagIsBigEndian) diff --git a/libao2/ao_dxr2.c b/libao2/ao_dxr2.c index 136efd1a9e..1a0a3e6135 100644 --- a/libao2/ao_dxr2.c +++ b/libao2/ao_dxr2.c @@ -207,7 +207,7 @@ static int play(void* data,int len,int flags){ int i; //unsigned short *s=data; uint16_t *s=data; -#ifndef WORDS_BIGENDIAN +#if !HAVE_BIGENDIAN for(i=0;ia_in_buffer[5] & 0x7) << 8; // bsmod buf16[3] = len << 3; // number of bits in payload -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN memcpy(buf + 8, sh_audio->a_in_buffer, len); #else swab(sh_audio->a_in_buffer, buf + 8, len); @@ -524,7 +524,7 @@ static int decode_audio_dts(unsigned char *indata_ptr, int len, unsigned char *b buf16[3] = fsize << 3; if (!convert_16bits) { -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN /* BE stream */ if (indata_ptr[0] == 0x1f || indata_ptr[0] == 0x7f) #else diff --git a/libmpcodecs/img_format.h b/libmpcodecs/img_format.h index 3922fdc5f3..559501fb89 100644 --- a/libmpcodecs/img_format.h +++ b/libmpcodecs/img_format.h @@ -25,7 +25,7 @@ #define IMGFMT_BGR24 (IMGFMT_BGR|24) #define IMGFMT_BGR32 (IMGFMT_BGR|32) -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN #define IMGFMT_ABGR IMGFMT_RGB32 #define IMGFMT_BGRA (IMGFMT_RGB32|64) #define IMGFMT_ARGB IMGFMT_BGR32 diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 244e6495b3..68e7c3aa17 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -896,7 +896,7 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){ mpi->stride[2]*=2; } -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN // FIXME: this might cause problems for buffers with FF_BUFFER_HINTS_PRESERVE if (mpi->bpp == 8) swap_palette(mpi->planes[1]); diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 08d0b130c1..6192ffda20 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -233,7 +233,7 @@ void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){ unsigned int* p=(unsigned int*) dst; int size=(mpi->bpp>>3)*w/4; int i; -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN #define CLEAR_PACKEDYUV_PATTERN 0x00800080 #define CLEAR_PACKEDYUV_PATTERN_SWAPPED 0x80008000 #else diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index 6c741cfad9..ccd0c1c96e 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -322,7 +322,7 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){ 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 +#if HAVE_BIGENDIAN uint32_t pal2[256]; if (src[1] && !src[2]){ int i; diff --git a/libmpdemux/asf.h b/libmpdemux/asf.h index b8cd4374ff..a1e29a942f 100644 --- a/libmpdemux/asf.h +++ b/libmpdemux/asf.h @@ -19,7 +19,7 @@ #ifndef MPLAYER_ASF_H #define MPLAYER_ASF_H -//#include "config.h" /* for WORDS_BIGENDIAN */ +//#include "config.h" /* for HAVE_BIGENDIAN */ #include #include "libavutil/common.h" #include "mpbswap.h" @@ -105,7 +105,7 @@ typedef struct __attribute__((packed)) { } ASF_stream_chunck_t; // Definition of the stream type -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN #define ASF_STREAMING_CLEAR 0x2443 // $C #define ASF_STREAMING_DATA 0x2444 // $D #define ASF_STREAMING_END_TRANS 0x2445 // $E @@ -140,7 +140,7 @@ typedef struct { * Some macros to swap little endian structures read from an ASF file * into machine endian format */ -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN #define le2me_ASF_obj_header_t(h) { \ (h)->size = le2me_64((h)->size); \ } diff --git a/libmpdemux/aviheader.h b/libmpdemux/aviheader.h index 0dd915fc5d..a06ef711ac 100644 --- a/libmpdemux/aviheader.h +++ b/libmpdemux/aviheader.h @@ -21,7 +21,7 @@ #include #include -#include "config.h" /* get correct definition of WORDS_BIGENDIAN */ +#include "config.h" /* get correct definition of HAVE_BIGENDIAN */ #include "libavutil/common.h" #include "mpbswap.h" @@ -227,7 +227,7 @@ typedef enum { * Some macros to swap little endian structures read from an AVI file * into machine endian format */ -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN #define le2me_MainAVIHeader(h) { \ (h)->dwMicroSecPerFrame = le2me_32((h)->dwMicroSecPerFrame); \ (h)->dwMaxBytesPerSec = le2me_32((h)->dwMaxBytesPerSec); \ diff --git a/libmpdemux/demux_xmms.c b/libmpdemux/demux_xmms.c index 9263621a0b..8edbc2fe28 100644 --- a/libmpdemux/demux_xmms.c +++ b/libmpdemux/demux_xmms.c @@ -101,7 +101,7 @@ static int disk_open(AFormat fmt, int rate, int nch) { xmms_afmt=AF_FORMAT_U16_LE; break; case FMT_U16_NE: -#ifdef WORDS_BIGENDIAN +#if HAVE_BIGENDIAN xmms_afmt=AF_FORMAT_U16_BE; #else