[FFmpeg-devel] [PATCH 2/7] Removed unecessary if/else branch when getting QP.

Tucker DiNapoli t.dinapoli42 at gmail.com
Fri Mar 27 21:51:43 CET 2015


From: Tucker DiNapoli <T.DiNapoli42 at gmail.com>

There's still an if, as QP needs to be modified if isColor=0, but it
still removes a unecessary branch.
---
 libpostproc/postprocess_template.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c
index 48501fe..6377ea7 100644
--- a/libpostproc/postprocess_template.c
+++ b/libpostproc/postprocess_template.c
@@ -3482,16 +3482,12 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
 
           for(x = startx; x < endx; x+=BLOCK_SIZE){
             const int stride= dstStride;
-
-            if(isColor){
-                QP= QPptr[x>>qpHShift];
-                c.nonBQP= nonBQPptr[x>>qpHShift];
-            }else{
-                QP= QPptr[x>>4];
+            QP = QPptr[x>>qpHShift];
+            c.nonBQP = nonBQPptr[x>>qpHShift];
+            if(!isColor){
                 QP= (QP* QPCorrecture + 256*128)>>16;
-                c.nonBQP= nonBQPptr[x>>4];
                 c.nonBQP= (c.nonBQP* QPCorrecture + 256*128)>>16;
-                yHistogram[ srcBlock[srcStride*12 + 4] ]++;
+                yHistogram[srcBlock[srcStride*12 + 4]]++;
             }
             c.QP= QP;
 #if TEMPLATE_PP_MMX
-- 
2.3.3



More information about the ffmpeg-devel mailing list