diff options
author | Måns Rullgård <mans@mansr.com> | 2006-12-08 00:35:08 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2006-12-08 00:35:08 +0000 |
commit | 849f10351d673ced1db6f13e399876f22121f60c (patch) | |
tree | 779ae65e38d3070b7bf48ea6e6d89032a9e00521 | |
parent | fb17fac8c7dd92c77cf93019510e15fdae418d16 (diff) | |
download | ffmpeg-849f10351d673ced1db6f13e399876f22121f60c.tar.gz |
rename always_inline to av_always_inline and move to common.h
Originally committed as revision 7256 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/bitstream.h | 2 | ||||
-rw-r--r-- | libavcodec/bytestream.h | 20 | ||||
-rw-r--r-- | libavcodec/cabac.h | 4 | ||||
-rw-r--r-- | libavcodec/dv.c | 14 | ||||
-rw-r--r-- | libavcodec/faandct.c | 2 | ||||
-rw-r--r-- | libavcodec/ffv1.c | 2 | ||||
-rw-r--r-- | libavcodec/h264.c | 4 | ||||
-rw-r--r-- | libavcodec/h264idct.c | 2 | ||||
-rw-r--r-- | libavcodec/i386/fdct_mmx.c | 8 | ||||
-rw-r--r-- | libavcodec/jfdctfst.c | 2 | ||||
-rw-r--r-- | libavcodec/jfdctint.c | 2 | ||||
-rw-r--r-- | libavcodec/mathops.h | 2 | ||||
-rw-r--r-- | libavcodec/motion_est.c | 2 | ||||
-rw-r--r-- | libavcodec/motion_est_template.c | 6 | ||||
-rw-r--r-- | libavcodec/mpeg12.c | 2 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 10 | ||||
-rw-r--r-- | libavcodec/pthread.c | 2 | ||||
-rw-r--r-- | libavcodec/smacker.c | 4 | ||||
-rw-r--r-- | libavcodec/snow.c | 22 | ||||
-rw-r--r-- | libavcodec/snow.h | 8 | ||||
-rw-r--r-- | libavcodec/vc1.c | 2 | ||||
-rw-r--r-- | libavcodec/vc1dsp.c | 2 | ||||
-rw-r--r-- | libavcodec/vmnc.c | 6 | ||||
-rw-r--r-- | libavcodec/vp3dsp.c | 2 | ||||
-rw-r--r-- | libavcodec/wavpack.c | 4 | ||||
-rw-r--r-- | libavutil/bswap.h | 14 | ||||
-rw-r--r-- | libavutil/common.h | 11 | ||||
-rw-r--r-- | libavutil/internal.h | 10 | ||||
-rw-r--r-- | libpostproc/postprocess.c | 2 | ||||
-rw-r--r-- | libpostproc/postprocess_template.c | 2 |
30 files changed, 89 insertions, 86 deletions
diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h index af25b6dcf5..22ec01069f 100644 --- a/libavcodec/bitstream.h +++ b/libavcodec/bitstream.h @@ -877,7 +877,7 @@ void free_vlc(VLC *vlc); * read the longest vlc code * = (max_vlc_length + bits - 1) / bits */ -static always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2], +static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int max_depth) { int code; diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index 25c457fe4c..a742fa1c14 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -22,32 +22,32 @@ #ifndef FFMPEG_BYTESTREAM_H #define FFMPEG_BYTESTREAM_H -static always_inline unsigned int bytestream_get_le32(uint8_t **b) +static av_always_inline unsigned int bytestream_get_le32(uint8_t **b) { (*b) += 4; return LE_32(*b - 4); } -static always_inline unsigned int bytestream_get_le16(uint8_t **b) +static av_always_inline unsigned int bytestream_get_le16(uint8_t **b) { (*b) += 2; return LE_16(*b - 2); } -static always_inline unsigned int bytestream_get_byte(uint8_t **b) +static av_always_inline unsigned int bytestream_get_byte(uint8_t **b) { (*b)++; return (*b)[-1]; } -static always_inline unsigned int bytestream_get_buffer(uint8_t **b, uint8_t *dst, unsigned int size) +static av_always_inline unsigned int bytestream_get_buffer(uint8_t **b, uint8_t *dst, unsigned int size) { memcpy(dst, *b, size); (*b) += size; return size; } -static always_inline void bytestream_put_be32(uint8_t **b, const unsigned int value) +static av_always_inline void bytestream_put_be32(uint8_t **b, const unsigned int value) { *(*b)++ = value >> 24; *(*b)++ = value >> 16; @@ -55,13 +55,13 @@ static always_inline void bytestream_put_be32(uint8_t **b, const unsigned int va *(*b)++ = value; }; -static always_inline void bytestream_put_be16(uint8_t **b, const unsigned int value) +static av_always_inline void bytestream_put_be16(uint8_t **b, const unsigned int value) { *(*b)++ = value >> 8; *(*b)++ = value; } -static always_inline void bytestream_put_le32(uint8_t **b, const unsigned int value) +static av_always_inline void bytestream_put_le32(uint8_t **b, const unsigned int value) { *(*b)++ = value; *(*b)++ = value >> 8; @@ -69,18 +69,18 @@ static always_inline void bytestream_put_le32(uint8_t **b, const unsigned int va *(*b)++ = value >> 24; } -static always_inline void bytestream_put_le16(uint8_t **b, const unsigned int value) +static av_always_inline void bytestream_put_le16(uint8_t **b, const unsigned int value) { *(*b)++ = value; *(*b)++ = value >> 8; } -static always_inline void bytestream_put_byte(uint8_t **b, const unsigned int value) +static av_always_inline void bytestream_put_byte(uint8_t **b, const unsigned int value) { *(*b)++ = value; } -static always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size) +static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size) { memcpy(*b, src, size); (*b) += size; diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index 43fe78e3bb..f47406a9ea 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -363,7 +363,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){ refill(c); } -static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state){ +static int av_always_inline get_cabac_inline(CABACContext *c, uint8_t * const state){ //FIXME gcc generates duplicate load/stores for c->low and c->range #define LOW "0" #define RANGE "4" @@ -631,7 +631,7 @@ static int get_cabac_bypass(CABACContext *c){ } -static always_inline int get_cabac_bypass_sign(CABACContext *c, int val){ +static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){ #if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) asm volatile( "movl "RANGE "(%1), %%ebx \n\t" diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 76095a4819..803d3502de 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -560,7 +560,7 @@ static inline void dv_decode_video_segment(DVVideoContext *s, #ifdef DV_CODEC_TINY_TARGET /* Converts run and level (where level != 0) pair into vlc, returning bit size */ -static always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc) +static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc) { int size; if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) { @@ -585,7 +585,7 @@ static always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc) return size; } -static always_inline int dv_rl2vlc_size(int run, int level) +static av_always_inline int dv_rl2vlc_size(int run, int level) { int size; @@ -601,13 +601,13 @@ static always_inline int dv_rl2vlc_size(int run, int level) return size; } #else -static always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t* vlc) +static av_always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t* vlc) { *vlc = dv_vlc_map[run][l].vlc | sign; return dv_vlc_map[run][l].size; } -static always_inline int dv_rl2vlc_size(int run, int l) +static av_always_inline int dv_rl2vlc_size(int run, int l) { return dv_vlc_map[run][l].size; } @@ -627,7 +627,7 @@ typedef struct EncBlockInfo { uint32_t partial_bit_buffer; /* we can't use uint16_t here */ } EncBlockInfo; -static always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, +static av_always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, PutBitContext* pb_end) { int prev; @@ -670,7 +670,7 @@ static always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext return pb; } -static always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi, +static av_always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi, const uint8_t* zigzag_scan, const int *weight, int bias) { int i, area; @@ -742,7 +742,7 @@ static always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi, //FIXME replace this by dsputil #define SC(x, y) ((s[x] - s[y]) ^ ((s[x] - s[y]) >> 7)) -static always_inline int dv_guess_dct_mode(DCTELEM *blk) { +static av_always_inline int dv_guess_dct_mode(DCTELEM *blk) { DCTELEM *s; int score88 = 0; int score248 = 0; diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c index e3c0d84a2c..6f73ee5e97 100644 --- a/libavcodec/faandct.c +++ b/libavcodec/faandct.c @@ -70,7 +70,7 @@ B6*B0, B6*B1, B6*B2, B6*B3, B6*B4, B6*B5, B6*B6, B6*B7, B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7, }; -static always_inline void row_fdct(FLOAT temp[64], DCTELEM * data) +static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data) { FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; FLOAT tmp10, tmp11, tmp12, tmp13; diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 62623e591b..1ca18a4e87 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -186,7 +186,7 @@ typedef struct FFV1Context{ DSPContext dsp; }FFV1Context; -static always_inline int fold(int diff, int bits){ +static av_always_inline int fold(int diff, int bits){ if(bits==8) diff= (int8_t)diff; else{ diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 00ab7d7ff8..d7c48bd4a3 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -400,7 +400,7 @@ static void svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, in static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize); static void filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize); -static always_inline uint32_t pack16to32(int a, int b){ +static av_always_inline uint32_t pack16to32(int a, int b){ #ifdef WORDS_BIGENDIAN return (b&0xFFFF) + (a<<16); #else @@ -423,7 +423,7 @@ const uint8_t ff_div6[52]={ * @param w width of the rectangle, should be a constant * @param size the size of val (1 or 4), should be a constant */ -static always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){ +static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){ uint8_t *p= (uint8_t*)vp; assert(size==1 || size==4); assert(w<=4); diff --git a/libavcodec/h264idct.c b/libavcodec/h264idct.c index 3506418ad6..a6a56d33a7 100644 --- a/libavcodec/h264idct.c +++ b/libavcodec/h264idct.c @@ -28,7 +28,7 @@ #include "dsputil.h" -static always_inline void idct_internal(uint8_t *dst, DCTELEM *block, int stride, int block_stride, int shift, int add){ +static av_always_inline void idct_internal(uint8_t *dst, DCTELEM *block, int stride, int block_stride, int shift, int add){ int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; diff --git a/libavcodec/i386/fdct_mmx.c b/libavcodec/i386/fdct_mmx.c index 2ffbfecf64..7e2682a4af 100644 --- a/libavcodec/i386/fdct_mmx.c +++ b/libavcodec/i386/fdct_mmx.c @@ -284,7 +284,7 @@ TABLE_SSE2 }}; -static always_inline void fdct_col(const int16_t *in, int16_t *out, int offset) +static av_always_inline void fdct_col(const int16_t *in, int16_t *out, int offset) { movq_m2r(*(in + offset + 1 * 8), mm0); movq_m2r(*(in + offset + 6 * 8), mm1); @@ -364,7 +364,7 @@ static always_inline void fdct_col(const int16_t *in, int16_t *out, int offset) } -static always_inline void fdct_row_sse2(const int16_t *in, int16_t *out) +static av_always_inline void fdct_row_sse2(const int16_t *in, int16_t *out) { asm volatile( #define FDCT_ROW_SSE2_H1(i,t) \ @@ -426,7 +426,7 @@ static always_inline void fdct_row_sse2(const int16_t *in, int16_t *out) ); } -static always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table) +static av_always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table) { pshufw_m2r(*(in + 4), mm5, 0x1B); movq_m2r(*(in + 0), mm0); @@ -469,7 +469,7 @@ static always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const i movq_r2m(mm7, *(out + 4)); } -static always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table) +static av_always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table) { //FIXME reorder (i dont have a old mmx only cpu here to benchmark ...) movd_m2r(*(in + 6), mm1); diff --git a/libavcodec/jfdctfst.c b/libavcodec/jfdctfst.c index 38424563d1..a9dcfab825 100644 --- a/libavcodec/jfdctfst.c +++ b/libavcodec/jfdctfst.c @@ -145,7 +145,7 @@ #define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) -static always_inline void row_fdct(DCTELEM * data){ +static av_always_inline void row_fdct(DCTELEM * data){ int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int_fast16_t tmp10, tmp11, tmp12, tmp13; int_fast16_t z1, z2, z3, z4, z5, z11, z13; diff --git a/libavcodec/jfdctint.c b/libavcodec/jfdctint.c index 58f3a1446a..250312467f 100644 --- a/libavcodec/jfdctint.c +++ b/libavcodec/jfdctint.c @@ -181,7 +181,7 @@ #endif -static always_inline void row_fdct(DCTELEM * data){ +static av_always_inline void row_fdct(DCTELEM * data){ int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int_fast32_t tmp10, tmp11, tmp12, tmp13; int_fast32_t z1, z2, z3, z4, z5; diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 9ae34d71b2..c6ec705977 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -46,7 +46,7 @@ //gcc 3.4 creates an incredibly bloated mess out of this //# define MULH(a,b) (((int64_t)(a) * (int64_t)(b))>>32) -static always_inline int MULH(int a, int b){ +static av_always_inline int MULH(int a, int b){ return ((int64_t)(a) * (int64_t)(b))>>32; } #endif diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 2c5705c2ba..fc057712d4 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -103,7 +103,7 @@ static int get_flags(MotionEstContext *c, int direct, int chroma){ + (chroma ? FLAG_CHROMA : 0); } -static always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, +static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, const int size, const int h, int ref_index, int src_index, me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ MotionEstContext * const c= &s->me; diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c index 980727d5a8..5a01ef6222 100644 --- a/libavcodec/motion_est_template.c +++ b/libavcodec/motion_est_template.c @@ -555,7 +555,7 @@ if( (y)>(ymax<<(S)) ) printf("%d %d %d %d %d ymax" #v, ymax, (x), (y), s->mb_x, const int qpel= flags&FLAG_QPEL;\ const int shift= 1+qpel;\ -static always_inline int small_diamond_search(MpegEncContext * s, int *best, int dmin, +static av_always_inline int small_diamond_search(MpegEncContext * s, int *best, int dmin, int src_index, int ref_index, int const penalty_factor, int size, int h, int flags) { @@ -964,7 +964,7 @@ if(256*256*256*64 % (stats[0]+1)==0){ return dmin; } -static always_inline int diamond_search(MpegEncContext * s, int *best, int dmin, +static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin, int src_index, int ref_index, int const penalty_factor, int size, int h, int flags){ MotionEstContext * const c= &s->me; @@ -984,7 +984,7 @@ static always_inline int diamond_search(MpegEncContext * s, int *best, int dmin, return var_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); } -static always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr, +static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale, int flags, int size, int h) { diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index c392e17afa..36d7153519 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -508,7 +508,7 @@ static inline void put_mb_modes(MpegEncContext *s, int n, int bits, } } -static always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, +static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y, int mb_block_count) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 4f286fb2f9..41127013c6 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2946,7 +2946,7 @@ static inline int hpel_motion_lowres(MpegEncContext *s, } /* apply one mpeg motion vector to the three components */ -static always_inline void mpeg_motion(MpegEncContext *s, +static av_always_inline void mpeg_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint8_t **ref_picture, op_pixels_func (*pix_op)[4], @@ -3063,7 +3063,7 @@ if(s->quarter_sample) } /* apply one mpeg motion vector to the three components */ -static always_inline void mpeg_motion_lowres(MpegEncContext *s, +static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint8_t **ref_picture, h264_chroma_mc_func *pix_op, @@ -3895,7 +3895,7 @@ void ff_clean_intra_table_entries(MpegEncContext *s) s->mv : motion vector s->interlaced_dct : true if interlaced dct used (mpeg2) */ -static always_inline void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], int lowres_flag) +static av_always_inline void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], int lowres_flag) { int mb_x, mb_y; const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; @@ -4318,7 +4318,7 @@ static void get_vissual_weight(int16_t *weight, uint8_t *ptr, int stride){ } } -static always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count) +static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count) { int16_t weight[8][64]; DCTELEM orig[8][64]; @@ -4600,7 +4600,7 @@ static always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, in } } -static always_inline void encode_mb(MpegEncContext *s, int motion_x, int motion_y) +static av_always_inline void encode_mb(MpegEncContext *s, int motion_x, int motion_y) { if (s->chroma_format == CHROMA_420) encode_mb_internal(s, motion_x, motion_y, 8, 6); else encode_mb_internal(s, motion_x, motion_y, 16, 8); diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 4737211cbc..f2c636bbe9 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -76,7 +76,7 @@ static void* worker(void *v) } } -static always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count) +static av_always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count) { pthread_cond_wait(&c->last_job_cond, &c->current_job_lock); pthread_mutex_unlock(&c->current_job_lock); diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 2f21858488..2e1784075d 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -320,12 +320,12 @@ static int decode_header_trees(SmackVContext *smk) { return 0; } -static always_inline void last_reset(int *recode, int *last) { +static av_always_inline void last_reset(int *recode, int *last) { recode[last[0]] = recode[last[1]] = recode[last[2]] = 0; } /* get code and update history */ -static always_inline int smk_get_code(GetBitContext *gb, int *recode, int *last) { +static av_always_inline int smk_get_code(GetBitContext *gb, int *recode, int *last) { register int *table = recode; int v, b; diff --git a/libavcodec/snow.c b/libavcodec/snow.c index 6bc9a8f1ae..ae6608bf31 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -709,7 +709,7 @@ static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2){ return v; } -static always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ +static av_always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ const int mirror_left= !highpass; const int mirror_right= (width&1) ^ highpass; const int w= (width>>1) - 1 + (highpass & width); @@ -732,7 +732,7 @@ static always_inline void lift(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst } #ifndef lift5 -static always_inline void lift5(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ +static av_always_inline void lift5(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ const int mirror_left= !highpass; const int mirror_right= (width&1) ^ highpass; const int w= (width>>1) - 1 + (highpass & width); @@ -764,7 +764,7 @@ static always_inline void lift5(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int ds #endif #ifndef liftS -static always_inline void liftS(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ +static av_always_inline void liftS(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse){ const int mirror_left= !highpass; const int mirror_right= (width&1) ^ highpass; const int w= (width>>1) - 1 + (highpass & width); @@ -2206,7 +2206,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ } } -static always_inline int same_block(BlockNode *a, BlockNode *b){ +static av_always_inline int same_block(BlockNode *a, BlockNode *b){ if((a->type&BLOCK_INTRA) && (b->type&BLOCK_INTRA)){ return !((a->color[0] - b->color[0]) | (a->color[1] - b->color[1]) | (a->color[2] - b->color[2])); }else{ @@ -2553,7 +2553,7 @@ void ff_snow_inner_add_yblock(uint8_t *obmc, const int obmc_stride, uint8_t * * } //FIXME name clenup (b_w, block_w, b_width stuff) -static always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer *sb, DWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index){ +static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer *sb, DWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index){ const int b_width = s->b_width << s->block_max_depth; const int b_height= s->b_height << s->block_max_depth; const int b_stride= b_width; @@ -2712,7 +2712,7 @@ assert(src_stride > 2*MB_SIZE + 5); #endif } -static always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, DWTELEM * old_buffer, int plane_index, int add, int mb_y){ +static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, DWTELEM * old_buffer, int plane_index, int add, int mb_y){ Plane *p= &s->plane[plane_index]; const int mb_w= s->b_width << s->block_max_depth; const int mb_h= s->b_height << s->block_max_depth; @@ -2779,7 +2779,7 @@ static always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * STOP_TIMER("predict_slice") } -static always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_index, int add, int mb_y){ +static av_always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_index, int add, int mb_y){ Plane *p= &s->plane[plane_index]; const int mb_w= s->b_width << s->block_max_depth; const int mb_h= s->b_height << s->block_max_depth; @@ -2836,7 +2836,7 @@ static always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_ STOP_TIMER("predict_slice") } -static always_inline void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index, int add){ +static av_always_inline void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index, int add){ const int mb_h= s->b_height << s->block_max_depth; int mb_y; for(mb_y=0; mb_y<=mb_h; mb_y++) @@ -3094,7 +3094,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ return distortion + rate*penalty_factor; } -static always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3], int intra, const uint8_t *obmc_edged, int *best_rd){ +static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3], int intra, const uint8_t *obmc_edged, int *best_rd){ const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup= *block; @@ -3133,12 +3133,12 @@ static always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int p[3 } /* special case for int[2] args we discard afterward, fixes compilation prob with gcc 2.95 */ -static always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, const uint8_t *obmc_edged, int *best_rd){ +static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, const uint8_t *obmc_edged, int *best_rd){ int p[2] = {p0, p1}; return check_block(s, mb_x, mb_y, p, 0, obmc_edged, best_rd); } -static always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ +static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]}; diff --git a/libavcodec/snow.h b/libavcodec/snow.h index f7cee131af..6794d2c5a4 100644 --- a/libavcodec/snow.h +++ b/libavcodec/snow.h @@ -137,7 +137,7 @@ static int w97_32_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int /* C bits used by mmx/sse2/altivec */ -static always_inline void snow_interleave_line_header(int * i, int width, DWTELEM * low, DWTELEM * high){ +static av_always_inline void snow_interleave_line_header(int * i, int width, DWTELEM * low, DWTELEM * high){ (*i) = (width) - 2; if (width & 1){ @@ -146,14 +146,14 @@ static always_inline void snow_interleave_line_header(int * i, int width, DWTELE } } -static always_inline void snow_interleave_line_footer(int * i, DWTELEM * low, DWTELEM * high){ +static av_always_inline void snow_interleave_line_footer(int * i, DWTELEM * low, DWTELEM * high){ for (; (*i)>=0; (*i)-=2){ low[(*i)+1] = high[(*i)>>1]; low[*i] = low[(*i)>>1]; } } -static always_inline void snow_horizontal_compose_lift_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){ +static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){ for(; i<w; i++){ dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift); } @@ -163,7 +163,7 @@ static always_inline void snow_horizontal_compose_lift_lead_out(int i, DWTELEM * } } -static always_inline void snow_horizontal_compose_liftS_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w){ +static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w){ for(; i<w; i++){ dst[i] = src[i] - (((-(ref[i] + ref[(i+1)])+W_BO) - 4 * src[i]) >> W_BS); } diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 7b385ca47f..cceeccfa5c 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -2140,7 +2140,7 @@ static void vc1_interp_mc(VC1Context *v) dsp->avg_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy); } -static always_inline int scale_mv(int value, int bfrac, int inv, int qs) +static av_always_inline int scale_mv(int value, int bfrac, int inv, int qs) { int n = bfrac; diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 9139ffb284..f19f266d1a 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -326,7 +326,7 @@ static void vc1_inv_trans_4x4_c(DCTELEM block[64], int n) /** Filter used to interpolate fractional pel values */ -static always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r) +static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride, int mode, int r) { switch(mode){ case 0: //no shift diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index 7b5f567e77..49210158ff 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -72,7 +72,7 @@ typedef struct VmncContext { } VmncContext; /* read pixel value from stream */ -static always_inline int vmnc_get_pixel(uint8_t* buf, int bpp, int be) { +static av_always_inline int vmnc_get_pixel(uint8_t* buf, int bpp, int be) { switch(bpp * 2 + be) { case 2: case 3: return *buf; @@ -172,7 +172,7 @@ static void put_cursor(uint8_t *dst, int stride, VmncContext *c, int dx, int dy) } /* fill rectangle with given colour */ -static always_inline void paint_rect(uint8_t *dst, int dx, int dy, int w, int h, int color, int bpp, int stride) +static av_always_inline void paint_rect(uint8_t *dst, int dx, int dy, int w, int h, int color, int bpp, int stride) { int i, j; dst += dx * bpp + dy * stride; @@ -202,7 +202,7 @@ static always_inline void paint_rect(uint8_t *dst, int dx, int dy, int w, int h, } } -static always_inline void paint_raw(uint8_t *dst, int w, int h, uint8_t* src, int bpp, int be, int stride) +static av_always_inline void paint_raw(uint8_t *dst, int w, int h, uint8_t* src, int bpp, int be, int stride) { int i, j, p; for(j = 0; j < h; j++) { diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c index a48515a5e5..bb9fed091f 100644 --- a/libavcodec/vp3dsp.c +++ b/libavcodec/vp3dsp.c @@ -39,7 +39,7 @@ #define M(a,b) (((a) * (b))>>16) -static always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type) +static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type) { int16_t *ip = input; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 5a54f7d0e2..18544831e8 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -98,7 +98,7 @@ static const uint8_t wp_exp2_table [256] = { 0xea, 0xec, 0xed, 0xee, 0xf0, 0xf1, 0xf2, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xff }; -static always_inline int wp_exp2(int16_t val) +static av_always_inline int wp_exp2(int16_t val) { int res, neg = 0; @@ -137,7 +137,7 @@ static inline int get_unary(GetBitContext *gb){ } -static always_inline int get_tail(GetBitContext *gb, int k) +static av_always_inline int get_tail(GetBitContext *gb, int k) { int p, e, res; diff --git a/libavutil/bswap.h b/libavutil/bswap.h index 4614c90458..03d613db2d 100644 --- a/libavutil/bswap.h +++ b/libavutil/bswap.h @@ -37,7 +37,7 @@ #endif #if defined(ARCH_X86) -static always_inline uint16_t bswap_16(uint16_t x) +static av_always_inline uint16_t bswap_16(uint16_t x) { __asm("rorw $8, %0" : LEGACY_REGS (x) : @@ -45,7 +45,7 @@ static always_inline uint16_t bswap_16(uint16_t x) return x; } -static always_inline uint32_t bswap_32(uint32_t x) +static av_always_inline uint32_t bswap_32(uint32_t x) { #if __CPU__ != 386 __asm("bswap %0": @@ -82,12 +82,12 @@ static inline uint64_t bswap_64(uint64_t x) #elif defined(ARCH_SH4) -static always_inline uint16_t bswap_16(uint16_t x) { +static av_always_inline uint16_t bswap_16(uint16_t x) { __asm__("swap.b %0,%0":"=r"(x):"0"(x)); return x; } -static always_inline uint32_t bswap_32(uint32_t x) { +static av_always_inline uint32_t bswap_32(uint32_t x) { __asm__( "swap.b %0,%0\n" "swap.w %0,%0\n" @@ -110,12 +110,12 @@ static inline uint64_t bswap_64(uint64_t x) } #else -static always_inline uint16_t bswap_16(uint16_t x){ +static av_always_inline uint16_t bswap_16(uint16_t x){ return (x>>8) | (x<<8); } #ifdef ARCH_ARM -static always_inline uint32_t bswap_32(uint32_t x){ +static av_always_inline uint32_t bswap_32(uint32_t x){ uint32_t t; __asm__ ( "eor %1, %0, %0, ror #16 \n\t" @@ -126,7 +126,7 @@ static always_inline uint32_t bswap_32(uint32_t x){ return x; } #else -static always_inline uint32_t bswap_32(uint32_t x){ +static av_always_inline uint32_t bswap_32(uint32_t x){ x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); return (x>>16) | (x<<16); } diff --git a/libavutil/common.h b/libavutil/common.h index d8baf12379..ca6147a802 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -43,6 +43,17 @@ # include "berrno.h" # endif # include <math.h> +#endif /* HAVE_AV_CONFIG_H */ + +#ifndef av_always_inline +#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +# define av_always_inline __attribute__((always_inline)) inline +#else +# define av_always_inline inline +#endif +#endif + +#ifdef HAVE_AV_CONFIG_H # include "internal.h" #endif /* HAVE_AV_CONFIG_H */ diff --git a/libavutil/internal.h b/libavutil/internal.h index 6e3e47af0b..d498f99de6 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -26,14 +26,6 @@ #ifndef INTERNAL_H #define INTERNAL_H -#ifndef always_inline -#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define always_inline __attribute__((always_inline)) inline -#else -# define always_inline inline -#endif -#endif - #ifndef attribute_used #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) # define attribute_used __attribute__((used)) @@ -309,7 +301,7 @@ if((y)<(x)){\ /* XXX: add ISOC specific test to avoid specific BSD testing. */ /* better than nothing implementation. */ /* btw, rintf() is existing on fbsd too -- alex */ -static always_inline long int lrintf(float x) +static av_always_inline long int lrintf(float x) { #ifdef __MINGW32__ # ifdef ARCH_X86_32 diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index c9f2893e3c..f68c8a7232 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -466,7 +466,7 @@ static inline void horizX1Filter(uint8_t *src, int stride, int QP) /** * accurate deblock filter */ -static always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, PPContext *c){ +static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, PPContext *c){ int y; const int QP= c->QP; const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1; diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index c22d5d1b6d..55602bbdf5 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -2645,7 +2645,7 @@ Switch between /** * accurate deblock filter */ -static always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int stride, PPContext *c){ +static av_always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int stride, PPContext *c){ int64_t dc_mask, eq_mask, both_masks; int64_t sums[10*8*2]; src+= step*3; // src points to begin of the 8x8 Block |