patch by Carl Eugen Hoyos cehoyos chez ag or at original thread: [FFmpeg-devel] [PATCH] attribute_unused -> av_unused date: 05/29/2007 01:23 PM Originally committed as revision 9155 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.5
@@ -555,7 +555,7 @@ static int decode_i_frame(FourXContext *f, uint8_t *buf, int length){ | |||||
uint16_t *dst= (uint16_t*)f->current_picture.data[0]; | uint16_t *dst= (uint16_t*)f->current_picture.data[0]; | ||||
const int stride= f->current_picture.linesize[0]>>1; | const int stride= f->current_picture.linesize[0]>>1; | ||||
const unsigned int bitstream_size= get32(buf); | const unsigned int bitstream_size= get32(buf); | ||||
const int token_count attribute_unused = get32(buf + bitstream_size + 8); | |||||
const int token_count av_unused = get32(buf + bitstream_size + 8); | |||||
unsigned int prestream_size= 4*get32(buf + bitstream_size + 4); | unsigned int prestream_size= 4*get32(buf + bitstream_size + 4); | ||||
uint8_t *prestream= buf + bitstream_size + 12; | uint8_t *prestream= buf + bitstream_size + 12; | ||||
@@ -539,7 +539,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const st | |||||
#else /* defined(ARCH_X86) && defined(CONFIG_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ | #else /* defined(ARCH_X86) && defined(CONFIG_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */ | ||||
int s = *state; | int s = *state; | ||||
int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s]; | int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s]; | ||||
int bit, lps_mask attribute_unused; | |||||
int bit, lps_mask av_unused; | |||||
c->range -= RangeLPS; | c->range -= RangeLPS; | ||||
#ifndef BRANCHLESS_CABAC_DECODER | #ifndef BRANCHLESS_CABAC_DECODER | ||||
@@ -2534,7 +2534,7 @@ static const uint8_t dv_audio_shuffle625[12][9] = { | |||||
{ 31, 67, 103, 21, 57, 93, 11, 47, 83}, | { 31, 67, 103, 21, 57, 93, 11, 47, 83}, | ||||
}; | }; | ||||
static const attribute_unused int dv_audio_frequency[3] = { | |||||
static const av_unused int dv_audio_frequency[3] = { | |||||
48000, 44100, 32000, | 48000, 44100, 32000, | ||||
}; | }; | ||||
@@ -1733,22 +1733,22 @@ static void pred4x4_128_dc_c(uint8_t *src, uint8_t *topright, int stride){ | |||||
#define LOAD_TOP_RIGHT_EDGE\ | #define LOAD_TOP_RIGHT_EDGE\ | ||||
const int attribute_unused t4= topright[0];\ | |||||
const int attribute_unused t5= topright[1];\ | |||||
const int attribute_unused t6= topright[2];\ | |||||
const int attribute_unused t7= topright[3];\ | |||||
const int av_unused t4= topright[0];\ | |||||
const int av_unused t5= topright[1];\ | |||||
const int av_unused t6= topright[2];\ | |||||
const int av_unused t7= topright[3];\ | |||||
#define LOAD_LEFT_EDGE\ | #define LOAD_LEFT_EDGE\ | ||||
const int attribute_unused l0= src[-1+0*stride];\ | |||||
const int attribute_unused l1= src[-1+1*stride];\ | |||||
const int attribute_unused l2= src[-1+2*stride];\ | |||||
const int attribute_unused l3= src[-1+3*stride];\ | |||||
const int av_unused l0= src[-1+0*stride];\ | |||||
const int av_unused l1= src[-1+1*stride];\ | |||||
const int av_unused l2= src[-1+2*stride];\ | |||||
const int av_unused l3= src[-1+3*stride];\ | |||||
#define LOAD_TOP_EDGE\ | #define LOAD_TOP_EDGE\ | ||||
const int attribute_unused t0= src[ 0-1*stride];\ | |||||
const int attribute_unused t1= src[ 1-1*stride];\ | |||||
const int attribute_unused t2= src[ 2-1*stride];\ | |||||
const int attribute_unused t3= src[ 3-1*stride];\ | |||||
const int av_unused t0= src[ 0-1*stride];\ | |||||
const int av_unused t1= src[ 1-1*stride];\ | |||||
const int av_unused t2= src[ 2-1*stride];\ | |||||
const int av_unused t3= src[ 3-1*stride];\ | |||||
static void pred4x4_down_right_c(uint8_t *src, uint8_t *topright, int stride){ | static void pred4x4_down_right_c(uint8_t *src, uint8_t *topright, int stride){ | ||||
const int lt= src[-1-1*stride]; | const int lt= src[-1-1*stride]; | ||||
@@ -2159,7 +2159,7 @@ void ff_pred8x8_plane_c(uint8_t *src, int stride){ | |||||
const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \ | const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \ | ||||
+ 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \ | + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \ | ||||
PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \ | PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \ | ||||
const int l7 attribute_unused = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2 | |||||
const int l7 av_unused = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2 | |||||
#define PT(x) \ | #define PT(x) \ | ||||
const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2; | const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2; | ||||
@@ -2167,7 +2167,7 @@ void ff_pred8x8_plane_c(uint8_t *src, int stride){ | |||||
const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \ | const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \ | ||||
+ 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \ | + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \ | ||||
PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \ | PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \ | ||||
const int t7 attribute_unused = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \ | |||||
const int t7 av_unused = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \ | |||||
+ 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2 | + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2 | ||||
#define PTR(x) \ | #define PTR(x) \ | ||||
@@ -57,7 +57,7 @@ static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line | |||||
:REG_a, "memory"); | :REG_a, "memory"); | ||||
} | } | ||||
static void attribute_unused DEF(put, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
static void av_unused DEF(put, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
{ | { | ||||
MOVQ_BFE(mm6); | MOVQ_BFE(mm6); | ||||
__asm __volatile( | __asm __volatile( | ||||
@@ -153,7 +153,7 @@ static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int lin | |||||
:REG_a, "memory"); | :REG_a, "memory"); | ||||
} | } | ||||
static void attribute_unused DEF(put, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
static void av_unused DEF(put, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
{ | { | ||||
MOVQ_BFE(mm6); | MOVQ_BFE(mm6); | ||||
__asm __volatile( | __asm __volatile( | ||||
@@ -298,7 +298,7 @@ static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int lin | |||||
} | } | ||||
// avg_pixels | // avg_pixels | ||||
static void attribute_unused DEF(avg, pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h) | |||||
static void av_unused DEF(avg, pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h) | |||||
{ | { | ||||
MOVQ_BFE(mm6); | MOVQ_BFE(mm6); | ||||
JUMPALIGN(); | JUMPALIGN(); | ||||
@@ -380,7 +380,7 @@ static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line | |||||
} while (--h); | } while (--h); | ||||
} | } | ||||
static attribute_unused void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
static av_unused void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
{ | { | ||||
MOVQ_BFE(mm6); | MOVQ_BFE(mm6); | ||||
JUMPALIGN(); | JUMPALIGN(); | ||||
@@ -427,7 +427,7 @@ static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int lin | |||||
} while (--h); | } while (--h); | ||||
} | } | ||||
static attribute_unused void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
static av_unused void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) | |||||
{ | { | ||||
MOVQ_BFE(mm6); | MOVQ_BFE(mm6); | ||||
JUMPALIGN(); | JUMPALIGN(); | ||||
@@ -27,11 +27,11 @@ | |||||
//lets hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...) | //lets hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...) | ||||
#define LOAD_COMMON\ | #define LOAD_COMMON\ | ||||
uint32_t attribute_unused * const score_map= c->score_map;\ | |||||
const int attribute_unused xmin= c->xmin;\ | |||||
const int attribute_unused ymin= c->ymin;\ | |||||
const int attribute_unused xmax= c->xmax;\ | |||||
const int attribute_unused ymax= c->ymax;\ | |||||
uint32_t av_unused * const score_map= c->score_map;\ | |||||
const int av_unused xmin= c->xmin;\ | |||||
const int av_unused ymin= c->ymin;\ | |||||
const int av_unused xmax= c->xmax;\ | |||||
const int av_unused ymax= c->ymax;\ | |||||
uint8_t *mv_penalty= c->current_mv_penalty;\ | uint8_t *mv_penalty= c->current_mv_penalty;\ | ||||
const int pred_x= c->pred_x;\ | const int pred_x= c->pred_x;\ | ||||
const int pred_y= c->pred_y;\ | const int pred_y= c->pred_y;\ | ||||
@@ -103,7 +103,7 @@ static inline void refill(RangeCoder *c){ | |||||
static inline int get_rac(RangeCoder *c, uint8_t * const state){ | static inline int get_rac(RangeCoder *c, uint8_t * const state){ | ||||
int range1= (c->range * (*state)) >> 8; | int range1= (c->range * (*state)) >> 8; | ||||
int attribute_unused one_mask; | |||||
int av_unused one_mask; | |||||
c->range -= range1; | c->range -= range1; | ||||
#if 1 | #if 1 | ||||
@@ -183,8 +183,8 @@ static void svq3_add_idct_c (uint8_t *dst, DCTELEM *block, int stride, int qp, i | |||||
static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){ | static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){ | ||||
LOAD_TOP_EDGE | LOAD_TOP_EDGE | ||||
LOAD_LEFT_EDGE | LOAD_LEFT_EDGE | ||||
const attribute_unused int unu0= t0; | |||||
const attribute_unused int unu1= l0; | |||||
const av_unused int unu0= t0; | |||||
const av_unused int unu1= l0; | |||||
src[0+0*stride]=(l1 + t1)>>1; | src[0+0*stride]=(l1 + t1)>>1; | ||||
src[1+0*stride]= | src[1+0*stride]= | ||||
@@ -63,6 +63,14 @@ | |||||
#endif | #endif | ||||
#endif | #endif | ||||
#ifndef av_unused | |||||
#if defined(__GNUC__) | |||||
# define av_unused __attribute__((unused)) | |||||
#else | |||||
# define av_unused | |||||
#endif | |||||
#endif | |||||
#include "mem.h" | #include "mem.h" | ||||
//rounded divison & shift | //rounded divison & shift | ||||
@@ -34,14 +34,6 @@ | |||||
#endif | #endif | ||||
#endif | #endif | ||||
#ifndef attribute_unused | |||||
#if defined(__GNUC__) | |||||
# define attribute_unused __attribute__((unused)) | |||||
#else | |||||
# define attribute_unused | |||||
#endif | |||||
#endif | |||||
#ifndef M_PI | #ifndef M_PI | ||||
#define M_PI 3.14159265358979323846 | #define M_PI 3.14159265358979323846 | ||||
#endif | #endif | ||||
@@ -87,7 +87,7 @@ static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32) | |||||
static void body(uint32_t ABCD[4], uint32_t X[16]){ | static void body(uint32_t ABCD[4], uint32_t X[16]){ | ||||
int t; | int t; | ||||
int i attribute_unused; | |||||
int i av_unused; | |||||
unsigned int a= ABCD[3]; | unsigned int a= ABCD[3]; | ||||
unsigned int b= ABCD[2]; | unsigned int b= ABCD[2]; | ||||
unsigned int c= ABCD[1]; | unsigned int c= ABCD[1]; | ||||