Files
haikuports/media-video/ffmpeg/patches/ffmpeg-0.11.5.patchset
Adrien Destugues 4f177d6f8e ffmpeg 0.11: make it work with gcc2.
* Assembler code completely disabled for gcc2. Cross platform C code is
used instead, which means this needs more CPU than the 0.10.x branch
with asm enabled. But, at least it works.
* Redone the gcc2 support to make it more well behaved. Things that only
* need to be disabled for gcc2 are under a #if __GNUC__ > 2 check,
instead of #if 0. Also removed a lot of hacks to the configure script
that are not needed anymore.
* Since the patch for gcc2 should not create problems for the gcc4
version, use a single patch. The hack used to decide which patchset to
use did not work, because effectoiveTargetarchitecture was not set yet
when parsing the file to find the PATCHES variable.
* I leave this marked as broken for gcc2, because 0.11.5 was not updated
for years, while the ffmpeg team is still updating the 0.10.x branch
with regular releases. This means 0.10 gets bugfixes in the codecs, and
0.11 doesn't. We better use the latest codecs, even if we don't get the
latest API.
2015-08-30 16:25:00 +02:00

1044 lines
34 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From 6f35c0d178448ffa3b8fc22c9b88694c52f4e132 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Fri, 24 Oct 2014 09:41:41 +0000
Subject: applying patch ffmpeg-0.11.5-gcc4.patch
diff --git a/doc/filters.texi b/doc/filters.texi
index 324a154..7303a7d 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -2924,7 +2924,7 @@ Tile several successive frames together.
It accepts as argument the tile size (i.e. the number of lines and columns)
in the form "@var{w}x@var{h}".
-For example, produce 8×8 PNG tiles of all keyframes (@option{-skip_frame
+For example, produce 8x8 PNG tiles of all keyframes (@option{-skip_frame
nokey}) in a movie:
@example
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
--
2.2.2
From 048247798d420c5c081dfa87c36c1c3099b122c5 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Sun, 30 Aug 2015 10:59:56 +0200
Subject: Fix build with gcc2 and --disable-asm.
* Confirmed that this fixes the problems with playing h264 and other
formats. Not sure if the update to 0.11.5 is worth it, since apparently
the 0.10.x series is getting more updates from ffmpeg team.
diff --git a/cmdutils.c b/cmdutils.c
index 9afb54c..e331af1 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -20,6 +20,7 @@
*/
#include <string.h>
+#include <stdarg.h>
#include <stdlib.h>
#include <errno.h>
#include <math.h>
@@ -55,6 +56,8 @@
#include <sys/resource.h>
#endif
+#define va_copy(a,b) ((a)=(b))
+
struct SwsContext *sws_opts;
SwrContext *swr_opts;
AVDictionary *format_opts, *codec_opts;
diff --git a/ffprobe.c b/ffprobe.c
index d53ec11..d91eda7 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -312,7 +312,7 @@ static void writer_print_time(WriterContext *wctx, const char *key,
writer_print_string(wctx, key, "N/A", 1);
} else {
double d = ts * av_q2d(*time_base);
- value_string(buf, sizeof(buf), (struct unit_value){.val.d=d, .unit=unit_second_str});
+ value_string(buf, sizeof(buf), (struct unit_value){d, unit_second_str});
writer_print_string(wctx, key, buf, 0);
}
}
@@ -1188,7 +1188,7 @@ static void writer_register_all(void)
#define print_time(k, v, tb) writer_print_time(w, k, v, tb)
#define print_ts(k, v) writer_print_ts(w, k, v)
#define print_val(k, v, u) writer_print_string(w, k, \
- value_string(val_str, sizeof(val_str), (struct unit_value){.val.i = v, .unit=u}), 0)
+ value_string(val_str, sizeof(val_str), (struct unit_value){v, u}), 0)
#define print_section_header(s) writer_print_section_header(w, s)
#define print_section_footer(s) writer_print_section_footer(w, s)
#define show_tags(metadata) writer_show_tags(w, metadata)
@@ -1658,7 +1658,9 @@ static void ffprobe_show_library_versions(WriterContext *w)
SHOW_LIB_VERSION(avfilter, AVFILTER);
SHOW_LIB_VERSION(swscale, SWSCALE);
SHOW_LIB_VERSION(swresample, SWRESAMPLE);
+#if 0
SHOW_LIB_VERSION(postproc, POSTPROC);
+#endif
writer_print_chapter_footer(w, "library_versions");
}
diff --git a/libavcodec/aacpsdsp.c b/libavcodec/aacpsdsp.c
index e90c50b..84c4a49 100644
--- a/libavcodec/aacpsdsp.c
+++ b/libavcodec/aacpsdsp.c
@@ -209,6 +209,7 @@ av_cold void ff_psdsp_init(PSDSPContext *s)
s->stereo_interpolate[0] = ps_stereo_interpolate_c;
s->stereo_interpolate[1] = ps_stereo_interpolate_ipdopd_c;
- if (ARCH_ARM)
+#if ARCH_ARM
ff_psdsp_init_arm(s);
+#endif
}
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c
index 581e5f5..cf7dedc 100644
--- a/libavcodec/ac3dsp.c
+++ b/libavcodec/ac3dsp.c
@@ -228,8 +228,10 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact)
c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c;
c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c;
- if (ARCH_ARM)
+#if ARCH_ARM
ff_ac3dsp_init_arm(c, bit_exact);
- if (HAVE_MMX)
+#endif
+#if HAVE_MMX
ff_ac3dsp_init_x86(c, bit_exact);
+#endif
}
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index ac05b9b..8ca524a 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -54,6 +54,7 @@ void avcodec_register_all(void)
initialized = 1;
/* hardware accelerators */
+#if __GNUC__ > 2
REGISTER_HWACCEL (H263_VAAPI, h263_vaapi);
REGISTER_HWACCEL (H264_DXVA2, h264_dxva2);
REGISTER_HWACCEL (H264_VAAPI, h264_vaapi);
@@ -67,6 +68,7 @@ void avcodec_register_all(void)
REGISTER_HWACCEL (VC1_VAAPI, vc1_vaapi);
REGISTER_HWACCEL (WMV3_DXVA2, wmv3_dxva2);
REGISTER_HWACCEL (WMV3_VAAPI, wmv3_vaapi);
+#endif
/* video codecs */
REGISTER_ENCODER (A64MULTI, a64multi);
diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c
index 192e0f9..42fa63c 100644
--- a/libavcodec/cavsdsp.c
+++ b/libavcodec/cavsdsp.c
@@ -544,5 +544,7 @@ av_cold void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx) {
c->cavs_filter_ch = cavs_filter_ch_c;
c->cavs_idct8_add = cavs_idct8_add_c;
- if (HAVE_MMX) ff_cavsdsp_init_mmx(c, avctx);
+#if HAVE_MMX
+ ff_cavsdsp_init_mmx(c, avctx);
+#endif
}
diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c
index dd4994d..7a980a1 100644
--- a/libavcodec/dcadsp.c
+++ b/libavcodec/dcadsp.c
@@ -47,5 +47,7 @@ static void dca_lfe_fir_c(float *out, const float *in, const float *coefs,
void ff_dcadsp_init(DCADSPContext *s)
{
s->lfe_fir = dca_lfe_fir_c;
- if (ARCH_ARM) ff_dcadsp_init_arm(s);
+#if ARCH_ARM
+ ff_dcadsp_init_arm(s);
+#endif
}
diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index 4800e13..aff6a81 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -208,8 +208,9 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
}
s->dct32 = ff_dct32_float;
- if (HAVE_MMX)
+#if HAVE_MMX
ff_dct_init_mmx(s);
+#endif
return 0;
}
diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c
index 429241d..57990b1 100644
--- a/libavcodec/diracdsp.c
+++ b/libavcodec/diracdsp.c
@@ -197,5 +197,7 @@ void ff_diracdsp_init(DiracDSPContext *c)
PIXFUNC(avg, 16);
PIXFUNC(avg, 32);
- if (HAVE_MMX && HAVE_YASM) ff_diracdsp_init_mmx(c);
+#if HAVE_MMX && HAVE_YASM
+ ff_diracdsp_init_mmx(c);
+#endif
}
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index a13540d..96a955a 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -3169,14 +3169,30 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
}
- if (HAVE_MMX) ff_dsputil_init_mmx (c, avctx);
- if (ARCH_ARM) ff_dsputil_init_arm (c, avctx);
- if (HAVE_VIS) ff_dsputil_init_vis (c, avctx);
- if (ARCH_ALPHA) ff_dsputil_init_alpha (c, avctx);
- if (ARCH_PPC) ff_dsputil_init_ppc (c, avctx);
- if (HAVE_MMI) ff_dsputil_init_mmi (c, avctx);
- if (ARCH_SH4) ff_dsputil_init_sh4 (c, avctx);
- if (ARCH_BFIN) ff_dsputil_init_bfin (c, avctx);
+#if HAVE_MMX
+ ff_dsputil_init_mmx (c, avctx);
+#endif
+#if ARCH_ARM
+ ff_dsputil_init_arm (c, avctx);
+#endif
+#if HAVE_VIS
+ ff_dsputil_init_vis (c, avctx);
+#endif
+#if ARCH_ALPHA
+ ff_dsputil_init_alpha (c, avctx);
+#endif
+#if ARCH_PPC
+ ff_dsputil_init_ppc (c, avctx);
+#endif
+#if HAVE_MMI
+ ff_dsputil_init_mmi (c, avctx);
+#endif
+#if ARCH_SH4
+ ff_dsputil_init_sh4 (c, avctx);
+#endif
+#if ARCH_BFIN
+ ff_dsputil_init_bfin (c, avctx);
+#endif
for (i = 0; i < 4; i++) {
for (j = 0; j < 16; j++) {
diff --git a/libavcodec/dwt.c b/libavcodec/dwt.c
index 6c1f131..e87b19a 100644
--- a/libavcodec/dwt.c
+++ b/libavcodec/dwt.c
@@ -993,8 +993,9 @@ void ff_dwt_init(DWTContext *c)
c->horizontal_compose97i = ff_snow_horizontal_compose97i;
c->inner_add_yblock = ff_snow_inner_add_yblock;
- if (HAVE_MMX)
+#if HAVE_MMX
ff_dwt_init_x86(c);
+#endif
}
diff --git a/libavcodec/fft.c b/libavcodec/fft.c
index 6b93a5c..916145e 100644
--- a/libavcodec/fft.c
+++ b/libavcodec/fft.c
@@ -164,7 +164,9 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
if (CONFIG_MDCT) s->mdct_calcw = s->mdct_calc;
#else
if (CONFIG_MDCT) s->mdct_calcw = ff_mdct_calcw_c;
- if (ARCH_ARM) ff_fft_fixed_init_arm(s);
+#if ARCH_ARM
+ ff_fft_fixed_init_arm(s);
+#endif
#endif
for(j=4; j<=nbits; j++) {
diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c
index c03117c..40c0e33 100644
--- a/libavcodec/fmtconvert.c
+++ b/libavcodec/fmtconvert.c
@@ -82,9 +82,15 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx)
c->float_to_int16_interleave = float_to_int16_interleave_c;
c->float_interleave = ff_float_interleave_c;
- if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx);
- if (HAVE_ALTIVEC) ff_fmt_convert_init_altivec(c, avctx);
- if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx);
+#if (ARCH_ARM)
+ ff_fmt_convert_init_arm(c, avctx);
+#endif
+#if (HAVE_ALTIVEC)
+ ff_fmt_convert_init_altivec(c, avctx);
+#endif
+#if (HAVE_MMX)
+ ff_fmt_convert_init_x86(c, avctx);
+#endif
}
/* ffdshow custom code */
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 4d3c7b8..c3873f9 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -648,10 +648,12 @@ retry:
if (!s->divx_packed) ff_thread_finish_setup(avctx);
- if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
+#if CONFIG_MPEG4_VDPAU_DECODER
+ if ((s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
ff_vdpau_mpeg4_decode_picture(s, s->gb.buffer, s->gb.buffer_end - s->gb.buffer);
goto frame_end;
}
+#endif
if (avctx->hwaccel) {
if (avctx->hwaccel->start_frame(avctx, s->gb.buffer, s->gb.buffer_end - s->gb.buffer) < 0)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 1e6326f..fe76cf7 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2746,9 +2746,10 @@ static int field_end(H264Context *h, int in_setup)
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX,
s->picture_structure == PICT_BOTTOM_FIELD);
- if (CONFIG_H264_VDPAU_DECODER &&
- s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+#if CONFIG_H264_VDPAU_DECODER
+ if (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_set_reference_frames(s);
+#endif
if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
if (!s->dropable) {
@@ -2767,9 +2768,11 @@ static int field_end(H264Context *h, int in_setup)
"hardware accelerator failed to decode picture\n");
}
+#if CONFIG_H264_VDPAU_DECODER
if (CONFIG_H264_VDPAU_DECODER &&
s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_picture_complete(s);
+#endif
/*
* FIXME: Error handling code does not seem to support interlaced
@@ -4394,9 +4397,11 @@ again:
if (s->avctx->hwaccel &&
s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
return -1;
+#if CONFIG_H264_VDPAU_DECODER
if (CONFIG_H264_VDPAU_DECODER &&
s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_picture_start(s);
+#endif
}
if (hx->redundant_pic_count == 0 &&
@@ -4412,6 +4417,7 @@ again:
&buf[buf_index - consumed],
consumed) < 0)
return -1;
+#if CONFIG_H264_VDPAU_DECODER
} else if (CONFIG_H264_VDPAU_DECODER &&
s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) {
static const uint8_t start_code[] = {
@@ -4420,6 +4426,7 @@ again:
sizeof(start_code));
ff_vdpau_add_data_chunk(s, &buf[buf_index - consumed],
consumed);
+#endif
} else
context_count++;
}
diff --git a/libavcodec/h264dsp.c b/libavcodec/h264dsp.c
index bd35aa3..7b69198 100644
--- a/libavcodec/h264dsp.c
+++ b/libavcodec/h264dsp.c
@@ -111,7 +111,13 @@ void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_fo
break;
}
- if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc);
- if (HAVE_ALTIVEC) ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc);
- if (HAVE_MMX) ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc);
+#if (ARCH_ARM)
+ ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc);
+#endif
+#if (HAVE_ALTIVEC)
+ ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc);
+#endif
+#if (HAVE_MMX)
+ ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc);
+#endif
}
diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c
index a174b4c..78e33cb 100644
--- a/libavcodec/h264pred.c
+++ b/libavcodec/h264pred.c
@@ -532,6 +532,10 @@ void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, co
break;
}
- if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
- if (HAVE_MMX) ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
+#if (ARCH_ARM)
+ ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
+#endif
+#if (HAVE_MMX)
+ ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
+#endif
}
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index 5faddc2..459ec34 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -258,8 +258,9 @@ av_cold int ff_lpc_init(LPCContext *s, int blocksize, int max_order,
s->lpc_apply_welch_window = lpc_apply_welch_window_c;
s->lpc_compute_autocorr = lpc_compute_autocorr_c;
- if (HAVE_MMX)
+#if (HAVE_MMX)
ff_lpc_init_x86(s);
+#endif
return 0;
}
diff --git a/libavcodec/mlpdsp.c b/libavcodec/mlpdsp.c
index 7ec8dd2..f1c04c0 100644
--- a/libavcodec/mlpdsp.c
+++ b/libavcodec/mlpdsp.c
@@ -58,6 +58,7 @@ static void ff_mlp_filter_channel(int32_t *state, const int32_t *coeff,
void ff_mlp_init(DSPContext* c, AVCodecContext *avctx)
{
c->mlp_filter_channel = ff_mlp_filter_channel;
- if (ARCH_X86)
+#if (ARCH_X86)
ff_mlp_init_x86(c, avctx);
+#endif
}
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index bcee1d8..8a8cdac 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -834,12 +834,14 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64])
memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */
s->mb_intra = 1;
// if 1, we memcpy blocks in xvmcvideo
+#if CONFIG_XVMC_DECODER
if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks
if (s->swap_uv) {
exchange_uv(s);
}
}
+#endif
if (s->codec_id == CODEC_ID_MPEG2VIDEO) {
if (s->flags2 & CODEC_FLAG2_FAST) {
@@ -1052,12 +1054,14 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64])
}
//if 1, we memcpy blocks in xvmcvideo
+#if CONFIG_XVMC_DECODER
if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
ff_xvmc_pack_pblocks(s, cbp);
if (s->swap_uv) {
exchange_uv(s);
}
}
+#endif
if (s->codec_id == CODEC_ID_MPEG2VIDEO) {
if (s->flags2 & CODEC_FLAG2_FAST) {
@@ -1656,9 +1660,11 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
// MPV_frame_start will call this function too,
// but we need to call it on every field
+#if CONFIG_MPEG_XVMC_DECODER
if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
if (ff_xvmc_field_start(s, avctx) < 0)
return -1;
+#endif
return 0;
}
diff --git a/libavcodec/mpegaudiodsp.c b/libavcodec/mpegaudiodsp.c
index cc12dd9..b311d21 100644
--- a/libavcodec/mpegaudiodsp.c
+++ b/libavcodec/mpegaudiodsp.c
@@ -40,7 +40,13 @@ void ff_mpadsp_init(MPADSPContext *s)
s->imdct36_blocks_float = ff_imdct36_blocks_float;
s->imdct36_blocks_fixed = ff_imdct36_blocks_fixed;
- if (ARCH_ARM) ff_mpadsp_init_arm(s);
- if (HAVE_MMX) ff_mpadsp_init_mmx(s);
- if (HAVE_ALTIVEC) ff_mpadsp_init_altivec(s);
+#if (ARCH_ARM)
+ ff_mpadsp_init_arm(s);
+#endif
+#if (HAVE_MMX)
+ ff_mpadsp_init_mmx(s);
+#endif
+#if (HAVE_ALTIVEC)
+ ff_mpadsp_init_altivec(s);
+#endif
}
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 705951a..49f52d5 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1327,8 +1327,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
update_noise_reduction(s);
}
+#if CONFIG_MPEG_XVMC_DECODER
if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
return ff_xvmc_field_start(s, avctx);
+#endif
return 0;
}
@@ -1340,9 +1342,12 @@ void ff_MPV_frame_end(MpegEncContext *s)
int i;
/* redraw edges for the frame if decoding didn't complete */
// just to make sure that all data is rendered.
+#if CONFIG_MPEG_XVMC_DECODER
if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
ff_xvmc_field_end(s);
- } else if((s->error_count || s->encoding || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) &&
+ } else
+#endif
+ if((s->error_count || s->encoding || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) &&
!s->avctx->hwaccel &&
!(s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) &&
s->unrestricted_mv &&
@@ -2271,10 +2276,12 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
int lowres_flag, int is_mpeg12)
{
const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
+#if CONFIG_MPEG_XVMC_DECODER
if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){
ff_xvmc_decode_mb(s);//xvmc uses pblocks
return;
}
+#endif
if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {
/* save DCT coefficients */
diff --git a/libavcodec/pngdsp.c b/libavcodec/pngdsp.c
index eb8c6b2..989d9eb 100644
--- a/libavcodec/pngdsp.c
+++ b/libavcodec/pngdsp.c
@@ -44,5 +44,7 @@ void ff_pngdsp_init(PNGDSPContext *dsp)
dsp->add_bytes_l2 = add_bytes_l2_c;
dsp->add_paeth_prediction = ff_add_png_paeth_prediction;
- if (HAVE_MMX) ff_pngdsp_init_x86(dsp);
+#if (HAVE_MMX)
+ ff_pngdsp_init_x86(dsp);
+#endif
}
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index c29435b..181b4a1 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -56,7 +56,8 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
uint8_t *d;
const uint8_t *s;
- mask = (int[]){0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}[pass];
+ const int tmp[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
+ mask = tmp[pass];
switch(bits_per_pixel) {
case 1:
memset(dst, 0, row_size);
diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
index a21003c..99c22a5 100644
--- a/libavcodec/proresdsp.c
+++ b/libavcodec/proresdsp.c
@@ -74,7 +74,9 @@ void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
dsp->idct_put = prores_idct_put_c;
dsp->idct_permutation_type = FF_NO_IDCT_PERM;
- if (HAVE_MMX) ff_proresdsp_x86_init(dsp, avctx);
+#if (HAVE_MMX)
+ ff_proresdsp_x86_init(dsp, avctx);
+#endif
ff_init_scantable_permutation(dsp->idct_permutation,
dsp->idct_permutation_type);
diff --git a/libavcodec/rdft.c b/libavcodec/rdft.c
index ebddd8b..9509bc4 100644
--- a/libavcodec/rdft.c
+++ b/libavcodec/rdft.c
@@ -122,7 +122,9 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
#endif
s->rdft_calc = ff_rdft_calc_c;
- if (ARCH_ARM) ff_rdft_init_arm(s);
+#if (ARCH_ARM)
+ ff_rdft_init_arm(s);
+#endif
return 0;
}
diff --git a/libavcodec/rv34dsp.c b/libavcodec/rv34dsp.c
index 1ddcea4..b6b380a 100644
--- a/libavcodec/rv34dsp.c
+++ b/libavcodec/rv34dsp.c
@@ -134,8 +134,10 @@ av_cold void ff_rv34dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->rv34_idct_add = rv34_idct_add_c;
c->rv34_idct_dc_add = rv34_idct_dc_add_c;
- if (HAVE_NEON)
+#if (HAVE_NEON)
ff_rv34dsp_init_neon(c, dsp);
- if (HAVE_MMX)
+#endif
+#if (HAVE_MMX)
ff_rv34dsp_init_x86(c, dsp);
+#endif
}
diff --git a/libavcodec/rv40dsp.c b/libavcodec/rv40dsp.c
index 8ba10be..c1bfd95 100644
--- a/libavcodec/rv40dsp.c
+++ b/libavcodec/rv40dsp.c
@@ -602,8 +602,10 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->rv40_loop_filter_strength[0] = rv40_h_loop_filter_strength;
c->rv40_loop_filter_strength[1] = rv40_v_loop_filter_strength;
- if (HAVE_MMX)
+#if (HAVE_MMX)
ff_rv40dsp_init_x86(c, dsp);
- if (HAVE_NEON)
+#endif
+#if (HAVE_NEON)
ff_rv40dsp_init_neon(c, dsp);
+#endif
}
diff --git a/libavcodec/sbrdsp.c b/libavcodec/sbrdsp.c
index 8c88fb3..b3879b9 100644
--- a/libavcodec/sbrdsp.c
+++ b/libavcodec/sbrdsp.c
@@ -241,8 +241,10 @@ av_cold void ff_sbrdsp_init(SBRDSPContext *s)
s->hf_apply_noise[2] = sbr_hf_apply_noise_2;
s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
- if (ARCH_ARM)
+#if (ARCH_ARM)
ff_sbrdsp_init_arm(s);
- if (HAVE_MMX)
+#endif
+#if (HAVE_MMX)
ff_sbrdsp_init_x86(s);
+#endif
}
diff --git a/libavcodec/synth_filter.c b/libavcodec/synth_filter.c
index 5f10530..9ecd440 100644
--- a/libavcodec/synth_filter.c
+++ b/libavcodec/synth_filter.c
@@ -60,5 +60,7 @@ av_cold void ff_synth_filter_init(SynthFilterContext *c)
{
c->synth_filter_float = synth_filter_float;
- if (ARCH_ARM) ff_synth_filter_init_arm(c);
+#if (ARCH_ARM)
+ ff_synth_filter_init_arm(c);
+#endif
}
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 4533903..9684360 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -63,8 +63,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->unpack_frame = v210_planar_unpack_c;
- if (HAVE_MMX)
+#if (HAVE_MMX)
v210_x86_init(s);
+#endif
return 0;
}
@@ -101,8 +102,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
aligned_input = !((uintptr_t)psrc & 0xf) && !(stride & 0xf);
if (aligned_input != s->aligned_input) {
s->aligned_input = aligned_input;
- if (HAVE_MMX)
+#if (HAVE_MMX)
v210_x86_init(s);
+#endif
}
if (pic->data[0])
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 309194e..6341d98 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5545,10 +5545,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->me.qpel_put = s->dsp.put_qpel_pixels_tab;
s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab;
+#if CONFIG_VC1_VDPAU_DECODER
if ((CONFIG_VC1_VDPAU_DECODER)
&&s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_vc1_decode_picture(s, buf_start, (buf + buf_size) - buf_start);
- else if (avctx->hwaccel) {
+ else
+#endif
+ if (avctx->hwaccel) {
if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
goto err;
if (avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start) < 0)
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index da7593f..38a28aa 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -846,8 +846,10 @@ av_cold void ff_vc1dsp_init(VC1DSPContext* dsp) {
dsp->sprite_v_double_twoscale = sprite_v_double_twoscale_c;
#endif
- if (HAVE_ALTIVEC)
+#if (HAVE_ALTIVEC)
ff_vc1dsp_init_altivec(dsp);
- if (HAVE_MMX)
+#endif
+#if (HAVE_MMX)
ff_vc1dsp_init_mmx(dsp);
+#endif
}
diff --git a/libavcodec/vp56dsp.c b/libavcodec/vp56dsp.c
index c629343..51419f6 100644
--- a/libavcodec/vp56dsp.c
+++ b/libavcodec/vp56dsp.c
@@ -88,6 +88,10 @@ void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec)
}
}
- if (ARCH_ARM) ff_vp56dsp_init_arm(s, codec);
- if (HAVE_MMX) ff_vp56dsp_init_x86(s, codec);
+#if (ARCH_ARM)
+ ff_vp56dsp_init_arm(s, codec);
+#endif
+#if (HAVE_MMX)
+ ff_vp56dsp_init_x86(s, codec);
+#endif
}
diff --git a/libavcodec/vp8dsp.c b/libavcodec/vp8dsp.c
index 1ee070c..8a9af2b 100644
--- a/libavcodec/vp8dsp.c
+++ b/libavcodec/vp8dsp.c
@@ -520,10 +520,13 @@ av_cold void ff_vp8dsp_init(VP8DSPContext *dsp)
VP8_BILINEAR_MC_FUNC(1, 8);
VP8_BILINEAR_MC_FUNC(2, 4);
- if (HAVE_MMX)
+#if (HAVE_MMX)
ff_vp8dsp_init_x86(dsp);
- if (HAVE_ALTIVEC)
+#endif
+#if (HAVE_ALTIVEC)
ff_vp8dsp_init_altivec(dsp);
- if (ARCH_ARM)
+#endif
+#if (ARCH_ARM)
ff_vp8dsp_init_arm(dsp);
+#endif
}
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 86ebfee..f994690 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -38,7 +38,9 @@ void avdevice_register_all(void)
initialized = 1;
/* devices */
+#if __GNUC__ > 2
REGISTER_INOUTDEV (ALSA, alsa);
+#endif
REGISTER_INDEV (BKTR, bktr);
REGISTER_INDEV (DSHOW, dshow);
REGISTER_INDEV (DV1394, dv1394);
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 90e8781..9284f04 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -103,20 +103,23 @@ static int query_formats(AVFilterContext *ctx)
ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts);
if(out_rate > 0) {
- out_samplerates = avfilter_make_format_list((int[]){ out_rate, -1 });
+ int tmp[] = {out_rate, -1};
+ out_samplerates = avfilter_make_format_list(tmp);
} else {
out_samplerates = ff_all_samplerates();
}
avfilter_formats_ref(out_samplerates, &outlink->in_samplerates);
if(out_format != AV_SAMPLE_FMT_NONE) {
- out_formats = avfilter_make_format_list((int[]){ out_format, -1 });
+ int tmp[] = {out_format, -1};
+ out_formats = avfilter_make_format_list(tmp);
} else
out_formats = avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO);
avfilter_formats_ref(out_formats, &outlink->in_formats);
if(out_layout) {
- out_layouts = avfilter_make_format64_list((int64_t[]){ out_layout, -1 });
+ int64_t tmp[] = {out_layout, -1};
+ out_layouts = avfilter_make_format64_list(tmp);
} else
out_layouts = ff_all_channel_layouts();
ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index b9d44f2..f1940f1 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -43,7 +43,9 @@ void avfilter_register_all(void)
REGISTER_FILTER (ASHOWINFO, ashowinfo, af);
REGISTER_FILTER (ASPLIT, asplit, af);
REGISTER_FILTER (ASTREAMSYNC, astreamsync, af);
+#if __GNUC__ > 2
REGISTER_FILTER (ASYNCTS, asyncts, af);
+#endif
REGISTER_FILTER (EARWAX, earwax, af);
REGISTER_FILTER (PAN, pan, af);
REGISTER_FILTER (SILENCEDETECT, silencedetect, af);
diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c
index 49e5255..db7a78a 100644
--- a/libavfilter/vf_gradfun.c
+++ b/libavfilter/vf_gradfun.c
@@ -132,12 +132,18 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
gf->blur_line = ff_gradfun_blur_line_c;
gf->filter_line = ff_gradfun_filter_line_c;
+#if HAVE_MMX
if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX2)
gf->filter_line = ff_gradfun_filter_line_mmx2;
+#endif
+#if HAVE_SSSE3
if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3)
gf->filter_line = ff_gradfun_filter_line_ssse3;
+#endif
+#if HAVE_SSE
if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
gf->blur_line = ff_gradfun_blur_line_sse2;
+#endif
av_log(ctx, AV_LOG_INFO, "threshold:%.2f radius:%d\n", thresh, gf->radius);
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 1862449..b6fb353 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -67,7 +67,9 @@ void av_register_all(void)
REGISTER_MUXER (ASF_STREAM, asf_stream);
REGISTER_MUXDEMUX (AU, au);
REGISTER_MUXDEMUX (AVI, avi);
+#if __GNUC__ > 2
REGISTER_DEMUXER (AVISYNTH, avisynth);
+#endif
REGISTER_MUXER (AVM2, avm2);
REGISTER_DEMUXER (AVS, avs);
REGISTER_DEMUXER (BETHSOFTVID, bethsoftvid);
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index b911880..edf893e 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -32,9 +32,15 @@ int av_get_cpu_flags(void)
if (checked)
return flags;
- if (ARCH_ARM) flags = ff_get_cpu_flags_arm();
- if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
- if (ARCH_X86) flags = ff_get_cpu_flags_x86();
+#if ARCH_ARM
+ flags = ff_get_cpu_flags_arm();
+#endif
+#if ARCH_PPC
+ flags = ff_get_cpu_flags_ppc();
+#endif
+#if ARCH_X86
+ flags = ff_get_cpu_flags_x86();
+#endif
checked = 1;
return flags;
diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c
index c531356..40634c6 100644
--- a/libswresample/audioconvert.c
+++ b/libswresample/audioconvert.c
@@ -154,7 +154,9 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt,
}
}
- if(HAVE_YASM && HAVE_MMX) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);
+#if HAVE_YASM && HAVE_MMX
+ swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);
+#endif
return ctx;
}
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index ba7d6de..5bdc182 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -128,8 +128,9 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
void sws_rgb2rgb_init(void)
{
rgb2rgb_init_c();
- if (HAVE_MMX)
+#if (HAVE_MMX)
rgb2rgb_init_x86();
+#endif
}
void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 5dd4124..9901f83 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -734,10 +734,12 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
{
sws_init_swScale_c(c);
- if (HAVE_MMX)
+#if (HAVE_MMX)
ff_sws_init_swScale_mmx(c);
- if (HAVE_ALTIVEC)
+#endif
+#if (HAVE_ALTIVEC)
ff_sws_init_swScale_altivec(c);
+#endif
return swScale;
}
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 52951e0..b7310d4 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -473,36 +473,48 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
switch (c->dstFormat) {
case PIX_FMT_BGR24:
- gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },
- (int []) { srcStride[1], srcStride[0], srcStride[2] },
+ {
+ const uint8_t * srca[] = { src[1], src[0], src[2] };
+ int stride[] = { srcStride[1], srcStride[0], srcStride[2] };
+ gbr24ptopacked24(srca, stride,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, c->srcW);
break;
+ }
case PIX_FMT_RGB24:
- gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] },
- (int []) { srcStride[2], srcStride[0], srcStride[1] },
+ {
+ const uint8_t * srca[] = { src[2], src[0], src[1] };
+ int stride[] = { srcStride[2], srcStride[0], srcStride[1] };
+ gbr24ptopacked24(srca, stride,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, c->srcW);
break;
+ }
case PIX_FMT_ARGB:
alpha_first = 1;
case PIX_FMT_RGBA:
- gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] },
- (int []) { srcStride[2], srcStride[0], srcStride[1] },
+ {
+ const uint8_t * srca[] = { src[2], src[0], src[1] };
+ int stride[] = { srcStride[2], srcStride[0], srcStride[1] };
+ gbr24ptopacked32(srca, stride,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, alpha_first, c->srcW);
break;
+ }
case PIX_FMT_ABGR:
alpha_first = 1;
case PIX_FMT_BGRA:
- gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] },
- (int []) { srcStride[1], srcStride[0], srcStride[2] },
+ {
+ const uint8_t * srca[] = { src[1], src[0], src[2] };
+ int stride[] = { srcStride[1], srcStride[0], srcStride[2] };
+ gbr24ptopacked32(srca, stride,
dst[0] + srcSliceY * dstStride[0], dstStride[0],
srcSliceH, alpha_first, c->srcW);
break;
+ }
default:
av_log(c, AV_LOG_ERROR,
@@ -981,10 +993,12 @@ void ff_get_unscaled_swscale(SwsContext *c)
c->swScale = planarCopyWrapper;
}
- if (ARCH_BFIN)
+#if (ARCH_BFIN)
ff_bfin_get_unscaled_swscale(c);
- if (HAVE_ALTIVEC)
+#endif
+#if (HAVE_ALTIVEC)
ff_swscale_get_unscaled_altivec(c);
+#endif
}
static void reset_ptr(const uint8_t *src[], int format)
diff --git a/libswscale/utils.c b/libswscale/utils.c
index dc489de..31ebda7 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -778,9 +778,11 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
contrast, saturation);
// FIXME factorize
+#if HAVE_ALTIVEC
if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)
ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness,
contrast, saturation);
+#endif
return 0;
}
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 446b433..9e5e376 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -534,14 +534,15 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
{
SwsFunc t = NULL;
- if (HAVE_MMX)
+#if (HAVE_MMX)
t = ff_yuv2rgb_init_mmx(c);
- else if (HAVE_VIS)
+#elif (HAVE_VIS)
t = ff_yuv2rgb_init_vis(c);
- else if (HAVE_ALTIVEC)
+#elif (HAVE_ALTIVEC)
t = ff_yuv2rgb_init_altivec(c);
- else if (ARCH_BFIN)
+#elif (ARCH_BFIN)
t = ff_yuv2rgb_get_func_ptr_bfin(c);
+#endif
if (t)
return t;
--
2.2.2