libavutil: drop fallback definitions of INTxx_MIN/MAX

This list is incomplete (we also use UINT16_MAX), so there does
not appear to be any system we care about that needs these.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavutil: drop offsetof() fallback definition

The only compiler I have that does not define the standard
offsetof() macro is "Bruce's C Compiler", a simple compiler
for producing 8/16-bit 8086 code, usually for use in early
stages of PC booting.

Signed-off-by: Mans Rullgard <mans@mansr.com>
ffmenc: replace if/abort with assert()

The condition is trivially true, but keeping the assert() is
sensible to avoid FFM_HEADER_SIZE ever getting out of sync with
the actual code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavutil: remove unused av_abort() macro

Signed-off-by: Mans Rullgard <mans@mansr.com>
rtmp: Factorize the code by adding handle_invoke_result

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
rtmp: Factorize the code by adding handle_invoke_status

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
rtmp: Factorize the code by adding handle_invoke_error

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
ARM: add missing "cc" clobber in av_clipl_int32_arm()

Signed-off-by: Mans Rullgard <mans@mansr.com>
g723.1: remove unused #includes

Signed-off-by: Mans Rullgard <mans@mansr.com>
g723.1: deobfuscate an expression

(x << 2) - x is just an optimisation of 3 * x the compiler is
perfectly capable of doing on its own.

Signed-off-by: Mans Rullgard <mans@mansr.com>
g723.1: simplify and fix multiplication overflow

In 16-bit arithmetic, x * 0xffffc is simply x * -4 with extra overflows,
(and the constant was probably meant to be 0xfffc).  Combined with the
shift, this simplifies to -x >> 1.  Finally, clearing the low two bits
with a 32-bit mask and switching to a 32-bit type allows more efficient
code on 32-bit machines.

Signed-off-by: Mans Rullgard <mans@mansr.com>
g723.1: fix addition overflow

This addition must be done as 64-bit to avoid overflow and for
the subsequent clipping to be meaningful.

Signed-off-by: Mans Rullgard <mans@mansr.com>
dict: add av_dict_count()

This adds a function to retrieve the number of entries in a
dictionary and updates the places directly accessing what should
be an opaque struct to use this new function instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
dict: move struct AVDictionary definition to dict.c

This makes struct AVDictionary fully opaque now that nothing
needs to access it directly any more.

Signed-off-by: Mans Rullgard <mans@mansr.com>
lavc: fix mixing CODEC_ID/AV_CODEC_ID in C++ code.

C++ does not allow to mix different enums, so e.g. code comparing
ACodecID with CodecID would fail to compile with gcc.

This very evil hack should fix this problem.
lavc: add codec descriptors.

They describe properties that are inherent to a codec (as described by
an AVCodecID) without referring to a specific implementation.
lavc: add an intra-only codec property.
lavf: simplify is_intra_only() by using codec descriptors.
rtmp: Factorize the code by adding find_tracked_method

Also fix the bytestream reader size parameter to take the
offset into account.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtmp: split chunk_size var into in_chunk_size and out_chunk_size

Signed-off-by: Martin Storsjö <martin@martin.st>