[Ffmpeg-devel] Re: Where do I report bugs?

Matti Hamalainen mhamalai
Sat Jan 14 07:25:40 CET 2006


On Fri, 13 Jan 2006, David Abrahams wrote:

> Diego Biurrun <diego at biurrun.de> writes:
> > On Fri, Jan 13, 2006 at 02:43:49PM -0500, David Abrahams wrote:
> >> It's still a problem.
> >
> > Send a patch.
> 
> Sorry; I mean this only with the greatest respect, but this is someone
> else's bug, I don't have time to fix it, fixing it is mechanical
> (doesn't require any special research -- just replace always_inline
> with FFMPEG_ALWAYS_INLINE everywhere except in the right-hand-side of
> any resulting #define FFMPEG_ALWAYS_INLINE) and I currently have a
> workaround I can live with.  I cared enough to report the bug, but if
> nobody is ready to fix it today I am confident that you will get
> plenty of complaints from other people in the future, so I guess I'll
> leave it at that.
> 
> Thanks for your time.

I am still amazed by people who apparently have time to have often lengthy 
e-mail discussions, but can't spare a moment to fix something that is 
apparently so simple that you can call it "mechanical".

In any case, attached is my suggestion for a patch to fix this. It
replaces always_inline with FFMPEG_ALWAYS_INLINE in the code and
defines CONFIG_SMALL in config.h if --enable-small is given to configure.
CONFIG_SMALL is used instead of #ifndef always_inline to determine
what FFMPEG_ALWAYS_INLINE will be #defined to in libavutil/common.h

-- 
] ccr/TNSP^DKD^pWp :: ccr(at)tnsp(dot)org :: http://ccr.tnsp.org/
] Fingerprint: 0466 95ED 96DF 3701 C71D   D62D 10A6 28A6 1374 C112
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/configure,v
retrieving revision 1.231
diff -u -r1.231 configure
--- configure	14 Jan 2006 03:39:01 -0000	1.231
+++ configure	14 Jan 2006 05:53:40 -0000
@@ -1753,7 +1753,7 @@
 echo "#define restrict $_restrict" >> $TMPH
 
 if test "$optimize" = "small"; then
-  echo "#define always_inline"  >> $TMPH
+  echo "#define CONFIG_SMALL 1"  >> $TMPH
 fi
 
 # build tree in object directory if source path is different from current one
Index: libavcodec/bitstream.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/bitstream.h,v
retrieving revision 1.159
diff -u -r1.159 bitstream.h
--- libavcodec/bitstream.h	8 Jan 2006 21:19:39 -0000	1.159
+++ libavcodec/bitstream.h	14 Jan 2006 05:53:40 -0000
@@ -799,7 +799,7 @@
  *                  read the longest vlc code
  *                  = (max_vlc_length + bits - 1) / bits
  */
-static always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
+static FFMPEG_ALWAYS_INLINE int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
                                   int bits, int max_depth)
 {
     int code;
Index: libavcodec/dv.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/dv.c,v
retrieving revision 1.70
diff -u -r1.70 dv.c
--- libavcodec/dv.c	12 Jan 2006 22:43:15 -0000	1.70
+++ libavcodec/dv.c	14 Jan 2006 05:53:41 -0000
@@ -537,7 +537,7 @@
 
 #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 FFMPEG_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) {
@@ -562,7 +562,7 @@
     return size;
 }
 
-static always_inline int dv_rl2vlc_size(int run, int level)
+static FFMPEG_ALWAYS_INLINE int dv_rl2vlc_size(int run, int level)
 {
     int size;
 
@@ -578,13 +578,13 @@
     return size;
 }
 #else
-static always_inline int dv_rl2vlc(int run, int l, int sign, uint32_t* vlc)
+static FFMPEG_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 FFMPEG_ALWAYS_INLINE int dv_rl2vlc_size(int run, int l)
 {
     return dv_vlc_map[run][l].size;
 }
@@ -604,7 +604,7 @@
     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 FFMPEG_ALWAYS_INLINE PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool,
                                        PutBitContext* pb_end)
 {
     int prev;
@@ -647,7 +647,7 @@
     return pb;
 }
 
-static always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
+static FFMPEG_ALWAYS_INLINE void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
                                               const uint8_t* zigzag_scan, int bias)
 {
     int i, area;
@@ -701,7 +701,7 @@
 
 //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 FFMPEG_ALWAYS_INLINE int dv_guess_dct_mode(DCTELEM *blk) {
     DCTELEM *s;
     int score88 = 0;
     int score248 = 0;
Index: libavcodec/faandct.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/faandct.c,v
retrieving revision 1.11
diff -u -r1.11 faandct.c
--- libavcodec/faandct.c	12 Jan 2006 22:43:15 -0000	1.11
+++ libavcodec/faandct.c	14 Jan 2006 05:53:41 -0000
@@ -68,7 +68,7 @@
 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 FFMPEG_ALWAYS_INLINE void row_fdct(FLOAT temp[64], DCTELEM * data)
 {
     FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
     FLOAT tmp10, tmp11, tmp12, tmp13;
Index: libavcodec/ffv1.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/ffv1.c,v
retrieving revision 1.35
diff -u -r1.35 ffv1.c
--- libavcodec/ffv1.c	12 Jan 2006 22:43:15 -0000	1.35
+++ libavcodec/ffv1.c	14 Jan 2006 05:53:42 -0000
@@ -184,7 +184,7 @@
     DSPContext dsp;
 }FFV1Context;
 
-static always_inline int fold(int diff, int bits){
+static FFMPEG_ALWAYS_INLINE int fold(int diff, int bits){
     if(bits==8)
         diff= (int8_t)diff;
     else{
Index: libavcodec/h264.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264.c,v
retrieving revision 1.179
diff -u -r1.179 h264.c
--- libavcodec/h264.c	12 Jan 2006 22:43:15 -0000	1.179
+++ libavcodec/h264.c	14 Jan 2006 05:53:47 -0000
@@ -377,7 +377,7 @@
 static void svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc);
 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 always_inline uint32_t pack16to32(int a, int b){
+static FFMPEG_ALWAYS_INLINE uint32_t pack16to32(int a, int b){
 #ifdef WORDS_BIGENDIAN
    return (b&0xFFFF) + (a<<16);
 #else
@@ -391,7 +391,7 @@
  * @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 FFMPEG_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);
 
Index: libavcodec/h264idct.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264idct.c,v
retrieving revision 1.4
diff -u -r1.4 h264idct.c
--- libavcodec/h264idct.c	12 Jan 2006 22:43:15 -0000	1.4
+++ libavcodec/h264idct.c	14 Jan 2006 05:53:47 -0000
@@ -26,7 +26,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 FFMPEG_ALWAYS_INLINE void idct_internal(uint8_t *dst, DCTELEM *block, int stride, int block_stride, int shift, int add){
     int i;
     uint8_t *cm = cropTbl + MAX_NEG_CROP;
 
Index: libavcodec/jfdctfst.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/jfdctfst.c,v
retrieving revision 1.9
diff -u -r1.9 jfdctfst.c
--- libavcodec/jfdctfst.c	22 Dec 2005 01:10:08 -0000	1.9
+++ libavcodec/jfdctfst.c	14 Jan 2006 05:53:47 -0000
@@ -112,7 +112,7 @@
 
 #define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
 
-static always_inline void row_fdct(DCTELEM * data){
+static FFMPEG_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;
Index: libavcodec/jfdctint.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/jfdctint.c,v
retrieving revision 1.8
diff -u -r1.8 jfdctint.c
--- libavcodec/jfdctint.c	22 Dec 2005 01:10:08 -0000	1.8
+++ libavcodec/jfdctint.c	14 Jan 2006 05:53:48 -0000
@@ -148,7 +148,7 @@
 #endif
 
 
-static always_inline void row_fdct(DCTELEM * data){
+static FFMPEG_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;
Index: libavcodec/motion_est.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est.c,v
retrieving revision 1.119
diff -u -r1.119 motion_est.c
--- libavcodec/motion_est.c	12 Jan 2006 22:43:15 -0000	1.119
+++ libavcodec/motion_est.c	14 Jan 2006 05:53:49 -0000
@@ -101,7 +101,7 @@
            + (chroma ? FLAG_CHROMA : 0);
 }
 
-static always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
+static FFMPEG_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;
Index: libavcodec/motion_est_template.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est_template.c,v
retrieving revision 1.29
diff -u -r1.29 motion_est_template.c
--- libavcodec/motion_est_template.c	12 Jan 2006 22:43:15 -0000	1.29
+++ libavcodec/motion_est_template.c	14 Jan 2006 05:53:50 -0000
@@ -553,7 +553,7 @@
     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 FFMPEG_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)
 {
@@ -843,7 +843,7 @@
     return dmin;
 }
 
-static always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
+static FFMPEG_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;
@@ -857,7 +857,7 @@
         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 FFMPEG_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)
 {
Index: libavcodec/mpegaudiodec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegaudiodec.c,v
retrieving revision 1.66
diff -u -r1.66 mpegaudiodec.c
--- libavcodec/mpegaudiodec.c	12 Jan 2006 22:43:16 -0000	1.66
+++ libavcodec/mpegaudiodec.c	14 Jan 2006 05:53:51 -0000
@@ -52,7 +52,7 @@
 
 #define FIXHR(a) ((int)((a) * (1LL<<32) + 0.5))
 //#define MULH(a,b) (((int64_t)(a) * (int64_t)(b))>>32) //gcc 3.4 creates an incredibly bloated mess out of this
-static always_inline int MULH(int a, int b){
+static FFMPEG_ALWAYS_INLINE int MULH(int a, int b){
     return ((int64_t)(a) * (int64_t)(b))>>32;
 }
 
Index: libavcodec/mpegvideo.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.c,v
retrieving revision 1.503
diff -u -r1.503 mpegvideo.c
--- libavcodec/mpegvideo.c	12 Jan 2006 22:43:16 -0000	1.503
+++ libavcodec/mpegvideo.c	14 Jan 2006 05:53:56 -0000
@@ -2823,7 +2823,7 @@
 }
 
 /* apply one mpeg motion vector to the three components */
-static always_inline void mpeg_motion(MpegEncContext *s,
+static FFMPEG_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],
@@ -2940,7 +2940,7 @@
 }
 
 /* apply one mpeg motion vector to the three components */
-static always_inline void mpeg_motion_lowres(MpegEncContext *s,
+static FFMPEG_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,
@@ -3758,7 +3758,7 @@
    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 FFMPEG_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;
Index: libavcodec/pthread.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/pthread.c,v
retrieving revision 1.8
diff -u -r1.8 pthread.c
--- libavcodec/pthread.c	12 Jan 2006 22:43:16 -0000	1.8
+++ libavcodec/pthread.c	14 Jan 2006 05:53:56 -0000
@@ -74,7 +74,7 @@
     }
 }
 
-static always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count)
+static FFMPEG_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);
Index: libavcodec/snow.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/snow.c,v
retrieving revision 1.81
diff -u -r1.81 snow.c
--- libavcodec/snow.c	12 Jan 2006 22:43:16 -0000	1.81
+++ libavcodec/snow.c	14 Jan 2006 05:54:00 -0000
@@ -719,7 +719,7 @@
     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 FFMPEG_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);
@@ -741,7 +741,7 @@
     }
 }
 
-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 FFMPEG_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);
@@ -771,7 +771,7 @@
     }
 }
 
-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 FFMPEG_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);
@@ -2244,7 +2244,7 @@
     }
 }
 
-static always_inline int same_block(BlockNode *a, BlockNode *b){
+static FFMPEG_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{
@@ -2546,7 +2546,7 @@
 }
 
 //FIXME name clenup (b_w, block_w, b_width stuff)
-static always_inline void add_yblock_buffered(SnowContext *s, slice_buffer * sb, DWTELEM *old_dst, uint8_t *dst8, uint8_t *src, 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 plane_index){
+static FFMPEG_ALWAYS_INLINE void add_yblock_buffered(SnowContext *s, slice_buffer * sb, DWTELEM *old_dst, uint8_t *dst8, uint8_t *src, 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 plane_index){
     DWTELEM * dst = NULL;
     const int b_width = s->b_width  << s->block_max_depth;
     const int b_height= s->b_height << s->block_max_depth;
@@ -2705,7 +2705,7 @@
 }
 
 //FIXME name clenup (b_w, block_w, b_width stuff)
-static always_inline void add_yblock(SnowContext *s, DWTELEM *dst, uint8_t *dst8, uint8_t *src, 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 FFMPEG_ALWAYS_INLINE void add_yblock(SnowContext *s, DWTELEM *dst, uint8_t *dst8, uint8_t *src, 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;
@@ -2858,7 +2858,7 @@
 #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 FFMPEG_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;
@@ -2926,7 +2926,7 @@
     STOP_TIMER("predict_slice")
 }
 
-static always_inline void predict_slice(SnowContext *s, DWTELEM *buf, int plane_index, int add, int mb_y){
+static FFMPEG_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;
@@ -2984,7 +2984,7 @@
     STOP_TIMER("predict_slice")
 }
 
-static always_inline void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index, int add){
+static FFMPEG_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++)
@@ -3146,7 +3146,7 @@
     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 FFMPEG_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;
@@ -3185,7 +3185,7 @@
 }
 
 /* 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, int intra, const uint8_t *obmc_edged, int *best_rd){
+static FFMPEG_ALWAYS_INLINE int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int intra, const uint8_t *obmc_edged, int *best_rd){
     int p[2] = {p0, p1};
     return check_block(s, mb_x, mb_y, p, intra, obmc_edged, best_rd);
 }
Index: libavcodec/vp3dsp.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/vp3dsp.c,v
retrieving revision 1.9
diff -u -r1.9 vp3dsp.c
--- libavcodec/vp3dsp.c	12 Jan 2006 22:43:17 -0000	1.9
+++ libavcodec/vp3dsp.c	14 Jan 2006 05:54:00 -0000
@@ -35,7 +35,7 @@
 #define xC6S2 25080
 #define xC7S1 12785
 
-static always_inline void idct(uint8_t *dst, int stride, int16_t *input, int type)
+static FFMPEG_ALWAYS_INLINE void idct(uint8_t *dst, int stride, int16_t *input, int type)
 {
     int16_t *ip = input;
     uint8_t *cm = cropTbl + MAX_NEG_CROP;
Index: libavcodec/i386/fdct_mmx.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/fdct_mmx.c,v
retrieving revision 1.19
diff -u -r1.19 fdct_mmx.c
--- libavcodec/i386/fdct_mmx.c	22 Dec 2005 01:10:09 -0000	1.19
+++ libavcodec/i386/fdct_mmx.c	14 Jan 2006 05:54:00 -0000
@@ -268,7 +268,7 @@
 }};
 
 
-static always_inline void fdct_col(const int16_t *in, int16_t *out, int offset)
+static FFMPEG_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);
@@ -348,7 +348,7 @@
 }
 
 
-static always_inline void fdct_row_sse2(const int16_t *in, int16_t *out)
+static FFMPEG_ALWAYS_INLINE void fdct_row_sse2(const int16_t *in, int16_t *out)
 {
     asm volatile(
         ".macro FDCT_ROW_SSE2_H1 i t    \n\t"
@@ -410,7 +410,7 @@
     );
 }
 
-static always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table)
+static FFMPEG_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);
@@ -453,7 +453,7 @@
     movq_r2m(mm7, *(out + 4));
 }
 
-static always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table)
+static FFMPEG_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);
Index: libavcodec/libpostproc/postprocess.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/libpostproc/postprocess.c,v
retrieving revision 1.113
diff -u -r1.113 postprocess.c
--- libavcodec/libpostproc/postprocess.c	12 Jan 2006 22:43:19 -0000	1.113
+++ libavcodec/libpostproc/postprocess.c	14 Jan 2006 05:54:01 -0000
@@ -113,10 +113,10 @@
 
 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
 #    define attribute_used __attribute__((used))
-#    define always_inline __attribute__((always_inline)) inline
+#    define FFMPEG_ALWAYS_INLINE __attribute__((FFMPEG_ALWAYS_INLINE)) inline
 #else
 #    define attribute_used
-#    define always_inline inline
+#    define FFMPEG_ALWAYS_INLINE inline
 #endif
 
 #if defined(ARCH_X86) || defined(ARCH_X86_64)
@@ -482,7 +482,7 @@
 /**
  * accurate deblock filter
  */
-static always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, PPContext *c){
+static FFMPEG_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;
Index: libavcodec/libpostproc/postprocess_template.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/libpostproc/postprocess_template.c,v
retrieving revision 1.100
diff -u -r1.100 postprocess_template.c
--- libavcodec/libpostproc/postprocess_template.c	12 Jan 2006 22:43:19 -0000	1.100
+++ libavcodec/libpostproc/postprocess_template.c	14 Jan 2006 05:54:04 -0000
@@ -2645,7 +2645,7 @@
 /**
  * accurate deblock filter
  */
-static always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int stride, PPContext *c){
+static FFMPEG_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
Index: libavutil/bswap.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavutil/bswap.h,v
retrieving revision 1.12
diff -u -r1.12 bswap.h
--- libavutil/bswap.h	22 Dec 2005 01:10:11 -0000	1.12
+++ libavutil/bswap.h	14 Jan 2006 05:54:04 -0000
@@ -17,7 +17,7 @@
 #endif
 
 #if defined(ARCH_X86) || defined(ARCH_X86_64)
-static always_inline uint16_t bswap_16(uint16_t x)
+static FFMPEG_ALWAYS_INLINE uint16_t bswap_16(uint16_t x)
 {
   __asm("rorw $8, %0"   :
         LEGACY_REGS (x) :
@@ -25,7 +25,7 @@
     return x;
 }
 
-static always_inline uint32_t bswap_32(uint32_t x)
+static FFMPEG_ALWAYS_INLINE uint32_t bswap_32(uint32_t x)
 {
 #if __CPU__ > 386
  __asm("bswap   %0":
@@ -62,12 +62,12 @@
 
 #elif defined(ARCH_SH4)
 
-static always_inline uint16_t bswap_16(uint16_t x) {
+static FFMPEG_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 FFMPEG_ALWAYS_INLINE uint32_t bswap_32(uint32_t x) {
         __asm__(
         "swap.b %0,%0\n"
         "swap.w %0,%0\n"
@@ -90,12 +90,12 @@
 }
 #else
 
-static always_inline uint16_t bswap_16(uint16_t x){
+static FFMPEG_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 FFMPEG_ALWAYS_INLINE uint32_t bswap_32(uint32_t x){
     uint32_t t;
     __asm__ (
       "eor %1, %0, %0, ror #16 \n\t"
@@ -106,7 +106,7 @@
     return x;
 }
 #else
-static always_inline uint32_t bswap_32(uint32_t x){
+static FFMPEG_ALWAYS_INLINE uint32_t bswap_32(uint32_t x){
     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
     return (x>>16) | (x<<16);
 }
Index: libavutil/common.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavutil/common.h,v
retrieving revision 1.159
diff -u -r1.159 common.h
--- libavutil/common.h	22 Dec 2005 01:10:11 -0000	1.159
+++ libavutil/common.h	14 Jan 2006 05:54:05 -0000
@@ -65,12 +65,14 @@
 #    define restrict
 #endif
 
-#ifndef always_inline
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
-#    define always_inline __attribute__((always_inline)) inline
+#ifndef CONFIG_SMALL
+#    if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#        define FFMPEG_ALWAYS_INLINE __attribute__((always_inline)) inline
+#    else
+#        define FFMPEG_ALWAYS_INLINE inline
+#    endif
 #else
-#    define always_inline inline
-#endif
+#    define FFMPEG_ALWAYS_INLINE
 #endif
 
 #ifndef attribute_used
@@ -575,7 +577,7 @@
 /* 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 FFMPEG_ALWAYS_INLINE long int lrintf(float x)
 {
 #ifdef CONFIG_WIN32
 #  ifdef ARCH_X86



More information about the ffmpeg-devel mailing list