Revision 45a1b86a

View differences:

libavutil/common.h
123 123
}
124 124

  
125 125
/**
126
 * Clips a signed integer value into the -128,127 range.
127
 * @param a value to clip
128
 * @return clipped value
129
 */
130
static inline av_const int8_t av_clip_int8(int a)
131
{
132
    if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
133
    else                  return a;
134
}
135

  
136
/**
126 137
 * Clips a signed integer value into the 0-65535 range.
127 138
 * @param a value to clip
128 139
 * @return clipped value

Also available in: Unified diff