Initialise VC1DSPContext for parser as well as for decoder.
Note, the VC-1 code doesn't actually use the function pointer yet.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This caused mpv (and possibly others) to fallback to software decoding after
seeking a VC1 stream.
Bug-Id: 667
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
The most interesting parts are initialization in ff_MPV_common_init() and
uninitialization in ff_MPV_common_end().
ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL
checks for Picture.f, because these functions can be called on
uninitialized or partially initialized Pictures.
NULL pointer checks are added to ff_thread_release_buffer() stub function.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Several decoders disable those anyway and they are not measurably faster
on x86. They might be somewhat faster on other platforms due to missing
emu edge SIMD, but the gain is not large enough (and those decoders
relevant enough) to justify the added complexity.
Tables are always allocated now with sufficient space for either progressive
or interlaced content. The alternative would be to detect a change
and reallocate.
This fixes decoding of a sample.
Signed-off-by: Martin Storsjö <martin@martin.st>
This code was originally added in
5f1948111a to h263 to set decoded frame
pts to some random numbers (removed in
a1c5cc429d) and then cargo culted to other
decoders.
The code is left in h263dec for now, since some part of the decoder
(apparently OBMC) relies on the specific previous frame to be reused.
Happens on a B-frame when neither low_delay nor last_picture_ptr is set
(probably corrupted streams only).
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Allow supporting files for which the image stride is smaller than
the maximum block size + number of subpel mc taps, e.g. a 64x64 VP9
file or a 16x16 VP8 file with -fflags +emu_edge.
Previously, s->context_initialized was left set to 1
if ff_vc1_decode_init_alloc_tables failed, skipping the
initialization completely on the next decode call.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Now it can use different references for those blocks and even use
averaging.
This fixes several chroma artifacts in several videos.
Signed-off-by: Martin Storsjö <martin@martin.st>
Use the intensity-compensated reference frame for subsequent
fields/B-frames.
Since we currently don't change the reference frame we have to
maintain lookup tables for intensity compensation in the following
dependent frames.
Signed-off-by: Martin Storsjö <martin@martin.st>
This simplifies the code since copying MVs to the reference is not needed
anymore (and maybe something about fixing artifacts).
Also remove the unused mv_f_last.
Fixes a small number of artifacts in black_screen_VC-1.mkv
and several more artifacts in other videos.
Signed-off-by: Martin Storsjö <martin@martin.st>
This is required if we return other error codes than explicitly
-1, which so far has been the only other possible return value
besides 0.
Signed-off-by: Martin Storsjö <martin@martin.st>
This replaces a large number of checks for the second field by
fixing the pointers when they are setup.
This should also fix I/BI field pictures.
Changes checksums for vc1_sa10143, the file becomes slightly closer
to what the reference decoder outputs.
Based on "vc1dec: the second field is written wrong to the picture"
by Sebastian Sandberg <sebastiand.sandberg@gmail.com>.
Signed-off-by: Martin Storsjö <martin@martin.st>