aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pthread.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | threads: move state update after progress cleanup.Michael Niedermayer2012-02-121-2/+2
| | | | | | | | | | | | This order is more logic and might prevent a race. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pthreads: Generic progress lubrication support.Michael Niedermayer2012-01-231-0/+7
| | | | | | | | | | | | Fixes bug118, bug120 and bug125 at least Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pthreads: reset got_frames on flush.Michael Niedermayer2012-01-231-0/+1
| | | | | | | | | | | | | | This fixes memory corruption when seeking in broken streams. a random mpeg4 in nut file was used to debug. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pthread: Change a signal to a broadcast as multiple threadsMichael Niedermayer2012-01-221-1/+1
| | | | | | | | | | | | have been seen waiting and deadlocking on it in bug125. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-211-3/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtpdec: Use our own SSRC in the SDES field when sending RRs Finalize changelog for 0.8 Release Prepare for 0.8 Release threads: change the default for threads back to 1 threads: update slice_count and slice_offset from user context aviocat: Remove useless includes doc/APIChanges: fill in missing dates and hashes Revert "avserver: fix build after the next bump." mpegaudiodec: switch error detection check to AV_EF_BUFFER lavf: rename fer option and document resulting (f_)err_detect options lavc: rename err_filter option to err_detect and document it mpegvideo: fix invalid memory access for small video dimensions movenc: Reorder entries in the MOVIentry struct, for tigheter packing rtsp: Remove extern declarations for variables that don't exist aviocat: Flush the output before closing Conflicts: Changelog RELEASE libavcodec/mpegaudiodec.c libavcodec/pthread.c libavformat/options.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * threads: update slice_count and slice_offset from user contextJanne Grunau2012-01-211-3/+21
| | | | | | | | | | They are used to signal the number of slices and offsets of each slice out of band to the decoder.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-081-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (29 commits) cabac: Move code only used within the CABAC test program into the test program. vp56: Drop unnecessary cabac.h #include. h264-test: Initialize AVCodecContext.av_class. build: Skip compiling network.h and rtsp.h if networking is not enabled. cosmetics: drop some pointless parentheses Disable annoying warning without changing behavior faq: Solutions for common problems with sample paths when running FATE. avcodec: attempt to clarify the CODEC_CAP_DELAY documentation avcodec: fix avcodec_encode_audio() documentation. FATE: xmv-demux test; exercise the XMV demuxer without decoding the perceptual codecs inside. vqf: recognize more metadata chunks FATE test: BMV demuxer and associated video and audio decoders. FATE: indeo4 video decoder test. FATE: update xxan-wc4 test to a sample with more code coverage. Change the recent h264_mp4toannexb bitstream filter test to output to an elementary stream rather than a program stream. g722enc: validate AVCodecContext.trellis g722enc: set frame_size, and also handle an odd number of input samples g722enc: split encoding into separate functions for trellis vs. no trellis mpegaudiodec: Use clearer pointer math tta: Fix returned error code at EOF ... Conflicts: libavcodec/h264.c libavcodec/indeo3.c libavcodec/interplayvideo.c libavcodec/ivi_common.c libavcodec/libxvidff.c libavcodec/mpegvideo.c libavcodec/ppc/mpegvideo_altivec.c libavcodec/tta.c libavcodec/utils.c libavfilter/vsrc_buffer.c libavformat/Makefile tests/fate/indeo.mak tests/ref/acodec/g722 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: drop some pointless parenthesesDiego Biurrun2012-01-071-1/+1
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-041-5/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: fate: add dxtory test adx_parser: rewrite. adxdec: Validate channel count to fix a division by zero. adxdec: Do not require extradata. cmdutils: K&R reformatting cosmetics alacdec: implement the 2-pass prediction type. alacenc: implement the 2-pass prediction type. alacenc: do not generate invalid multi-channel ALAC files alacdec: fill in missing or guessed info about the extradata format. utvideo: proper median prediction for interlaced videos lavu: bump lavu minor for av_popcount64 dca: K&R formatting cosmetics dct: K&R formatting cosmetics lavf: flush decoders in avformat_find_stream_info(). win32: detect number of CPUs using affinity Add av_popcount64 snow: Restore three mistakenly removed casts. Conflicts: cmdutils.c doc/APIchanges libavcodec/adx_parser.c libavcodec/adxdec.c libavcodec/alacenc.c libavutil/avutil.h tests/fate/screen.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * win32: detect number of CPUs using affinityDaniel Verkamp2012-01-031-5/+6
| | | | | | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-021-5/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avconv: make -frames work for all types of streams, not just video. bfi: K&R cosmetics bgmc: K&R cleanup rawdec: Set start_time to 0 for raw audio files. Detect 'yuv2' as rawvideo also in avi. rawdec: propagate pict_type information to the output frame rawdec: Support more QT 1bpp rawvideo files. avconv: free bitstream filters threads: limit the number of automatic threads to MAX_AUTO_THREADS avplay: K&R cleanup fate: use rgb24 as output format for dfa tests threads: set thread_count to 1 when thread support is disabled threads: introduce CODEC_CAP_AUTO_THREADS and add it to libx264 Conflicts: ffplay.c libavcodec/avcodec.h libavcodec/pthread.c libavcodec/version.h tests/ref/fate/dfa1 tests/ref/fate/dfa10 tests/ref/fate/dfa11 tests/ref/fate/dfa2 tests/ref/fate/dfa3 tests/ref/fate/dfa4 tests/ref/fate/dfa5 tests/ref/fate/dfa6 tests/ref/fate/dfa7 tests/ref/fate/dfa8 tests/ref/fate/dfa9 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * threads: limit the number of automatic threads to MAX_AUTO_THREADSJanne Grunau2012-01-011-5/+9
| | | | | | | | | | | | The extra thread added in {frame_}*thread_init was not taken into account. Explicitly sets thread_count to 1 if only one CPU core was detected. Also fixes two typos in comments.
| * threads: introduce CODEC_CAP_AUTO_THREADS and add it to libx264Janne Grunau2012-01-011-0/+3
| | | | | | | | | | | | Some external codecs have their own code to determine the best number of threads. This number is not necessary the number of cpu cores. Thread_count will be only 0 if the codec has CODEC_CAP_AUTO_THREADS.
* | pthread: dont autoenable frame threads with visualizationMichael Niedermayer2012-01-011-0/+2
| | | | | | | | | | | | This combination doesnt work Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pthread: Limit automatic threads to mb_height.Michael Niedermayer2012-01-011-0/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-011-2/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: FATE: add tests for dfa mpegaudiodec: fix seeking. mpegaudiodec: fix compilation when testing the unchecked bitstream reader threads: add sysconf based number of CPUs detection threads: always include necessary headers for number of CPUs detection threads: default to automatic thread count detection Changelog: restore version <next> header cook: K&R formatting cosmetics Conflicts: Changelog libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * threads: add sysconf based number of CPUs detectionJanne Grunau2011-12-311-0/+7
| | | | | | | | Can act as fallback and should work on a couple of Unix systems.
| * threads: always include necessary headers for number of CPUs detectionJanne Grunau2011-12-311-2/+4
| | | | | | | | | | | | Since the conditions for the actual usage are more specific a less preferred method can be used. This would cause compilation errors because necessary headers are not included.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-281-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpegvideo_enc: K&R cosmetics doxygen: remove unreplaced variables from custom header and footer threads: test for sys/param.h and include it for sysctl on OpenBSD v4l2: remove unneded linux specific asm/types.h include x86: Fix constraints for decode_significance*_x86 Conflicts: libavcodec/mpegvideo_enc.c libavdevice/v4l2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * threads: test for sys/param.h and include it for sysctl on OpenBSDJanne Grunau2011-12-271-0/+3
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-261-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avs: call release_buffer() at the end. Add minor bumps and APIchanges entries for lavc/lavfi changes. mpegvideo.c: K&R formatting and cosmetics. avconv: avoid memcpy in vsrc_buffer when possible. avconv: implement get_buffer()/release_buffer(). lavfi: add a new function av_buffersrc_buffer(). lavfi: add avfilter_copy_frame_props() lavc: add format field to AVFrame lavc: add width and height fields to AVFrame lavc: add a sample_aspect_ratio field to AVFrame doxy: add website-alike style to the html output FAQ: add an entry for common error when using -profile Conflicts: avconv.c cmdutils.c doc/APIchanges libavcodec/avcodec.h libavcodec/mpegvideo.c libavcodec/utils.c libavcodec/version.h libavfilter/Makefile libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/src_movie.c libavfilter/vsrc_buffer.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: add format field to AVFrameStefano Sabatini2011-12-251-0/+1
| | | | | | | | | | | | The format is a per-frame property, having it in AVFrame simplify the operation of extraction of that information, since avoids the need to access the codec/stream context.
| * lavc: add width and height fields to AVFrameStefano Sabatini2011-12-251-0/+2
| | | | | | | | | | | | width and height are per-frame properties, setting these values in AVFrame simplify the operation of extraction of that information, since avoids the need to check the codec/stream context.
| * lavc: add a sample_aspect_ratio field to AVFrameStefano Sabatini2011-12-251-0/+1
| | | | | | | | | | | | | | The sample aspect ratio is a per-frame property, so it makes sense to define it in AVFrame rather than in the codec/stream context. Simplify application-level sample aspect ratio information extraction, and allow further simplifications.
| * threads: check defines before using them in automatic thread detectionJanne Grunau2011-12-231-2/+2
| |
| * pthread: include sys/types.h before sys/sysctl.hJanne Grunau2011-12-231-1/+1
| | | | | | | | Fixes compilation on FreeBSD with clang 3.
* | pthread: sysctl.h needs param.h on openbsdMichael Niedermayer2011-12-231-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | threads: check defines before using them in automatic thread detectionJanne Grunau2011-12-231-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pthread: include sys/types.h before sys/sysctl.hJanne Grunau2011-12-231-1/+1
| | | | | | | | | | | | Fixes compilation on FreeBSD with clang 3. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-231-1/+62
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: build: fix standalone compilation of OMA muxer build: fix standalone compilation of Microsoft XMV demuxer build: fix standalone compilation of Core Audio Format demuxer kvmc: fix invalid reads 4xm: Add a check in decode_i_frame to prevent buffer overreads adpcm: fix IMA SMJPEG decoding options: set minimum for "threads" to zero bsd: use number of logical CPUs as automatic thread count windows: use number of CPUs as automatic thread count linux: use number of CPUs as automatic thread count pthreads: reset active_thread_type when slice thread_init returrns early v410dec: include correct headers Drop ALT_ prefix from BITSTREAM_READER_LE name. lavfi: always build vsrc_buffer. ra144enc: zero the reflection coeffs if the filter is unstable sws: readd PAL8 to isPacked() mov: Don't stick the QuickTime field ordering atom in extradata. truespeech: fix invalid reads in truespeech_apply_twopoint_filter() Conflicts: configure libavcodec/4xm.c libavcodec/avcodec.h libavfilter/Makefile libavfilter/allfilters.c libavformat/Makefile libswscale/swscale_internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bsd: use number of logical CPUs as automatic thread countJanne Grunau2011-12-221-0/+10
| |
| * windows: use number of CPUs as automatic thread countJanne Grunau2011-12-221-0/+6
| |
| * linux: use number of CPUs as automatic thread countJanne Grunau2011-12-221-0/+43
| | | | | | | | | | | | Use sched_getaffinity to determine the number of logical CPUs. Limits the number of threads to 16 since slice threading of H.264 seems to be buggy with more than 16 threads.
| * pthreads: reset active_thread_type when slice thread_init returrns earlyJanne Grunau2011-12-221-1/+3
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-191-7/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: APIchanges: fill in revision for AVFrame.age deprecation avcodec: deprecate AVFrame.age 4xm: remove unneeded check for remaining unused data. lavf: force threads to 1 in avformat_find_stream_info() swscale: fix overflows in vertical scaling at top/bottom edges. lavf: add OpenMG audio muxer. omadec: split data that will be used in the muxer to a separate file. lavf: rename oma.c -> omadec.c tmv decoder: set correct pix_fmt Conflicts: Changelog doc/APIchanges libavcodec/mpegvideo.c libavcodec/version.h libavformat/oma.c libavformat/version.h libswscale/swscale.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: deprecate AVFrame.ageMans Rullgard2011-12-181-7/+0
| | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: doxygen: misc consistency, spelling and wording fixes vcr1: drop unnecessary emms_c() calls without MMX code Replace all uses of av_close_input_file() with avformat_close_input(). lavf: add avformat_close_input(). lavf: deprecate av_close_input_stream(). lavf doxy: add some basic demuxing documentation. lavf doxy: add some general lavf information. lavf doxy: add misc utility functions to a group. lavf doxy: add av_guess_codec/format to the encoding group. lavf doxy: add core functions to a doxy group. Add basic libavdevice documentation. lavc: convert error_recognition to err_recognition. avconv: update -map option help text x86: Require 7 registers for the cabac asm x86: bswap: remove test for bswap instruction bswap: make generic implementation more compiler-friendly h264: remove useless cast proresdec: fix decode_slice() prototype Conflicts: configure doc/APIchanges ffprobe.c libavcodec/avcodec.h libavcodec/celp_math.h libavcodec/h264.c libavfilter/src_movie.c libavformat/anm.c libavformat/avformat.h libavformat/version.h libavutil/avstring.h libavutil/bswap.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * doxygen: misc consistency, spelling and wording fixesDiego Biurrun2011-12-121-1/+1
| |
* | pthread: fixed thread initialization issues related to thread-safe buffer ↵Anatoliy Wasserman2011-12-081-2/+4
| | | | | | | | | | | | | | allocator Signed-off-by: Anatoliy Wasserman <anatoliy.wasserman@yandex.ru> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-301-2/+1
|\| | | | | | | | | | | | | | | | | | | | | | | * qatar/master: indeo3: check per-plane data buffer against input buffer bounds. avconv: Handle audio sync for non-S16 sample formats. pthread: don't increment index on zero-sized packets. Conflicts: libavcodec/indeo3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pthread: don't increment index on zero-sized packets.Aaron Colwell2011-11-281-2/+1
| | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-281-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: vc1: use an enum for Frame Coding Mode doc: cleanup filter section indeo3: error out if no motion vector is set. x86inc: Flag shufps as an floating-point instruction for the AVX emulation code. mpegaudio: do not use init_static_data() for initializing tables. musepack: fix signed shift overflow in mpc_read_packet() mov: Make format string match variable type. wmavoice: Make format string match variable type. vc1: select interlaced scan table by FCM element Generalize RIFF INFO tag support; support reading INFO tag in wav pthread: track thread existence in a separate variable. Conflicts: doc/filters.texi libavcodec/pthread.c libavformat/avi.c libavformat/riff.c libavformat/riff.h libavformat/wav.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pthread: track thread existence in a separate variable.Cheng Sun2011-11-261-2/+4
| | | | | | | | | | | | | | | | 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>
* | pthread: check pthread_create() return value.Michael Niedermayer2011-11-271-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pthread: next try on freeing threads without crashing.Michael Niedermayer2011-11-271-2/+4
| | | | | | | | | | | | This should fix mingw Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-271-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (42 commits) swscale: fix signed overflow in yuv2mono_X_c_template snow: fix integer overflows svq1enc: remove stale altivec-related hack snow: fix signed overflow in byte to 32-bit replication adx: rename ff_adx_decode_header() to avpriv_adx_decode_header() avformat: add CRI ADX format demuxer adx: add an ADX parser. adx: move header decoding to ADX common code adx: calculate the number of blocks in a packet adx: define and use 2 new macro constants BLOCK_SIZE and BLOCK_SAMPLES adx: check for unsupported ADX formats adx: simplify encoding by using put_sbits() adx: calculate correct LPC coeffs adx: use 12-bit coefficients instead of 14-bit to avoid integer overflow adx: simplify adx_decode() by using get_sbits() to read residual samples adx: fix the data offset parsing in adx_decode_header() adx: remove unneeded post-decode channel interleaving adx: validate header values adx: cosmetics: general pretty-printing and comment clean-up adx: remove useless comments ... Conflicts: Changelog libavcodec/cook.c libavcodec/fraps.c libavcodec/nuv.c libavcodec/pthread.c libavcodec/version.h libavformat/Makefile libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * [PATCH] Fix crash when initializing multi-threaded decoding for corrupted file.Cheng Sun2011-11-261-1/+2
| | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | pthreads: fix segfault due to the thread beimg killed before it has been ↵Michael Niedermayer2011-11-261-1/+2
| | | | | | | | | | | | allocated Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-261-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: swscale: Readd #define _SVID_SOURCE Fix av_get_channel_layout_string() for positions >31 configure: Store vda lib flags in extralibs instead of ldflags Make channel layout masks unsigned dca: ARMv6 optimised decode_blockcode() nullenc: drop AVFMT_RAWPICTURE from the flags frame-mt: return consumed packet size in ff_thread_decode_frame aacdec: add more fate tests covering SBR and PS MK(BE)TAG: avoid undefined shifts Conflicts: configure libavcodec/arm/dca.h libavcodec/dca.c libavcodec/mlp_parser.c libavcodec/version.h libavfilter/asrc_anullsrc.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/defaults.c libavutil/audioconvert.c libavutil/avutil.h libswscale/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * frame-mt: return consumed packet size in ff_thread_decode_frameJanne Grunau2011-11-251-2/+3
| | | | | | | | | | This is required to fulfill avcodec_decode_video2() promise to return the number of consumed bytes on success.