diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-09-18 14:06:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-18 14:43:43 +0200 |
commit | 9f9ebe631dc1162c89115c9cf408a348dd3e46aa (patch) | |
tree | 8792cbedd450173b0c009315a8faef345fa2b7f7 | |
parent | 074eef56ef4ad4af3cb4d5a1265efb00ec6d9858 (diff) | |
download | ffmpeg-9f9ebe631dc1162c89115c9cf408a348dd3e46aa.tar.gz |
libpostproc/postprocess: avoid some if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libpostproc/postprocess.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 01ec0f9867..3396f56eb7 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -209,13 +209,13 @@ static inline int isHorizDC_C(const uint8_t src[], int stride, const PPContext * const int dcThreshold= dcOffset*2 + 1; for(y=0; y<BLOCK_SIZE; y++){ - if(((unsigned)(src[0] - src[1] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[1] - src[2] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[2] - src[3] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[3] - src[4] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[4] - src[5] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[5] - src[6] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[6] - src[7] + dcOffset)) < dcThreshold) numEq++; + numEq += ((unsigned)(src[0] - src[1] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[1] - src[2] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[2] - src[3] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[3] - src[4] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[4] - src[5] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[5] - src[6] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[6] - src[7] + dcOffset)) < dcThreshold; src+= stride; } return numEq > c->ppMode.flatnessThreshold; @@ -233,14 +233,14 @@ static inline int isVertDC_C(const uint8_t src[], int stride, const PPContext *c src+= stride*4; // src points to begin of the 8x8 Block for(y=0; y<BLOCK_SIZE-1; y++){ - if(((unsigned)(src[0] - src[0+stride] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[1] - src[1+stride] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[2] - src[2+stride] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[3] - src[3+stride] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[4] - src[4+stride] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[5] - src[5+stride] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[6] - src[6+stride] + dcOffset)) < dcThreshold) numEq++; - if(((unsigned)(src[7] - src[7+stride] + dcOffset)) < dcThreshold) numEq++; + numEq += ((unsigned)(src[0] - src[0+stride] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[1] - src[1+stride] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[2] - src[2+stride] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[3] - src[3+stride] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[4] - src[4+stride] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[5] - src[5+stride] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[6] - src[6+stride] + dcOffset)) < dcThreshold; + numEq += ((unsigned)(src[7] - src[7+stride] + dcOffset)) < dcThreshold; src+= stride; } return numEq > c->ppMode.flatnessThreshold; |