From ad86ea038a0b4803c7e3f1a82a293e2ee538e345 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sat, 1 Nov 2003 18:12:53 +0000 Subject: big ffmpeg patch * do not define CONFIG_ENCODERS any more, use a stripped down XINE_MPEG_ENCODER, which will only compile an I-frame-only MPEG1 encoder (speeds up compile time) * fix a lot of warnings in ffmpeg (a good deal of which have already been submitted to the ffmpeg project by Mike) * simplify some Makefiles CVS patchset: 5667 CVS date: 2003/11/01 18:12:53 --- configure.ac | 5 +- src/libffmpeg/Makefile.am | 2 +- src/libffmpeg/diff_to_ffmpeg_cvs.txt | 757 ++++++++++++++++----- src/libffmpeg/libavcodec/Makefile.am | 13 +- src/libffmpeg/libavcodec/armv4l/Makefile.am | 5 - src/libffmpeg/libavcodec/asv1.c | 8 + src/libffmpeg/libavcodec/avcodec.h | 7 + src/libffmpeg/libavcodec/cinepak.c | 3 + src/libffmpeg/libavcodec/common.c | 4 +- src/libffmpeg/libavcodec/dpcm.c | 4 + src/libffmpeg/libavcodec/h263.c | 4 + src/libffmpeg/libavcodec/h264.c | 4 + src/libffmpeg/libavcodec/i386/Makefile.am | 3 - src/libffmpeg/libavcodec/i386/dsputil_mmx.c | 7 +- src/libffmpeg/libavcodec/i386/fdct_mmx.c | 3 +- src/libffmpeg/libavcodec/i386/idct_mmx.c | 7 +- src/libffmpeg/libavcodec/i386/motion_est_mmx.c | 6 +- src/libffmpeg/libavcodec/i386/simple_idct_mmx.c | 1 + src/libffmpeg/libavcodec/imgconvert.c | 2 +- src/libffmpeg/libavcodec/libpostproc/Makefile.am | 3 - src/libffmpeg/libavcodec/libpostproc/postprocess.c | 21 +- .../libavcodec/libpostproc/postprocess_template.c | 1 - src/libffmpeg/libavcodec/mlib/Makefile.am | 5 - src/libffmpeg/libavcodec/mpeg12.c | 8 +- src/libffmpeg/libavcodec/mpegaudiodec.c | 2 + src/libffmpeg/libavcodec/mpegvideo.c | 71 +- src/libffmpeg/libavcodec/msvideo1.c | 2 + src/libffmpeg/libavcodec/ppc/Makefile.am | 14 +- src/libffmpeg/libavcodec/ra144.c | 2 +- src/libffmpeg/libavcodec/ra288.c | 4 +- src/libffmpeg/libavcodec/rpza.c | 3 + src/libffmpeg/libavcodec/rv10.c | 2 + src/libffmpeg/libavcodec/utils.c | 6 +- src/libffmpeg/libavcodec/vp3.c | 6 +- src/libffmpeg/libavcodec/vqavideo.c | 4 + src/libffmpeg/libavcodec/xan.c | 6 + src/libffmpeg/xine_encoder.c | 3 +- 37 files changed, 746 insertions(+), 262 deletions(-) diff --git a/configure.ac b/configure.ac index 302d07b64..67532e6b7 100644 --- a/configure.ac +++ b/configure.ac @@ -222,14 +222,14 @@ AC_SUBST(DYNAMIC_LD_LIBS) dnl --------------------------------------------- -dnl mpeg2lib stuff +dnl mpeg2lib and ffmpeg stuff dnl --------------------------------------------- AC_SUBST(LIBMPEG2_CFLAGS) AC_SUBST(LIBFFMPEG_CFLAGS) LIBMPEG2_CFLAGS="" -LIBFFMPEG_CFLAGS="-DSIMPLE_IDCT -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DUSE_FASTMEMCPY -DCONFIG_RISKY -DCONFIG_ENCODERS -DCONFIG_DECODERS" +LIBFFMPEG_CFLAGS="-DSIMPLE_IDCT -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DUSE_FASTMEMCPY -DCONFIG_RISKY -DCONFIG_DECODERS -DXINE_MPEG_ENCODER" AC_CHECK_DECL(lrintf,[AC_DEFINE(HAVE_LRINTF,1,[Define this if the 'lrintf' function is declared in math.h])],,[ #define _ISOC9X_SOURCE @@ -1821,6 +1821,7 @@ src/libffmpeg/libavcodec/armv4l/Makefile src/libffmpeg/libavcodec/i386/Makefile src/libffmpeg/libavcodec/mlib/Makefile src/libffmpeg/libavcodec/alpha/Makefile +src/libffmpeg/libavcodec/ppc/Makefile src/libffmpeg/libavcodec/libpostproc/Makefile src/libflac/Makefile src/liblpcm/Makefile diff --git a/src/libffmpeg/Makefile.am b/src/libffmpeg/Makefile.am index 9bccb7589..6b1732dd6 100644 --- a/src/libffmpeg/Makefile.am +++ b/src/libffmpeg/Makefile.am @@ -3,7 +3,7 @@ include $(top_srcdir)/misc/Makefile.common SUBDIRS = libavcodec # this must always be included, even if the current machine has no DXR3... -EXTRA_DIST = xine_encoder.c +EXTRA_DIST = xine_encoder.c diff_to_ffmpeg_cvs.txt INTERNAL_DOCS = diff_to_ffmpeg_cvs.txt diff --git a/src/libffmpeg/diff_to_ffmpeg_cvs.txt b/src/libffmpeg/diff_to_ffmpeg_cvs.txt index f68156a78..abed38ce8 100644 --- a/src/libffmpeg/diff_to_ffmpeg_cvs.txt +++ b/src/libffmpeg/diff_to_ffmpeg_cvs.txt @@ -1,10 +1,53 @@ -Index: libavcodec/common.h -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/common.h,v -retrieving revision 1.106 -diff -u -u -r1.106 common.h ---- libavcodec/common.h 20 Oct 2003 20:23:46 -0000 1.106 -+++ libavcodec/common.h 21 Oct 2003 12:10:49 -0000 +--- libavcodec/avcodec.h 2003-10-30 07:00:25.000000000 +0100 ++++ libavcodec/avcodec.h 2003-11-01 18:34:59.000000000 +0100 +@@ -14,6 +14,13 @@ + #include "common.h" + #include "rational.h" + ++/* FIXME: We cannot use ffmpeg's XvMC capabilities, since that would require ++ * linking the ffmpeg plugin against XvMC libraries, which is a bad thing, ++ * since they are output dependend. ++ * The correct fix would be to reimplement the XvMC functions libavcodec uses ++ * and do the necessary talking with our XvMC output plugin there. */ ++#undef HAVE_XVMC ++ + #define FFMPEG_VERSION_INT 0x000408 + #define FFMPEG_VERSION "0.4.8" + #define LIBAVCODEC_BUILD 4688 +--- libavcodec/cinepak.c 2003-10-27 16:24:38.000000000 +0100 ++++ libavcodec/cinepak.c 2003-10-28 21:01:06.000000000 +0100 +@@ -37,6 +37,9 @@ + + #define PALETTE_COUNT 256 + ++#undef BE_16 ++#undef BE_32 ++ + #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) + #define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \ + (((uint8_t*)(x))[1] << 16) | \ +--- libavcodec/common.c 2003-10-27 16:24:38.000000000 +0100 ++++ libavcodec/common.c 2003-10-27 19:42:02.000000000 +0100 +@@ -60,7 +60,7 @@ + #endif + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + /* return the number of bits output */ + int64_t get_bit_count(PutBitContext *s) +@@ -101,7 +101,7 @@ + #endif + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + void put_string(PutBitContext * pbc, char *s) + { +--- libavcodec/common.h 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/common.h 2003-10-27 19:42:02.000000000 +0100 @@ -184,11 +184,19 @@ # else @@ -30,13 +73,21 @@ diff -u -u -r1.106 common.h # endif /* !CONFIG_WIN32 */ -Index: libavcodec/dsputil.h -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/dsputil.h,v -retrieving revision 1.74 -diff -u -u -r1.74 dsputil.h ---- libavcodec/dsputil.h 13 Oct 2003 17:27:30 -0000 1.74 -+++ libavcodec/dsputil.h 21 Oct 2003 12:10:51 -0000 +--- libavcodec/dpcm.c 2003-10-27 16:24:38.000000000 +0100 ++++ libavcodec/dpcm.c 2003-10-28 21:01:51.000000000 +0100 +@@ -44,6 +44,10 @@ + #define SATURATE_S16(x) if (x < -32768) x = -32768; \ + else if (x > 32767) x = 32767; + #define SE_16BIT(x) if (x & 0x8000) x -= 0x10000; ++ ++#undef LE_16 ++#undef LE_32 ++ + #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) + #define LE_32(x) ((((uint8_t*)(x))[3] << 24) | \ + (((uint8_t*)(x))[2] << 16) | \ +--- libavcodec/dsputil.h 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/dsputil.h 2003-10-27 19:42:02.000000000 +0100 @@ -29,9 +29,14 @@ #include "common.h" @@ -79,13 +130,8 @@ diff -u -u -r1.74 dsputil.h #define emms_c() \ -Index: libavcodec/fastmemcpy.h -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/fastmemcpy.h,v -retrieving revision 1.1 -diff -u -u -r1.1 fastmemcpy.h ---- libavcodec/fastmemcpy.h 2 Aug 2001 08:29:38 -0000 1.1 -+++ libavcodec/fastmemcpy.h 21 Oct 2003 12:10:53 -0000 +--- libavcodec/fastmemcpy.h 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/fastmemcpy.h 2003-04-16 02:18:37.000000000 +0200 @@ -1 +1,8 @@ -#include "../libvo/fastmemcpy.h" +#ifndef __FASTMEMCPY_H__ @@ -96,89 +142,8 @@ diff -u -u -r1.1 fastmemcpy.h +#define memcpy(a,b,c) xine_fast_memcpy(a,b,c) + +#endif -Index: libavcodec/mjpeg.c -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mjpeg.c,v -retrieving revision 1.78 -diff -u -u -r1.78 mjpeg.c ---- libavcodec/mjpeg.c 20 Oct 2003 20:23:46 -0000 1.78 -+++ libavcodec/mjpeg.c 21 Oct 2003 12:11:08 -0000 -@@ -1504,7 +1504,7 @@ - 4bytes field_size - 4bytes field_size_less_padding - */ -- s->buggy_avid = 1; -+// s->buggy_avid = 1; - // if (s->first_picture) - // printf("mjpeg: workarounding buggy AVID\n"); - s->interlace_polarity = get_bits(&s->gb, 8); -Index: libavcodec/mpegvideo.c -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.c,v -retrieving revision 1.291 -diff -u -u -r1.291 mpegvideo.c ---- libavcodec/mpegvideo.c 20 Oct 2003 09:52:02 -0000 1.291 -+++ libavcodec/mpegvideo.c 21 Oct 2003 12:11:17 -0000 -@@ -836,7 +836,9 @@ - if (MPV_common_init(s) < 0) - return -1; - -+#ifdef CONFIG_ENCODERS_FULL - ff_init_me(s); -+#endif - - #ifdef CONFIG_ENCODERS - #ifdef CONFIG_RISKY -@@ -1637,8 +1639,10 @@ - if (s->out_format == FMT_MJPEG) - mjpeg_picture_trailer(s); - -+#ifdef CONFIG_ENCODERS_FULL - if(s->flags&CODEC_FLAG_PASS1) - ff_write_pass1_stats(s); -+#endif - - for(i=0; i<4; i++){ - avctx->error[i] += s->current_picture_ptr->error[i]; -@@ -3362,6 +3366,7 @@ - /* Estimate motion for every MB */ - s->mb_intra=0; //for the rate distoration & bit compare functions - if(s->pict_type != I_TYPE){ -+#ifdef CONFIG_ENCODERS_FULL - if(s->pict_type != B_TYPE){ - if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ - s->me.pre_pass=1; -@@ -3399,6 +3404,7 @@ - ff_estimate_p_frame_motion(s, mb_x, mb_y); - } - } -+#endif - }else /* if(s->pict_type == I_TYPE) */{ - /* I-Frame */ - //FIXME do we need to zero them? -@@ -3433,6 +3439,7 @@ - //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); - } - -+#ifdef CONFIG_ENCODERS_FULL - if(!s->umvplus){ - if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) { - s->f_code= ff_get_best_fcode(s, s->p_mv_table, MB_TYPE_INTER); -@@ -3457,6 +3464,7 @@ - ff_fix_long_b_mvs(s, s->b_bidir_back_mv_table, s->b_code, MB_TYPE_BIDIR); - } - } -+#endif - - if (!s->fixed_qscale) - s->current_picture.quality = ff_rate_estimate_qscale(s); -Index: libavcodec/i386/cputest.c -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/cputest.c,v -retrieving revision 1.8 -diff -u -u -r1.8 cputest.c ---- libavcodec/i386/cputest.c 26 Nov 2002 16:26:58 -0000 1.8 -+++ libavcodec/i386/cputest.c 21 Oct 2003 12:11:37 -0000 +--- libavcodec/i386/cputest.c 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/i386/cputest.c 2003-07-02 16:36:41.000000000 +0200 @@ -1,122 +1,13 @@ -/* Cpu detection code, extracted from mmx.h ((c)1997-99 by H. Dietz - and R. Fisher). Converted to C and improved by Fabrice Bellard */ @@ -305,13 +270,28 @@ diff -u -u -r1.8 cputest.c } #ifdef __TEST__ -Index: libavcodec/i386/mmx.h -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/mmx.h,v -retrieving revision 1.3 -diff -u -u -r1.3 mmx.h ---- libavcodec/i386/mmx.h 27 May 2002 08:31:54 -0000 1.3 -+++ libavcodec/i386/mmx.h 21 Oct 2003 12:11:38 -0000 +--- libavcodec/i386/fdct_mmx.c 2002-11-11 14:45:36.000000000 +0100 ++++ libavcodec/i386/fdct_mmx.c 2003-10-24 14:04:32.000000000 +0200 +@@ -10,6 +10,7 @@ + #include "../dsputil.h" + #include "mmx.h" + ++#undef ATTR_ALIGN + #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align))) + + ////////////////////////////////////////////////////////////////////// +--- libavcodec/i386/idct_mmx.c 2002-10-29 17:29:19.000000000 +0100 ++++ libavcodec/i386/idct_mmx.c 2003-10-30 23:21:12.000000000 +0100 +@@ -26,6 +26,7 @@ + + #include "mmx.h" + ++#undef ATTR_ALIGN + #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align))) + + #define ROW_SHIFT 11 +--- libavcodec/i386/mmx.h 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/i386/mmx.h 2003-07-02 16:36:41.000000000 +0200 @@ -1,243 +1 @@ -/* - * mmx.h @@ -557,29 +537,8 @@ diff -u -u -r1.3 mmx.h - -#endif /* AVCODEC_I386MMX_H */ +#include "xineutils.h" -Index: libavcodec/i386/motion_est_mmx.c -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/motion_est_mmx.c,v -retrieving revision 1.11 -diff -u -u -r1.11 motion_est_mmx.c ---- libavcodec/i386/motion_est_mmx.c 9 Sep 2003 22:59:16 -0000 1.11 -+++ libavcodec/i386/motion_est_mmx.c 21 Oct 2003 12:11:39 -0000 -@@ -26,7 +26,7 @@ - 0x0002000200020002, - }; - --static __attribute__ ((aligned(8), unused)) uint64_t bone= 0x0101010101010101LL; -+static const __attribute__ ((aligned(8), unused)) uint64_t bone= 0x0101010101010101LL; - - static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) - { -Index: libavcodec/libpostproc/postprocess.c -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/libpostproc/postprocess.c,v -retrieving revision 1.90 -diff -u -u -r1.90 postprocess.c ---- libavcodec/libpostproc/postprocess.c 14 Sep 2003 16:52:34 -0000 1.90 -+++ libavcodec/libpostproc/postprocess.c 21 Oct 2003 12:11:40 -0000 +--- libavcodec/libpostproc/postprocess.c 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/libpostproc/postprocess.c 2003-10-27 19:42:16.000000000 +0100 @@ -70,8 +70,9 @@ #include "config.h" #include @@ -605,31 +564,14 @@ diff -u -u -r1.90 postprocess.c #include "postprocess.h" #include "postprocess_internal.h" -@@ -104,13 +105,13 @@ - //#define NUM_BLOCKS_AT_ONCE 16 //not used yet - - #ifdef ARCH_X86 --static uint64_t __attribute__((aligned(8))) w05= 0x0005000500050005LL; --static uint64_t __attribute__((aligned(8))) w20= 0x0020002000200020LL; --static uint64_t __attribute__((aligned(8))) b00= 0x0000000000000000LL; --static uint64_t __attribute__((aligned(8))) b01= 0x0101010101010101LL; --static uint64_t __attribute__((aligned(8))) b02= 0x0202020202020202LL; --static uint64_t __attribute__((aligned(8))) b08= 0x0808080808080808LL; --static uint64_t __attribute__((aligned(8))) b80= 0x8080808080808080LL; -+static const uint64_t __attribute__((aligned(8))) w05= 0x0005000500050005LL; -+static const uint64_t __attribute__((aligned(8))) w20= 0x0020002000200020LL; -+ uint64_t __attribute__((aligned(8))) b00= 0x0000000000000000LL; -+static const uint64_t __attribute__((aligned(8))) b01= 0x0101010101010101LL; -+static const uint64_t __attribute__((aligned(8))) b02= 0x0202020202020202LL; -+static const uint64_t __attribute__((aligned(8))) b08= 0x0808080808080808LL; -+static const uint64_t __attribute__((aligned(8))) b80= 0x8080808080808080LL; - #endif - +@@ -152,44 +153,6 @@ + NULL //End Marker + }; -@@ -156,37 +157,6 @@ - static inline void unusedVariableWarningFixer() - { - if(w05 + w20 + b00 + b01 + b02 + b08 + b80 == 0) b00=0; +-#ifdef ARCH_X86 +-static inline void unusedVariableWarningFixer() +-{ +- if(w05 + w20 + b00 + b01 + b02 + b08 + b80 == 0) b00=0; -} -#endif - @@ -661,16 +603,25 @@ diff -u -u -r1.90 postprocess.c - asm volatile( "prefetcht2 (%0)\n\t" - : : "r" (p) - ); - } - #endif +-} +-#endif +- + // The horizontal Functions exist only in C cuz the MMX code is faster with vertical filters and transposing -Index: libavcodec/mlib/dsputil_mlib.c -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mlib/dsputil_mlib.c,v -retrieving revision 1.14 -diff -u -u -r1.14 dsputil_mlib.c ---- libavcodec/mlib/dsputil_mlib.c 11 Oct 2003 16:43:51 -0000 1.14 -+++ libavcodec/mlib/dsputil_mlib.c 21 Oct 2003 12:11:42 -0000 + /** +--- libavcodec/mjpeg.c 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/mjpeg.c 2003-10-27 19:42:08.000000000 +0100 +@@ -1504,7 +1504,7 @@ + 4bytes field_size + 4bytes field_size_less_padding + */ +- s->buggy_avid = 1; ++// s->buggy_avid = 1; + // if (s->first_picture) + // printf("mjpeg: workarounding buggy AVID\n"); + s->interlace_polarity = get_bits(&s->gb, 8); +--- libavcodec/mlib/dsputil_mlib.c 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/mlib/dsputil_mlib.c 2003-10-27 19:42:17.000000000 +0100 @@ -419,6 +419,7 @@ void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx) @@ -698,3 +649,475 @@ diff -u -u -r1.14 dsputil_mlib.c } + } } +--- libavcodec/mpeg12.c 2003-10-27 16:24:38.000000000 +0100 ++++ libavcodec/mpeg12.c 2003-10-28 19:24:46.000000000 +0100 +@@ -48,7 +48,7 @@ + #define MB_BTYPE_VLC_BITS 6 + #define TEX_VLC_BITS 9 + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + static void mpeg1_encode_block(MpegEncContext *s, + DCTELEM *block, + int component); +@@ -74,7 +74,7 @@ + extern int XVMC_field_end(MpegEncContext *s); + #endif + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL; + static uint8_t fcode_tab[MAX_MV*2+1]; + +@@ -128,7 +128,7 @@ + } + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + static void init_uni_ac_vlc(RLTable *rl, uint32_t *uni_ac_vlc_bits, uint8_t *uni_ac_vlc_len){ + int i; + +@@ -383,7 +383,7 @@ + memset(s->last_mv, 0, sizeof(s->last_mv)); + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + void ff_mpeg1_encode_slice_header(MpegEncContext *s){ + put_header(s, SLICE_MIN_START_CODE + s->mb_y); +--- libavcodec/mpegvideo.c 2003-11-01 18:43:19.000000000 +0100 ++++ libavcodec/mpegvideo.c 2003-10-30 23:26:04.000000000 +0100 +@@ -36,7 +36,7 @@ + //#undef NDEBUG + //#include + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + static void encode_picture(MpegEncContext *s, int picture_number); + #endif //CONFIG_ENCODERS + static void dct_unquantize_mpeg1_c(MpegEncContext *s, +@@ -46,7 +46,7 @@ + static void dct_unquantize_h263_c(MpegEncContext *s, + DCTELEM *block, int n, int qscale); + static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w); +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + static int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); + static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); + static int sse_mb(MpegEncContext *s); +@@ -87,7 +87,7 @@ + 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + }; + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + static uint8_t (*default_mv_penalty)[MAX_MV*2+1]=NULL; + static uint8_t default_fcode_tab[MAX_MV*2+1]; + +@@ -173,7 +173,7 @@ + } + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + void ff_write_quant_matrix(PutBitContext *pb, int16_t *matrix){ + int i; + +@@ -194,7 +194,7 @@ + s->dct_unquantize_mpeg1 = dct_unquantize_mpeg1_c; + s->dct_unquantize_mpeg2 = dct_unquantize_mpeg2_c; + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + s->dct_quantize= dct_quantize_c; + #endif + +@@ -217,7 +217,7 @@ + MPV_common_init_ppc(s); + #endif + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + s->fast_dct_quantize= s->dct_quantize; + + if(s->flags&CODEC_FLAG_TRELLIS_QUANT){ +@@ -569,7 +569,7 @@ + s->current_picture_ptr= NULL; + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + /* init video encoder */ + int MPV_encode_init(AVCodecContext *avctx) +@@ -686,6 +686,7 @@ + s->low_delay= 0; //s->max_b_frames ? 0 : 1; + avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1); + break; ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + case CODEC_ID_MPEG2VIDEO: + s->out_format = FMT_MPEG1; + s->low_delay= 0; //s->max_b_frames ? 0 : 1; +@@ -802,6 +803,7 @@ + s->low_delay=1; + break; + #endif ++#endif + default: + return -1; + } +@@ -836,22 +838,25 @@ + if (MPV_common_init(s) < 0) + return -1; + ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + ff_init_me(s); ++#endif + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + if (s->out_format == FMT_H263) + h263_encode_init(s); + if(s->msmpeg4_version) + ff_msmpeg4_encode_init(s); + #endif ++#endif + if (s->out_format == FMT_MPEG1) + ff_mpeg1_encode_init(s); +-#endif + + /* init default q matrix */ + for(i=0;i<64;i++) { + int j= s->dsp.idct_permutation[i]; ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + if(s->codec_id==CODEC_ID_MPEG4 && s->mpeg_quant){ + s->intra_matrix[j] = ff_mpeg4_default_intra_matrix[i]; +@@ -861,6 +866,7 @@ + s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i]; + }else + #endif ++#endif + { /* mpeg1/2 */ + s->intra_matrix[j] = ff_mpeg1_default_intra_matrix[i]; + s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i]; +@@ -904,8 +910,10 @@ + ff_rate_control_uninit(s); + + MPV_common_end(s); ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + if (s->out_format == FMT_MJPEG) + mjpeg_close(s); ++#endif + + av_freep(&avctx->extradata); + +@@ -1341,7 +1349,7 @@ + } + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + static int get_sae(uint8_t *src, int ref, int stride){ + int x,y; +@@ -1634,11 +1642,13 @@ + + MPV_frame_end(s); + ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + if (s->out_format == FMT_MJPEG) + mjpeg_picture_trailer(s); + + if(s->flags&CODEC_FLAG_PASS1) + ff_write_pass1_stats(s); ++#endif + + for(i=0; i<4; i++){ + avctx->error[i] += s->current_picture_ptr->error[i]; +@@ -2607,7 +2617,7 @@ + } + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + static inline void dct_single_coeff_elimination(MpegEncContext *s, int n, int threshold) + { +@@ -2812,7 +2822,7 @@ + } + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + static void encode_mb(MpegEncContext *s, int motion_x, int motion_y) + { +@@ -3051,6 +3061,7 @@ + case CODEC_ID_MPEG1VIDEO: + case CODEC_ID_MPEG2VIDEO: + mpeg1_encode_mb(s, s->block, motion_x, motion_y); break; ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + case CODEC_ID_MPEG4: + mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; +@@ -3068,6 +3079,7 @@ + #endif + case CODEC_ID_MJPEG: + mjpeg_encode_mb(s, s->block); break; ++#endif + default: + assert(0); + } +@@ -3152,7 +3164,7 @@ + s->parse_context.last_index= 0; + } + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length) + { + int bytes= length>>4; +@@ -3340,12 +3352,14 @@ + s->current_picture.mb_var_sum = 0; + s->current_picture.mc_mb_var_sum = 0; + ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + /* we need to initialize some time vars before we can encode b-frames */ + // RAL: Condition added for MPEG1VIDEO + if (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->h263_msmpeg4)) + ff_set_mpeg4_time(s, s->picture_number); + #endif ++#endif + + s->scene_change_score=0; + +@@ -3362,6 +3376,7 @@ + /* Estimate motion for every MB */ + s->mb_intra=0; //for the rate distoration & bit compare functions + if(s->pict_type != I_TYPE){ ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + if(s->pict_type != B_TYPE){ + if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ + s->me.pre_pass=1; +@@ -3399,6 +3414,7 @@ + ff_estimate_p_frame_motion(s, mb_x, mb_y); + } + } ++#endif + }else /* if(s->pict_type == I_TYPE) */{ + /* I-Frame */ + //FIXME do we need to zero them? +@@ -3433,6 +3449,7 @@ + //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); + } + ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + if(!s->umvplus){ + if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) { + s->f_code= ff_get_best_fcode(s, s->p_mv_table, MB_TYPE_INTER); +@@ -3457,11 +3474,13 @@ + ff_fix_long_b_mvs(s, s->b_bidir_back_mv_table, s->b_code, MB_TYPE_BIDIR); + } + } ++#endif + + if (!s->fixed_qscale) + s->current_picture.quality = ff_rate_estimate_qscale(s); + + if(s->adaptive_quant){ ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + switch(s->codec_id){ + case CODEC_ID_MPEG4: +@@ -3474,6 +3493,7 @@ + break; + } + #endif ++#endif + + s->lambda= s->lambda_table[0]; + //FIXME broken +@@ -3506,6 +3526,7 @@ + + s->last_bits= get_bit_count(&s->pb); + switch(s->out_format) { ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + case FMT_MJPEG: + mjpeg_picture_header(s); + break; +@@ -3524,6 +3545,15 @@ + else + h263_encode_picture_header(s, picture_number); + break; ++#else ++ case FMT_H263: ++ break; ++#endif ++#else ++ case FMT_MJPEG: ++ break; ++ case FMT_H263: ++ break; + #endif + case FMT_MPEG1: + mpeg1_encode_picture_header(s, picture_number); +@@ -3558,6 +3588,7 @@ + + s->last_mv_dir = 0; + ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + switch(s->codec_id){ + case CODEC_ID_H263: +@@ -3571,6 +3602,7 @@ + break; + } + #endif ++#endif + + s->resync_mb_x=0; + s->resync_mb_y=0; +@@ -3594,6 +3626,7 @@ + ff_update_block_index(s); + + /* write gob / video packet header */ ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + if(s->rtp_mode && mb_y + mb_x>0){ + int current_packet_size, is_gob_start; +@@ -3649,6 +3682,7 @@ + } + } + #endif ++#endif + + if( (s->resync_mb_x == s->mb_x) + && s->resync_mb_y+1 == s->mb_y){ +@@ -3734,9 +3768,11 @@ + + s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; + s->mb_intra= 0; ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + ff_mpeg4_set_direct_mv(s, mx, my); + #endif ++#endif + encode_mb_hq(s, &backup_s, &best_s, MB_TYPE_DIRECT, pb, pb2, tex_pb, + &dmin, &next_block, mx, my); + } +@@ -3905,9 +3941,11 @@ + s->mb_intra= 0; + motion_x=s->b_direct_mv_table[xy][0]; + motion_y=s->b_direct_mv_table[xy][1]; ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + ff_mpeg4_set_direct_mv(s, motion_x, motion_y); + #endif ++#endif + break; + case MB_TYPE_BIDIR: + s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD; +@@ -3978,6 +4016,7 @@ + } + emms_c(); + ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + if(s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame) + ff_mpeg4_merge_partitions(s); +@@ -3988,6 +4027,7 @@ + if(s->codec_id==CODEC_ID_MPEG4) + ff_mpeg4_stuffing(&s->pb); + #endif ++#endif + + //if (s->gob_number) + // fprintf(stderr,"\nNumber of GOB: %d", s->gob_number); +@@ -4626,7 +4666,7 @@ + AVOPTION_END() + }; + +-#ifdef CONFIG_ENCODERS ++#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) + + AVCodec mpeg1video_encoder = { + "mpeg1video", +@@ -4638,6 +4678,7 @@ + MPV_encode_end, + }; + ++#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) + #ifdef CONFIG_RISKY + + AVCodec mpeg2video_encoder = { +@@ -4757,5 +4798,7 @@ + MPV_encode_end, + }; + ++#endif ++ + #endif //CONFIG_ENCODERS + +--- libavcodec/msvideo1.c 2003-10-27 16:24:38.000000000 +0100 ++++ libavcodec/msvideo1.c 2003-10-28 21:04:59.000000000 +0100 +@@ -38,6 +38,8 @@ + #include "avcodec.h" + #include "dsputil.h" + ++#undef LE_16 ++ + #define PALETTE_COUNT 256 + #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) + #define CHECK_STREAM_PTR(n) \ +--- libavcodec/rpza.c 2003-10-27 16:24:38.000000000 +0100 ++++ libavcodec/rpza.c 2003-10-28 21:05:35.000000000 +0100 +@@ -54,6 +54,9 @@ + + } RpzaContext; + ++#undef BE_16 ++#undef BE_32 ++ + #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) + #define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \ + (((uint8_t*)(x))[1] << 16) | \ +--- libavcodec/vqavideo.c 2003-10-30 07:00:28.000000000 +0100 ++++ libavcodec/vqavideo.c 2003-10-30 20:13:31.000000000 +0100 +@@ -82,6 +82,10 @@ + #define MAX_VECTORS (MAX_CODEBOOK_VECTORS + SOLID_PIXEL_VECTORS) + #define MAX_CODEBOOK_SIZE (MAX_VECTORS * 4 * 4) + ++#undef LE_16 ++#undef BE_16 ++#undef BE_32 ++ + #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) + #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) + #define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \ +--- libavcodec/xan.c 2003-10-30 07:00:29.000000000 +0100 ++++ libavcodec/xan.c 2003-10-30 23:27:28.000000000 +0100 +@@ -58,6 +58,10 @@ + + } XanContext; + ++#undef BE_16 ++#undef LE_16 ++#undef LE_32 ++ + #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) + #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) + #define LE_32(x) ((((uint8_t*)(x))[3] << 24) | \ +@@ -69,6 +73,8 @@ + #define SCALEFACTOR 65536 + #define CENTERSAMPLE 128 + ++#undef COMPUTE_Y ++ + #define COMPUTE_Y(r, g, b) \ + (unsigned char) \ + ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR) diff --git a/src/libffmpeg/libavcodec/Makefile.am b/src/libffmpeg/libavcodec/Makefile.am index 87d234a17..3f477ded2 100644 --- a/src/libffmpeg/libavcodec/Makefile.am +++ b/src/libffmpeg/libavcodec/Makefile.am @@ -1,14 +1,9 @@ include $(top_srcdir)/misc/Makefile.common -SUBDIRS = armv4l i386 mlib alpha libpostproc +SUBDIRS = armv4l i386 mlib alpha ppc libpostproc -## we include ppc/* files since auto* doesn't dive into. -## we also include imgresample.c motion_est.c which are unused +## we include some unused files EXTRA_DIST = fdctref.c motion_est_template.c svq3.c wmv2.c \ - ppc/dsputil_ppc.c ppc/libavcodec_ppc_dummy.c ppc/mpegvideo_altivec.c \ - ppc/dsputil_altivec.c ppc/fft_altivec.c ppc/Makefile.am \ - ppc/mpegvideo_ppc.c ppc/dsputil_altivec.h ppc/idct_altivec.c \ - ppc/dsputil_ppc.h ppc/gcc_fixes.h ppc/gmc_altivec.c \ imgresample.c motion_est.c AM_CFLAGS = $(LIBFFMPEG_CFLAGS) @@ -74,6 +69,7 @@ libavcodec_la_LDFLAGS = \ $(top_builddir)/src/libffmpeg/libavcodec/armv4l/libavcodec_armv4l.la \ $(top_builddir)/src/libffmpeg/libavcodec/i386/libavcodec_mmx.la \ $(top_builddir)/src/libffmpeg/libavcodec/mlib/libavcodec_mlib.la \ + $(top_builddir)/src/libffmpeg/libavcodec/ppc/libavcodec_ppc.la \ -avoid-version -module @@ -105,6 +101,3 @@ noinst_HEADERS = \ svq1_vlc.h \ vp3data.h \ wmadata.h - -.s.lo: - $(ASCOMPILE) -o $@ `test -f $< || echo '$(srcdir)/'`$< diff --git a/src/libffmpeg/libavcodec/armv4l/Makefile.am b/src/libffmpeg/libavcodec/armv4l/Makefile.am index 8d3b87ce5..123978087 100644 --- a/src/libffmpeg/libavcodec/armv4l/Makefile.am +++ b/src/libffmpeg/libavcodec/armv4l/Makefile.am @@ -15,8 +15,3 @@ EXTRA_DIST = $(libavcodec_armv4l_src) $(libavcodec_armv4l_dummy) armv4l_modules = libavcodec_armv4l_la_SOURCES = $(armv4l_modules) $(libavcodec_armv4l_dummy) - -noinst_HEADERS = - -.s.lo: - $(ASCOMPILE) -o $@ `test -f $< || echo '$(srcdir)/'`$< diff --git a/src/libffmpeg/libavcodec/asv1.c b/src/libffmpeg/libavcodec/asv1.c index 2e6f785fb..bff0fe37a 100644 --- a/src/libffmpeg/libavcodec/asv1.c +++ b/src/libffmpeg/libavcodec/asv1.c @@ -481,6 +481,8 @@ for(i=0; iavctx->extradata_size; i++){ return (get_bits_count(&a->gb)+31)/32*4; } +#ifdef CONFIG_ENCODERS + static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ ASV1Context * const a = avctx->priv_data; AVFrame *pict = data; @@ -535,6 +537,8 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, return size*4; } +#endif + static void common_init(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; @@ -582,6 +586,8 @@ static int decode_init(AVCodecContext *avctx){ return 0; } +#ifdef CONFIG_ENCODERS + static int encode_init(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; int i; @@ -606,6 +612,8 @@ static int encode_init(AVCodecContext *avctx){ return 0; } +#endif + static int decode_end(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; diff --git a/src/libffmpeg/libavcodec/avcodec.h b/src/libffmpeg/libavcodec/avcodec.h index 90b20f425..3293411be 100644 --- a/src/libffmpeg/libavcodec/avcodec.h +++ b/src/libffmpeg/libavcodec/avcodec.h @@ -14,6 +14,13 @@ extern "C" { #include "common.h" #include "rational.h" +/* FIXME: We cannot use ffmpeg's XvMC capabilities, since that would require + * linking the ffmpeg plugin against XvMC libraries, which is a bad thing, + * since they are output dependend. + * The correct fix would be to reimplement the XvMC functions libavcodec uses + * and do the necessary talking with our XvMC output plugin there. */ +#undef HAVE_XVMC + #define FFMPEG_VERSION_INT 0x000408 #define FFMPEG_VERSION "0.4.8" #define LIBAVCODEC_BUILD 4688 diff --git a/src/libffmpeg/libavcodec/cinepak.c b/src/libffmpeg/libavcodec/cinepak.c index af168d07b..56c4990be 100644 --- a/src/libffmpeg/libavcodec/cinepak.c +++ b/src/libffmpeg/libavcodec/cinepak.c @@ -37,6 +37,9 @@ #define PALETTE_COUNT 256 +#undef BE_16 +#undef BE_32 + #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) #define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \ (((uint8_t*)(x))[1] << 16) | \ diff --git a/src/libffmpeg/libavcodec/common.c b/src/libffmpeg/libavcodec/common.c index f37c2c9eb..673ce7083 100644 --- a/src/libffmpeg/libavcodec/common.c +++ b/src/libffmpeg/libavcodec/common.c @@ -60,7 +60,7 @@ void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size) #endif } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) /* return the number of bits output */ int64_t get_bit_count(PutBitContext *s) @@ -101,7 +101,7 @@ void flush_put_bits(PutBitContext *s) #endif } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) void put_string(PutBitContext * pbc, char *s) { diff --git a/src/libffmpeg/libavcodec/dpcm.c b/src/libffmpeg/libavcodec/dpcm.c index ef4ccf886..aed892c53 100644 --- a/src/libffmpeg/libavcodec/dpcm.c +++ b/src/libffmpeg/libavcodec/dpcm.c @@ -44,6 +44,10 @@ typedef struct DPCMContext { #define SATURATE_S16(x) if (x < -32768) x = -32768; \ else if (x > 32767) x = 32767; #define SE_16BIT(x) if (x & 0x8000) x -= 0x10000; + +#undef LE_16 +#undef LE_32 + #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) #define LE_32(x) ((((uint8_t*)(x))[3] << 24) | \ (((uint8_t*)(x))[2] << 16) | \ diff --git a/src/libffmpeg/libavcodec/h263.c b/src/libffmpeg/libavcodec/h263.c index 0b09dc731..018300aa6 100644 --- a/src/libffmpeg/libavcodec/h263.c +++ b/src/libffmpeg/libavcodec/h263.c @@ -2377,6 +2377,7 @@ static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n #endif } +#if 0 static inline int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, uint8_t *scan_table) { @@ -2430,6 +2431,7 @@ static inline int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, in return len; } +#endif #endif @@ -2593,12 +2595,14 @@ static int h263_decode_gob_header(MpegEncContext *s) return 0; } +#if 0 static inline void memsetw(short *tab, int val, int n) { int i; for(i=0;imax_pic_num= 1<<(h->sps.log2_max_frame_num + 1); } +#if 0 if(h->nal_unit_type == NAL_IDR_SLICE){ get_ue_golomb(&s->gb); /* idr_pic_id */ } +#endif if(h->sps.poc_type==0){ h->poc_lsb= get_bits(&s->gb, h->sps.log2_max_poc_lsb); @@ -2982,12 +2984,14 @@ static int decode_slice_header(H264Context *h){ s->qscale = h->pps.init_qp + get_se_golomb(&s->gb); //slice_qp_delta //FIXME qscale / qp ... stuff +#if 0 if(h->slice_type == SP_TYPE){ get_bits1(&s->gb); /* sp_for_switch_flag */ } if(h->slice_type==SP_TYPE || h->slice_type == SI_TYPE){ get_se_golomb(&s->gb); /* slice_qs_delta */ } +#endif if( h->pps.deblocking_filter_parameters_present ) { h->disable_deblocking_filter_idc= get_ue_golomb(&s->gb); diff --git a/src/libffmpeg/libavcodec/i386/Makefile.am b/src/libffmpeg/libavcodec/i386/Makefile.am index 34fc82988..c9d90d951 100644 --- a/src/libffmpeg/libavcodec/i386/Makefile.am +++ b/src/libffmpeg/libavcodec/i386/Makefile.am @@ -34,6 +34,3 @@ endif libavcodec_mmx_la_SOURCES = $(mmx_modules) $(libavcodec_mmx_dummy) noinst_HEADERS = dsputil_mmx_avg.h dsputil_mmx_rnd.h mmx.h - -.s.lo: - $(ASCOMPILE) -o $@ `test -f $< || echo '$(srcdir)/'`$< diff --git a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c b/src/libffmpeg/libavcodec/i386/dsputil_mmx.c index c523be74a..a1e1642d5 100644 --- a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c +++ b/src/libffmpeg/libavcodec/i386/dsputil_mmx.c @@ -588,6 +588,7 @@ static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){ for(; idct_algo; const int idct_algo= avctx->idct_algo; - #ifdef CONFIG_ENCODERS + const int dct_algo = avctx->dct_algo; + if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX) c->fdct = ff_fdct_mmx; #endif //CONFIG_ENCODERS diff --git a/src/libffmpeg/libavcodec/i386/fdct_mmx.c b/src/libffmpeg/libavcodec/i386/fdct_mmx.c index 8d3552d2a..a2402c95d 100644 --- a/src/libffmpeg/libavcodec/i386/fdct_mmx.c +++ b/src/libffmpeg/libavcodec/i386/fdct_mmx.c @@ -7,9 +7,10 @@ * Intel Application Note AP-922 - fast, precise implementation of DCT * http://developer.intel.com/vtune/cbts/appnotes.htm */ -#include "../common.h" +#include "../dsputil.h" #include "mmx.h" +#undef ATTR_ALIGN #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align))) ////////////////////////////////////////////////////////////////////// diff --git a/src/libffmpeg/libavcodec/i386/idct_mmx.c b/src/libffmpeg/libavcodec/i386/idct_mmx.c index 298c8a8b0..654792e5e 100644 --- a/src/libffmpeg/libavcodec/i386/idct_mmx.c +++ b/src/libffmpeg/libavcodec/i386/idct_mmx.c @@ -22,10 +22,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common.h" +#include "../dsputil.h" #include "mmx.h" +#undef ATTR_ALIGN #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align))) #define ROW_SHIFT 11 @@ -554,6 +555,10 @@ static int32_t rounder5[] ATTR_ALIGN(8) = #undef COL_SHIFT #undef ROW_SHIFT +/* the macro below will generate these */ +void ff_mmx_idct(DCTELEM *block); +void ff_mmxext_idct(DCTELEM *block); + #define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \ void idct (int16_t * block) \ { \ diff --git a/src/libffmpeg/libavcodec/i386/motion_est_mmx.c b/src/libffmpeg/libavcodec/i386/motion_est_mmx.c index aa22f0649..950100e63 100644 --- a/src/libffmpeg/libavcodec/i386/motion_est_mmx.c +++ b/src/libffmpeg/libavcodec/i386/motion_est_mmx.c @@ -21,9 +21,9 @@ #include "../dsputil.h" static const __attribute__ ((aligned(8))) uint64_t round_tab[3]={ -0x0000000000000000, -0x0001000100010001, -0x0002000200020002, +0x0000000000000000ULL, +0x0001000100010001ULL, +0x0002000200020002ULL, }; static const __attribute__ ((aligned(8), unused)) uint64_t bone= 0x0101010101010101LL; diff --git a/src/libffmpeg/libavcodec/i386/simple_idct_mmx.c b/src/libffmpeg/libavcodec/i386/simple_idct_mmx.c index 626c1f565..1ee88b634 100644 --- a/src/libffmpeg/libavcodec/i386/simple_idct_mmx.c +++ b/src/libffmpeg/libavcodec/i386/simple_idct_mmx.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../dsputil.h" +#include "../simple_idct.h" /* 23170.475006 diff --git a/src/libffmpeg/libavcodec/imgconvert.c b/src/libffmpeg/libavcodec/imgconvert.c index f154e4437..93e19ff59 100644 --- a/src/libffmpeg/libavcodec/imgconvert.c +++ b/src/libffmpeg/libavcodec/imgconvert.c @@ -535,7 +535,7 @@ static void img_copy_plane(uint8_t *dst, int dst_wrap, /** * Copy image 'src' to 'dst'. */ -void img_copy(AVPicture *dst, const AVPicture *src, +static void img_copy(AVPicture *dst, const AVPicture *src, int pix_fmt, int width, int height) { int bwidth, bits, i; diff --git a/src/libffmpeg/libavcodec/libpostproc/Makefile.am b/src/libffmpeg/libavcodec/libpostproc/Makefile.am index 60aa5f9a3..26631d570 100644 --- a/src/libffmpeg/libavcodec/libpostproc/Makefile.am +++ b/src/libffmpeg/libavcodec/libpostproc/Makefile.am @@ -10,6 +10,3 @@ EXTRA_DIST = postprocess_template.c libpostprocess_la_SOURCES = postprocess.c noinst_HEADERS = mangle.h postprocess.h postprocess_internal.h - -.s.lo: - $(ASCOMPILE) -o $@ `test -f $< || echo '$(srcdir)/'`$< diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess.c b/src/libffmpeg/libavcodec/libpostproc/postprocess.c index 0db5341e3..11267b666 100644 --- a/src/libffmpeg/libavcodec/libpostproc/postprocess.c +++ b/src/libffmpeg/libavcodec/libpostproc/postprocess.c @@ -105,13 +105,13 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks //#define NUM_BLOCKS_AT_ONCE 16 //not used yet #ifdef ARCH_X86 -static const uint64_t __attribute__((aligned(8))) w05= 0x0005000500050005LL; -static const uint64_t __attribute__((aligned(8))) w20= 0x0020002000200020LL; - uint64_t __attribute__((aligned(8))) b00= 0x0000000000000000LL; -static const uint64_t __attribute__((aligned(8))) b01= 0x0101010101010101LL; -static const uint64_t __attribute__((aligned(8))) b02= 0x0202020202020202LL; -static const uint64_t __attribute__((aligned(8))) b08= 0x0808080808080808LL; -static const uint64_t __attribute__((aligned(8))) b80= 0x8080808080808080LL; +static const uint64_t __attribute__((aligned(8))) w05= 0x0005000500050005ULL; +static const uint64_t __attribute__((aligned(8))) w20= 0x0020002000200020ULL; +static const uint64_t __attribute__((aligned(8))) b00= 0x0000000000000000ULL; +static const uint64_t __attribute__((aligned(8))) b01= 0x0101010101010101ULL; +static const uint64_t __attribute__((aligned(8))) b02= 0x0202020202020202ULL; +static const uint64_t __attribute__((aligned(8))) b08= 0x0808080808080808ULL; +static const uint64_t __attribute__((aligned(8))) b80= 0x8080808080808080ULL; #endif @@ -153,13 +153,6 @@ static char *replaceTable[]= NULL //End Marker }; -#ifdef ARCH_X86 -static inline void unusedVariableWarningFixer() -{ - if(w05 + w20 + b00 + b01 + b02 + b08 + b80 == 0) b00=0; -} -#endif - // The horizontal Functions exist only in C cuz the MMX code is faster with vertical filters and transposing /** diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c b/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c index 582ad28f2..636212959 100644 --- a/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c +++ b/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c @@ -2788,7 +2788,6 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int uint64_t * const yHistogram= c.yHistogram; uint8_t * const tempSrc= c.tempSrc; uint8_t * const tempDst= c.tempDst; - const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4; #ifdef HAVE_MMX for(i=0; i<32; i++){ diff --git a/src/libffmpeg/libavcodec/mlib/Makefile.am b/src/libffmpeg/libavcodec/mlib/Makefile.am index 73f2495d6..69e9ed245 100644 --- a/src/libffmpeg/libavcodec/mlib/Makefile.am +++ b/src/libffmpeg/libavcodec/mlib/Makefile.am @@ -15,8 +15,3 @@ mlib_modules = $(libavcodec_mlib_src) endif libavcodec_mlib_la_SOURCES = $(mlib_modules) $(libavcodec_mlib_dummy) - -noinst_HEADERS = - -.s.lo: - $(ASCOMPILE) -o $@ `test -f $< || echo '$(srcdir)/'`$< diff --git a/src/libffmpeg/libavcodec/mpeg12.c b/src/libffmpeg/libavcodec/mpeg12.c index cd3a725ae..7cf6a21df 100644 --- a/src/libffmpeg/libavcodec/mpeg12.c +++ b/src/libffmpeg/libavcodec/mpeg12.c @@ -48,7 +48,7 @@ #define MB_BTYPE_VLC_BITS 6 #define TEX_VLC_BITS 9 -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static void mpeg1_encode_block(MpegEncContext *s, DCTELEM *block, int component); @@ -74,7 +74,7 @@ extern int XVMC_field_start(MpegEncContext *s, AVCodecContext *avctx); extern int XVMC_field_end(MpegEncContext *s); #endif -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL; static uint8_t fcode_tab[MAX_MV*2+1]; @@ -128,7 +128,7 @@ static void init_2d_vlc_rl(RLTable *rl) } } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static void init_uni_ac_vlc(RLTable *rl, uint32_t *uni_ac_vlc_bits, uint8_t *uni_ac_vlc_len){ int i; @@ -383,7 +383,7 @@ void ff_mpeg1_clean_buffers(MpegEncContext *s){ memset(s->last_mv, 0, sizeof(s->last_mv)); } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) void ff_mpeg1_encode_slice_header(MpegEncContext *s){ put_header(s, SLICE_MIN_START_CODE + s->mb_y); diff --git a/src/libffmpeg/libavcodec/mpegaudiodec.c b/src/libffmpeg/libavcodec/mpegaudiodec.c index 51c8ef130..b08f83757 100644 --- a/src/libffmpeg/libavcodec/mpegaudiodec.c +++ b/src/libffmpeg/libavcodec/mpegaudiodec.c @@ -1206,6 +1206,7 @@ static int decode_header(MPADecodeContext *s, uint32_t header) return 0; } +#if 0 /* useful helper to get mpeg audio stream infos. Return -1 if error in header */ int mp_decode_header(int *sample_rate_ptr, @@ -1246,6 +1247,7 @@ int mp_decode_header(int *sample_rate_ptr, *decoded_frame_size_ptr = decoded_frame_size * 2 * s->nb_channels; return 0; } +#endif /* return the number of decoded frames */ static int mp_decode_layer1(MPADecodeContext *s) diff --git a/src/libffmpeg/libavcodec/mpegvideo.c b/src/libffmpeg/libavcodec/mpegvideo.c index 0e04301a4..0dd59d62e 100644 --- a/src/libffmpeg/libavcodec/mpegvideo.c +++ b/src/libffmpeg/libavcodec/mpegvideo.c @@ -36,7 +36,7 @@ //#undef NDEBUG //#include -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static void encode_picture(MpegEncContext *s, int picture_number); #endif //CONFIG_ENCODERS static void dct_unquantize_mpeg1_c(MpegEncContext *s, @@ -46,7 +46,7 @@ static void dct_unquantize_mpeg2_c(MpegEncContext *s, static void dct_unquantize_h263_c(MpegEncContext *s, DCTELEM *block, int n, int qscale); static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w); -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); static int sse_mb(MpegEncContext *s); @@ -87,7 +87,7 @@ static const uint8_t h263_chroma_roundtab[16] = { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, }; -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static uint8_t (*default_mv_penalty)[MAX_MV*2+1]=NULL; static uint8_t default_fcode_tab[MAX_MV*2+1]; @@ -173,7 +173,7 @@ void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_s } } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) void ff_write_quant_matrix(PutBitContext *pb, int16_t *matrix){ int i; @@ -194,7 +194,7 @@ int DCT_common_init(MpegEncContext *s) s->dct_unquantize_mpeg1 = dct_unquantize_mpeg1_c; s->dct_unquantize_mpeg2 = dct_unquantize_mpeg2_c; -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) s->dct_quantize= dct_quantize_c; #endif @@ -217,7 +217,7 @@ int DCT_common_init(MpegEncContext *s) MPV_common_init_ppc(s); #endif -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) s->fast_dct_quantize= s->dct_quantize; if(s->flags&CODEC_FLAG_TRELLIS_QUANT){ @@ -569,7 +569,7 @@ void MPV_common_end(MpegEncContext *s) s->current_picture_ptr= NULL; } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) /* init video encoder */ int MPV_encode_init(AVCodecContext *avctx) @@ -686,6 +686,7 @@ int MPV_encode_init(AVCodecContext *avctx) s->low_delay= 0; //s->max_b_frames ? 0 : 1; avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1); break; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) case CODEC_ID_MPEG2VIDEO: s->out_format = FMT_MPEG1; s->low_delay= 0; //s->max_b_frames ? 0 : 1; @@ -801,6 +802,7 @@ int MPV_encode_init(AVCodecContext *avctx) avctx->delay=0; s->low_delay=1; break; +#endif #endif default: return -1; @@ -836,24 +838,25 @@ int MPV_encode_init(AVCodecContext *avctx) if (MPV_common_init(s) < 0) return -1; -#ifdef CONFIG_ENCODERS_FULL +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) ff_init_me(s); #endif -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY if (s->out_format == FMT_H263) h263_encode_init(s); if(s->msmpeg4_version) ff_msmpeg4_encode_init(s); +#endif #endif if (s->out_format == FMT_MPEG1) ff_mpeg1_encode_init(s); -#endif /* init default q matrix */ for(i=0;i<64;i++) { int j= s->dsp.idct_permutation[i]; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY if(s->codec_id==CODEC_ID_MPEG4 && s->mpeg_quant){ s->intra_matrix[j] = ff_mpeg4_default_intra_matrix[i]; @@ -862,6 +865,7 @@ int MPV_encode_init(AVCodecContext *avctx) s->intra_matrix[j] = s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i]; }else +#endif #endif { /* mpeg1/2 */ s->intra_matrix[j] = ff_mpeg1_default_intra_matrix[i]; @@ -906,8 +910,10 @@ int MPV_encode_end(AVCodecContext *avctx) ff_rate_control_uninit(s); MPV_common_end(s); +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) if (s->out_format == FMT_MJPEG) mjpeg_close(s); +#endif av_freep(&avctx->extradata); @@ -1343,7 +1349,7 @@ void ff_print_debug_info(MpegEncContext *s, Picture *pict){ } } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static int get_sae(uint8_t *src, int ref, int stride){ int x,y; @@ -1636,10 +1642,10 @@ int MPV_encode_picture(AVCodecContext *avctx, MPV_frame_end(s); +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) if (s->out_format == FMT_MJPEG) mjpeg_picture_trailer(s); -#ifdef CONFIG_ENCODERS_FULL if(s->flags&CODEC_FLAG_PASS1) ff_write_pass1_stats(s); #endif @@ -2611,7 +2617,7 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) } } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static inline void dct_single_coeff_elimination(MpegEncContext *s, int n, int threshold) { @@ -2816,7 +2822,7 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename } } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) static void encode_mb(MpegEncContext *s, int motion_x, int motion_y) { @@ -3055,6 +3061,7 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y) case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: mpeg1_encode_mb(s, s->block, motion_x, motion_y); break; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY case CODEC_ID_MPEG4: mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; @@ -3072,6 +3079,7 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y) #endif case CODEC_ID_MJPEG: mjpeg_encode_mb(s, s->block); break; +#endif default: assert(0); } @@ -3156,7 +3164,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){ s->parse_context.last_index= 0; } -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length) { int bytes= length>>4; @@ -3344,11 +3352,13 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->current_picture.mb_var_sum = 0; s->current_picture.mc_mb_var_sum = 0; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY /* we need to initialize some time vars before we can encode b-frames */ // RAL: Condition added for MPEG1VIDEO if (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->h263_msmpeg4)) ff_set_mpeg4_time(s, s->picture_number); +#endif #endif s->scene_change_score=0; @@ -3366,7 +3376,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) /* Estimate motion for every MB */ s->mb_intra=0; //for the rate distoration & bit compare functions if(s->pict_type != I_TYPE){ -#ifdef CONFIG_ENCODERS_FULL +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) if(s->pict_type != B_TYPE){ if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ s->me.pre_pass=1; @@ -3439,7 +3449,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); } -#ifdef CONFIG_ENCODERS_FULL +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) if(!s->umvplus){ if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) { s->f_code= ff_get_best_fcode(s, s->p_mv_table, MB_TYPE_INTER); @@ -3470,6 +3480,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->current_picture.quality = ff_rate_estimate_qscale(s); if(s->adaptive_quant){ +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY switch(s->codec_id){ case CODEC_ID_MPEG4: @@ -3481,6 +3492,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) ff_clean_h263_qscales(s); break; } +#endif #endif s->lambda= s->lambda_table[0]; @@ -3514,6 +3526,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->last_bits= get_bit_count(&s->pb); switch(s->out_format) { +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) case FMT_MJPEG: mjpeg_picture_header(s); break; @@ -3532,6 +3545,15 @@ static void encode_picture(MpegEncContext *s, int picture_number) else h263_encode_picture_header(s, picture_number); break; +#else + case FMT_H263: + break; +#endif +#else + case FMT_MJPEG: + break; + case FMT_H263: + break; #endif case FMT_MPEG1: mpeg1_encode_picture_header(s, picture_number); @@ -3566,6 +3588,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->last_mv_dir = 0; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY switch(s->codec_id){ case CODEC_ID_H263: @@ -3578,6 +3601,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) ff_mpeg4_init_partitions(s); break; } +#endif #endif s->resync_mb_x=0; @@ -3602,6 +3626,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) ff_update_block_index(s); /* write gob / video packet header */ +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY if(s->rtp_mode && mb_y + mb_x>0){ int current_packet_size, is_gob_start; @@ -3656,6 +3681,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->resync_mb_y=mb_y; } } +#endif #endif if( (s->resync_mb_x == s->mb_x) @@ -3742,8 +3768,10 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; s->mb_intra= 0; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY ff_mpeg4_set_direct_mv(s, mx, my); +#endif #endif encode_mb_hq(s, &backup_s, &best_s, MB_TYPE_DIRECT, pb, pb2, tex_pb, &dmin, &next_block, mx, my); @@ -3913,8 +3941,10 @@ static void encode_picture(MpegEncContext *s, int picture_number) s->mb_intra= 0; motion_x=s->b_direct_mv_table[xy][0]; motion_y=s->b_direct_mv_table[xy][1]; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY ff_mpeg4_set_direct_mv(s, motion_x, motion_y); +#endif #endif break; case MB_TYPE_BIDIR: @@ -3986,6 +4016,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) } emms_c(); +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY if(s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame) ff_mpeg4_merge_partitions(s); @@ -3995,6 +4026,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) if(s->codec_id==CODEC_ID_MPEG4) ff_mpeg4_stuffing(&s->pb); +#endif #endif //if (s->gob_number) @@ -4634,7 +4666,7 @@ static const AVOption mpeg4_options[] = AVOPTION_END() }; -#ifdef CONFIG_ENCODERS +#if defined(CONFIG_ENCODERS) || defined(XINE_MPEG_ENCODER) AVCodec mpeg1video_encoder = { "mpeg1video", @@ -4646,6 +4678,7 @@ AVCodec mpeg1video_encoder = { MPV_encode_end, }; +#if defined(CONFIG_ENCODERS) || !defined(XINE_MPEG_ENCODER) #ifdef CONFIG_RISKY AVCodec mpeg2video_encoder = { @@ -4765,5 +4798,7 @@ AVCodec mjpeg_encoder = { MPV_encode_end, }; +#endif + #endif //CONFIG_ENCODERS diff --git a/src/libffmpeg/libavcodec/msvideo1.c b/src/libffmpeg/libavcodec/msvideo1.c index 71d8af987..6e1d0a8d4 100644 --- a/src/libffmpeg/libavcodec/msvideo1.c +++ b/src/libffmpeg/libavcodec/msvideo1.c @@ -38,6 +38,8 @@ #include "avcodec.h" #include "dsputil.h" +#undef LE_16 + #define PALETTE_COUNT 256 #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) #define CHECK_STREAM_PTR(n) \ diff --git a/src/libffmpeg/libavcodec/ppc/Makefile.am b/src/libffmpeg/libavcodec/ppc/Makefile.am index 8d3b6cea8..fbd734c29 100644 --- a/src/libffmpeg/libavcodec/ppc/Makefile.am +++ b/src/libffmpeg/libavcodec/ppc/Makefile.am @@ -1,8 +1,9 @@ include $(top_srcdir)/misc/Makefile.common -# we must not use CFLAGS here, gcc optimizations produce -# bad code if we do so. AM_CFLAGS = $(LIBFFMPEG_CFLAGS) +# CFLAGS is here to filter out -funroll-loops because it causes bad +# behavior of libavcodec +CFLAGS = `echo @CFLAGS@ | sed -e 's/-funroll-loops//g'` ASFLAGS = @@ -19,14 +20,11 @@ libavcodec_ppc_dummy = libavcodec_ppc_dummy.c EXTRA_DIST = $(libavcodec_ppc_src) $(libavcodec_ppc_dummy) -if ARCH_POWERPC -ppc_modules = $(libavcodec_ppc_src) -endif +#if PPC_ARCH +#ppc_modules = $(libavcodec_ppc_src) +#endif libavcodec_ppc_la_SOURCES = $(ppc_modules) $(libavcodec_ppc_dummy) noinst_HEADERS = dsputil_altivec.h dsputil_ppc.h gcc_fixes.h - -.s.lo: - $(ASCOMPILE) -o $@ `test -f $< || echo '$(srcdir)/'`$< diff --git a/src/libffmpeg/libavcodec/ra144.c b/src/libffmpeg/libavcodec/ra144.c index 2d882f744..fbc145af1 100644 --- a/src/libffmpeg/libavcodec/ra144.c +++ b/src/libffmpeg/libavcodec/ra144.c @@ -495,7 +495,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, temp=glob->swapbuf2alt; glob->swapbuf2alt=glob->swapbuf2; glob->swapbuf2=temp; - *data_size=data-datao; + *data_size=(char *)data-(char *)datao; return 20; } diff --git a/src/libffmpeg/libavcodec/ra288.c b/src/libffmpeg/libavcodec/ra288.c index b59074822..979be2e7c 100644 --- a/src/libffmpeg/libavcodec/ra288.c +++ b/src/libffmpeg/libavcodec/ra288.c @@ -206,7 +206,7 @@ static void prodsum(float *tgt, float *src, int len, int n) } } -void * decode_block(AVCodecContext * avctx, unsigned char *in, signed short int *out,unsigned len) +static void * decode_block(AVCodecContext * avctx, unsigned char *in, signed short int *out,unsigned len) { int x,y; Real288_internal *glob=avctx->priv_data; @@ -255,7 +255,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, data=decode_block(avctx,&buf[j*cfs+cfs*i*h/2],(signed short *)data,cfs); bret += cfs; } - *data_size = data - datao; + *data_size = (char *)data - (char *)datao; return bret; } else diff --git a/src/libffmpeg/libavcodec/rpza.c b/src/libffmpeg/libavcodec/rpza.c index 675d7f34c..e002c14dd 100644 --- a/src/libffmpeg/libavcodec/rpza.c +++ b/src/libffmpeg/libavcodec/rpza.c @@ -54,6 +54,9 @@ typedef struct RpzaContext { } RpzaContext; +#undef BE_16 +#undef BE_32 + #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) #define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \ (((uint8_t*)(x))[1] << 16) | \ diff --git a/src/libffmpeg/libavcodec/rv10.c b/src/libffmpeg/libavcodec/rv10.c index c19c36ec5..b057ae602 100644 --- a/src/libffmpeg/libavcodec/rv10.c +++ b/src/libffmpeg/libavcodec/rv10.c @@ -257,6 +257,7 @@ void rv10_encode_picture_header(MpegEncContext *s, int picture_number) put_bits(&s->pb, 3, 0); /* ignored */ } +#if 0 static int get_num(GetBitContext *gb) { int n, n1; @@ -269,6 +270,7 @@ static int get_num(GetBitContext *gb) return (n << 16) | n1; } } +#endif #endif //CONFIG_ENCODERS diff --git a/src/libffmpeg/libavcodec/utils.c b/src/libffmpeg/libavcodec/utils.c index ace54ef11..2334de8e6 100644 --- a/src/libffmpeg/libavcodec/utils.c +++ b/src/libffmpeg/libavcodec/utils.c @@ -129,7 +129,7 @@ typedef struct InternalBuffer{ #define ALIGN(x, a) (((x)+(a)-1)&~((a)-1)) -void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){ +static void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){ int w_align= 1; int h_align= 1; @@ -283,7 +283,7 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ //printf("R%X\n", pic->opaque); } -enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, enum PixelFormat * fmt){ +static enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, enum PixelFormat * fmt){ return fmt[0]; } @@ -491,7 +491,7 @@ AVCodec *avcodec_find_decoder_by_name(const char *name) return NULL; } -AVCodec *avcodec_find(enum CodecID id) +static AVCodec *avcodec_find(enum CodecID id) { AVCodec *p; p = first_avcodec; diff --git a/src/libffmpeg/libavcodec/vp3.c b/src/libffmpeg/libavcodec/vp3.c index c72c7fc16..430212ad8 100644 --- a/src/libffmpeg/libavcodec/vp3.c +++ b/src/libffmpeg/libavcodec/vp3.c @@ -314,7 +314,7 @@ typedef struct Vp3DecodeContext { #define xC6S2 25080 #define xC7S1 12785 -void vp3_idct_c(int16_t *input_data, int16_t *dequant_matrix, +static void vp3_idct_c(int16_t *input_data, int16_t *dequant_matrix, int16_t *output_data) { int32_t intermediate_data[64]; @@ -548,7 +548,7 @@ void vp3_idct_c(int16_t *input_data, int16_t *dequant_matrix, } } -void vp3_idct_put(int16_t *input_data, int16_t *dequant_matrix, +static void vp3_idct_put(int16_t *input_data, int16_t *dequant_matrix, uint8_t *dest, int stride) { int16_t transformed_data[64]; @@ -574,7 +574,7 @@ void vp3_idct_put(int16_t *input_data, int16_t *dequant_matrix, } } -void vp3_idct_add(int16_t *input_data, int16_t *dequant_matrix, +static void vp3_idct_add(int16_t *input_data, int16_t *dequant_matrix, uint8_t *dest, int stride) { int16_t transformed_data[64]; diff --git a/src/libffmpeg/libavcodec/vqavideo.c b/src/libffmpeg/libavcodec/vqavideo.c index 8f4ac173f..b3b310b64 100644 --- a/src/libffmpeg/libavcodec/vqavideo.c +++ b/src/libffmpeg/libavcodec/vqavideo.c @@ -82,6 +82,10 @@ #define MAX_VECTORS (MAX_CODEBOOK_VECTORS + SOLID_PIXEL_VECTORS) #define MAX_CODEBOOK_SIZE (MAX_VECTORS * 4 * 4) +#undef LE_16 +#undef BE_16 +#undef BE_32 + #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) #define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \ diff --git a/src/libffmpeg/libavcodec/xan.c b/src/libffmpeg/libavcodec/xan.c index 49e207677..742bd3705 100644 --- a/src/libffmpeg/libavcodec/xan.c +++ b/src/libffmpeg/libavcodec/xan.c @@ -58,6 +58,10 @@ typedef struct XanContext { } XanContext; +#undef BE_16 +#undef LE_16 +#undef LE_32 + #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) #define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) #define LE_32(x) ((((uint8_t*)(x))[3] << 24) | \ @@ -69,6 +73,8 @@ typedef struct XanContext { #define SCALEFACTOR 65536 #define CENTERSAMPLE 128 +#undef COMPUTE_Y + #define COMPUTE_Y(r, g, b) \ (unsigned char) \ ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR) diff --git a/src/libffmpeg/xine_encoder.c b/src/libffmpeg/xine_encoder.c index a993a6955..cb8a996b2 100644 --- a/src/libffmpeg/xine_encoder.c +++ b/src/libffmpeg/xine_encoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_encoder.c,v 1.6 2003/09/11 10:01:02 mroi Exp $ + * $Id: xine_encoder.c,v 1.7 2003/11/01 18:12:53 mroi Exp $ */ /* mpeg encoders for the dxr3 video out plugin. */ @@ -256,7 +256,6 @@ static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame) { int size; lavc_data_t* this = (lavc_data_t *)drv->enc; - char tmpstr[128]; ssize_t written; if (frame->vo_frame.bad_frame) return 1; -- cgit v1.2.3