mpeg12: do not fail on zero dimensions in the sequence header.

The total frame size is a combination of the 12 bits in the sequence
header and 2 more bits in the the sequence extension. While the
specification explicitly forbids the dimensions from the sequence header
from being 0 (thus ruling out multiples of 4096), such videos
apparrently exist in the wild so we should attempt to decode them.

Based on a patch by Michael Niedermayer <michaelni@gmx.at>

Fixes Bug 416.
print_options: do not generate docs for options without enc or dec flags

Those are not usable from the avtools, so mentioning them in the
manpages just confuses the reader.
Revert "asfenc: return error on negative timestamp"

This reverts commit d1bec33b46091546c5b2e6815210e73f87abf413, it breaks
FATE.
avplay: remove the -debug option.

It just shadows the corresponding AVOption and prevents using named
constants.
pixdesc: add a function for counting planes in a pixel format.
lavc, lavfi: fix counting number of planes in AVBufferRef wrappers

Number of planes is not always equal to the number of components even
for formats marked with PIX_FMT_PLANAR -- e.g. NV12 has three components
in two planes.
buffersrc: fix a typo.

Vertical shift is log2_chroma_h, not log2_chroma_w.
lavc: update the doxy for avcodec_decode_{video,audio} wtih refcounting.
mpegvideo: fix allocation of the hwaccel_picture_private data

Signed-off-by: Anton Khirnov <anton@khirnov.net>
pthread: unref already decoded frames when flushing the decoder

Signed-off-by: Anton Khirnov <anton@khirnov.net>
h264: allocate hwaccel privdata after the frame buffer

This ensures the hwaccel privdata does not leak when a frame buffer could
not be allocated (and toggle the assert when the frame is re-used).
Having no frame buffer available is quite common when using the DXVA2
hwaccel in situations where the DXVA2 renderer is being re-allocated, for
example when moving between displays.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
mpegvideo: allocate hwaccel privdata after the frame buffer

This ensures the hwaccel privdata does not leak when a frame buffer could
not be allocated (and toggle the assert when the frame is re-used).
Having no frame buffer available is quite common when using the DXVA2
hwaccel in situations where the DXVA2 renderer is being re-allocated, for
example when moving between displays.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
rtmp: Pass the parameters to do_adobe_auth in the right order

do_adobe_auth takes the parameters in the order "opaque, challenge".

Due to the way they are treated, this didn't matter in the tested
setups though - if both are set, we only use one. In the tested
setups (Wowza and Akamai) either one of them were null or they
were both set to the same value, which is why this worked before.

Signed-off-by: Martin Storsjö <martin@martin.st>
h264: fix bit depth changes with frame threading

AVCodecContext.bits_per_raw_sample is updated from the previous thread
in the generic update function before the codec specific update_thread
function is called. The check for reinitialization of dsp functions uses
bits_per_raw_sample. When called from update_thread_context it will be
already at the current value and the dsp functions aren't updated if
only the bit depth changes.
fate: add tests for h264 decoder reinit
h264: make ff_h264_frame_start static.

It is not called from outside h264.c
h264: merge common_init() into ff_h264_decode_init.

There is no point in keeping those separate.
h264: add a parameter to the MB_MBAFF macro.

This way it does not look like a constant.
h264: add a parameter to the MB_FIELD macro.

This way it does not look like a constant.
h264: add a parameter to the FRAME_MBAFF macro.

This way it does not look like a constant.