av_gcd is now always defined regardless of input. This documents this
change in the "documented API". Two benefits (closely related):
1. The function is robust, and there is no need to worry about INT64_MIN, etc.
2. Clients of av_gcd, like av_reduce, can now be made fully correct. Currently,
av_reduce can trigger undefined behavior if e.g num is INT64_MIN due to
integer overflow in the FFABS. Furthermore, this undefined behavior is
completely undocumented, and could be a fuzzer's paradise. The FFABS was needed in the past as
av_gcd was undefined for negative inputs. In order to make av_reduce
robust, it is essential to guarantee that av_gcd works for all int64_t.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* qatar/master:
opt/eval: Include mathematics.h for NAN/INFINITY
mathematics: Don't use division by zero in NAN/INFINITY macros
wma: Lower the maximum number of channels to 2
x86: cpu: clean up check for cpuid instruction support
ARM: generate position independent code to access data symbols
Conflicts:
libavutil/opt.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Some compilers, MSVC among them, don't recognize the divisions by
zero as meaning infinity/nan.
These macros should, according to the standard, expand to constant
expressions, but this shouldn't matter for our usage.
Signed-off-by: Martin Storsjö <martin@martin.st>
This reverts commit a2b186a188.
The defines were present for several years, removing
them without a version bump may break API.
(Fixes MPlayer compilation.)
* qatar/master:
MS Screen 1 decoder
aacdec: Fix popping channel layouts.
av_gettime: support Win32 without gettimeofday()
Use av_gettime() in various places
Move av_gettime() to libavutil
dct-test: use emms_c() from libavutil instead of duplicating it
mov: fix operator precedence bug
mathematics.h: remove a couple of math defines
Remove unnecessary inclusions of [sys/]time.h
lavf: remove unnecessary inclusions of unistd.h
bfin: libswscale: add const where appropriate to fix warnings
bfin: libswscale: remove unnecessary #includes
udp: Properly check for invalid sockets
tcp: Check the return value from getsockopt
network: Use av_strerror for getting error messages
udp: Properly print error from getnameinfo
mmst: Use AVUNERROR() to convert error codes to the right range for strerror
network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows
rtmp: Reduce the number of idle posts sent by sleeping 50ms
Conflicts:
Changelog
configure
libavcodec/aacdec.c
libavcodec/allcodecs.c
libavcodec/avcodec.h
libavcodec/dct-test.c
libavcodec/version.h
libavformat/riff.c
libavformat/udp.c
libavutil/Makefile
libswscale/bfin/yuv2rgb_bfin.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
While these defines are not defined by the C standard they are
standardized as X/Open System Interfaces Extension. We use the
appropiate _XOPEN_SOURCE define to make them available. They
seem to be available on all FATE configs since the constants
are used in files where mathematics.h is not included.
* qatar/master: (36 commits)
adpcmenc: Use correct frame_size for Yamaha ADPCM.
avcodec: add ff_samples_to_time_base() convenience function to internal.h
adx parser: set duration
mlp parser: set duration instead of frame_size
gsm parser: set duration
mpegaudio parser: set duration instead of frame_size
(e)ac3 parser: set duration instead of frame_size
flac parser: set duration instead of frame_size
avcodec: add duration field to AVCodecParserContext
avutil: add av_rescale_q_rnd() to allow different rounding
pnmdec: remove useless .pix_fmts
libmp3lame: support float and s32 sample formats
libmp3lame: renaming, rearrangement, alignment, and comments
libmp3lame: use the LAME default bit rate
libmp3lame: use avpriv_mpegaudio_decode_header() for output frame parsing
libmp3lame: cosmetics: remove some pointless comments
libmp3lame: convert some debugging code to av_dlog()
libmp3lame: remove outdated comment.
libmp3lame: do not set coded_frame->key_frame.
libmp3lame: improve error handling in MP3lame_encode_init()
...
Conflicts:
doc/APIchanges
libavcodec/libmp3lame.c
libavcodec/pcxenc.c
libavcodec/pnmdec.c
libavcodec/pnmenc.c
libavcodec/sgienc.c
libavcodec/utils.c
libavformat/hls.c
libavutil/avutil.h
libswscale/x86/swscale_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master: (22 commits)
aacdec: Fix PS in ADTS.
avconv: Consistently use PIX_FMT_NONE.
dsputil: use cpuflags in x86 emu_edge_core
dsputil: use movups instead of movdqu in ff_emu_edge_core_sse()
wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
mov: Remove some redundant and obsolete comments.
Add libavutil/mathematics.h #includes for INFINITY
doxy: structure libavformat groups
doxy: introduce an empty structure in libavcodec
doxy: provide a start page and document libavutil
doxy: cleanup pixfmt.h
regtest: split video encode/decode tests into individual targets
ARM: add explicit .arch and .fpu directives to asm.S
pthread: do not touch has_b_frames
avconv: cleanup the transcoding loop in output_packet().
avconv: split subtitle transcoding out of output_packet().
avconv: split video transcoding out of output_packet().
avconv: split audio transcoding out of output_packet().
avconv: reindent.
avconv: move streamcopy-only code out of decoding loop.
...
Conflicts:
avconv.c
libavcodec/aaccoder.c
libavcodec/pthread.c
libavcodec/version.h
libavutil/audioconvert.h
libavutil/avutil.h
libavutil/mem.h
tests/ref/vsynth1/dv
tests/ref/vsynth1/mpeg2thread
tests/ref/vsynth2/dv
tests/ref/vsynth2/mpeg2thread
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This reduces the number of false dependencies on header files and
speeds up compilation.
Originally committed as revision 22407 to svn://svn.ffmpeg.org/ffmpeg/trunk
Consistently apply this rule: the guard name is obtained from the
filename by stripping the leading "lib", converting '/' and '.' to
'_' and uppercasing the resulting name. Guard names in the root
directory have to be prefixed by "FFMPEG_".
Originally committed as revision 15120 to svn://svn.ffmpeg.org/ffmpeg/trunk
Patch by Zuxy Meng: zuxy meng gmail com
Original thread:
[FFmpeg-devel] [PATCH] Pure, const and malloc attributes to libavutil
Date: 03/18/2008 6:09 AM
Originally committed as revision 12489 to svn://svn.ffmpeg.org/ffmpeg/trunk