This one was missed in the previous fraps fix, the
allocation is exactly the same in both cases.
Fixes fraps-v5 under valgrind.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This is needed in case the get_buffer() callback doesnt set
width/height.
Ideally all decoders would make calls through some wraper
to the callbacks and that wraper would call ff_init_buffer_info()
But until thats done, the default reget buffer must call this
itself as it needs the values for the changed size check later.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The same as av_fast_malloc but uses av_mallocz and keeps extra
always-0 padding.
This does not mean the memory will be 0-initialized after each call,
but actually only after each growth of the buffer.
However this makes sure that
a) all data anywhere in the buffer is always initialized
b) the padding is always 0
c) the user does not have to bother with adding the padding themselves
Fixes another valgrind warning about use of uninitialized data,
this time with fate-vsynth1-jpegls.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This combination is quite odd and almost certainly a bug if
it happens.
Reviewed-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Overall almost 4% faster, idct_add down from 350 to 85 cycles, idct_dc_add
down from 83 to 30 cycles.
squash: rv34 idct rearrange partial register loads
This reworks the frame skipping code such that the reference
buffers are still updated according to the header.
However it also ensures that the current frame will not end
up in any reference buffer.
Also fixes a hang with frame-multithreading, probably because
get_buffer was already called and would have reset the progress,
however the frame could remain in framep due to the missing update
(or it could be assigned to next_framep and a skip_frame skip would
then write it into framep - there might be even more failure modes).
Sample might become available at samples/nsv/vp8.nsv
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This is required by the spec and fixes video-1frag.ogg.48.ogg. (FPE)
Based on the debuging work of Oana Stratulat and ubitux.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This allows audio encoders to optionally take an AVFrame as input and write
encoded output to an AVPacket.
This also adds AVCodec.encode2() which will also be usable by video and
subtitle encoders once support is implemented in the public functions.
Extract processing of intra 16x16 blocks from intra macroblock
processing.
Also implement a function performing inverse transform and block
reconstruction for DC-only blocks in 1 pass instead of 2.
Split inter/intra macroblock handling code. This will allow further
optimizations such as performing inverse transform and block reconstruction
in a single pass as well as specialize code.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Do not fail audio decoding with avcodec_decode_audio3 if user has set a
custom get_buffer. Strictly speaking, this was never allowed by the API,
but it seems that some software packages did so anyways. In order to
unbreak applications (cf. http://bugs.debian.org/655890), this change
clarifies the API and overrides the custom get_buffer() with the defaults.
This change is inspired by a similar
commit (c3846e3eba) in FFmpeg.
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Reference decoder clips data before shifting it to final range and also
forces 32-bit lossy mode to be actually 24-bit lossy mode in order to be
able to perform proper clipping.
This is not a real error and memsetting always even when the
size did not change is overkill, but it still should be
an acceptable trade-off.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
At the very least this should fix warnings about unused static
functions if one or more of these is not defined.
However even compilation might be broken if the compiler does
not optimize the function away completely.
This actually happens in case of the AVX function, since the
function pointer is used in an assignment that is not under
an #if and thus probably only optimized away after the function
was already marked as used.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>