From 9505d904591a7776bae7547018f8e01a4fb5deec Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Fri, 19 Sep 2014 10:19:42 +0200
Subject: applying patch ffmpeg-0.10.14-gcc2.patch


diff --git a/cmdutils.c b/cmdutils.c
index 01abc51..ea73b8c 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -89,7 +89,7 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
     char line[1024];
     static int print_prefix = 1;
 
-    va_copy(vl2, vl);
+    __va_copy(vl2, vl);
     av_log_default_callback(ptr, level, fmt, vl);
     av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix);
     va_end(vl2);
diff --git a/configure b/configure
index b65cefe..8c6b676 100755
--- a/configure
+++ b/configure
@@ -1369,7 +1369,6 @@ avx_deps="ssse3"
 
 aligned_stack_if_any="ppc x86"
 fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
 fast_unaligned_if_any="armv6 ppc x86"
 
 inline_asm_deps="!tms470"
@@ -1876,7 +1875,7 @@ AS_O='-o $@'
 CC_O='-o $@'
 CXX_O='-o $@'
 
-host_cflags='-D_ISOC99_SOURCE -O3 -g'
+host_cflags='-D_ISOC99_SOURCE -O2 -g'
 host_libs='-lm'
 
 target_path='$(CURDIR)'
@@ -1958,6 +1957,7 @@ for n in $COMPONENT_LIST; do
 done
 
 enable $ARCH_EXT_LIST $ALL_TESTS
+disable sse
 
 die_unknown(){
     echo "Unknown option \"$1\"."
@@ -2154,7 +2154,7 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then
         CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
         AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
     fi
-    speed_cflags='-O3'
+    speed_cflags='-O2'
     size_cflags='-Os'
 elif $cc --version 2>/dev/null | grep -q Intel; then
     cc_type=icc
@@ -2841,10 +2841,6 @@ check_cc <<EOF && enable attribute_packed
 struct { int x; } __attribute__((packed)) x;
 EOF
 
-check_cc <<EOF && enable attribute_may_alias
-union { int x; } __attribute__((may_alias)) x;
-EOF
-
 check_cc <<EOF || die "endian test failed"
 unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
 EOF
@@ -3116,8 +3112,6 @@ disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersi
 enabled vaapi && require vaapi va/va.h vaInitialize -lva
 
 check_mathfunc cbrtf
-check_mathfunc exp2
-check_mathfunc exp2f
 check_mathfunc llrint
 check_mathfunc llrintf
 check_mathfunc log2
diff --git a/ffmpeg.c b/ffmpeg.c
index 2d2d081..de93ea2 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1247,9 +1247,11 @@ need_realloc:
                                 av_fifo_size(ost->fifo) / (enc->channels * osize); // FIXME wrong
 
     if (ost->audio_resample) {
+	uint8_t *buftmp2[] = { buftmp };
+	const uint8_t *buf2[] = { buf };
         buftmp = audio_buf;
-        size_out = swr_convert(ost->swr, (      uint8_t*[]){buftmp}, audio_buf_size / (enc->channels * osize),
-                                         (const uint8_t*[]){buf   }, size / (dec->channels * isize));
+        size_out = swr_convert(ost->swr, buftmp2, audio_buf_size / (enc->channels * osize),
+                                         buf2, size / (dec->channels * isize));
         size_out = size_out * enc->channels * osize;
     } else {
         buftmp = buf;
diff --git a/ffprobe.c b/ffprobe.c
index 48c813a..be3d3ad 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -293,7 +293,9 @@ 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});
+	struct unit_value value2 = {.unit=unit_second_str};
+	value2.val.d = d;
+        value_string(buf, sizeof(buf), value2);
         writer_print_string(wctx, key, buf, 0);
     }
 }
@@ -1249,8 +1251,8 @@ static void writer_register_all(void)
 #define print_str_opt(k, v)     writer_print_string(w, k, v, 1)
 #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)
+#define print_val(k, v, u)      value2.val.i = v; value2.unit=u; writer_print_string(w, k, \
+    value_string(val_str, sizeof(val_str), value2), 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)
@@ -1261,6 +1263,7 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk
     AVStream *st = fmt_ctx->streams[pkt->stream_index];
     struct print_buf pbuf = {.s = NULL};
     const char *s;
+    struct unit_value value2;
 
     print_section_header("packet");
     s = av_get_media_type_string(st->codec->codec_type);
@@ -1404,6 +1407,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
     const char *s;
     AVRational display_aspect_ratio;
     struct print_buf pbuf = {.s = NULL};
+    struct unit_value value2;
 
     print_section_header("stream");
 
@@ -1516,6 +1520,7 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
 {
     char val_str[128];
     int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1;
+    struct unit_value value2;
 
     print_section_header("format");
     print_str("filename",         fmt_ctx->filename);
@@ -1524,9 +1529,9 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
     print_str("format_long_name", fmt_ctx->iformat->long_name);
     print_time("start_time",      fmt_ctx->start_time, &AV_TIME_BASE_Q);
     print_time("duration",        fmt_ctx->duration,   &AV_TIME_BASE_Q);
-    if (size >= 0) print_val    ("size", size, unit_byte_str);
+    if (size >= 0) { print_val    ("size", size, unit_byte_str); }
     else           print_str_opt("size", "N/A");
-    if (fmt_ctx->bit_rate > 0) print_val    ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str);
+    if (fmt_ctx->bit_rate > 0) { print_val    ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str); }
     else                       print_str_opt("bit_rate", "N/A");
     show_tags(fmt_ctx->metadata);
     print_section_footer("format");
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 2ff6f9c..344fbd4 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -223,8 +223,9 @@ WINDOW_FUNC(eight_short)
     const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
     const float *in = audio + 448;
     float *out = sce->ret;
+	int w;
 
-    for (int w = 0; w < 8; w++) {
+    for (w = 0; w < 8; w++) {
         dsp->vector_fmul        (out, in, w ? pwindow : swindow, 128);
         out += 128;
         in  += 128;
@@ -686,11 +687,12 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
 
 static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
 {
+	int ch;
     FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
     FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
     FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
 
-    for(int ch = 0; ch < s->channels; ch++)
+    for(ch = 0; ch < s->channels; ch++)
         s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
 
     return 0;
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index d36914a..103b742 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -54,8 +54,9 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
     int x, mask, dst_x, j, b, bpp;
     uint8_t *d;
     const uint8_t *s;
-
-    mask =  (int[]){0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}[pass];
+    int mask_tmp[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
+ 
+    mask =  mask_tmp[pass];
     switch(bits_per_pixel) {
     case 1:
         memset(dst, 0, row_size);
diff --git a/libavfilter/vsrc_mptestsrc.c b/libavfilter/vsrc_mptestsrc.c
index 96b2a4c..3043204 100644
--- a/libavfilter/vsrc_mptestsrc.c
+++ b/libavfilter/vsrc_mptestsrc.c
@@ -385,7 +385,6 @@ AVFilter avfilter_vsrc_mptestsrc = {
 
     .outputs   = (const AVFilterPad[]) {{ .name = "default",
                                     .type = AVMEDIA_TYPE_VIDEO,
-                                    .config_props = config_props,
                                     .request_frame = request_frame,
                                     .config_props  = config_props, },
                                   { .name = NULL }},
diff --git a/libavfilter/x86/yadif_template.c b/libavfilter/x86/yadif_template.c
index 0b60526..cc6f6a8 100644
--- a/libavfilter/x86/yadif_template.c
+++ b/libavfilter/x86/yadif_template.c
@@ -56,8 +56,8 @@
 #endif
 
 #define CHECK(pj,mj) \
-            MOVQU" "#pj"(%[cur],%[mrefs]), "MM"2 \n\t" /* cur[x-refs-1+j] */\
-            MOVQU" "#mj"(%[cur],%[prefs]), "MM"3 \n\t" /* cur[x+refs-1-j] */\
+            MOVQU" "#pj"(%2,%5), "MM"2 \n\t" /* cur[x-refs-1+j] */\
+            MOVQU" "#mj"(%2,%4), "MM"3 \n\t" /* cur[x+refs-1-j] */\
             MOVQ"      "MM"2, "MM"4 \n\t"\
             MOVQ"      "MM"2, "MM"5 \n\t"\
             "pxor      "MM"3, "MM"4 \n\t"\
@@ -115,20 +115,20 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
     for(x=0; x<w; x+=STEP){\
         __asm__ volatile(\
             "pxor      "MM"7, "MM"7 \n\t"\
-            LOAD("(%[cur],%[mrefs])", MM"0") /* c = cur[x-refs] */\
-            LOAD("(%[cur],%[prefs])", MM"1") /* e = cur[x+refs] */\
-            LOAD("(%["prev2"])", MM"2") /* prev2[x] */\
-            LOAD("(%["next2"])", MM"3") /* next2[x] */\
+            LOAD("(%2,%5)", MM"0") /* c = cur[x-refs] */\
+            LOAD("(%2,%4)", MM"1") /* e = cur[x+refs] */\
+            LOAD("(%"prev2")", MM"2") /* prev2[x] */\
+            LOAD("(%"next2")", MM"3") /* next2[x] */\
             MOVQ"      "MM"3, "MM"4 \n\t"\
             "paddw     "MM"2, "MM"3 \n\t"\
             "psraw     $1,    "MM"3 \n\t" /* d = (prev2[x] + next2[x])>>1 */\
-            MOVQ"      "MM"0, (%[tmpA]) \n\t" /* c */\
-            MOVQ"      "MM"3, 16(%[tmpA]) \n\t" /* d */\
-            MOVQ"      "MM"1, 32(%[tmpA]) \n\t" /* e */\
+            MOVQ"      "MM"0, (%0) \n\t" /* c */\
+            MOVQ"      "MM"3, 16(%0) \n\t" /* d */\
+            MOVQ"      "MM"1, 32(%0) \n\t" /* e */\
             "psubw     "MM"4, "MM"2 \n\t"\
             PABS(      MM"4", MM"2") /* temporal_diff0 */\
-            LOAD("(%[prev],%[mrefs])", MM"3") /* prev[x-refs] */\
-            LOAD("(%[prev],%[prefs])", MM"4") /* prev[x+refs] */\
+            LOAD("(%1,%5)", MM"3") /* prev[x-refs] */\
+            LOAD("(%1,%4)", MM"4") /* prev[x+refs] */\
             "psubw     "MM"0, "MM"3 \n\t"\
             "psubw     "MM"1, "MM"4 \n\t"\
             PABS(      MM"5", MM"3")\
@@ -137,8 +137,8 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
             "psrlw     $1,    "MM"2 \n\t"\
             "psrlw     $1,    "MM"3 \n\t"\
             "pmaxsw    "MM"3, "MM"2 \n\t"\
-            LOAD("(%[next],%[mrefs])", MM"3") /* next[x-refs] */\
-            LOAD("(%[next],%[prefs])", MM"4") /* next[x+refs] */\
+            LOAD("(%3,%5)", MM"3") /* next[x-refs] */\
+            LOAD("(%3,%4)", MM"4") /* next[x+refs] */\
             "psubw     "MM"0, "MM"3 \n\t"\
             "psubw     "MM"1, "MM"4 \n\t"\
             PABS(      MM"5", MM"3")\
@@ -146,7 +146,7 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
             "paddw     "MM"4, "MM"3 \n\t" /* temporal_diff2 */\
             "psrlw     $1,    "MM"3 \n\t"\
             "pmaxsw    "MM"3, "MM"2 \n\t"\
-            MOVQ"      "MM"2, 48(%[tmpA]) \n\t" /* diff */\
+            MOVQ"      "MM"2, 48(%0) \n\t" /* diff */\
 \
             "paddw     "MM"0, "MM"1 \n\t"\
             "paddw     "MM"0, "MM"0 \n\t"\
@@ -154,8 +154,8 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
             "psrlw     $1,    "MM"1 \n\t" /* spatial_pred */\
             PABS(      MM"2", MM"0")      /* ABS(c-e) */\
 \
-            MOVQU" -1(%[cur],%[mrefs]), "MM"2 \n\t" /* cur[x-refs-1] */\
-            MOVQU" -1(%[cur],%[prefs]), "MM"3 \n\t" /* cur[x+refs-1] */\
+            MOVQU" -1(%2,%5), "MM"2 \n\t" /* cur[x-refs-1] */\
+            MOVQU" -1(%2,%4), "MM"3 \n\t" /* cur[x+refs-1] */\
             MOVQ"      "MM"2, "MM"4 \n\t"\
             "psubusb   "MM"3, "MM"2 \n\t"\
             "psubusb   "MM"4, "MM"3 \n\t"\
@@ -177,20 +177,20 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
             CHECK2\
 \
             /* if(p->mode<2) ... */\
-            MOVQ"    48(%[tmpA]), "MM"6 \n\t" /* diff */\
-            "cmpl      $2, %[mode] \n\t"\
+            MOVQ"    48(%0), "MM"6 \n\t" /* diff */\
+            "cmpl      $2, %6 \n\t"\
             "jge       1f \n\t"\
-            LOAD("(%["prev2"],%[mrefs],2)", MM"2") /* prev2[x-2*refs] */\
-            LOAD("(%["next2"],%[mrefs],2)", MM"4") /* next2[x-2*refs] */\
-            LOAD("(%["prev2"],%[prefs],2)", MM"3") /* prev2[x+2*refs] */\
-            LOAD("(%["next2"],%[prefs],2)", MM"5") /* next2[x+2*refs] */\
+            LOAD("(%"prev2",%5,2)", MM"2") /* prev2[x-2*refs] */\
+            LOAD("(%"next2",%5,2)", MM"4") /* next2[x-2*refs] */\
+            LOAD("(%"prev2",%4,2)", MM"3") /* prev2[x+2*refs] */\
+            LOAD("(%"next2",%4,2)", MM"5") /* next2[x+2*refs] */\
             "paddw     "MM"4, "MM"2 \n\t"\
             "paddw     "MM"5, "MM"3 \n\t"\
             "psrlw     $1,    "MM"2 \n\t" /* b */\
             "psrlw     $1,    "MM"3 \n\t" /* f */\
-            MOVQ"    (%[tmpA]), "MM"4 \n\t" /* c */\
-            MOVQ"    16(%[tmpA]), "MM"5 \n\t" /* d */\
-            MOVQ"    32(%[tmpA]), "MM"7 \n\t" /* e */\
+            MOVQ"    (%0), "MM"4 \n\t" /* c */\
+            MOVQ"    16(%0), "MM"5 \n\t" /* d */\
+            MOVQ"    32(%0), "MM"7 \n\t" /* e */\
             "psubw     "MM"4, "MM"2 \n\t" /* b-c */\
             "psubw     "MM"7, "MM"3 \n\t" /* f-e */\
             MOVQ"      "MM"5, "MM"0 \n\t"\
@@ -209,7 +209,7 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
             "pmaxsw    "MM"4, "MM"6 \n\t" /* diff= MAX3(diff, min, -max); */\
             "1: \n\t"\
 \
-            MOVQ"    16(%[tmpA]), "MM"2 \n\t" /* d */\
+            MOVQ"    16(%0), "MM"2 \n\t" /* d */\
             MOVQ"      "MM"2, "MM"3 \n\t"\
             "psubw     "MM"6, "MM"2 \n\t" /* d-diff */\
             "paddw     "MM"6, "MM"3 \n\t" /* d+diff */\
@@ -218,13 +218,13 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
             "packuswb  "MM"1, "MM"1 \n\t"\
 \
             :\
-            :[tmpA] "r"(tmpA),\
-             [prev] "r"(prev),\
-             [cur]  "r"(cur),\
-             [next] "r"(next),\
-             [prefs]"r"((x86_reg)prefs),\
-             [mrefs]"r"((x86_reg)mrefs),\
-             [mode] "g"(mode)\
+            : "r"(tmpA),\
+             "r"(prev),\
+             "r"(cur),\
+             "r"(next),\
+             "r"((x86_reg)prefs),\
+             "r"((x86_reg)mrefs),\
+             "g"(mode)\
         );\
         __asm__ volatile(MOV" "MM"1, %0" :"=m"(*dst));\
         dst += STEP;\
@@ -234,14 +234,14 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst,
     }
 
     if (parity) {
-#define prev2 "prev"
-#define next2 "cur"
+#define prev2 "1"
+#define next2 "2"
         FILTER
 #undef prev2
 #undef next2
     } else {
-#define prev2 "cur"
-#define next2 "next"
+#define prev2 "2"
+#define next2 "3"
         FILTER
 #undef prev2
 #undef next2
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index e73fbfe..3cde56c 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1096,12 +1096,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_h = 1,
         .flags = PIX_FMT_HWACCEL,
     },
-    [PIX_FMT_VDA_VLD] = {
-        .name = "vda_vld",
-        .log2_chroma_w = 1,
-        .log2_chroma_h = 1,
-        .flags = PIX_FMT_HWACCEL,
-    },
     [PIX_FMT_GRAY8A] = {
         .name = "gray8a",
         .nb_components = 2,
@@ -1110,16 +1104,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
             { 0, 1, 2, 0, 7 },        /* A */
         },
     },
-    [PIX_FMT_GBR24P] = {
-        .name = "gbr24p",
-        .nb_components= 3,
-        .comp = {
-            { 1, 0, 1, 0, 7 },        /* B */
-            { 0, 0, 1, 0, 7 },        /* G */
-            { 2, 0, 1, 0, 7 },        /* R */
-        },
-        .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
-    },
     [PIX_FMT_GBRP] = {
         .name = "gbrp",
         .nb_components = 3,
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index d4b39f4..b98d38a 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -370,30 +370,38 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStr
     }
 
     switch (c->dstFormat) {
-        case PIX_FMT_BGR24:
-            gbr24ptopacked24((const uint8_t* []) {src[1], src[0], src[2]}, (int []) {srcStride[1], srcStride[0], srcStride[2]},
+        case PIX_FMT_BGR24: {
+            const uint8_t* src2[] =  {src[1], src[0], src[2]};
+            int srcStride2[] = {srcStride[1], srcStride[0], srcStride[2]};
+            gbr24ptopacked24(src2, srcStride2,
                   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]},
+	}
+        case PIX_FMT_RGB24: {
+            const uint8_t* src2[] =  {src[2], src[0], src[1]};
+            int srcStride2[] = {srcStride[2], srcStride[0], srcStride[1]};
+            gbr24ptopacked24(src2, srcStride2,
                   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]},
+        case PIX_FMT_RGBA: {
+            const uint8_t* src2[] =  {src[2], src[0], src[1]};
+            int srcStride2[] = {srcStride[2], srcStride[0], srcStride[1]};
+            gbr24ptopacked32(src2, srcStride2,
                   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]},
+        case PIX_FMT_BGRA: {
+            const uint8_t* src2[] =  {src[1], src[0], src[2]};
+            int srcStride2[] = {srcStride[1], srcStride[0], srcStride[2]};
+            gbr24ptopacked32(src2, srcStride2,
                   dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW);
             break;
-
+        }
         default:
             av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
                     av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
-- 
1.8.3.4


From 9d9419ac69fb662487b172508ba4f85e14549f6b Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Fri, 7 Nov 2014 12:28:02 +0100
Subject: Backport http://trac.ffmpeg.org/ticket/452

* Support for APE files with different sample bit widths.

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 89d023b..464adc8 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -133,6 +133,7 @@ typedef struct APEContext {
     DSPContext dsp;
     int channels;
     int samples;                             ///< samples left to decode in current frame
+	int bps;
 
     int fileversion;                         ///< codec version, very important in decoding process
     int compression_level;                   ///< compression levels
@@ -183,14 +184,25 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n");
         return AVERROR(EINVAL);
     }
-    if (avctx->bits_per_coded_sample != 16) {
-        av_log(avctx, AV_LOG_ERROR, "Only 16-bit samples are supported\n");
-        return AVERROR(EINVAL);
-    }
     if (avctx->channels > 2) {
         av_log(avctx, AV_LOG_ERROR, "Only mono and stereo is supported\n");
         return AVERROR(EINVAL);
     }
+	s->bps = avctx->bits_per_coded_sample;
+	switch(s->bps) {
+		case 8:
+			avctx->sample_fmt = AV_SAMPLE_FMT_U8;
+			break;
+		case 16:
+			avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+			break;
+		case 24:
+			avctx->sample_fmt = AV_SAMPLE_FMT_S32;
+			break;
+		default:
+			av_log_ask_for_sample(avctx, "Unsupported bits per decoded sample %d\n", s->bps);
+			return AVERROR_PATCHWELCOME;
+	}
     s->avctx             = avctx;
     s->channels          = avctx->channels;
     s->fileversion       = AV_RL16(avctx->extradata);
@@ -214,7 +226,6 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
     }
 
     dsputil_init(&s->dsp, avctx);
-    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
     avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
 
     avcodec_get_frame_defaults(&s->frame);
@@ -819,7 +830,9 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
     const uint8_t *buf = avpkt->data;
     int buf_size = avpkt->size;
     APEContext *s = avctx->priv_data;
-    int16_t *samples;
+	uint8_t *samples8;
+    int16_t *samples16;
+	int32_t *samples24;
     int i, ret;
     int blockstodecode;
 
@@ -891,7 +904,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
     }
-    samples = (int16_t *)s->frame.data[0];
 
     s->error=0;
 
@@ -907,11 +919,32 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_INVALIDDATA;
     }
 
-    for (i = 0; i < blockstodecode; i++) {
-        *samples++ = s->decoded0[i];
-        if(s->channels == 2)
-            *samples++ = s->decoded1[i];
-    }
+	switch(s->bps) {
+		case 8:
+			samples8 = (uint8_t*)s->frame.data[0];
+			for (i = 0; i < blockstodecode; i++) {
+				*samples8++ = (s->decoded0[i] + 0x80) & 0xff;
+				if (s->channels == 2)
+					*samples8++ = (s->decoded1[i] + 0x80) & 0xff;
+			}
+			break;
+		case 16:
+			samples16 = (int16_t*)s->frame.data[0];
+			for (i = 0; i < blockstodecode; i++) {
+				*samples16++ = s->decoded0[i];
+				if (s->channels == 2)
+					*samples16++ = s->decoded1[i];
+			}
+			break;
+		case 24:
+			samples24 = (int32_t*)s->frame.data[0];
+			for (i = 0; i < blockstodecode; i++) {
+				*samples24++ = s->decoded0[i] << 8;
+				if (s->channels == 2)
+					*samples24++ = s->decoded1[i] << 8;
+			}
+			break;
+	}
 
     s->samples -= blockstodecode;
 
-- 
1.8.3.4


From 370f9377134aac06ad163b79446e841eda96698e Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Thu, 4 Dec 2014 13:31:12 +0100
Subject: Fix undefined symbols for gcc2

ffmpeg relies on the compiler to optimize "if(0) function()" and not
emit a reference to the function. Gcc2 doesn't always figure this out so
switch everything to using #ifdef.

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 32f3f52..970c5ed 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -54,6 +54,7 @@ void avcodec_register_all(void)
     initialized = 1;
 
     /* hardware accelerators */
+#if 0
     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);
@@ -126,8 +128,10 @@ void avcodec_register_all(void)
     REGISTER_DECODER (H263I, h263i);
     REGISTER_ENCODER (H263P, h263p);
     REGISTER_DECODER (H264, h264);
+#ifndef __HAIKU__
     REGISTER_DECODER (H264_CRYSTALHD, h264_crystalhd);
     REGISTER_DECODER (H264_VDPAU, h264_vdpau);
+#endif
     REGISTER_ENCDEC  (HUFFYUV, huffyuv);
     REGISTER_DECODER (IDCIN, idcin);
     REGISTER_DECODER (IFF_BYTERUN1, iff_byterun1);
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 464adc8..cd99900 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -193,6 +193,7 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
 		case 8:
 			avctx->sample_fmt = AV_SAMPLE_FMT_U8;
 			break;
+		case 0:
 		case 16:
 			avctx->sample_fmt = AV_SAMPLE_FMT_S16;
 			break;
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/dsputil.c b/libavcodec/dsputil.c
index dab74cc..0d6d2d0 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -3174,15 +3174,31 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
     }
 
 
-    if (HAVE_MMX)        dsputil_init_mmx   (c, avctx);
-    if (ARCH_ARM)        dsputil_init_arm   (c, avctx);
-    if (CONFIG_MLIB)     dsputil_init_mlib  (c, avctx);
-    if (HAVE_VIS)        dsputil_init_vis   (c, avctx);
-    if (ARCH_ALPHA)      dsputil_init_alpha (c, avctx);
-    if (ARCH_PPC)        dsputil_init_ppc   (c, avctx);
-    if (HAVE_MMI)        dsputil_init_mmi   (c, avctx);
-    if (ARCH_SH4)        dsputil_init_sh4   (c, avctx);
-    if (ARCH_BFIN)       dsputil_init_bfin  (c, avctx);
+#if HAVE_MMX
+    dsputil_init_mmx   (c, avctx);
+#endif
+#if ARCH_ARM
+    dsputil_init_arm   (c, avctx);
+#endif
+#if CONFIG_MLIB
+    dsputil_init_mlib  (c, avctx);
+#endif
+#if HAVE_VIS
+    dsputil_init_vis   (c, avctx);
+#endif
+#if ARCH_ALPHA
+    dsputil_init_alpha (c, avctx);
+#elif ARCH_PPC
+    dsputil_init_ppc   (c, avctx);
+#endif
+#if HAVE_MMI
+    dsputil_init_mmi   (c, avctx);
+#endif
+#if ARCH_SH4
+    dsputil_init_sh4   (c, avctx);
+#elif ARCH_BFIN
+    dsputil_init_bfin  (c, avctx);
+#endif
 
     for (i = 0; i < 4; i++) {
         for (j = 0; j < 16; j++) {
diff --git a/libavcodec/fft.c b/libavcodec/fft.c
index 4eb46f1..6197bd0 100644
--- a/libavcodec/fft.c
+++ b/libavcodec/fft.c
@@ -158,13 +158,21 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
 #endif
 
 #if CONFIG_FFT_FLOAT
-    if (ARCH_ARM)     ff_fft_init_arm(s);
-    if (HAVE_ALTIVEC) ff_fft_init_altivec(s);
-    if (HAVE_MMX)     ff_fft_init_mmx(s);
+#if ARCH_ARM
+    ff_fft_init_arm(s);
+#endif
+#if HAVE_ALTIVEC
+    ff_fft_init_altivec(s);
+#endif
+#if HAVE_MMX
+    ff_fft_init_mmx(s);
+#endif
     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..037bdf5 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 07fa430..0e3b2d9 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -643,10 +643,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 981adb4..3315ff4 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2509,8 +2509,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) {
@@ -2528,8 +2530,10 @@ static int field_end(H264Context *h, int in_setup){
             av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
     }
 
-    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_picture_complete(s);
+#endif
 
     /*
      * FIXME: Error handling code does not seem to support interlaced
@@ -4085,8 +4089,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
 
                 if (s->avctx->hwaccel && s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
                     return -1;
-                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_picture_start(s);
+#endif
             }
 
             if(hx->redundant_pic_count==0
@@ -4098,11 +4104,13 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
                     if (avctx->hwaccel->decode_slice(avctx, &buf[buf_index - consumed], consumed) < 0)
                         return -1;
                 }else
-                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){
                     static const uint8_t start_code[] = {0x00, 0x00, 0x01};
                     ff_vdpau_add_data_chunk(s, start_code, sizeof(start_code));
                     ff_vdpau_add_data_chunk(s, &buf[buf_index - consumed], consumed );
                 }else
+#endif
                     context_count++;
             }
             break;
diff --git a/libavcodec/h264dsp.c b/libavcodec/h264dsp.c
index eeee6a2..5340347 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 e3efdf9..be57d63 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/mpeg12.c b/libavcodec/mpeg12.c
index 58456a6..8e0568e 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -843,12 +843,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_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
+#if CONFIG_MPEG_XVMC_DECODER
+        if (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) {
@@ -1061,12 +1063,14 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64])
             }
 
             //if 1, we memcpy blocks in xvmcvideo
-            if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
+#if CONFIG_MPEG_XVMC_DECODER
+            if (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) {
@@ -1654,9 +1658,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 && s->avctx->xvmc_acceleration)
+#if CONFIG_MPEG_XVMC_DECODER
+    if (s->avctx->xvmc_acceleration)
         if (ff_xvmc_field_start(s, avctx) < 0)
             return -1;
+#endif
 
     return 0;
 }
@@ -1758,8 +1764,10 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
 
     for (;;) {
         // If 1, we memcpy blocks in xvmcvideo.
-        if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1)
+#if CONFIG_MPEG_XVMC_DECODER
+        if (s->avctx->xvmc_acceleration > 1)
             ff_xvmc_init_block(s); // set s->block
+#endif
 
         if (mpeg_decode_mb(s, s->block) < 0)
             return -1;
@@ -1947,8 +1955,10 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
             av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
     }
 
-    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
+#if CONFIG_MPEG_XVMC_DECODER
+    if (s->avctx->xvmc_acceleration)
         ff_xvmc_field_end(s);
+#endif
 
     /* end of slice reached */
     if (/*s->mb_y << field_pic == s->mb_height &&*/ !s->first_field && !s->first_slice) {
diff --git a/libavcodec/mpegaudiodsp.c b/libavcodec/mpegaudiodsp.c
index cc12dd9..b7b95fd 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 9bb862a..0bedbeb 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1330,8 +1330,10 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
         update_noise_reduction(s);
     }
 
-    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
+#if CONFIG_MPEG_XVMC_DECODER
+    if (s->avctx->xvmc_acceleration)
         return ff_xvmc_field_start(s, avctx);
+#endif
 
     return 0;
 }
@@ -1343,9 +1345,12 @@ void 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 &&
diff --git a/libavcodec/rdft.c b/libavcodec/rdft.c
index ebddd8b..66918f9 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 919703d..4f4918d 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 913ced0..e16f1e6 100644
--- a/libavcodec/rv40dsp.c
+++ b/libavcodec/rv40dsp.c
@@ -588,8 +588,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/synth_filter.c b/libavcodec/synth_filter.c
index 5f10530..1009c53 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/vc1dec.c b/libavcodec/vc1dec.c
index 5f745ad..849ab69 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5571,10 +5571,12 @@ 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)
-        &&s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+#if CONFIG_VC1_VDPAU_DECODER
+    if (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..782bb39 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 af46b28..8f7564e 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/libavcodec/x86/ac3dsp_mmx.c b/libavcodec/x86/ac3dsp_mmx.c
index df5e77a..ea66b43 100644
--- a/libavcodec/x86/ac3dsp_mmx.c
+++ b/libavcodec/x86/ac3dsp_mmx.c
@@ -57,20 +57,25 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
         c->ac3_lshift_int16 = ff_ac3_lshift_int16_mmx;
         c->ac3_rshift_int32 = ff_ac3_rshift_int32_mmx;
     }
-    if (mm_flags & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
+#if HAVE_AMD3DNOW
+    if (mm_flags & AV_CPU_FLAG_3DNOW) {
         c->extract_exponents = ff_ac3_extract_exponents_3dnow;
         if (!bit_exact) {
             c->float_to_fixed24 = ff_float_to_fixed24_3dnow;
         }
     }
-    if (mm_flags & AV_CPU_FLAG_MMX2 && HAVE_MMX2) {
+#endif
+#if HAVE_MMX2
+    if (mm_flags & AV_CPU_FLAG_MMX2) {
         c->ac3_exponent_min = ff_ac3_exponent_min_mmxext;
         c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmxext;
     }
-    if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) {
+#endif
+#if HAVE_SSE
+    if (mm_flags & AV_CPU_FLAG_SSE) {
         c->float_to_fixed24 = ff_float_to_fixed24_sse;
     }
-    if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) {
+    if (mm_flags & AV_CPU_FLAG_SSE2) {
         c->ac3_exponent_min = ff_ac3_exponent_min_sse2;
         c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_sse2;
         c->float_to_fixed24 = ff_float_to_fixed24_sse2;
@@ -81,11 +86,14 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
             c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
         }
     }
-    if (mm_flags & AV_CPU_FLAG_SSSE3 && HAVE_SSSE3) {
+#endif
+#if HAVE_SSSE3
+    if (mm_flags & AV_CPU_FLAG_SSSE3) {
         c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_ssse3;
         if (!(mm_flags & AV_CPU_FLAG_ATOM)) {
             c->extract_exponents = ff_ac3_extract_exponents_ssse3;
         }
     }
 #endif
+#endif
 }
diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c
index 7918fcb..cf81caa 100644
--- a/libavcodec/x86/fft.c
+++ b/libavcodec/x86/fft.c
@@ -25,6 +25,7 @@ av_cold void ff_fft_init_mmx(FFTContext *s)
 {
 #if HAVE_YASM
     int has_vectors = av_get_cpu_flags();
+#if HAVE_AVX
     if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) {
         /* AVX for SB */
         s->imdct_calc      = ff_imdct_calc_sse;
@@ -32,7 +33,10 @@ av_cold void ff_fft_init_mmx(FFTContext *s)
         s->fft_permute     = ff_fft_permute_sse;
         s->fft_calc        = ff_fft_calc_avx;
         s->fft_permutation = FF_FFT_PERM_AVX;
-    } else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
+    } else 
+#endif
+#if HAVE_SSE
+		if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
         /* SSE for P3/P4/K8 */
         s->imdct_calc  = ff_imdct_calc_sse;
         s->imdct_half  = ff_imdct_half_sse;
@@ -41,6 +45,7 @@ av_cold void ff_fft_init_mmx(FFTContext *s)
         s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
     }
 #endif
+#endif
 }
 
 #if CONFIG_DCT
@@ -48,13 +53,18 @@ av_cold void ff_dct_init_mmx(DCTContext *s)
 {
 #if HAVE_YASM
     int has_vectors = av_get_cpu_flags();
-    if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
+#if HAVE_AVX
+    if (has_vectors & AV_CPU_FLAG_AVX)
         s->dct32 = ff_dct32_float_avx;
-    else if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
+    else
+#endif
+#if HAVE_SSE	
+	if (has_vectors & AV_CPU_FLAG_SSE2)
         s->dct32 = ff_dct32_float_sse2;
-    else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
+    else if (has_vectors & AV_CPU_FLAG_SSE)
         s->dct32 = ff_dct32_float_sse;
 #endif
+#endif
 }
 #endif
 
diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c
index fdf44c5..7bc1c18 100644
--- a/libavcodec/x86/h264dsp_mmx.c
+++ b/libavcodec/x86/h264dsp_mmx.c
@@ -419,6 +419,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom
                 c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16_ssse3;
                 c->biweight_h264_pixels_tab[1]= ff_h264_biweight_8_ssse3;
             }
+#if HAVE_AVX
             if (HAVE_AVX && mm_flags&AV_CPU_FLAG_AVX) {
 #if HAVE_ALIGNED_STACK
                 c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_avx;
@@ -427,6 +428,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom
                 c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx;
 #endif
             }
+#endif
         }
     }
 #endif
diff --git a/libavcodec/x86/v210-init.c b/libavcodec/x86/v210-init.c
index 425c628..b881624 100644
--- a/libavcodec/x86/v210-init.c
+++ b/libavcodec/x86/v210-init.c
@@ -34,15 +34,19 @@ av_cold void v210_x86_init(V210DecContext *s)
         if (cpu_flags & AV_CPU_FLAG_SSSE3)
             s->unpack_frame = ff_v210_planar_unpack_aligned_ssse3;
 
-        if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX)
+#if HAVE_AVX
+        if (cpu_flags & AV_CPU_FLAG_AVX)
             s->unpack_frame = ff_v210_planar_unpack_aligned_avx;
+#endif
     }
     else {
         if (cpu_flags & AV_CPU_FLAG_SSSE3)
             s->unpack_frame = ff_v210_planar_unpack_unaligned_ssse3;
 
-        if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX)
+#if HAVE_AVX
+        if (cpu_flags & AV_CPU_FLAG_AVX)
             s->unpack_frame = ff_v210_planar_unpack_unaligned_avx;
+#endif
     }
 #endif
 }
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 161c3b4..7dfe988 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -38,22 +38,22 @@ void avdevice_register_all(void)
     initialized = 1;
 
     /* devices */
-    REGISTER_INOUTDEV (ALSA, alsa);
+    //REGISTER_INOUTDEV (ALSA, alsa);
     REGISTER_INDEV    (BKTR, bktr);
-    REGISTER_INDEV    (DSHOW, dshow);
-    REGISTER_INDEV    (DV1394, dv1394);
+    //REGISTER_INDEV    (DSHOW, dshow);
+    //REGISTER_INDEV    (DV1394, dv1394);
     REGISTER_INDEV    (FBDEV, fbdev);
-    REGISTER_INDEV    (JACK, jack);
+    //REGISTER_INDEV    (JACK, jack);
     REGISTER_INDEV    (LAVFI, lavfi);
     REGISTER_INDEV    (OPENAL, openal);
     REGISTER_INOUTDEV (OSS, oss);
     REGISTER_INDEV    (PULSE, pulse);
     REGISTER_OUTDEV   (SDL, sdl);
     REGISTER_INOUTDEV (SNDIO, sndio);
-    REGISTER_INDEV    (V4L2, v4l2);
-    REGISTER_INDEV    (V4L, v4l);
-    REGISTER_INDEV    (VFWCAP, vfwcap);
-    REGISTER_INDEV    (X11_GRAB_DEVICE, x11_grab_device);
+    //REGISTER_INDEV    (V4L2, v4l2);
+    //REGISTER_INDEV    (V4L, v4l);
+    //REGISTER_INDEV    (VFWCAP, vfwcap);
+    //REGISTER_INDEV    (X11_GRAB_DEVICE, x11_grab_device);
 
     /* external libraries */
     REGISTER_INDEV    (LIBCDIO, libcdio);
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index ef99298..e083934 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -55,7 +55,7 @@ void avfilter_register_all(void)
     REGISTER_FILTER (ABUFFERSINK, abuffersink, asink);
     REGISTER_FILTER (ANULLSINK,   anullsink,   asink);
 
-    REGISTER_FILTER (ASS,         ass,  vf);
+    //REGISTER_FILTER (ASS,         ass,  vf);
     REGISTER_FILTER (BLACKFRAME,  blackframe,  vf);
     REGISTER_FILTER (BOXBLUR,     boxblur,     vf);
     REGISTER_FILTER (COPY,        copy,        vf);
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 3a96373..d813ecf 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -380,12 +380,20 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     if (args) sscanf(args, "%d:%d:%d", &yadif->mode, &yadif->parity, &yadif->auto_enable);
 
     yadif->filter_line = filter_line_c;
+#if HAVE_SSSE3
     if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3)
         yadif->filter_line = ff_yadif_filter_line_ssse3;
-    else if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
+    else
+#endif
+#if HAVE_SSE
+		if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
         yadif->filter_line = ff_yadif_filter_line_sse2;
-    else if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX)
+    else 
+#endif
+#if HAVE_MMX
+		if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX)
         yadif->filter_line = ff_yadif_filter_line_mmx;
+#endif
 
     av_log(ctx, AV_LOG_INFO, "mode:%d parity:%d auto_enable:%d\n", yadif->mode, yadif->parity, yadif->auto_enable);
 
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 134839f..7b3d63d 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -48,7 +48,9 @@ void av_register_all(void)
     avcodec_register_all();
 
     /* (de)muxers */
+#ifndef __HAIKU__
     REGISTER_MUXER    (A64, a64);
+#endif
     REGISTER_DEMUXER  (AAC, aac);
     REGISTER_MUXDEMUX (AC3, ac3);
     REGISTER_DEMUXER  (ACT, act);
@@ -67,7 +69,9 @@ void av_register_all(void)
     REGISTER_MUXER    (ASF_STREAM, asf_stream);
     REGISTER_MUXDEMUX (AU, au);
     REGISTER_MUXDEMUX (AVI, avi);
+#if CONFIG_AVISYNTH_DEMUXER
     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 fa64a83..c05196f 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -31,9 +31,13 @@ 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_ARM
+    flags = ff_get_cpu_flags_arm();
+#elif ARCH_PPC
+    flags = ff_get_cpu_flags_ppc();
+#else
     if (ARCH_X86) flags = ff_get_cpu_flags_x86();
+#endif
 
     checked = 1;
     return flags;
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index a98a389..eca61ce 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -3045,10 +3045,11 @@ 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)
+#elif (HAVE_ALTIVEC)
         ff_sws_init_swScale_altivec(c);
+#endif
 
     return swScale;
 }
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index b98d38a..520fcba 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -877,10 +877,11 @@ 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)
+#elif (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 abd9993..c679ff4 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -719,8 +719,10 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
     ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, contrast, saturation);
     //FIXME factorize
 
-    if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)
+#if HAVE_ALTIVEC
+    if (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/x86/swscale_mmx.c b/libswscale/x86/swscale_mmx.c
index fdfd1f2..ded55ac 100644
--- a/libswscale/x86/swscale_mmx.c
+++ b/libswscale/x86/swscale_mmx.c
@@ -503,7 +503,8 @@ switch(c->dstBpc){ \
             c->yuv2plane1 = ff_yuv2plane1_16_sse4;
     }
 
-    if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX) {
+#if HAVE_AVX
+    if (cpu_flags & AV_CPU_FLAG_AVX) {
         ASSIGN_VSCALEX_FUNC(c->yuv2planeX, avx,);
         ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1);
 
@@ -525,4 +526,5 @@ switch(c->dstBpc){ \
         }
     }
 #endif
+#endif
 }
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 6100fbc..bb36732 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -507,17 +507,17 @@ 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 (CONFIG_MLIB) {
+#elif (CONFIG_MLIB)
         t = ff_yuv2rgb_init_mlib(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;
-- 
1.8.3.4

