Commit Graph

153 Commits

Author SHA1 Message Date
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
Ronald S. Bultje baf35bb4bc dsputil: remove one array dimension from avg_no_rnd_pixels_tab. 2013-01-22 18:41:36 -08:00
Diego Biurrun 88bd7fdc82 Drop DCTELEM typedef
It does not help as an abstraction and adds dsputil dependencies.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2013-01-22 18:32:56 -08:00
Ronald S. Bultje 93af2734ee lavc: put FF_IDCT_{VP3,H264,CAVS,BINK,EA,WMV2} under FF_API_IDCT.
This allows us to get rid of them on the next major bump. All of the
above are functionally irrelevant, and most of them are unused, except
the vp3 one, which is used wrongly in the bfin arch optimizations.
2013-01-20 22:15:28 -08:00
Vladimir Pantelic 7b8c5b263b vc1dec: prevent a crash due missing pred_flag parameter
Handle pred_flag parameter not given to get_mvdata_interlaced()

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 04:57:41 +01:00
Ronald S. Bultje 8c53d39e7f lavc: introduce VideoDSPContext
Move some functions from dsputil. The idea is that videodsp contains
functions that are useful for a large and varied set of video decoders.
Currently, it contains emulated_edge_mc() and prefetch().

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-12-20 13:40:45 +01:00
Diego Biurrun ba0c898120 cosmetics: Fix dropable --> droppable typo 2012-12-09 13:36:11 +01:00
Anton Khirnov df9b956751 lavc: fix decode_frame() third parameter semantics for video decoders
It's got_frame, not data size
2012-12-04 21:45:36 +01:00
Anton Khirnov 594d4d5df3 lavc: add a wrapper for AVCodecContext.get_buffer().
It will be useful in the upcoming transition to refcounted AVFrames.
2012-12-04 21:41:59 +01:00
Mashiat Sarker Shakkhar 35a35d49d2 Double motion vector range for HPEL interlaced picture in proper place
The existing code is not in the right place and it should cover both
interlaced frame and field pictures.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:56:02 -04:00
Mashiat Sarker Shakkhar eb657ecefd vc1dec: Set opposite to the correct value for 1REF field pictures
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:55:38 -04:00
Mashiat Sarker Shakkhar 7cc3c4e1d4 vc1dec: Invoke edge emulation regardless of MV precision for 1-MV chroma
This is required due to the way VC-1 handles chroma pull-back which may end
up causing negative chroma MV for zero luma MV. Edge emulation needs to be
invoked in such cases.

This only affects vertical component of chroma motion vector.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:54:19 -04:00
Mashiat Sarker Shakkhar 88058d9a99 vc1dec: Set chroma reference field from REFFIELD for 1REF field pictures
Interlaced field pictures can have one or two reference pictures, signaled
by NUMREF syntax element. For single reference pictures, reference picture
is determined by REFFIELD syntax element.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:50:07 -04:00
Mashiat Sarker Shakkhar 7fb35ee931 vc1dec: Use correct spelling of "opposite"
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-10-10 16:28:31 +02:00
Janne Grunau 6f8ef5320f vc1dec: prevent memory leak in error path
Fixes CID732271.
2012-10-09 16:09:41 +02:00