changeset 6655:22cca5d3173a libavcodec

Implement FFMAX3(a,b,c) - maximum over three arguments.
author voroshil
date Sat, 19 Apr 2008 17:07:58 +0000
parents 603c780be9ff
children b1049dd41dd4
files h263.c h264.c mjpegbdec.c mjpegdec.c mpegvideo_enc.c
diffstat 5 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Sat Apr 19 13:03:12 2008 +0000
+++ b/h263.c	Sat Apr 19 17:07:58 2008 +0000
@@ -3100,7 +3100,7 @@
         case FF_S_TYPE:
             return s->f_code+15;
         case FF_B_TYPE:
-            return FFMAX(FFMAX(s->f_code, s->b_code)+15, 17);
+            return FFMAX3(s->f_code, s->b_code, 2) + 15;
         default:
             return -1;
     }
--- a/h264.c	Sat Apr 19 13:03:12 2008 +0000
+++ b/h264.c	Sat Apr 19 17:07:58 2008 +0000
@@ -6502,7 +6502,7 @@
     //for sufficiently low qp, filtering wouldn't do anything
     //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp
     if(!FRAME_MBAFF){
-        int qp_thresh = 15 - h->slice_alpha_c0_offset - FFMAX(0, FFMAX(h->pps.chroma_qp_index_offset[0], h->pps.chroma_qp_index_offset[1]));
+        int qp_thresh = 15 - h->slice_alpha_c0_offset - FFMAX3(0, h->pps.chroma_qp_index_offset[0], h->pps.chroma_qp_index_offset[1]);
         int qp = s->current_picture.qscale_table[mb_xy];
         if(qp <= qp_thresh
            && (mb_x == 0 || ((qp + s->current_picture.qscale_table[mb_xy-1] + 1)>>1) <= qp_thresh)
--- a/mjpegbdec.c	Sat Apr 19 13:03:12 2008 +0000
+++ b/mjpegbdec.c	Sat Apr 19 17:07:58 2008 +0000
@@ -123,7 +123,7 @@
     *data_size = sizeof(AVFrame);
 
     if(!s->lossless){
-        picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
+        picture->quality= FFMAX3(s->qscale[0], s->qscale[1], s->qscale[2]);
         picture->qstride= 0;
         picture->qscale_table= s->qscale_table;
         memset(picture->qscale_table, picture->quality, (s->width+15)/16);
--- a/mjpegdec.c	Sat Apr 19 13:03:12 2008 +0000
+++ b/mjpegdec.c	Sat Apr 19 17:07:58 2008 +0000
@@ -1284,7 +1284,7 @@
                         *data_size = sizeof(AVFrame);
 
                         if(!s->lossless){
-                            picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
+                            picture->quality= FFMAX3(s->qscale[0], s->qscale[1], s->qscale[2]);
                             picture->qstride= 0;
                             picture->qscale_table= s->qscale_table;
                             memset(picture->qscale_table, picture->quality, (s->width+15)/16);
--- a/mpegvideo_enc.c	Sat Apr 19 13:03:12 2008 +0000
+++ b/mpegvideo_enc.c	Sat Apr 19 17:07:58 2008 +0000
@@ -2814,7 +2814,7 @@
                 int a,b;
                 a= ff_get_best_fcode(s, s->p_field_mv_table[0][0], CANDIDATE_MB_TYPE_INTER_I); //FIXME field_select
                 b= ff_get_best_fcode(s, s->p_field_mv_table[1][1], CANDIDATE_MB_TYPE_INTER_I);
-                s->f_code= FFMAX(s->f_code, FFMAX(a,b));
+                s->f_code= FFMAX3(s->f_code, a, b);
             }
 
             ff_fix_long_p_mvs(s);