ffmpeg/libavutil
Ganesh Ajjanagadde 6f520ce1a6 avutil/common: add av_rint64_clip
The rationale for this function is reflected in the documentation for
it, and is copied here:

Clip a double value into the long long amin-amax range.
This function is needed because conversion of floating point to integers when
it does not fit in the integer's representation does not necessarily saturate
correctly (usually converted to a cvttsd2si on x86) which saturates numbers
> INT64_MAX to INT64_MIN. The standard marks such conversions as undefined
behavior, allowing this sort of mathematically bogus conversions. This provides
a safe alternative that is slower obviously but assures safety and better
mathematical behavior.
API:
@param a value to clip
@param amin minimum value of the clip range
@param amax maximum value of the clip range
@return clipped value

Note that a priori if one can guarantee from the calling side that the
double is in range, it is safe to simply do an explicit/implicit cast,
and that will be far faster. However, otherwise this function should be
used.

avutil minor version is bumped.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-13 21:48:16 -05:00
..
aarch64
arm
avr32
bfin
mips
ppc
sh4
tomi
x86
Makefile
adler32.c
adler32.h
aes.c
aes.h
aes_internal.h
atomic.c
atomic.h
atomic_gcc.h
atomic_suncc.h
atomic_win32.h
attributes.h
audio_fifo.c
audio_fifo.h
avassert.h
avstring.c
avstring.h
avutil.h
avutilres.rc
base64.c
base64.h
blowfish.c
blowfish.h
bprint.c
bprint.h
bswap.h
buffer.c
buffer.h
buffer_internal.h
camellia.c
camellia.h
cast5.c
cast5.h
channel_layout.c
channel_layout.h
color_utils.c
color_utils.h
colorspace.h
common.h
cpu.c
cpu.h
cpu_internal.h
crc.c
crc.h
des.c
des.h
dict.c
dict.h
display.c
display.h
downmix_info.c
downmix_info.h
dynarray.h
error.c
error.h
eval.c
eval.h
fifo.c
fifo.h
file.c
file.h
file_open.c
fixed_dsp.c
fixed_dsp.h
float_dsp.c
float_dsp.h
frame.c
frame.h
hash.c
hash.h
hmac.c
hmac.h
imgutils.c
imgutils.h
integer.c
integer.h
internal.h avutil/internal: add av_warn_unused_result to avpriv_open 2015-10-16 17:18:21 -04:00
intfloat.h
intmath.c
intmath.h
intreadwrite.h
lfg.c
lfg.h
libavutil.v
libm.h
lls.c
lls.h
log.c
log.h
log2_tab.c
lzo.c
lzo.h
macros.h
mathematics.c
mathematics.h
md5.c
md5.h
mem.c
mem.h
mem_internal.h
motion_vector.h
murmur3.c
murmur3.h
opencl.c
opencl.h
opencl_internal.c
opencl_internal.h
opt.c
opt.h
parseutils.c
parseutils.h
pca.c
pca.h
pixdesc.c
pixdesc.h
pixelutils.c
pixelutils.h
pixfmt.h
qsort.h
random_seed.c
random_seed.h
rational.c
rational.h
rc4.c
rc4.h
replaygain.h
reverse.c
ripemd.c
ripemd.h
samplefmt.c
samplefmt.h
sha.c
sha.h
sha512.c
sha512.h
softfloat.c
softfloat.h
softfloat_tables.h
stereo3d.c
stereo3d.h
tea.c
tea.h
thread.h
threadmessage.c
threadmessage.h
time.c
time.h
time_internal.h
timecode.c
timecode.h
timer.h
timestamp.h
tree.c
tree.h
twofish.c
twofish.h
utf8.c
utils.c
version.h
wchar_filename.h
x86_cpu.h
xga_font_data.c
xga_font_data.h
xtea.c
xtea.h