From b8a78f419dd67cebc70f78e3d183c7eb4ed10c0e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 10 Nov 2002 11:46:59 +0000 Subject: [PATCH] reversing header game MIN/MAX -> FFMIN/FFMAX Originally committed as revision 1184 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffserver.c | 8 ++------ libav/http.c | 2 +- libav/rtp.c | 2 +- libav/rtpproto.c | 2 +- libav/rtsp.c | 2 +- libav/tcp.c | 2 +- libav/udp.c | 2 +- libavcodec/common.h | 9 ++------- libavcodec/error_resilience.c | 14 +++++++------- libavcodec/h263.c | 4 ++-- libavcodec/motion_est.c | 4 ++-- libavcodec/mpegvideo.c | 8 ++++---- libavcodec/msmpeg4.c | 2 +- libavcodec/ratecontrol.c | 4 ++-- 14 files changed, 28 insertions(+), 37 deletions(-) diff --git a/ffserver.c b/ffserver.c index 33508ec..aa8e72c 100644 --- a/ffserver.c +++ b/ffserver.c @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define HAVE_AV_CONFIG_H -#include #include "avformat.h" #include +#include #include #include #include @@ -31,11 +31,7 @@ #include #include #include -#ifndef __BEOS__ -# include -#else -# include "libav/barpainet.h" -#endif +#include #include #include #include diff --git a/libav/http.c b/libav/http.c index 64025f2..7271a6d 100644 --- a/libav/http.c +++ b/libav/http.c @@ -16,11 +16,11 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "avformat.h" #include #include #include +#include #include #ifndef __BEOS__ # include diff --git a/libav/rtp.c b/libav/rtp.c index b42065f..714787c 100644 --- a/libav/rtp.c +++ b/libav/rtp.c @@ -16,11 +16,11 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "avformat.h" #include #include +#include #include #ifndef __BEOS__ # include diff --git a/libav/rtpproto.c b/libav/rtpproto.c index 25b10b8..41823fc 100644 --- a/libav/rtpproto.c +++ b/libav/rtpproto.c @@ -16,12 +16,12 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "avformat.h" #include #include #include +#include #include #ifndef __BEOS__ # include diff --git a/libav/rtsp.c b/libav/rtsp.c index 667a3c0..81b59f8 100644 --- a/libav/rtsp.c +++ b/libav/rtsp.c @@ -16,10 +16,10 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "avformat.h" #include +#include #include #ifndef __BEOS__ # include diff --git a/libav/tcp.c b/libav/tcp.c index 6f4c037..61d8665 100644 --- a/libav/tcp.c +++ b/libav/tcp.c @@ -16,11 +16,11 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "avformat.h" #include #include #include +#include #include #ifndef __BEOS__ # include diff --git a/libav/udp.c b/libav/udp.c index 6e91a22..8df93a8 100644 --- a/libav/udp.c +++ b/libav/udp.c @@ -16,10 +16,10 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "avformat.h" #include #include +#include #include #ifndef __BEOS__ # include diff --git a/libavcodec/common.h b/libavcodec/common.h index 67e25c7..73e2d08 100644 --- a/libavcodec/common.h +++ b/libavcodec/common.h @@ -161,13 +161,8 @@ inline void dprintf(const char* fmt,...) {} #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) #define ABS(a) ((a) >= 0 ? (a) : (-(a))) -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef MIN -# define MIN(a,b) ((a) > (b) ? (b) : (a)) -#endif +#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) +#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) #ifdef ARCH_X86 // avoid +32 for shift optimization (gcc should do that ...) diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 84b7bb8..5023ff2 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -209,7 +209,7 @@ static void h_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri c= dst[offset + 9 + y*stride] - dst[offset + 8 + y*stride]; d= ABS(b) - ((ABS(a) + ABS(c) + 1)>>1); - d= MAX(d, 0); + d= FFMAX(d, 0); if(b<0) d= -d; if(d==0) continue; @@ -269,7 +269,7 @@ static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri c= dst[offset + x + 9*stride] - dst[offset + x + 8*stride]; d= ABS(b) - ((ABS(a) + ABS(c)+1)>>1); - d= MAX(d, 0); + d= FFMAX(d, 0); if(b<0) d= -d; if(d==0) continue; @@ -430,10 +430,10 @@ int score_sum=0; min_x=min_y=max_x=max_y=0; } for(j=0; j use temporal prediction - skip_amount= MAX(undamaged_count/50, 1); //check only upto 50 MBs + skip_amount= FFMAX(undamaged_count/50, 1); //check only upto 50 MBs is_intra_likely=0; j=0; diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 2c8b1ec..df6fe37 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -2204,7 +2204,7 @@ int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s){ case S_TYPE: return s->f_code+15; case B_TYPE: - return MAX(MAX(s->f_code, s->b_code)+15, 17); + return FFMAX(FFMAX(s->f_code, s->b_code)+15, 17); default: return -1; } @@ -3981,7 +3981,7 @@ static void mpeg4_decode_sprite_trajectory(MpegEncContext * s) s->sprite_shift[1]= alpha+rho+2; break; case 3: - min_ab= MIN(alpha, beta); + min_ab= FFMIN(alpha, beta); w3= w2>>min_ab; h3= h2>>min_ab; s->sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+beta+rho-min_ab)) diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index e94657d..81447b3 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -1600,8 +1600,8 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type) i= y*s->mb_width; for(x=0; xmb_width; x++){ if(s->mb_type[i] & type){ - int fcode= MAX(fcode_tab[mv_table[xy][0] + MAX_MV], - fcode_tab[mv_table[xy][1] + MAX_MV]); + int fcode= FFMAX(fcode_tab[mv_table[xy][0] + MAX_MV], + fcode_tab[mv_table[xy][1] + MAX_MV]); int j; for(j=0; jpb, 5, s->frame_rate / FRAME_RATE_BASE); //yes 29.97 -> 29 - put_bits(&s->pb, 11, MIN(s->bit_rate/1024, 2047)); + put_bits(&s->pb, 11, FFMIN(s->bit_rate/1024, 2047)); if(s->msmpeg4_version<3) s->flipflop_rounding=0; diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index 99e46db..870cd21 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -405,7 +405,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q, else if(d<0.0001) d=0.0001; q*= pow(d, 1.0/s->avctx->rc_buffer_aggressivity); - q= MIN(q, bits2qp(rce, MAX((min_rate - buffer_size + rcc->buffer_index)*2, 1))); + q= FFMIN(q, bits2qp(rce, FFMAX((min_rate - buffer_size + rcc->buffer_index)*2, 1))); } if(max_rate){ @@ -414,7 +414,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q, else if(d<0.0001) d=0.0001; q/= pow(d, 1.0/s->avctx->rc_buffer_aggressivity); - q= MAX(q, bits2qp(rce, MAX(rcc->buffer_index/2, 1))); + q= FFMAX(q, bits2qp(rce, FFMAX(rcc->buffer_index/2, 1))); } } //printf("q:%f max:%f min:%f size:%f index:%d bits:%f agr:%f\n", q,max_rate, min_rate, buffer_size, rcc->buffer_index, bits, s->avctx->rc_buffer_aggressivity); -- 2.7.4