changeset 2024:f65d87bfdd5a libavcodec

some of the warning fixes by (Michael Roitzsch <mroi at users dot sourceforge dot net>)
author michael
date Tue, 18 May 2004 17:09:46 +0000
parents 50e92cec1b84
children 591233f22963
files avcodec.h cabac.c cabac.h dsputil.h faandct.c i386/dsputil_mmx.c i386/dsputil_mmx_avg.h i386/dsputil_mmx_rnd.h i386/fdct_mmx.c i386/idct_mmx.c i386/mpegvideo_mmx.c i386/simple_idct_mmx.c libpostproc/postprocess.c mpegvideo.c mpegvideo.h parser.c ra288.c svq1.c svq1_cb.h vp3data.h vp3dsp.c wmv2.c
diffstat 22 files changed, 47 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Tue May 18 01:53:43 2004 +0000
+++ b/avcodec.h	Tue May 18 17:09:46 2004 +0000
@@ -2159,6 +2159,7 @@
 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 @@
                    (((uint8_t*)(x))[2] << 16) | \
                    (((uint8_t*)(x))[1] << 8) | \
                     ((uint8_t*)(x))[0])
+#endif
 
 #ifdef __cplusplus
 }
--- a/cabac.c	Tue May 18 01:53:43 2004 +0000
+++ b/cabac.c	Tue May 18 17:09:46 2004 +0000
@@ -90,7 +90,7 @@
  *
  * @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;
 
--- a/cabac.h	Tue May 18 01:53:43 2004 +0000
+++ b/cabac.h	Tue May 18 17:09:46 2004 +0000
@@ -37,8 +37,8 @@
     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_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);
 
--- a/dsputil.h	Tue May 18 01:53:43 2004 +0000
+++ b/dsputil.h	Tue May 18 17:09:46 2004 +0000
@@ -564,6 +564,11 @@
     return (int)(rint(x));
 #endif
 }
+#else
+#ifndef _ISOC9X_SOURCE
+#define _ISOC9X_SOURCE
+#endif
+#include <math.h>
 #endif
 
 #endif
--- a/faandct.c	Tue May 18 01:53:43 2004 +0000
+++ b/faandct.c	Tue May 18 17:09:46 2004 +0000
@@ -26,8 +26,6 @@
  * @author Michael Niedermayer <michaelni@gmx.at>
  */
 
-#include <math.h>
-
 #include "dsputil.h"
 #include "faandct.h"
 
--- a/i386/dsputil_mmx.c	Tue May 18 01:53:43 2004 +0000
+++ b/i386/dsputil_mmx.c	Tue May 18 17:09:46 2004 +0000
@@ -2132,10 +2132,10 @@
 #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;
--- a/i386/dsputil_mmx_avg.h	Tue May 18 01:53:43 2004 +0000
+++ b/i386/dsputil_mmx_avg.h	Tue May 18 17:09:46 2004 +0000
@@ -53,7 +53,7 @@
 	:"%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 @@
 	:"%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"
--- a/i386/dsputil_mmx_rnd.h	Tue May 18 01:53:43 2004 +0000
+++ b/i386/dsputil_mmx_rnd.h	Tue May 18 17:09:46 2004 +0000
@@ -359,7 +359,7 @@
     } 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 @@
     } 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();
--- a/i386/fdct_mmx.c	Tue May 18 01:53:43 2004 +0000
+++ b/i386/fdct_mmx.c	Tue May 18 17:09:46 2004 +0000
@@ -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)))
--- a/i386/idct_mmx.c	Tue May 18 01:53:43 2004 +0000
+++ b/i386/idct_mmx.c	Tue May 18 17:09:46 2004 +0000
@@ -23,6 +23,7 @@
  */
 
 #include "../common.h"
+#include "../dsputil.h"
 
 #include "mmx.h"
 
@@ -588,6 +589,8 @@
     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)
--- a/i386/mpegvideo_mmx.c	Tue May 18 01:53:43 2004 +0000
+++ b/i386/mpegvideo_mmx.c	Tue May 18 17:09:46 2004 +0000
@@ -109,7 +109,7 @@
 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;
--- a/i386/simple_idct_mmx.c	Tue May 18 01:53:43 2004 +0000
+++ b/i386/simple_idct_mmx.c	Tue May 18 17:09:46 2004 +0000
@@ -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
--- a/libpostproc/postprocess.c	Tue May 18 01:53:43 2004 +0000
+++ b/libpostproc/postprocess.c	Tue May 18 17:09:46 2004 +0000
@@ -158,13 +158,6 @@
 	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)
--- a/mpegvideo.c	Tue May 18 01:53:43 2004 +0000
+++ b/mpegvideo.c	Tue May 18 17:09:46 2004 +0000
@@ -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 @@
  */
 
 #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 @@
                 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 encode_picture(MpegEncContext *s, int picture_number)
 {
-    int i, j;
+    int i;
     int bits;
 
     s->picture_number = picture_number;
@@ -4671,6 +4670,7 @@
             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 @@
             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 @@
         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
--- a/mpegvideo.h	Tue May 18 01:53:43 2004 +0000
+++ b/mpegvideo.h	Tue May 18 17:09:46 2004 +0000
@@ -813,6 +813,7 @@
 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_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,
--- a/parser.c	Tue May 18 01:53:43 2004 +0000
+++ b/parser.c	Tue May 18 17:09:46 2004 +0000
@@ -426,7 +426,7 @@
     return ret;
 }
 
-int mpeg4video_parse_init(AVCodecParserContext *s)
+static int mpeg4video_parse_init(AVCodecParserContext *s)
 {
     ParseContext1 *pc = s->priv_data;
 
--- a/ra288.c	Tue May 18 01:53:43 2004 +0000
+++ b/ra288.c	Tue May 18 17:09:46 2004 +0000
@@ -206,7 +206,7 @@
   }
 }
 
-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 @@
 	    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
--- a/svq1.c	Tue May 18 01:53:43 2004 +0000
+++ b/svq1.c	Tue May 18 17:09:46 2004 +0000
@@ -600,6 +600,7 @@
   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 @@
 
   return value;
 }
+#endif
 
 static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
   uint8_t seed;
--- a/svq1_cb.h	Tue May 18 01:53:43 2004 +0000
+++ b/svq1_cb.h	Tue May 18 17:09:46 2004 +0000
@@ -769,7 +769,7 @@
     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 @@
     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,
--- a/vp3data.h	Tue May 18 01:53:43 2004 +0000
+++ b/vp3data.h	Tue May 18 17:09:46 2004 +0000
@@ -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 @@
 
 /* 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 @@
 };
 
 /* 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 @@
     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 @@
   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 @@
 };
 
 /* 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 */
--- a/vp3dsp.c	Tue May 18 01:53:43 2004 +0000
+++ b/vp3dsp.c	Tue May 18 17:09:46 2004 +0000
@@ -24,6 +24,7 @@
 
 #include "common.h"
 #include "avcodec.h"
+#include "dsputil.h"
 #include "vp3data.h"
 
 #define IdctAdjustBeforeShift 8
--- a/wmv2.c	Tue May 18 01:53:43 2004 +0000
+++ b/wmv2.c	Tue May 18 17:09:46 2004 +0000
@@ -59,6 +59,8 @@
     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 @@
     return 0;
 }
 
-#ifdef CONFIG_ENCODERS
 static int wmv2_encode_init(AVCodecContext *avctx){
     Wmv2Context * const w= avctx->priv_data;