Revision ad640896 libavutil/common.h

View differences:

libavutil/common.h
118 118
 */
119 119
static inline av_const uint8_t av_clip_uint8(int a)
120 120
{
121
    if (a&(~255)) return (-a)>>31;
121
    if (a&(~0xFF)) return (-a)>>31;
122 122
    else          return a;
123 123
}
124 124

  
......
129 129
 */
130 130
static inline av_const uint16_t av_clip_uint16(int a)
131 131
{
132
    if (a&(~65535)) return (-a)>>31;
132
    if (a&(~0xFFFF)) return (-a)>>31;
133 133
    else            return a;
134 134
}
135 135

  
......
140 140
 */
141 141
static inline av_const int16_t av_clip_int16(int a)
142 142
{
143
    if ((a+32768) & ~65535) return (a>>31) ^ 32767;
143
    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
144 144
    else                    return a;
145 145
}
146 146

  

Also available in: Unified diff