Commit Graph

113 Commits

Author SHA1 Message Date
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
Janne Grunau
714f5ab597 vc1dec: prevent memory leak on av_realloc error 2012-10-09 16:07:12 +02:00
Anton Khirnov
716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Diego Biurrun
1218777ffd avcodec: Convert some commented-out printf/av_log instances to av_dlog 2012-10-01 10:24:28 +02:00
Kostya Shishkov
4dc8c8386e vc1dec: add flush function for WMV9 and VC-1 decoders
CC: libav-stable@libav.org
2012-09-28 07:08:54 +02:00
Alberto Delmás
ee769c6a7c MSS2 decoder
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-31 07:37:16 +02:00
Kostya Shishkov
7627c35a81 vc1: export some functions
This is a preparatory step for the MSS2 decoder which needs to use
the WMV9 decoder to decode some kinds of frames.

From the patch by Alberto Delmás <adelmas@gmail.com>
2012-08-28 07:37:06 +02:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Mashiat Sarker Shakkhar
9cc74c9f6e vc1dec: Remove separate scaling function for interlaced field MVs
The scaling process for obtaining direct MVs from co-located field MVs
is the same for interlaced field and progressive pictures.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-03 17:21:54 +02:00
Mashiat Sarker Shakkhar
8379ea5e9f vc1dec: Invoke edge_emulation regardless of MV precision
In VC-1 interlaced field pictures, chroma motion vectors can extend beyond
picture boundary even if luma vectors are bounded. The problem shows up
only for hpel interpolated MVs, and may be due to the way motion vectors
are scaled / cropped.

Thanks to Konstantin Shishkov for suggesting the fix. This fixes
long-known segfaults in MC-VC1.ts from videolan streams archive.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-03 17:21:54 +02:00
Mans Rullgard
cfb1091898 vc1dec: remove useless #include simple_idct.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-02 12:14:52 +01:00
Michael Niedermayer
45838561f2 vc1dec: Override invalid macroblock quantizer
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 14:13:22 +02:00
Michael Niedermayer
2bf369b60c vc1: avoid reading beyond the last line in vc1_draw_sprites()
Fixes overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 13:35:12 +02:00
Michael Niedermayer
1100acbab2 vc1dec: check that coded slice positions and interlacing match.
This fixes out of array writes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 13:34:05 +02:00
Michael Niedermayer
0aa907cfb1 vc1dec: Do not ignore ff_vc1_parse_frame_header_adv return value
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 13:34:05 +02:00
Mashiat Sarker Shakkhar
082829520e vc1dec: Do not use random pred_flag if motion vector data is skipped
This fixes SA10143.vc1 from test-suite. Also partially fixes MC-VC1.ts
from videolan streams archive.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-15 14:02:38 +03:00
Martin Storsjö
00c3b67b8a cosmetics: Align codec declarations
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 22:37:38 +03:00
Mashiat Sarker Shakkhar
95b192de5d vc1: Do not read from array if index is invalid.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-26 17:48:13 -07:00
Diego Biurrun
3c715383ea vc1: Move init code shared between decoder and parser to common code file.
This fixes standalone compilation of the VC-1 parser.
2012-03-07 09:36:04 +01:00
Diego Biurrun
324deaa268 Replace AVFrame pointer type punning by proper struct member assignments. 2012-03-01 23:11:13 +01:00
Ronald S. Bultje
c742ab4e81 vc1parse: call vc1_init_common().
The parser uses VLC tables initialized in vc1_common_init(), therefore
we should call this function on parser init also.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-18 09:16:39 -08:00
Ronald S. Bultje
ae591aeea5 vc1: prevent using last_frame as a reference for I/P first frame.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-15 19:58:10 -08:00
Martin Storsjö
efd29844eb mpegvideo: Add ff_ prefix to nonstatic functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-15 22:07:23 +02:00
Martin Storsjö
5f2c159c0f vc1: Add ff_ prefix to nonstatic symbols
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-15 22:07:05 +02:00
Martin Storsjö
1fec055066 msmpeg4: Add ff_ prefixes to nonstatic symbols
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-15 22:07:01 +02:00
Janne Grunau
510ef04a46 vc1: prevent null pointer dereference on broken files
CC: libav-stable@libav.org
2012-02-01 12:54:39 +01:00
Mashiat Sarker Shakkhar
d51d6ae9c4 vc1dec.c: Don't use uninitialized values of dmv_[x, y]
MVDATA may or may not be transmitted. If it is not, both
dmv_x and dmv_y is to be assumed zero.

This may not trigger wrong picture in all systems, but
it's a bug nevertheless. Fixes SA10116.vc1 on my 64-bit
Windows 7.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-27 09:24:13 +08:00
Diego Biurrun
3dc99a18d4 cosmetics: drop some pointless parentheses 2012-01-07 22:13:07 +01:00
John Brooks
d209c27b09 vc1dec: fix invalid memory access for small video dimensions
For small video dimensions, these calculations of the upper bound
for pixel access may have a negative result. Using an unsigned
comparison to bound a potentially negative value only works if
the greater operand is non-negative. Fixed by doing edge emulation
when the upper bound is probably negative, everywhere that this
pattern appears.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-01-04 10:35:26 +01:00
Martin Storsjö
b797f73520 vc1dec: Use the right pointer type for the tmp pointer
This fixes warnings about assignment from incompatible
pointer type.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-20 11:04:26 +02:00
Aneesh Dogra
0a6aff6936 vc1: Handle WVC1 interlaced stream
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-19 22:22:15 +02:00
Andrey Utkin
4f820131fa mpegvideo: remove abort() in ff_find_unused_picture()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-14 18:17:21 +01:00
Luca Barbato
4f3667ba59 vc1: mark with ER_MB_ERROR bits overconsumption
This patch is a generalization of what Michael Niedermayer
fixed in a single case.

The wmv8-drm fate test had been updated accordingly.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-13 16:20:58 +01:00
Luca Barbato
63ccd46687 lavc: introduce ER_MB_END and ER_MB_ERROR
Simplify a little error resilience calls

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-13 16:20:58 +01:00
Luca Barbato
5bf2ac2b37 error_resilience: use the ER_ namespace
Add the namespace to {AC_,DC_,MV_}{END,ERROR} macros

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-13 16:20:58 +01:00
Diego Biurrun
da9cea77e3 Fix a bunch of common typos. 2011-12-11 00:32:25 +01:00
Diego Biurrun
ee41963f19 cosmetics: drop some completely pointless parentheses 2011-12-07 15:29:13 +01:00
Luca Barbato
1f948745c3 vc1: use an enum for Frame Coding Mode
Document it a little and possibly fix a bug in dxva2_vc1.
2011-11-28 00:40:22 +01:00
Kostya Shishkov
498605b4ad vc1: select interlaced scan table by FCM element
Interlaced videos can contain progressive frames too and now wrong scantable
is selected for them.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-26 18:14:07 -08:00
shahriman AMS
c33d4916fb VC1: Add bottom field offset to block_index[] to avoid rewriting (+10L)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-11-09 11:00:49 +01:00
shahriman AMS
62622d04eb vc1dec: move an if() block.
There are no reason for "if (c_valid) { ... }" to appear before
"if (b_valid) { ... }".

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-11-09 11:00:20 +01:00