mem: Add av_realloc_array and av_reallocp_array

These help avoiding overflows and simplify error handling.

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Keep track of the allocated size for the cluster array

When writing fragmented mp4, the cluster array is reset when a
fragment is written. Instead of starting off reallocating the
array only based on the number of current elements in it, keep
track of how many elements there were allocated earlier.

This avoids reallocating this array needlessly when writing
fragmented mp4 files.

Bug-Id: 525
Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Increase the cluster array allocation by doubling

The previous allocation increment of 16384 meant that the cluster
array was allocated for 0.6 MB initially, which is a bit excessive
for cases with fragmentation where only a fraction of that ever
actually is used.

Therefore, start off at a much smaller value, and increase by
doubling (to avoid reallocating too often when writing long
non-fragmented mp4 files).

Bug-Id: 525
Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Grow the frag_info array in chunks

Previously it was grown one element at a time, which leads to
excessive reallocations.

Bug-Id: 525
Signed-off-by: Martin Storsjö <martin@martin.st>
network: uniform ff_listen_bind and ff_listen_connect

Document the functions and have both use a millisecond timeout and
check for interrupt.
lavfi doxy: improve/extend AVFilter doxy.
avconv: check that the output format context exists before accessing it

Fixes a segfault in exit_program() if opening an output file fails.
apetag: use int64_t for filesize

CC: libav-stable@libav.org
pngdec: dont treat mpng like png with key and non keyframes

Fixes Ticket2618

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/general: update after e4e4add0e3ba7

Signed-off-by: Paul B Mahol <onemda@gmail.com>
swr: add native_simd_one

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swr: Fix dithering of s16 with SIMD

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swresample: set flags & description and add documentation for output_sample_bits

Allows users to actually use such option.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
lavfi: port sab filter from libmpcodecs
lavfi/mp: remove mp=sab

The filter was ported to a native libavfilter filter.
swr: set scale for 32->32/24 dither

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swr: dont treat 32 and 24 as equal in simple copy check

Fixes dithering from 32 to 24 bit

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/encoders: add documentation for libtwolame
Merge commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e'

* commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e':
  movenc: Keep track of the allocated size for the cluster array
  mem: Add av_realloc_array and av_reallocp_array

Conflicts:
	doc/APIchanges
	libavformat/movenc.c
	libavutil/mem.c
	libavutil/mem.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'ab1189766a82a95f108005463cde75f73fcc0ae5'

* commit 'ab1189766a82a95f108005463cde75f73fcc0ae5':
  movenc: Increase the cluster array allocation by doubling

Merged-by: Michael Niedermayer <michaelni@gmx.at>