Commit Graph

167 Commits

Author SHA1 Message Date
Anton Khirnov ebfe622bb1 mpegvideo: drop support for real (non-emulated) edges
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.
2014-01-09 09:41:19 +01:00
Michael Niedermayer d8fd183683 vc1: Fix mb_height for field pictures
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>
2013-12-17 22:01:45 +02:00
Anton Khirnov 66499f34b5 mpegvideo: do not set current_picture_ptr in decoders
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.
2013-12-05 13:28:05 +01:00
Anton Khirnov ac1fc92ea4 vc1dec: move setting repeat_pict after frame_start() has been called.
This will allow removing the hacks where each decoder sets
current_picture_ptr on its own.
2013-12-05 13:27:24 +01:00
Anton Khirnov de4ec972c0 vc1: fix a memleak.
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
2013-11-21 20:57:36 +01:00
Anton Khirnov 6792559f8a vc1: use the AVFrame API properly. 2013-11-16 17:44:40 +01:00
Ronald S. Bultje 458446acfa lavc: Edge emulation with dst/src linesize
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.
2013-11-15 10:16:27 +01:00
Luca Barbato 08303d7741 hwaccel: Simplify ff_find_hwaccel
It is always called by passing fields from an AVCodecContext.
2013-11-10 13:59:48 +01:00
Diego Biurrun b2bed9325d cosmetics: Group .name and .long_name together in codec/format declarations 2013-10-03 23:32:01 +02:00
Martin Storsjö 23d6ba2c44 vc1dec: Check the error handling flags on slice/field header decode errors
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Michael Niedermayer bb7bf17595 vc1dec: Don't decode slices when the latest slice header failed to decode
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö 5e25fdbfe0 vc1dec: Make sure last_picture is initialized in vc1_decode_skip_blocks
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö b772b0e28e vc1dec: Undo mpegvideo initialization if unable to allocate tables
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>
2013-09-22 21:02:47 +03:00
Martin Storsjö ede508443e vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 16:10:22 +03:00
Luca Barbato 43bacd5b7d vc1: check mb_height validity.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-08-05 16:24:13 +02:00
Luca Barbato 090cd06311 vc1: check the source buffer in vc1_mc functions
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-08-05 16:24:13 +02:00
Rémi Denis-Courmont 578ea75a9e vdpau: remove old-style decoders
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-05 11:15:49 +02:00
Michael Niedermayer d8b9dbe776 vc1dec: Fix mixed field/frame intensity compensation
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-28 13:56:24 +03:00
Michael Niedermayer 17410faa22 vc1dec: Match addressing between compensation and MC in vc1_mc_4mv_chroma4
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-28 13:56:20 +03:00
Michael Niedermayer 1be175f929 vc1dec: Handle top and bottom blocks in vc1_mc_4mv_chroma4() differently if needed
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>
2013-05-28 13:56:15 +03:00
Michael Niedermayer c69765a2cc vc1dec: Fix doxy for vc1_mc_4mv_chroma4()
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-28 13:56:12 +03:00
Michael Niedermayer b412f705b5 vc1dec: Drop old use_ic code from vc1_b_mc
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-28 13:56:08 +03:00
Michael Niedermayer 5053a9a1ff vc1: Use shuffled use_ic instead of equally shuffled mv_mode
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-28 13:56:04 +03:00
Michael Niedermayer 3ced06f283 vc1dec: Implement intensity compensation for vc1_interp_mc()
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-28 13:55:59 +03:00
Michael Niedermayer 28243b0d35 vc1dec: Redesign the intensity compensation
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>
2013-05-28 13:55:55 +03:00
Michael Niedermayer 93b1281264 vc1dec: Shuffle field MVs after decoding, not before
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>
2013-05-28 13:55:46 +03:00
Sebastian Sandberg 1fb013a57c vc1dec: Add support for interlaced B-frames
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-17 00:28:37 +03:00
Martin Storsjö 3ca3709ad4 vc1dec: Remove some now unused variables
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-15 12:13:53 +03:00
Michael Niedermayer 4162fc62b3 vc1dec: Do not allow field_mode to change after the first header
This fixes out of array accesses.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-15 12:13:53 +03:00
Martin Storsjö ec7d002e55 vc1, mss2: Check for any negative return value from ff_vc1_parse_frame_header
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>
2013-05-15 12:13:53 +03:00
Michael Niedermayer ccb148e478 vc1dec: Fix current ptr selection in vc1_mc_4mv_chroma()
No sample tried shows a difference.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-15 11:40:38 +03:00
Michael Niedermayer 201412ffec vc1dec: Factorize picture pointer selection in vc1_mc_4mv_chroma()
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-15 11:40:17 +03:00
Michael Niedermayer 2412ad1717 vc1dec: Factorize picture pointer selection code
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-15 11:39:57 +03:00
Michael Niedermayer 19673db34a vc1dec: Factorize srcU/V offseting
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-15 11:39:36 +03:00
Michael Niedermayer 012b319d91 vc1dec: Fix tff == 0 handling in init_block_index()
This fixes several files from VLC ticket 5887.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-15 11:39:17 +03:00
Michael Niedermayer 0313653928 vc1dec: Update destination pointers in context for fields
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>
2013-05-15 11:38:49 +03:00
Martin Storsjö 5d9d8461fb vc1dec: Don't apply the loop filter on fields
Fixes read of uninitialized memory.

Based on a patch by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-14 14:36:00 +03:00
Michael Niedermayer 46430fd47c vc1dec: Don't attempt error concealment on field pictures
This is not implemented and doesn't work.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-14 13:24:52 +03:00
Sebastian Sandberg 1bd57a850a vc1dec: fieldtx is only valid for interlaced frame pictures
The fieldtx_plane is not cleared for interlaced fields.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-14 12:44:09 +03:00
Martin Storsjö a60136ee57 vc1: Remove now unused variables
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-04-20 00:44:49 +03:00
Ronald S. Bultje f4fed5a2f9 mpegvideo: Use hpeldsp instead of dsputil for half-pel functions
This also converts vc1, since that is mpegvideo-based.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-04-19 23:18:21 +03:00
Diego Biurrun 6d97484d72 avcodec: av_log_ask_for_sample() ---> avpriv_request_sample() 2013-03-13 21:20:12 +01:00
Anton Khirnov 759001c534 lavc decoders: work with refcounted frames. 2013-03-08 07:38:30 +01:00
Diego Biurrun 5f401b7b71 Add missing error_resilience includes to files that use ER 2013-03-07 15:04:49 +01:00
Ronald S. Bultje 8d061989dd lavc: Split out ff_hwaccel_pixfmt_list_420[] over individual codecs
Not all hwaccels implement all codecs, so using one single list for
multiple such codecs means some codecs will be represented in the list,
even though they don't actually handle that codec. Copying specific
lists in each codec fixes that.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-06 21:18:50 +02:00
Diego Biurrun c242bbd8b6 Remove unnecessary dsputil.h #includes 2013-02-26 00:51:34 +01:00
Anton Khirnov 1d0feb5d1a mpegvideo: split ff_draw_horiz_band().
Split out dependency on MpegEncContext.
2013-02-15 16:10:19 +01:00
Anton Khirnov 54974c6298 error_resilience: decouple ER from MpegEncContext 2013-02-15 16:10:11 +01:00
Diego Biurrun 79dad2a932 dsputil: Separate h264chroma 2013-02-06 11:30:53 +01:00
Vladimir Pantelic 77bcb89600 vc1dec: use codec_id instead of codec_tag for VC1IMAGE
the rest of the code is using codec_id everywhere already

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2013-02-06 09:34:32 +01:00