Commit Graph

782 Commits

Author SHA1 Message Date
Janne Grunau 1f4ea4e068 mpegvideo: initialize videodsp with correct pixel depth
Fixes decoding of 9/10 bit per pixel h264 videos as reported in
https://bugzilla.libav.org/show_bug.cgi?id=404 .
2012-12-26 00:24:21 +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
Janne Grunau 45635885e4 mpegvideo: increase edge_emu_buffer size for VC1
The VC1 decoder uses edge_emu_buffer simultaneously for luma and chroma
and needs more space. That was not a problem before f1d8763a02
since the size for edge_emu_buffer was always calculated with 2 byte per
pixel since the linesize was not known.

Fixes occasionally fate errors in vc1_sa10143.
2012-12-19 07:57:22 +01:00
Janne Grunau f1d8763a02 mpegvideo: allocate scratch buffers after linesize is known
Since we can't know which stride a custom get_buffer() implementation is
going to use we have to allocate this scratch buffers after the linesize
is known. It was pretty safe for 8 bit per pixel pixel formats since we
always allocated memory for up to 16 bits per pixel. It broke hoever
with cmdutis.c's alloc_buffer() and high pixel bit depth since it
allocated larger edges than mpegvideo expected.

Fixes fuzzed sample nasa-8s2.ts_s244342.
2012-12-18 19:48:30 +01:00
Janne Grunau 6a27ae28f9 mpegvideo: treat delayed pictures as used
This requires to move the avcodec_default_free_buffers() call to
ff_MPV_common_end() since otherwise delayed pictures would get freed
during a size change.
2012-12-13 21:02:42 +01:00
Diego Biurrun ba0c898120 cosmetics: Fix dropable --> droppable typo 2012-12-09 13:36:11 +01:00
Janne Grunau d5e83122bd h264: set Picture.owner2 to the current thread
This does not seem to have an effect currently. Fate-h264 passes with
THREADS=1..16 and both threading types as before. It fixes however a
segfault during error resilience with my adaptive-frame-mt patchset.
A picture in use during error resilience gets realloced in another
thread in the fuzzed sample sample_varPAR.avi_s226019.
2012-11-27 12:26:33 +01:00
Luca Barbato c1a02e884a pixdesc: add av_pix_fmt_get_chroma_sub_sample
Deprecate avcodec_get_chroma_sub_sample.
2012-11-13 16:14:55 +01:00
Michael Niedermayer 6bcdfe48d0 mpeg4videodec: Disable frame multithreading for GMC, its not implemented at all
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-19 15:42:35 +03:00
Mans Rullgard 7e76fc528d mpegvideo: remove write-only variable
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-12 22:21:10 +01:00
Diego Biurrun ca411fc1d3 avcodec: Remove broken MMI optimizations
The code fails to compile and is broken beyond repair.
2012-10-12 20:56:54 +02:00
Anton Khirnov 50ba57e0ce lavc: do not use av_pix_fmt_descriptors directly. 2012-10-12 12:45:39 +02:00
Anton Khirnov 9953ff3cd8 mpegvideo: fix indentation 2012-10-12 12:45:38 +02:00
Diego Biurrun 9734b8ba56 Move avutil tables only used in libavcodec to libavcodec. 2012-10-11 18:29:36 +02:00
Anton Khirnov 716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Janne Grunau 1481e19825 mpegvideo: set extended_data in ff_update_duplicate_context()
AVFrame.extended_data has to reset to the AVFrame.data of the current
thread context after copying the frame contents.
Fixes crashes with frame-threading after 2bc0de3858.
2012-10-03 22:08:49 +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
Diego Biurrun 6f6b0311a3 avcodec: Drop some silly commented-out av_log() invocations 2012-10-01 10:24:28 +02:00
Janne Grunau 8701f4f8e8 mpeg4: support frame parameter changes with frame-mt
Adds a flag context_reinit to MpegEncContext to relieable keep track
of frame parameter changes which require a context reinitialization.
This is required for broken inputs which change the frame size but
error out before the context can be reinitialized.
2012-09-19 19:58:15 +02:00
Janne Grunau 01fc5d6609 mpegvideo: check ff_find_unused_picture() return value for errors 2012-09-19 19:58:15 +02:00
Janne Grunau 32c7589bb7 mpegvideo: release frame buffers before freeing them
Fixes triggering an assert in avcodec_default_release_buffer()
introduced in 1b3439b30.
2012-09-19 19:58:15 +02:00
Janne Grunau 435c0b87d2 mpegvideo: add reinit function for frame parameter changes
This is mainly required for frame parameter changes during frame based
multithreading but single threaded usage profits too from avoiding
ff_MPV_common_end()/ff_MPV_common_init() cycles.
2012-09-19 11:06:39 +02:00
Janne Grunau 1b3439b305 mpegvideo: move frame size dependent memory management to separate functions
This is a preparation for supporting frame size changes during
frame-based multithreading.
2012-09-19 11:06:31 +02:00
Janne Grunau 59383d5740 mpegvideo: set AVFrame fields to NULL after freeing the base memory
Prevents dangling pointers and makes access after free more obvious.
Setting AVFrame.qscale_table to NULL is required for successfully
allocating a previously freed Picture with ff_alloc_picture().
2012-09-06 19:02:43 +02:00
Michael Niedermayer 91672504a4 mpegvideo: remove last_picture_ptr / h264 assert.
This assert is no longer true since h264 error concealment needs
last_picture_ptr to be set.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 18:38:02 +03:00
Alberto Delmás ee769c6a7c MSS2 decoder
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-31 07:37:16 +02:00
Diego Biurrun dc40285427 x86: mpegvideo: more sensible names for optimization file and init function 2012-08-24 02:23:16 +02:00
Mans Rullgard 7a851153d3 mpegvideo: convert mpegvideo_common.h to a .c file
This file defines a single, huge function, MPV_motion(), which
although being declared inline is not actually inlined by the
compiler (for good reason).  There is thus no sense in defining
this function in a header file, resulting in multiple copies of
it in the final library.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 01:31:37 +01:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Mans Rullgard 87cf481aa8 mpegvideo: remove unnecessary inclusions of faandct.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-29 21:28:45 +01:00
Ronald S. Bultje 89b81a1c88 mpegvideo: remove VLAs
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-04 15:10:57 +03:00
Mans Rullgard 2bcbd98459 Remove lowres video decoding
This feature is complex, of questionable utility, and slows down
normal decoding.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-21 18:56:19 +01:00
Janne Grunau 5ab506a5c8 MPV: set reference frame pointers to NULL when allocation of dummy pictures fails 2012-03-23 17:50:46 +01:00
Janne Grunau 7b60799aa8 MPV: always mark dummy frames as reference
If the dummy frame are not created from a reference frame they could
be deleted untimely resulting in multithreaded decoder waiting on
the current frame to finish.
Noticed by Ronald S. Bultje in the RV34 decoder with a broken file.
2012-03-16 23:35:32 +01:00
Ronald S. Bultje c6ccb96bc9 mpeg4: report frame decoding completion at ff_MPV_frame_end().
Prevents hangs on corrupt input.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-16 15:30:53 -07:00
Diego Biurrun 47c0ac96aa Replace AVFrame pointer casts by proper struct member accesses. 2012-03-01 23:11:11 +01: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ö 9cf0841ef3 dsputil: Add ff_ prefix to the dsputil*_init* functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-15 22:06:34 +02:00
Martin Storsjö e96b4a53df vlc/rl: Add ff_ prefix to the nonstatic symbols
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-15 22:06:26 +02:00
Diego Biurrun 0144fe6995 Remove Sun medialib glue code.
It is obscure, most likely unused and not bit-exact compared to
libavcodec due to a different IDCT transform algorithm.
2012-02-08 08:52:30 +01:00
John Brooks 9b6aafba6c mpegvideo: fix invalid memory access for small video dimensions
When either video dimension is only one macroblock, subtractions
based on v_edge_pos and the macroblock size may be negative. In
that situation, an unsigned comparison isn't sufficent to test for
MV overruns, because a limit of (unsigned)-1 will let any other
value pass.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-21 08:28:08 +01:00
Janne Grunau 3ab7700018 mpegvideo: claim ownership of referenced pictures
Under certain conditions pictures could be released before they were
returned with frame-threading. Broken mv computation in the upcoming
rv34 frame-threading patch was caused by this.

To prevent contexts from running out of available pictures the loop
releasing "unused" pictures has to be run for B frames too.
2012-01-10 22:51:56 +01:00
Diego Biurrun 3dc99a18d4 cosmetics: drop some pointless parentheses 2012-01-07 22:13:07 +01:00
Janne Grunau 881a5e047d mpegenc: use avctx->slices as number of slices
Adds a new member to MpegEncContext to hold the number of used slice
contexts. Fixes segfaults with '-threads 17 -thread_type slice' and
fate-vsynth{1,2}-mpeg{2,4}thread{,_ilace} with --disable-pthreads.
2012-01-02 19:20:23 +01:00
Konstantin Todorov c65dfac466 mpegvideo.c: K&R formatting and cosmetics.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-25 10:07:19 -08:00
Mans Rullgard 8400b126ac avcodec: deprecate AVFrame.age
This was intended as an optimisation for skipped blocks in MPEG2
P-frames and never used elsewhere.  Removing this "optimisation"
speeds up MPEG2 decoding by 1-2% (ARM Cortex-A9).

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-18 22:14:33 +00: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
Diego Biurrun 58c42af722 doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
Dustin Brody 5b22d6e132 lavc: convert error_recognition to err_recognition.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-12-12 19:42:50 +01:00
Diego Biurrun ee41963f19 cosmetics: drop some completely pointless parentheses 2011-12-07 15:29:13 +01:00