diff options
author | Mans Rullgard <mans@mansr.com> | 2012-09-19 22:30:06 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-09-20 10:56:30 +0100 |
commit | a34a609fc1c21f6ab07ce0469e38c76a2ae077d1 (patch) | |
tree | 212a0c48ee7e6bf509cee2f0d4dac6f527daff71 /libavcodec/motion_est.c | |
parent | 50d1f4437be88a4b7e412e90d71153cae68017cc (diff) | |
download | ffmpeg-a34a609fc1c21f6ab07ce0469e38c76a2ae077d1.tar.gz |
motion_est: fix use of inline on extern functions
Inline functions declared without extern do not provide an external
definition in standard C99. This code only works because most
compilers do not implement the inline semantics correctly. With a
stricter compiler, linking fails with unresolved references to these
functions.
Declaring the functions extern inline works correctly with some
compilers while some others still fail to create external definitions.
For maximum portability, create a static inline version with an
externally visible wrapper for ff_get_mb_score. ff_epzs_motion_search
is so large that no sane compiler inlines it anyway, so there the
inline keyword can simply be dropped with no effect.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r-- | libavcodec/motion_est.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 4cf8a68df7..12e12571b1 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -1140,7 +1140,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16); if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip) - dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1); + dmin= get_mb_score(s, mx, my, 0, 0, 0, 16, 1); if((s->flags&CODEC_FLAG_4MV) && !c->skip && varc>50<<8 && vard>10<<8){ @@ -1312,7 +1312,7 @@ static int ff_estimate_motion_b(MpegEncContext * s, dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, ref_index, 0, 16); if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip) - dmin= ff_get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1); + dmin= get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1); //printf("%d %d %d %d//", s->mb_x, s->mb_y, mx, my); // s->mb_type[mb_y*s->mb_width + mb_x]= mb_type; @@ -1624,7 +1624,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) dmin = hpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16); if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip) - dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1); + dmin= get_mb_score(s, mx, my, 0, 0, 0, 16, 1); get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed |