Commit e96682e6 authored by Michael Niedermayer's avatar Michael Niedermayer

some of the warning fixes by (Michael Roitzsch <mroi at users dot sourceforge dot net>)

Originally committed as revision 3140 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 12cccabd
......@@ -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
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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
......@@ -26,8 +26,6 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
#include <math.h>
#include "dsputil.h"
#include "faandct.h"
......
......@@ -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;
......
......@@ -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"
......
......@@ -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();
......
......@@ -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)))
......
......@@ -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)
......
......@@ -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;
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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,
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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,
......
......@@ -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 */
......
......@@ -24,6 +24,7 @@
#include "common.h"
#include "avcodec.h"
#include "dsputil.h"
#include "vp3data.h"
#define IdctAdjustBeforeShift 8
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment