diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f4605bec8172f874684367d8cf920e0b2fee28ed..e56a5b280de5005c73755158fb0b7422a3ff20ce 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2159,6 +2159,7 @@ extern void av_log_set_level(int);
 extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));
 
 /* endian macros */
+#if !defined(BE_16) || !defined(BE_32) || !defined(LE_16) || !defined(LE_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) | \
@@ -2169,6 +2170,7 @@ extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));
                    (((uint8_t*)(x))[2] << 16) | \
                    (((uint8_t*)(x))[1] << 8) | \
                     ((uint8_t*)(x))[0])
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index 0e3e14f56e0f5e1bbef970ae5f70530f081469f1..2ae996a39d82a46782a8cf7594f2b9a59261316a 100644
--- a/libavcodec/cabac.c
+++ b/libavcodec/cabac.c
@@ -90,7 +90,7 @@ void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){
  *
  * @param buf_size size of buf in bits
  */
-void ff_init_cabac_decoder(CABACContext *c, uint8_t *buf, int buf_size){
+void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
     c->bytestream_start= 
     c->bytestream= buf;
 
diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h
index 852d47ebe8c3b899c890d47ea6e5be309d458e2c..05c47363d2b7ae6228a7a072e55faacb31c7653c 100644
--- a/libavcodec/cabac.h
+++ b/libavcodec/cabac.h
@@ -37,8 +37,8 @@ typedef struct CABACContext{
     uint8_t lps_range[2*64][4];   ///< rangeTabLPS
     uint8_t lps_state[2*64];      ///< transIdxLPS
     uint8_t mps_state[2*64];      ///< transIdxMPS
-    uint8_t *bytestream_start;
-    uint8_t *bytestream;
+    const uint8_t *bytestream_start;
+    const uint8_t *bytestream;
     int bits_left;                ///<
     PutBitContext pb;
 }CABACContext;
@@ -48,7 +48,7 @@ extern const uint8_t ff_h264_mps_state[64];
 extern const uint8_t ff_h264_lps_state[64];
 
 void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
-void ff_init_cabac_decoder(CABACContext *c, uint8_t *buf, int buf_size);
+void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
 void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4], 
                           uint8_t const *mps_state, uint8_t const *lps_state, int state_count);
 
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 3681541f5ade8cdc18ed154e0a5e4c0cd1e46fe6..0d42fe1089352bd3a15e6bb630ea432af4371bbf 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -564,6 +564,11 @@ static inline long int lrintf(float x)
     return (int)(rint(x));
 #endif
 }
+#else
+#ifndef _ISOC9X_SOURCE
+#define _ISOC9X_SOURCE
+#endif
+#include <math.h>
 #endif
 
 #endif
diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c
index 2a91184953c0dd1b42db83ea8abcd8817446ea0f..0462cee6123f501abf194c6becb45c6fc021a2b0 100644
--- a/libavcodec/faandct.c
+++ b/libavcodec/faandct.c
@@ -26,8 +26,6 @@
  * @author Michael Niedermayer <michaelni@gmx.at>
  */
 
-#include <math.h>
-
 #include "dsputil.h"
 #include "faandct.h"
 
diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/dsputil_mmx.c
index c8db22e6482d99d7c5fb8aec62a412b31e379a83..11504e2250fac2c054072889b30cdac64aaee114 100644
--- a/libavcodec/i386/dsputil_mmx.c
+++ b/libavcodec/i386/dsputil_mmx.c
@@ -2132,10 +2132,10 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
 #endif
 
     if (mm_flags & MM_MMX) {
-        const int dct_algo = avctx->dct_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){
             if(mm_flags & MM_SSE2){
                 c->fdct = ff_fdct_sse2;
diff --git a/libavcodec/i386/dsputil_mmx_avg.h b/libavcodec/i386/dsputil_mmx_avg.h
index c8494f51a6c6ccdc1418bcd8a2eba5d30e62dbce..052aad75c0680b07369ba8d31960d21293603cc2 100644
--- a/libavcodec/i386/dsputil_mmx_avg.h
+++ b/libavcodec/i386/dsputil_mmx_avg.h
@@ -53,7 +53,7 @@ static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_
 	:"%eax", "memory");
 }
 
-static void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+static __attribute__((unused)) void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
 {
     __asm __volatile(
 	"1:				\n\t"
@@ -125,7 +125,7 @@ static void DEF(put_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line
 	:"%eax", "memory");
 }
 
-static void DEF(put_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+static __attribute__((unused)) void DEF(put_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
 {
     __asm __volatile(
 	"1:				\n\t"
diff --git a/libavcodec/i386/dsputil_mmx_rnd.h b/libavcodec/i386/dsputil_mmx_rnd.h
index 21f0bfd8492324e9a5303f969b17ecfe81467f07..1b79aa56aaa048d43943b61f75214b0a1923e25e 100644
--- a/libavcodec/i386/dsputil_mmx_rnd.h
+++ b/libavcodec/i386/dsputil_mmx_rnd.h
@@ -359,7 +359,7 @@ static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line
     } while (--h);
 }
 
-static void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+static __attribute__((unused)) void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
 {
     MOVQ_BFE(mm6);
     JUMPALIGN();
@@ -406,7 +406,7 @@ static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int lin
     } while (--h);
 }
 
-static void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
+static __attribute__((unused)) void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h)
 {
     MOVQ_BFE(mm6);
     JUMPALIGN();
diff --git a/libavcodec/i386/fdct_mmx.c b/libavcodec/i386/fdct_mmx.c
index 68f788a23b409c764ee95d5ef75c026f7badd321..7f348329a2d9cee933a4aeb252f22c901accca48 100644
--- a/libavcodec/i386/fdct_mmx.c
+++ b/libavcodec/i386/fdct_mmx.c
@@ -14,6 +14,7 @@
  * Skal's fdct at http://skal.planet-d.net/coding/dct.html
  */
 #include "../common.h"
+#include "../dsputil.h"
 #include "mmx.h"
 
 #define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align)))
diff --git a/libavcodec/i386/idct_mmx.c b/libavcodec/i386/idct_mmx.c
index 298c8a8b034ce1f6a7a7b50b937c479fb9eb70a2..c356afe12c308eebc15ca73812983330bcf0cf4b 100644
--- a/libavcodec/i386/idct_mmx.c
+++ b/libavcodec/i386/idct_mmx.c
@@ -23,6 +23,7 @@
  */
 
 #include "../common.h"
+#include "../dsputil.h"
 
 #include "mmx.h"
 
@@ -588,6 +589,8 @@ void idct (int16_t * block)					\
     idct_col (block, 4);						\
 }
 
+void ff_mmx_idct(DCTELEM *block);
+void ff_mmxext_idct(DCTELEM *block);
 
 declare_idct (ff_mmxext_idct, mmxext_table,
 	      mmxext_row_head, mmxext_row, mmxext_row_tail, mmxext_row_mid)
diff --git a/libavcodec/i386/mpegvideo_mmx.c b/libavcodec/i386/mpegvideo_mmx.c
index 1c0e9f5ae3cfd3ef1b6aeb2a4d936b0c297872cc..f19de73d61d33461b8c60504d329c6a613535fd6 100644
--- a/libavcodec/i386/mpegvideo_mmx.c
+++ b/libavcodec/i386/mpegvideo_mmx.c
@@ -109,7 +109,7 @@ asm volatile(
 static void dct_unquantize_h263_inter_mmx(MpegEncContext *s,
                                   DCTELEM *block, int n, int qscale)
 {
-    int level, qmul, qadd, nCoeffs;
+    int qmul, qadd, nCoeffs;
 
     qmul = qscale << 1;
     qadd = (qscale - 1) | 1;
diff --git a/libavcodec/i386/simple_idct_mmx.c b/libavcodec/i386/simple_idct_mmx.c
index b005f9d8226c9aaf32014d67ad91d9ba3314d75c..92a366f2175130d77862c3bbac1c9e9bfac828f6 100644
--- a/libavcodec/i386/simple_idct_mmx.c
+++ b/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/libavcodec/libpostproc/postprocess.c b/libavcodec/libpostproc/postprocess.c
index 9ac18eaf2fec0c0ad8ca12ee9d930066d383740e..d4f6138f84cff56049a035573ad92dfb070ad51b 100644
--- a/libavcodec/libpostproc/postprocess.c
+++ b/libavcodec/libpostproc/postprocess.c
@@ -158,13 +158,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
-
 
 #ifdef ARCH_X86
 static inline void prefetchnta(void *p)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 74af8999a74a55717f5f5ba80dd19d8d6b6e07e3..246d480e56c170c95dce1afb4eb7ec7a64f2fe52 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -25,12 +25,11 @@
  * The simplest mpeg encoder (well, it was the simplest!).
  */ 
  
-#include <limits.h>
-#include <math.h> //for PI
 #include "avcodec.h"
 #include "dsputil.h"
 #include "mpegvideo.h"
 #include "faandct.h"
+#include <limits.h>
 
 #ifdef USE_FASTMEMCPY
 #include "fastmemcpy.h"
@@ -567,7 +566,7 @@ void MPV_decode_defaults(MpegEncContext *s){
  */
 
 #ifdef CONFIG_ENCODERS
-void MPV_encode_defaults(MpegEncContext *s){
+static void MPV_encode_defaults(MpegEncContext *s){
     static int done=0;
     
     MPV_common_defaults(s);
@@ -1708,7 +1707,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
                 if((s->avctx->debug_mv) && pict->motion_val){
                   int type;
                   for(type=0; type<3; type++){
-                    int direction;
+                    int direction = 0;
                     switch (type) {
                       case 0: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_P_FOR)) || (pict->pict_type!=FF_P_TYPE))
                                 continue;
@@ -4589,7 +4588,7 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src)
 
 static void encode_picture(MpegEncContext *s, int picture_number)
 {
-    int i, j;
+    int i;
     int bits;
 
     s->picture_number = picture_number;
@@ -4671,6 +4670,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
             ff_fix_long_p_mvs(s);
             ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, 0);
             if(s->flags & CODEC_FLAG_INTERLACED_ME){
+                int j;
                 for(i=0; i<2; i++){
                     for(j=0; j<2; j++)
                         ff_fix_long_mvs(s, s->p_field_select_table[i], j, 
@@ -4695,7 +4695,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
             ff_fix_long_mvs(s, NULL, 0, s->b_bidir_forw_mv_table, s->f_code, CANDIDATE_MB_TYPE_BIDIR, 1);
             ff_fix_long_mvs(s, NULL, 0, s->b_bidir_back_mv_table, s->b_code, CANDIDATE_MB_TYPE_BIDIR, 1);
             if(s->flags & CODEC_FLAG_INTERLACED_ME){
-                int dir;
+                int dir, j;
                 for(dir=0; dir<2; dir++){
                     for(i=0; i<2; i++){
                         for(j=0; j<2; j++){
@@ -5260,7 +5260,7 @@ STOP_TIMER("init rem[]")
         int best_score=s->dsp.try_8x8basis(rem, weight, basis[0], 0);
         int best_coeff=0;
         int best_change=0;
-        int run2, best_unquant_change, analyze_gradient;
+        int run2, best_unquant_change=0, analyze_gradient;
 #ifdef REFINE_STATS
 {START_TIMER
 #endif
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 0bdf0a305c7d586d96271f65bc1b102136d5e081..bdd05403b68c2691c8e5eb99dc479c2b44b80efc 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -813,6 +813,7 @@ void mpeg1_encode_mb(MpegEncContext *s,
 void ff_mpeg1_encode_init(MpegEncContext *s);
 void ff_mpeg1_encode_slice_header(MpegEncContext *s);
 void ff_mpeg1_clean_buffers(MpegEncContext *s);
+int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
 
 
 /** RLTable. */
@@ -852,6 +853,7 @@ extern const uint8_t ff_h263_chroma_qscale_table[32];
 extern const uint8_t ff_h263_loop_filter_strength[32];
 
 
+/* h263.c, h263dec.c */
 int ff_h263_decode_init(AVCodecContext *avctx);
 int ff_h263_decode_frame(AVCodecContext *avctx, 
                              void *data, int *data_size,
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 88894884cb8836b3ba102dfe03871ceea5555777..b7d6de31b956082f35bdf09f11a025b149ac3dfa 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -426,7 +426,7 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1,
     return ret;
 }
 
-int mpeg4video_parse_init(AVCodecParserContext *s)
+static int mpeg4video_parse_init(AVCodecParserContext *s)
 {
     ParseContext1 *pc = s->priv_data;
 
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index a44eb96f14471c875e05a24d5ab936d302a33037..09ecc7aacb120138f532e8f3b5882fccd92caaf5 100644
--- a/libavcodec/ra288.c
+++ b/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/libavcodec/svq1.c b/libavcodec/svq1.c
index 097c4532994e81a0fd78269b6aa0f37227dac5c1..b4f8e03b0b2e06f0a9a38ea69ca17886f78c6854 100644
--- a/libavcodec/svq1.c
+++ b/libavcodec/svq1.c
@@ -600,6 +600,7 @@ static uint16_t svq1_packet_checksum (uint8_t *data, int length, int value) {
   return value;
 }
 
+#if 0
 static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,
                                          int width, int height, int value) {
   int x, y;
@@ -614,6 +615,7 @@ static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,
 
   return value;
 }
+#endif
 
 static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
   uint8_t seed;
diff --git a/libavcodec/svq1_cb.h b/libavcodec/svq1_cb.h
index 0f766aa882c176a5e50bf9e50f5af7122e94b6f5..c6735fe8ea0589ae5051151d97582619954920e1 100644
--- a/libavcodec/svq1_cb.h
+++ b/libavcodec/svq1_cb.h
@@ -769,7 +769,7 @@ static const int8_t* const svq1_inter_codebooks[4] = {
     svq1_inter_codebook_8x4, svq1_inter_codebook_8x8
 };
 
-static const int8_t const svq1_inter_codebook_sum[4][16*6] = {
+static const int8_t svq1_inter_codebook_sum[4][16*6] = {
  {
  -1,  1, -2,  0,  1, -1, -1, -1, -2, -1,  1, -1, -1,  0, -1, -1,
   0, -1, -1, -1, -1,  0, -1,  0,  0,  0, -3,  1, -1,  0,  1, -1,
@@ -1543,7 +1543,7 @@ static const int8_t* const svq1_intra_codebooks[4] = {
     svq1_intra_codebook_8x4, svq1_intra_codebook_8x8
 };
 
-static const int8_t const svq1_intra_codebook_sum[4][16*6] = {
+static const int8_t svq1_intra_codebook_sum[4][16*6] = {
  {
   0,  0,  0, -1, -1, -1, -1, -2,  0, -1, -1,  0, -1,  0,  1,  0,
   1,  0, -1,  1,  0,  0, -1,  1, -1,  0,  0,  0, -1,  1,  0,  0,
diff --git a/libavcodec/vp3data.h b/libavcodec/vp3data.h
index a25c9f06efb149be7fe72f56c050372fbba4774a..1dd511fa0f15d06492b05fa029153713e7670245 100644
--- a/libavcodec/vp3data.h
+++ b/libavcodec/vp3data.h
@@ -3,7 +3,7 @@
 
 /* these coefficients dequantize intraframe Y plane coefficients
  * (note: same as JPEG) */
-static int16_t vp31_intra_y_dequant[64] =
+static const int16_t vp31_intra_y_dequant[64] =
 {       16,  11,  10,  16,  24,  40,  51,  61,
         12,  12,  14,  19,  26,  58,  60,  55,
         14,  13,  16,  24,  40,  57,  69,  56,
@@ -16,7 +16,7 @@ static int16_t vp31_intra_y_dequant[64] =
 
 /* these coefficients dequantize intraframe C plane coefficients 
  * (note: same as JPEG) */
-static int16_t vp31_intra_c_dequant[64] =
+static const int16_t vp31_intra_c_dequant[64] =
 {       17,  18,     24,     47,     99,     99,     99,     99,
         18,  21,     26,     66,     99,     99,     99,     99,
         24,  26,     56,     99,     99,     99,     99,     99,
@@ -28,7 +28,7 @@ static int16_t vp31_intra_c_dequant[64] =
 };
 
 /* these coefficients dequantize interframe coefficients (all planes) */
-static int16_t vp31_inter_dequant[64] =
+static const int16_t vp31_inter_dequant[64] =
 {   16,  16,  16,  20,  24,  28,  32,  40,
     16,  16,  20,  24,  28,  32,  40,  48,
     16,  20,  24,  28,  32,  40,  48,  64,
@@ -39,7 +39,7 @@ static int16_t vp31_inter_dequant[64] =
     40,  48,  64,  64,  64,  96,  128, 128
 };
 
-static int16_t vp31_dc_scale_factor[64] =
+static const int16_t vp31_dc_scale_factor[64] =
 { 220, 200, 190, 180, 170, 170, 160, 160,
   150, 150, 140, 140, 130, 130, 120, 120,
   110, 110, 100, 100, 90,  90,  90,  80,
@@ -50,7 +50,7 @@ static int16_t vp31_dc_scale_factor[64] =
   20,  10,  10,  10,  10,  10,  10,  10
 };
 
-static uint32_t vp31_ac_scale_factor[64] =
+static const uint32_t vp31_ac_scale_factor[64] =
 { 500,  450,  400,  370,  340,  310, 285, 265,
   245,  225,  210,  195,  185,  180, 170, 160,
   150,  145,  135,  130,  125,  115, 110, 107,
@@ -74,7 +74,7 @@ static const int dezigzag_index[64] =
 };
 
 /* inverse of dezigzag index */
-static int zigzag_index[64];
+static __attribute__((unused)) int zigzag_index[64];
 
 static const uint16_t dc_bias[16][32][2] = {
   {  /* DC bias table 0 */
diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c
index 3ead732803e2099de35d3b93091fb5967e5114b8..9c9530d05bd113827fb0b2c23e042daff64429fb 100644
--- a/libavcodec/vp3dsp.c
+++ b/libavcodec/vp3dsp.c
@@ -24,6 +24,7 @@
 
 #include "common.h"
 #include "avcodec.h"
+#include "dsputil.h"
 #include "vp3data.h"
 
 #define IdctAdjustBeforeShift 8
diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index 376f0706e1a90e4260c68f6bd29639fa78402ec6..a5ba1dd2dad8ea40f06abbb5bf4c4c40743cc5dd 100644
--- a/libavcodec/wmv2.c
+++ b/libavcodec/wmv2.c
@@ -59,6 +59,8 @@ static void wmv2_common_init(Wmv2Context * w){
     ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], wmv2_scantableB);
 }
 
+#ifdef CONFIG_ENCODERS
+
 static int encode_ext_header(Wmv2Context *w){
     MpegEncContext * const s= &w->s;
     PutBitContext pb;
@@ -84,7 +86,6 @@ static int encode_ext_header(Wmv2Context *w){
     return 0;
 }
 
-#ifdef CONFIG_ENCODERS
 static int wmv2_encode_init(AVCodecContext *avctx){
     Wmv2Context * const w= avctx->priv_data;