From 4c3fe04bd390f55ec285135cbab66f01ecc6f766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 10 Jul 2009 14:34:11 +0000 Subject: [PATCH] * More cleanup and removal of code duplication in the Jamfiles. Moved the HAIKU_FFMPEG_DEFINES and friends to the toplevel ffmpeg Jamfile. * Define the X86 CPU acceleration features in global Jamfile variables, so that we can build specific source files depending on those defines later (used for libavcodec_x86.a). * In config.h, a whole bunch of parsers were defined off, which was the actual reason why plain old .MPG files and also my .MTS streams with H.264 video gave only scrambled video. * Removed some files from the build by comparing which files are build by a pristine FFmpeg libavcodec Makefile. Attention: The following changes may break the GCC2 build: * Remove Haiku specific changes from - libavcodec/x86/cavsdsp_mmx.c - libavcodec/x86/dsputil_mmx.c - libavcodec/x86/h264dsp_mmx.c I will test this next after switching my GCC. If you are impatiant, the following changes were previously done to the pristine FFmpeg 0.5 files: libavcodec/x86/cavsdsp_mmx.c: * commented out line 426 to 429 libavcodec/x86/h264dsp_mmx.c * h264_loop_filter_strength_mmx2() was commented out. libavcodec/x86/dsputil_mmx.c * gmc_mmx() was commented out. * commented out line 2665 (assigning c->gmc) * commented out line 2786 (assigning c->h264_loop_filter_strength) However, I would now make similar changes by checking the GCC version. Also, the libavcodec/x86/dsputil_mmx.c:2786 was still assigning the dummy h264_loop_filter_strength_mmx2() version. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31506 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/media/plugins/ffmpeg/Jamfile | 51 +++++++++++ src/add-ons/media/plugins/ffmpeg/config.h | 40 ++++----- .../media/plugins/ffmpeg/libavcodec/Jamfile | 50 ++--------- .../plugins/ffmpeg/libavcodec/internal.h | 1 - .../plugins/ffmpeg/libavcodec/ppc/Jamfile | 7 +- .../plugins/ffmpeg/libavcodec/sparc/Jamfile | 7 +- .../plugins/ffmpeg/libavcodec/x86/Jamfile | 85 ++++++++++++------- .../ffmpeg/libavcodec/x86/cavsdsp_mmx.c | 2 - .../ffmpeg/libavcodec/x86/dsputil_mmx.c | 9 +- .../ffmpeg/libavcodec/x86/h264dsp_mmx.c | 7 -- .../media/plugins/ffmpeg/libavformat/Jamfile | 35 +------- .../media/plugins/ffmpeg/libavutil/Jamfile | 9 +- .../media/plugins/ffmpeg/libswscale/Jamfile | 36 ++------ 13 files changed, 153 insertions(+), 186 deletions(-) diff --git a/src/add-ons/media/plugins/ffmpeg/Jamfile b/src/add-ons/media/plugins/ffmpeg/Jamfile index c7f8060e7b..90f2c4e401 100644 --- a/src/add-ons/media/plugins/ffmpeg/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/Jamfile @@ -32,6 +32,57 @@ Addon ffmpeg : $(TARGET_LIBSUPC++) ; +# FFmpeg libs configuration is in the config.h header. Architecture specific +# defines have been commented out there and are being defined here instead. +# NOTE: These are intentionally global variables, so we can re-use them in +# sub-folders. +HAIKU_FFMPEG_DEFINES = HAVE_AV_CONFIG_H _FILE_OFFSET_BITS=64 + _LARGEFILE_SOURCE ; +HAIKU_FFMPEG_USE_MMX = 1 ; +HAIKU_FFMPEG_USE_MMX2 = 1 ; +HAIKU_FFMPEG_USE_SSE = 0 ; +HAIKU_FFMPEG_USE_SSSE3 = 1 ; +HAIKU_FFMPEG_USE_AMD3DNOW = 0 ; +HAIKU_FFMPEG_USE_AMD3DNOWEXT = 0 ; +HAIKU_FFMPEG_GCC_EXTRA_FLAGS = ; +if $(HAIKU_GCC_VERSION[1]) >= 3 { + HAIKU_FFMPEG_GCC_EXTRA_FLAGS = -fomit-frame-pointer -fno-pic ; +} else { + HAIKU_FFMPEG_GCC_EXTRA_FLAGS = -fomit-frame-pointer -DPIC ; +} + +if $(TARGET_ARCH) = x86 { + HAIKU_FFMPEG_DEFINES += ARCH_X86=1 ARCH_X86_32=1 ; + HAIKU_FFMPEG_DEFINES += ARCH_PPC=0 ; + HAIKU_FFMPEG_DEFINES += ARCH_SPARC=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=$(HAIKU_FFMPEG_USE_AMD3DNOW) ; + HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOWEXT=$(HAIKU_FFMPEG_USE_AMD3DNOWEXT) ; + HAIKU_FFMPEG_DEFINES += HAVE_MMX=$(HAIKU_FFMPEG_USE_MMX) ; + HAIKU_FFMPEG_DEFINES += HAVE_MMX2=$(HAIKU_FFMPEG_USE_MMX2) ; + HAIKU_FFMPEG_DEFINES += HAVE_SSE=$(HAIKU_FFMPEG_USE_SSE) ; + HAIKU_FFMPEG_DEFINES += HAVE_SSSE3=$(HAIKU_FFMPEG_USE_SSSE3) ; + HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_VIS=0 ; +} else if $(TARGET_ARCH) = ppc { + HAIKU_FFMPEG_DEFINES += ARCH_X86=0 ARCH_X86_32=0 ; + HAIKU_FFMPEG_DEFINES += ARCH_PPC=1 ; + HAIKU_FFMPEG_DEFINES += ARCH_SPARC=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=1 ; + HAIKU_FFMPEG_DEFINES += HAVE_VIS=0 ; +} else if $(TARGET_ARCH) = sparc { + HAIKU_FFMPEG_DEFINES += ARCH_X86=0 ARCH_X86_32=0 ; + HAIKU_FFMPEG_DEFINES += ARCH_PPC=0 ; + HAIKU_FFMPEG_DEFINES += ARCH_SPARC=1 ; + HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=0 ; + HAIKU_FFMPEG_DEFINES += HAVE_VIS=1 ; +} + +HAIKU_FFMPEG_DEFINES = [ FDefines $(HAIKU_FFMPEG_DEFINES) ] ; + SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavcodec ; SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavformat ; SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavutil ; diff --git a/src/add-ons/media/plugins/ffmpeg/config.h b/src/add-ons/media/plugins/ffmpeg/config.h index 039fc1b0f9..59dbdd00f9 100644 --- a/src/add-ons/media/plugins/ffmpeg/config.h +++ b/src/add-ons/media/plugins/ffmpeg/config.h @@ -95,7 +95,7 @@ #define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_SOUNDCARD_H 0 #define HAVE_SYS_VIDEOIO_H 0 -#define HAVE_TEN_OPERANDS 0 +#define HAVE_TEN_OPERANDS 1 #define HAVE_TERMIOS_H 1 #define HAVE_THREADS 1 #define HAVE_TRUNCF 1 @@ -485,25 +485,25 @@ #define CONFIG_LIBVORBIS_ENCODER 0 #define CONFIG_LIBX264_ENCODER 0 #define CONFIG_LIBXVID_ENCODER 0 -#define CONFIG_AAC_PARSER 0 -#define CONFIG_AC3_PARSER 0 -#define CONFIG_CAVSVIDEO_PARSER 0 -#define CONFIG_DCA_PARSER 0 -#define CONFIG_DIRAC_PARSER 0 -#define CONFIG_DNXHD_PARSER 0 -#define CONFIG_DVBSUB_PARSER 0 -#define CONFIG_DVDSUB_PARSER 0 -#define CONFIG_H261_PARSER 0 -#define CONFIG_H263_PARSER 0 -#define CONFIG_H264_PARSER 0 -#define CONFIG_MJPEG_PARSER 0 -#define CONFIG_MLP_PARSER 0 -#define CONFIG_MPEG4VIDEO_PARSER 0 -#define CONFIG_MPEGAUDIO_PARSER 0 -#define CONFIG_MPEGVIDEO_PARSER 0 -#define CONFIG_PNM_PARSER 0 -#define CONFIG_VC1_PARSER 0 -#define CONFIG_VP3_PARSER 0 +#define CONFIG_AAC_PARSER 1 +#define CONFIG_AC3_PARSER 1 +#define CONFIG_CAVSVIDEO_PARSER 1 +#define CONFIG_DCA_PARSER 1 +#define CONFIG_DIRAC_PARSER 1 +#define CONFIG_DNXHD_PARSER 1 +#define CONFIG_DVBSUB_PARSER 1 +#define CONFIG_DVDSUB_PARSER 1 +#define CONFIG_H261_PARSER 1 +#define CONFIG_H263_PARSER 1 +#define CONFIG_H264_PARSER 1 +#define CONFIG_MJPEG_PARSER 1 +#define CONFIG_MLP_PARSER 1 +#define CONFIG_MPEG4VIDEO_PARSER 1 +#define CONFIG_MPEGAUDIO_PARSER 1 +#define CONFIG_MPEGVIDEO_PARSER 1 +#define CONFIG_PNM_PARSER 1 +#define CONFIG_VC1_PARSER 1 +#define CONFIG_VP3_PARSER 1 #define CONFIG_DUMP_EXTRADATA_BSF 1 #define CONFIG_H264_MP4TOANNEXB_BSF 1 #define CONFIG_IMX_DUMP_HEADER_BSF 1 diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile b/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile index 38862201bb..dbe4782591 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/Jamfile @@ -11,43 +11,7 @@ UseLibraryHeaders zlib ; TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; -if $(HAIKU_GCC_VERSION[1]) >= 3 { - SubDirCcFlags -fomit-frame-pointer -fno-pic ; -} else { - SubDirCcFlags -fomit-frame-pointer -DPIC ; -} - -# NOTE: This is intentionally a global variable, so we can re-use it in -# sub-folders. -HAIKU_FFMPEG_DEFINES = HAVE_AV_CONFIG_H=1 ; - -if $(TARGET_ARCH) = x86 { - HAIKU_FFMPEG_DEFINES += ARCH_X86=1 ARCH_X86_32=1 ; - HAIKU_FFMPEG_DEFINES += ARCH_PPC=0 ; - HAIKU_FFMPEG_DEFINES += ARCH_SPARC=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_MMX=1 HAVE_MMX2=1 HAVE_SSE=0 HAVE_SSSE3=1 ; - HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_VIS=0 ; -} else if $(TARGET_ARCH) = ppc { - HAIKU_FFMPEG_DEFINES += ARCH_X86=0 ARCH_X86_32=0 ; - HAIKU_FFMPEG_DEFINES += ARCH_PPC=1 ; - HAIKU_FFMPEG_DEFINES += ARCH_SPARC=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=1 ; - HAIKU_FFMPEG_DEFINES += HAVE_VIS=0 ; -} else if $(TARGET_ARCH) = sparc { - HAIKU_FFMPEG_DEFINES += ARCH_X86=0 ARCH_X86_32=0 ; - HAIKU_FFMPEG_DEFINES += ARCH_PPC=0 ; - HAIKU_FFMPEG_DEFINES += ARCH_SPARC=1 ; - HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=0 ; - HAIKU_FFMPEG_DEFINES += HAVE_VIS=1 ; -} - -HAIKU_FFMPEG_DEFINES = [ FDefines $(HAIKU_FFMPEG_DEFINES) ] ; +SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ; SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ; SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ; @@ -100,6 +64,7 @@ StaticLibrary libavcodec.a : dca.c dca_parser.c dirac_parser.c + dnxhd_parser.c dnxhddata.c dnxhddec.c dpcm.c @@ -126,7 +91,7 @@ StaticLibrary libavcodec.a : faandct.c faanidct.c faxcompr.c - fdctref.c +# fdctref.c fft.c ffv1.c flacdec.c @@ -147,7 +112,7 @@ StaticLibrary libavcodec.a : h264.c h264_mp4toannexb_bsf.c h264_parser.c - h264dspenc.c +# h264dspenc.c h264idct.c h264pred.c huffman.c @@ -155,6 +120,7 @@ StaticLibrary libavcodec.a : idcinvideo.c imc.c imgconvert.c + imgresample.c imx_dump_header_bsf.c indeo2.c indeo3.c @@ -172,9 +138,9 @@ StaticLibrary libavcodec.a : # ljpegenc.c loco.c lpc.c - lsp.c +# lsp.c lzw.c - lzwenc.c +# lzwenc.c mace.c mdct.c mdec.c @@ -246,7 +212,7 @@ StaticLibrary libavcodec.a : resample2.c rl2.c rle.c - roqaudioenc.c +# roqaudioenc.c roqvideo.c roqvideodec.c # roqvideoenc.c diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/internal.h b/src/add-ons/media/plugins/ffmpeg/libavcodec/internal.h index e54d7c34e2..0466318acb 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/internal.h +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/internal.h @@ -26,7 +26,6 @@ #include #include "avcodec.h" -#include "libavutil/pixfmt.h" /** * Logs a generic warning message about a missing feature. diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/ppc/Jamfile b/src/add-ons/media/plugins/ffmpeg/libavcodec/ppc/Jamfile index 36cdb31b47..07378f6994 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/ppc/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/ppc/Jamfile @@ -9,15 +9,10 @@ SubDirHdrs [ FDirName $(SUBDIR) ../../libswscale ] ; TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; -if $(HAIKU_GCC_VERSION[1]) >= 3 { - SubDirCcFlags -fomit-frame-pointer -fno-pic ; -} else { - SubDirCcFlags -fomit-frame-pointer -DPIC ; -} - # Enable altivec support SubDirCcFlags -maltivec -mabi=altivec ; +SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ; SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ; SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ; diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/sparc/Jamfile b/src/add-ons/media/plugins/ffmpeg/libavcodec/sparc/Jamfile index f185475284..2cd522796b 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/sparc/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/sparc/Jamfile @@ -9,12 +9,7 @@ SubDirHdrs [ FDirName $(SUBDIR) ../../libswscale ] ; TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; -if $(HAIKU_GCC_VERSION[1]) >= 3 { - SubDirCcFlags -fomit-frame-pointer -fno-pic ; -} else { - SubDirCcFlags -fomit-frame-pointer -DPIC ; -} - +SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ; SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ; SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ; diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile index 19fdb8f68c..bc961e16c1 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/Jamfile @@ -9,39 +9,60 @@ SubDirHdrs [ FDirName $(SUBDIR) ../../libswscale ] ; TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; -if $(HAIKU_GCC_VERSION[1]) >= 3 { - SubDirCcFlags -fomit-frame-pointer -fno-pic ; -} else { - SubDirCcFlags -fomit-frame-pointer -DPIC ; -} - +SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ; SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ; SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ; -StaticLibrary libavcodec_x86.a : - cpuid.c - cavsdsp_mmx.c - idct_mmx.c - idct_mmx_xvid.c - idct_sse2_xvid.c - dsputil_mmx.c -# dsputilenc_mmx.c - fft_3dn.c - fft_3dn2.c - fft_sse.c - h264_idct_sse2.nasm - h264_deblock_sse2.nasm - fft_mmx.nasm - dsputil_yasm.nasm - simple_idct_mmx.c - motion_est_mmx.c - mpegvideo_mmx.c - rv40dsp_mmx.c - vc1dsp_mmx.c - vp3dsp_mmx.c - vp3dsp_sse2.c - vp6dsp_mmx.c - vp6dsp_sse2.c - fdct_mmx.c -; +local mmxSources = ; +if $(HAIKU_FFMPEG_USE_MMX) = 1 { + mmxSources = + cpuid.c + cavsdsp_mmx.c + dsputil_mmx.c +# dsputilenc_mmx.c # For when we enable encoders. + fdct_mmx.c +# idct_mmx.c # GPL + idct_mmx_xvid.c + motion_est_mmx.c + mpegvideo_mmx.c + rv40dsp_mmx.c + simple_idct_mmx.c + vc1dsp_mmx.c + vp3dsp_mmx.c + vp6dsp_mmx.c + fft_mmx.nasm + dsputil_yasm.nasm + ; +} + +local sseSources = ; +#if $(HAIKU_FFMPEG_USE_SSE) = 1 { +if $(HAIKU_FFMPEG_USE_SSSE3) = 1 { + sseSources = + fft_sse.c + idct_sse2_xvid.c + vp3dsp_sse2.c + vp6dsp_sse2.c + h264_idct_sse2.nasm + h264_deblock_sse2.nasm + ; +} + +local amdSources = ; +if $(HAIKU_FFMPEG_USE_AMD3DNOW) = 1 { + amdSources = + fft_3dn.c + ; +} +if $(HAIKU_FFMPEG_USE_AMD3DNOWEXT) = 1 { + amdSources += + fft_3dn2.c + ; +} + +StaticLibrary libavcodec_x86.a : + $(mmxSources) + $(sseSources) + $(amdSources) +; diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/cavsdsp_mmx.c b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/cavsdsp_mmx.c index aa9a8c4785..6c2bdc125c 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/cavsdsp_mmx.c +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/cavsdsp_mmx.c @@ -423,12 +423,10 @@ static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, ui "pavgb " #temp ", " #a " \n\t"\ "mov" #size " " #a ", " #b " \n\t" -#ifndef __HAIKU__ QPEL_CAVS(put_, PUT_OP, 3dnow) QPEL_CAVS(avg_, AVG_3DNOW_OP, 3dnow) QPEL_CAVS(put_, PUT_OP, mmx2) QPEL_CAVS(avg_, AVG_MMX2_OP, mmx2) -#endif CAVS_MC(put_, 8, 3dnow) CAVS_MC(put_, 16,3dnow) diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c index 2e6563c1d3..2f47f5fde9 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/dsputil_mmx.c @@ -1639,7 +1639,6 @@ QPEL_2TAP(avg_, 8, 3dnow) static void just_return(void) { return; } #endif -#ifndef __HAIKU__ static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height){ const int w = 8; @@ -1758,12 +1757,6 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int o } } -#else -static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, - int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height){ -} -#endif - #define PREFETCH(name, op) \ static void name(void *mem, int stride, int h){\ const uint8_t *p= mem;\ @@ -2669,7 +2662,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) SET_HPEL_FUNCS(avg, 1, 8, mmx); SET_HPEL_FUNCS(avg_no_rnd, 1, 8, mmx); - c->gmc= ff_gmc_c; + c->gmc= gmc_mmx; c->add_bytes= add_bytes_mmx; c->add_bytes_l2= add_bytes_l2_mmx; diff --git a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/h264dsp_mmx.c b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/h264dsp_mmx.c index f1a6bd2d7f..21be60d5f9 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/h264dsp_mmx.c +++ b/src/add-ons/media/plugins/ffmpeg/libavcodec/x86/h264dsp_mmx.c @@ -792,8 +792,6 @@ static void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int a transpose4x4(pix-2+4*stride, trans+4, stride, 8); } -#ifndef __HAIKU__ - static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) { int dir; @@ -897,11 +895,6 @@ static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40] ); } -#else -static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], - int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) { -} -#endif /***********************************/ /* motion compensation */ diff --git a/src/add-ons/media/plugins/ffmpeg/libavformat/Jamfile b/src/add-ons/media/plugins/ffmpeg/libavformat/Jamfile index c557be9da4..1e76531187 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavformat/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/libavformat/Jamfile @@ -10,38 +10,9 @@ UseLibraryHeaders zlib ; TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; -if $(HAIKU_GCC_VERSION[1]) >= 3 { - SubDirCcFlags -fomit-frame-pointer -fno-pic ; -} else { - SubDirCcFlags -fomit-frame-pointer -DPIC ; -} - -local defines ; -defines = HAVE_AV_CONFIG_H=1 ; - -if $(TARGET_ARCH) = x86 { - defines += ARCH_X86=1 ARCH_X86_32=1 ARCH_PPC=0 ARCH_SPARC=0 ; - defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - defines += HAVE_MMX=1 HAVE_MMX2=1 HAVE_SSE=0 HAVE_SSE3=1 ; - defines += HAVE_ALTIVEC=0 ; - defines += HAVE_VIS=0 ; -} else if $(TARGET_ARCH) = ppc { - defines += ARCH_X86=0 ARCH_X86_32=0 ARCH_PPC=1 ARCH_SPARC=0 ; - defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - defines += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSE3=0 ; - defines += HAVE_ALTIVEC=1 ; - defines += HAVE_VIS=0 ; -} else if $(TARGET_ARCH) = sparc { - defines += ARCH_X86=0 ARCH_X86_32=0 ARCH_PPC=0 ARCH_SPARC=1 ; - defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - defines += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSE3=0 ; - defines += HAVE_ALTIVEC=0 ; - defines += HAVE_VIS=1 ; -} - -defines = [ FDefines $(defines) ] ; -SubDirCcFlags $(defines) ; -SubDirC++Flags $(defines) ; +SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ; +SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ; +SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ; StaticLibrary libavformat.a : 4xm.c diff --git a/src/add-ons/media/plugins/ffmpeg/libavutil/Jamfile b/src/add-ons/media/plugins/ffmpeg/libavutil/Jamfile index 2ad5d37844..ac938cd661 100644 --- a/src/add-ons/media/plugins/ffmpeg/libavutil/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/libavutil/Jamfile @@ -7,8 +7,13 @@ TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) SubDirHdrs [ FDirName $(SUBDIR) .. ] ; SubDirHdrs [ FDirName $(SUBDIR) ../libavcodec ] ; -SubDirCcFlags -fomit-frame-pointer -DPIC ; -#SubDirCcFlags -DHAVE_AV_CONFIG_H=1 ; +# filter warnings we don't want here +TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) + : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; + +SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ; +SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ; +SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ; StaticLibrary libavutil.a : adler32.c diff --git a/src/add-ons/media/plugins/ffmpeg/libswscale/Jamfile b/src/add-ons/media/plugins/ffmpeg/libswscale/Jamfile index 8e2d293a66..982e2ce62f 100644 --- a/src/add-ons/media/plugins/ffmpeg/libswscale/Jamfile +++ b/src/add-ons/media/plugins/ffmpeg/libswscale/Jamfile @@ -8,40 +8,20 @@ SubDirHdrs [ FDirName $(SUBDIR) ../libavcodec ] ; TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare -Wpointer-arith ] ; -SubDirCcFlags -fomit-frame-pointer -DPIC ; - -local arch_sources ; -arch_sources = ; -local defines ; -defines = HAVE_AV_CONFIG_H=1 ; +local archSources ; +archSources = ; if $(TARGET_ARCH) = x86 { - defines += ARCH_X86=1 ARCH_X86_32=1 ARCH_PPC=0 ARCH_SPARC=0 ; - defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - defines += HAVE_MMX=1 HAVE_MMX2=1 HAVE_SSE=0 HAVE_SSE3=1 ; - defines += HAVE_ALTIVEC=0 HAVE_ALTIVEC_H=0 ; - defines += HAVE_VIS=0 ; } else if $(TARGET_ARCH) = ppc { - defines += ARCH_X86=0 ARCH_X86_32=0 ARCH_PPC=1 ARCH_SPARC=0 ; - defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - defines += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSE3=0 ; - defines += HAVE_ALTIVEC=1 HAVE_ALTIVEC_H=1 ; - defines += HAVE_VIS=0 ; - arch_sources = yuv2rgb_altivec.c ; + archSources = yuv2rgb_altivec.c ; SubDirCcFlags -maltivec -mabi=altivec ; } else if $(TARGET_ARCH) = sparc { - defines += ARCH_X86=0 ARCH_X86_32=0 ARCH_PPC=0 ARCH_SPARC=1 ; - defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ; - defines += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSE3=0 ; - defines += HAVE_ALTIVEC=0 HAVE_ALTIVEC_H=0 ; - defines += HAVE_VIS=1 ; - arch_sources = yuv2rgb_vis.c ; + archSources = yuv2rgb_vis.c ; } -defines = [ FDefines $(defines) ] ; -SubDirCcFlags $(defines) ; -SubDirC++Flags $(defines) ; - +SubDirCcFlags $(HAIKU_FFMPEG_GCC_EXTRA_FLAGS) ; +SubDirCcFlags $(HAIKU_FFMPEG_DEFINES) ; +SubDirC++Flags $(HAIKU_FFMPEG_DEFINES) ; StaticLibrary libswscale.a : rgb2rgb.c @@ -49,5 +29,5 @@ StaticLibrary libswscale.a : swscale_avoption.c yuv2rgb.c - $(arch_sources) + $(archSources) ;