summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
Commit message (Collapse)AuthorAge
...
* pthreads: reset active_thread_type when slice thread_init returrns earlyJanne Grunau2011-12-22
|
* avcodec: deprecate AVFrame.ageMans Rullgard2011-12-18
| | | | | | | | 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>
* doxygen: misc consistency, spelling and wording fixesDiego Biurrun2011-12-12
|
* pthread: don't increment index on zero-sized packets.Aaron Colwell2011-11-28
| | | | | | | | The next call to decode() will update from an invalid index, which will either lead to a memcpy() where dest==src (2 threads), or lead to a crash (>2 threads). Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* pthread: track thread existence in a separate variable.Cheng Sun2011-11-26
| | | | | | | | This fixes a compile error on mingw32 when using p->thread directly (as if it were a pointer) to track thread existence, because the type is opaque and may be a non-pointer. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* [PATCH] Fix crash when initializing multi-threaded decoding for corrupted file.Cheng Sun2011-11-26
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* frame-mt: return consumed packet size in ff_thread_decode_frameJanne Grunau2011-11-25
| | | | | This is required to fulfill avcodec_decode_video2() promise to return the number of consumed bytes on success.
* pthread: do not touch has_b_framesJanne Grunau2011-11-22
| | | | | | | | | | | | | | | | | | Adding the thread count in frame level multithreading to has_b_frames as an additional delay causes more problems than it solves. For example inconsistent behaviour during timestamp calculation in libavformat. Thread count and frame level multithreading are both set by the user. If the additional delay caused by frame level multithreading needs to be considered in the calling code it has all information to take it into account. Should it become necessary to calculate a maximum delay inside libavcodec it should be exported as its own field and not reusing an existing field. Based on a patch by Michael Niedermayer. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* pthread: add some malloc failure checksJustin Ruggles2011-11-21
|
* avcodec: move some AVCodecContext fields to an internal struct.Justin Ruggles2011-11-19
| | | | | | | | A new field, AVCodecContext.internal is used to hold a new struct AVCodecInternal, which has private fields that are not codec-specific and are used by general libavcodec functions. Moved internal_buffer, internal_buffer_count, and is_copy.
* threads: restore has_b_frames in frame_thread_freeJanne Grunau2011-10-26
| | | | | | Otherwise the delay expressed in has_b_frames increases with every avcodec_close/avcodec_open. Fixes fate-ea-dct with more than 1 thread.
* w32threads: support for frame multithreadingSteven Walters2011-10-16
| | | | | | | | Replace our incomplete w32threads implementation with x264's pthreads w32threads wrapper. Relicensed to LGPL with kind permission by Pegasys Inc. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* pthread: prevent updating AVCodecContext from itself in frame_thread_freeRonald S. Bultje2011-10-15
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* pthread: copy coded frame dimensions in update_context_from_threadRonald S. Bultje2011-10-15
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* vp8/mt: flush worker thread, not application thread context, on seek.Ronald S. Bultje2011-07-10
| | | | This prevents a crash when seeking.
* mt: proper locking around release_buffer calls.Ronald S. Bultje2011-07-10
| | | | | This fixes a crash when seeking in some webm files with many threads (e.g. 8).
* H264/MPEG frame-level multi-threading.Alexander Strange2011-06-02
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* lavc: remove FF_API_HURRY_UP cruftAnton Khirnov2011-04-26
|
* Introduce slice threads flag.Ronald S. Bultje2011-04-21
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* pthread: validate_thread_parameters() ignored slice-threading being ↵Alexander Strange2011-04-09
| | | | | | | | | | | | intentionally off The thread_type API allows you to request only FF_THREAD_FRAME (instead of FRAME | SLICE), but it was being ignored. We don't implement both of them at the same time, so there isn't an effect on current codecs, except that you can request no kinds of threading now (a bit useless). Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Remove unnecessary parameter from ff_thread_init() and fix behaviorAlexander Strange2011-04-05
| | | | | | | | | | | thread_count passed to ff_thread_init() is only used to set AVCodecContext. thread_count, and can be removed. Instead move it to the legacy implementation of avcodec_thread_init(). This also fixes the problem that calling avcodec_thread_init() with pthreads enabled did not set it since ff1efc524cb3c60f2f746e3b4550bb1a86c65316. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* lavc: mark hurry_up for removal on next major bumpAnton Khirnov2011-04-02
| | | | | It has been deprecated for about five years, skip_idct/skip_frame should be used instead.
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* threads: allow thread count of zeroMans Rullgard2011-03-02
| | | | | | | | | This moves setting the thread count to a minimum of 1 to frame_thread_init(), allowing a value of zero to propagate through to the codec if frame threading is not used. This makes auto-threads work in libx264. Signed-off-by: Mans Rullgard <mans@mansr.com>
* pthreads: Fix bug introduced with thread_safe_callbacksAlexander Strange2011-03-01
| | | | | | | | | For intra codecs, ff_thread_finish_setup() is called before decoding starts automatically. However, get_buffer can only be used before it's called, so adding this requirement broke frame threading for them. Fixed by moving the call until after get_buffer is finished. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Deprecate avcodec_thread_init()Alexander Strange2011-02-09
| | | | | | | | | | | | | | As a side effect of the last commit, avcodec_open() now calls it automatically, so there is no longer any need for clients to call it. Instead they should set AVCodecContext.thread_count. avcodec_thread_free() is deprecated, and will be removed from avcodec.h at the next MAJOR libavcodec bump. Rename the functions to ff_thread_init/free, since they are now internal. Wrappers are provided to maintain API compatibility. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Frame-based multithreading framework using pthreadsAlexander Strange2011-02-09
| | | | | | See doc/multithreading.txt for details on use in codecs. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Remove avcodec_thread_execute from avcodec.h, and make static functions thatBenoit Fouet2010-03-15
| | | | | | need it in *thread.c. Originally committed as revision 22544 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make avcodec_thread_execute2() staticAndreas Öman2010-03-08
| | | | Originally committed as revision 22324 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Always call avcodec_thread_init()Måns Rullgård2010-01-20
| | | | | | | | | The various avcodec_thread_init() functions are updated to return immediately after setting avctx->thread_count. This allows -threads 0 to pass through to codecs. It also simplifies the usage for apps using libavcodec. Originally committed as revision 21358 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add an execute2 function that is more flexible and allows to use parallelReimar Döffinger2009-10-12
| | | | | | | | processing with jobs > threads without wasting too much memory. It also avoids needing a separate int array when the only additional data the jobs needs is a single int running from 0 to count-1. Originally committed as revision 20210 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: Remove pointless period after copyright statement non-sentences.Diego Biurrun2009-01-19
| | | | Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Avoid invasion of POSIX-reserved _t namespace.Diego Biurrun2008-12-15
| | | | Originally committed as revision 16144 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Making it easier to send arbitrary structures as work orders to MT workersRoman Shaposhnik2008-11-12
| | | | Originally committed as revision 15804 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add attribute that forces alignment of stack to functions that need it.Ramiro Polla2007-08-13
| | | | | | | | | Necessary for systems that don't align by default to 16 bytes, required by some SSE instructions. Requires GCC >= 4.2. Based on patch by Gaël Chardon. Originally committed as revision 10106 to svn://svn.ffmpeg.org/ffmpeg/trunk
* set thread_opaque to NULL when freeing itBenoit Fouet2007-07-06
| | | | Originally committed as revision 9506 to svn://svn.ffmpeg.org/ffmpeg/trunk
* license header consistency cosmeticsDiego Biurrun2007-07-05
| | | | Originally committed as revision 9484 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove redundant #inclusion of common.h, avcodec.h already #includes it.Diego Biurrun2007-05-10
| | | | Originally committed as revision 8967 to svn://svn.ffmpeg.org/ffmpeg/trunk
* rename always_inline to av_always_inline and move to common.hMåns Rullgård2006-12-08
| | | | Originally committed as revision 7256 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change license headers to say 'FFmpeg' instead of 'this program/this library'Diego Biurrun2006-10-07
| | | | | | and fix GPL/LGPL version mismatches. Originally committed as revision 6577 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Update licensing information: The FSF changed postal address.Diego Biurrun2006-01-12
| | | | Originally committed as revision 4842 to svn://svn.ffmpeg.org/ffmpeg/trunk
* COSMETICS: tabs --> spaces, some prettyprintingDiego Biurrun2005-12-22
| | | | Originally committed as revision 4764 to svn://svn.ffmpeg.org/ffmpeg/trunk
* COSMETICS: Remove all trailing whitespace.Diego Biurrun2005-12-17
| | | | Originally committed as revision 4749 to svn://svn.ffmpeg.org/ffmpeg/trunk
* 10l fixes by ("Debabrata Banerjee" <davatar at comcast dot net>)Michael Niedermayer2004-05-26
| | | | Originally committed as revision 3161 to svn://svn.ffmpeg.org/ffmpeg/trunk
* * reimplementation using mutexes and condition variables.Roman Shaposhnik2004-05-18
| | | | Originally committed as revision 3138 to svn://svn.ffmpeg.org/ffmpeg/trunk
* count > thread_count for execute()Michael Niedermayer2004-03-03
| | | | Originally committed as revision 2842 to svn://svn.ffmpeg.org/ffmpeg/trunk
* w32threads by (Gildas Bazin <gbazin at altern dot org>)Michael Niedermayer2004-02-19
| | | | Originally committed as revision 2803 to svn://svn.ffmpeg.org/ffmpeg/trunk
* multithreaded/SMP motion estimationMichael Niedermayer2004-02-13
multithreaded/SMP encoding for MPEG1/MPEG2/MPEG4/H263 all pthread specific code is in pthread.c to try it, run configure --enable-pthreads and ffmpeg ... -threads <num> the internal thread API is a simple AVCodecContext.execute() callback which executes a given function pointer with different arguments and returns after finishing all, that way no mutexes or other thread-mess is needed outside pthread.c Originally committed as revision 2772 to svn://svn.ffmpeg.org/ffmpeg/trunk