postproc: Avoid floats in maxClipped computation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		@@ -681,7 +681,7 @@ pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality)
 | 
				
			|||||||
    ppMode->minAllowedY= 16;
 | 
					    ppMode->minAllowedY= 16;
 | 
				
			||||||
    ppMode->baseDcDiff= 256/8;
 | 
					    ppMode->baseDcDiff= 256/8;
 | 
				
			||||||
    ppMode->flatnessThreshold= 56-16-1;
 | 
					    ppMode->flatnessThreshold= 56-16-1;
 | 
				
			||||||
    ppMode->maxClippedThreshold= 0.01;
 | 
					    ppMode->maxClippedThreshold= (AVRational){1,100};
 | 
				
			||||||
    ppMode->error=0;
 | 
					    ppMode->error=0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    memset(temp, 0, GET_MODE_BUFFER_SIZE);
 | 
					    memset(temp, 0, GET_MODE_BUFFER_SIZE);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -99,7 +99,7 @@ typedef struct PPMode{
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    int minAllowedY;                ///< for brightness correction
 | 
					    int minAllowedY;                ///< for brightness correction
 | 
				
			||||||
    int maxAllowedY;                ///< 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)
 | 
					    int maxTmpNoise[3];             ///< for Temporal Noise Reducing filter (Maximal sum of abs differences)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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. */
 | 
					        /* 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;
 | 
					        clipped= sum;
 | 
				
			||||||
        for(black=255; black>0; black--){
 | 
					        for(black=255; black>0; black--){
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user