diff options
author | Michael Niedermayer | 2015-05-31 01:40:12 +0200 |
---|---|---|
committer | Michael Niedermayer | 2015-05-31 01:40:12 +0200 |
commit | 6f51674c91cfcae0c0fdebf23d9cb9a3e294f09b (patch) | |
tree | 5c78c74ba8748eb0bc1d2709eabbd145c2df0d4a /libpostproc | |
parent | ebe919cce2f46eedeb54948a3e49fa33f68bfbb0 (diff) |
postproc: Avoid floats in maxClipped computation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libpostproc')
-rw-r--r-- | libpostproc/postprocess.c | 2 | ||||
-rw-r--r-- | libpostproc/postprocess_internal.h | 2 | ||||
-rw-r--r-- | libpostproc/postprocess_template.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index acce0f273b..92cc4367d0 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -681,7 +681,7 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality) ppMode->minAllowedY= 16; ppMode->baseDcDiff= 256/8; ppMode->flatnessThreshold= 56-16-1; - ppMode->maxClippedThreshold= 0.01; + ppMode->maxClippedThreshold= (AVRational){1,100}; ppMode->error=0; memset(temp, 0, GET_MODE_BUFFER_SIZE); diff --git a/libpostproc/postprocess_internal.h b/libpostproc/postprocess_internal.h index c1a306dd32..d128dfbe2f 100644 --- a/libpostproc/postprocess_internal.h +++ b/libpostproc/postprocess_internal.h @@ -99,7 +99,7 @@ typedef struct PPMode{ int minAllowedY; ///< for brightness correction int maxAllowedY; ///< for brightness correction - float maxClippedThreshold; ///< amount of "black" you are willing to lose to get a brightness-corrected picture + AVRational maxClippedThreshold; ///< amount of "black" you are willing to lose to get a brightness-corrected picture int maxTmpNoise[3]; ///< for Temporal Noise Reducing filter (Maximal sum of abs differences) diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index fc49e19337..c7ad3f0306 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -3383,7 +3383,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ } /* We always get a completely black picture first. */ - maxClipped= (uint64_t)(sum * c.ppMode.maxClippedThreshold); + maxClipped= av_rescale(sum, c.ppMode.maxClippedThreshold.num, c.ppMode.maxClippedThreshold.den); clipped= sum; for(black=255; black>0; black--){ |