comparison liba52.c @ 5523:c2ab2ac31edb libavcodec

use av_clip_int16() where it makes sense
author aurel
date Sat, 11 Aug 2007 22:48:55 +0000
parents 4323e587708d
children bc4791868c52
comparison
equal deleted inserted replaced
5522:acaaff7b6fb8 5523:c2ab2ac31edb
121 } 121 }
122 122
123 /**** the following two functions comes from a52dec */ 123 /**** the following two functions comes from a52dec */
124 static inline int blah (int32_t i) 124 static inline int blah (int32_t i)
125 { 125 {
126 if (i > 0x43c07fff) 126 return av_clip_int16(i - 0x43c00000);
127 return 32767;
128 else if (i < 0x43bf8000)
129 return -32768;
130 return i - 0x43c00000;
131 } 127 }
132 128
133 static inline void float_to_int (float * _f, int16_t * s16, int nchannels) 129 static inline void float_to_int (float * _f, int16_t * s16, int nchannels)
134 { 130 {
135 int i, j, c; 131 int i, j, c;