# HG changeset patch # User rbultje # Date 1271872668 0 # Node ID 5dcfac995af3b0be9cad36ac49c090df09a59027 # Parent 0795a743bda1093e4e82c6edbfad4e711f448eff Move clipping of audio samples (for those codecs outputting float) from decoder to the audio conversion routines. diff -r 0795a743bda1 -r 5dcfac995af3 common.h --- a/common.h Tue Apr 20 14:45:34 2010 +0000 +++ b/common.h Wed Apr 21 17:57:48 2010 +0000 @@ -145,6 +145,17 @@ } /** + * Clips a signed 64-bit integer value into the -2147483648,2147483647 range. + * @param a value to clip + * @return clipped value + */ +static inline av_const int32_t av_clipl_int32(int64_t a) +{ + if ((a+2147483648) & ~2147483647) return (a>>63) ^ 2147483647; + else return a; +} + +/** * Clips a float value into the amin-amax range. * @param a value to clip * @param amin minimum value of the clip range