Commit Graph

14920 Commits

Author SHA1 Message Date
Janne Grunau
b6064d9a59 threads: set thread_count to 1 when thread support is disabled 2012-01-01 14:37:38 +01:00
Janne Grunau
b4d44a45f9 threads: introduce CODEC_CAP_AUTO_THREADS and add it to libx264
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.
2012-01-01 14:37:37 +01:00
Ronald S. Bultje
464f26889c mpegaudiodec: fix seeking.
The safe bitstream reader does not allow using skip_bits_long() to seek to a
point before the start of the buffer, which was needed by the mp3 decoder.
This change instead calculates the start point of the first valid granule and
skips to that position.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2011-12-31 14:19:09 -05:00
Justin Ruggles
481a7ff5bd mpegaudiodec: fix compilation when testing the unchecked bitstream reader 2011-12-31 14:19:09 -05:00
Janne Grunau
bcc7396065 threads: add sysconf based number of CPUs detection
Can act as fallback and should work on a couple of Unix systems.
2011-12-31 17:40:12 +01:00
Janne Grunau
937ff3a18a threads: always include necessary headers for number of CPUs detection
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.
2011-12-31 17:40:12 +01:00
Janne Grunau
e4e30256f8 threads: default to automatic thread count detection 2011-12-31 17:40:12 +01:00
Shitiz Garg
c3513477bb cook: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-12-31 01:04:09 +01:00
Diego Biurrun
d4b63054d9 cosmetics: Drop unnecessary parentheses around return values. 2011-12-30 22:18:07 +01:00
Diego Biurrun
ca5ab8cd21 libvorbis: K&R reformatting cosmetics 2011-12-29 23:30:20 +01:00
Aneesh Dogra
c4db344664 libmp3lame: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-12-29 23:30:20 +01:00
Aneesh Dogra
9342ecf02e mpegvideo_enc: K&R cosmetics (line 1000-2000).
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-29 13:52:04 -08:00
Kostya Shishkov
1fbd3d30ae indeo4: remove two unused variables 2011-12-29 17:42:31 +01:00
Thad Ward
7af507ea99 lagarith: add decode support for arith rgb24 mode
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-12-29 07:37:33 +01:00
Michael Niedermayer
8f5216905f v410dec: Check for sufficient input data. Fixes crash
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-28 12:47:36 -08:00
Kostya Shishkov
adfe0c942e Indeo 4 decoder
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2011-12-28 15:22:18 +01:00
Aneesh Dogra
bd96be6e27 mpegvideo_enc: K&R cosmetics
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-27 10:20:20 -08:00
Janne Grunau
06bb590558 threads: test for sys/param.h and include it for sysctl on OpenBSD 2011-12-27 16:09:41 +01:00
Martin Storsjö
676a9ee1d2 x86: Fix constraints for decode_significance*_x86
Originally, prior to 8742a4ff8, the caller code was compiled
within this condition:

ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE && !defined(BROKEN_RELOCATIONS)

Since HAVE_7REGS is defined as
(ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE))
the subcondition HAVE_7REGS && HAVE_EBX_AVAILABLE is equal
to HAVE_7REGS (for 32 bit at least). The correct simplification
of the original condition thus is HAVE_7REGS, not
HAVE_EBX_AVAILABLE.

This fixes compilation in some cases where HAVE_EBP_AVAILABLE = 0
and HAVE_EBX_AVAILABLE = 1.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-27 09:05:14 +02:00
Anton Khirnov
80dc7c0160 avs: call release_buffer() at the end.
Fixes a memleak.
2011-12-25 20:50:20 +01:00
Anton Khirnov
06e8d38f2b Add minor bumps and APIchanges entries for lavc/lavfi changes. 2011-12-25 20:50:16 +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
Stefano Sabatini
8a4a5f6ff7 lavc: add format field to AVFrame
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.
2011-12-25 16:18:57 +01:00
Stefano Sabatini
3a2ddf7c2c lavc: add width and height fields to AVFrame
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.
2011-12-25 16:18:57 +01:00
Stefano Sabatini
b58dbb5b03 lavc: add a sample_aspect_ratio field to AVFrame
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.
2011-12-25 16:18:57 +01:00
Reinhard Tartler
8b94df0f20 vp3dec: Check coefficient index in vp3_dequant()
Based on a patch by Michael Niedermayer <michaelni@gmx.at>

Fixes NGS00145, CVE-2011-4352

Found-by: Phillip Langlois
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-12-23 15:42:24 +01:00
Michael Niedermayer
6e24b9488e svq1dec: call avcodec_set_dimensions() after dimensions changed.
Fixes NGS00148, CVE-2011-4579

Found-by: Phillip Langlois
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-23 15:42:24 +01:00
Janne Grunau
7052618c7e threads: check defines before using them in automatic thread detection 2011-12-23 14:41:03 +01:00
Janne Grunau
846dca1aa3 pthread: include sys/types.h before sys/sysctl.h
Fixes compilation on FreeBSD with clang 3.
2011-12-23 14:40:39 +01:00
Anton Khirnov
d09298f0d6 4xm: remove unused variables. 2011-12-23 09:23:20 +01:00
Alexander Strange
bc6a3bd4a5 h264: Fix a possible overread in decode_nal_units()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-12-23 08:32:18 +01:00
Sergey Radionov
01eb9805f3 w32thread: call ResetEvent() in pthread_cond_broadcast().
Also add "volatile" to broadcast flag (since it is used from
multiple threads).

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-22 19:48:52 -08:00
Gaurav Narula
ad3161ec1d kvmc: fix invalid reads
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-12-23 00:11:19 +01:00
Shitiz Garg
355d917c0b 4xm: Add a check in decode_i_frame to prevent buffer overreads
Fixes bugzilla #135

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-12-22 23:26:55 +01:00
Paul B Mahol
01a01bf8bd adpcm: fix IMA SMJPEG decoding
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-12-22 23:04:30 +01:00
Janne Grunau
c32e4029d9 options: set minimum for "threads" to zero
A negative number of threads does not make sense and 0 is used for
autodetection. Adds a symbolic name for autodetection.
2011-12-22 21:50:07 +01:00
Janne Grunau
b9e2226972 bsd: use number of logical CPUs as automatic thread count 2011-12-22 21:50:07 +01:00
Janne Grunau
ad29ecbff0 windows: use number of CPUs as automatic thread count 2011-12-22 21:50:07 +01:00
Janne Grunau
ea4d5f4837 linux: use number of CPUs as automatic thread count
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.
2011-12-22 21:50:07 +01:00
Janne Grunau
f77f640b30 pthreads: reset active_thread_type when slice thread_init returrns early 2011-12-22 21:50:07 +01:00
Paul B. Mahol
fede015468 v410dec: include correct headers
This file does not use anything from get_bits.h but needs
intreadwrite.h.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-12-22 19:22:48 +01:00
Diego Biurrun
aaf47bcde7 Drop ALT_ prefix from BITSTREAM_READER_LE name.
The prefix is a historic remnant that probably meant "alternative".
Now that the A32 bitstream reader has been dropped it makes no sense anymore.
2011-12-22 16:51:23 +01:00
Justin Ruggles
9a3f10695a ra144enc: zero the reflection coeffs if the filter is unstable
fixes use of uninitialized values if the filter is still unstable after using
the previous frame lpc coefficients.
2011-12-22 08:31:07 -05:00
Alex Converse
4bf3c8f226 mov: Don't stick the QuickTime field ordering atom in extradata.
The 'fiel' atoms can be found in H.264 tracks clobbering the extradata.
MJPEG supports non field based extradata, and this data should be
preserved when copying.
2011-12-21 22:04:37 -08:00
Justin Ruggles
f264d336fe truespeech: fix invalid reads in truespeech_apply_twopoint_filter()
fixes Bug 171
2011-12-21 18:13:06 -05:00
Martin Storsjö
ce94948198 nellymoserdec: Indicate that the decoder can handle changed parameters
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-21 22:52:44 +02:00
Martin Storsjö
f13db94d0a libavcodec: Apply parameter change side data when decoding audio
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-21 22:52:42 +02:00
Martin Storsjö
fe75dc8583 libavcodec: Define a side data type for parameter changes
Also define a codec capability for codecs that can handle
parameters changed externally between decoded packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-21 22:52:39 +02:00
Martin Storsjö
132846b0c8 aacdec: Handle new extradata passed as side data
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-21 22:52:39 +02:00
Martin Storsjö
195c123cc8 libavcodec: Define a side data type for new extradata
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-21 22:52:36 +02:00