Commit Graph

15201 Commits

Author SHA1 Message Date
Christophe GISQUET
3eeb755763 rv34: Inter/intra MB code split
Split inter/intra macroblock handling code. This will allow further
optimizations such as performing inverse transform and block reconstruction
in a single pass as well as specialize code.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-16 00:41:51 +01:00
Reinhard Tartler
e2ff436ef6 lavc: Relax API strictness in avcodec_decode_audio3 with a custom get_buffer()
Do not fail audio decoding with avcodec_decode_audio3 if user has set a
custom get_buffer. Strictly speaking, this was never allowed by the API,
but it seems that some software packages did so anyways. In order to
unbreak applications (cf. http://bugs.debian.org/655890), this change
clarifies the API and overrides the custom get_buffer() with the defaults.

This change is inspired by a similar
commit (c3846e3eba) in FFmpeg.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-15 21:40:59 +01:00
Kostya Shishkov
e6e7bfc11e wavpack: fix clipping for 32-bit lossy mode
Reference decoder clips data before shifting it to final range and also
forces 32-bit lossy mode to be actually 24-bit lossy mode in order to be
able to perform proper clipping.
2012-01-15 15:27:55 +01:00
Laurentiu Ion
4fccc7c46c vb: Use bytestream2 functions
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-01-14 22:12:53 -05:00
Aneesh Dogra
4cd0bdae9a sgidec: Use bytestream2 functions to prevent buffer overreads.
The patch also adds several bytestream macros to deal with native endian.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-01-14 12:35:53 -05:00
Diego Biurrun
e44c11e9fa cosmetics: Move static and inline attributes to more standard places.
Fixes several "‘static’ is not at beginning of declaration" warnings.
2012-01-14 17:32:36 +01:00
Martin Storsjö
57facb73ab libx264: Don't leave max_b_frames as -1 if the user didn't set it
max_b_frames is initialized to -1 for libx264, to allow
distinguishing between an explicit user set 0 and a default not
touched 0 (see bb73cda2).

If max_b_frames is left as -1, this affects dts generation (where
expressions like max_b_frames != 0 are used), so make sure it is
left at the default 0 after the libx264 init function returns.

This avoids unnecessarily producing dts != pts when using
profile=baseline.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-14 02:08:42 +02:00
Justin Ruggles
faaebcdf6b targa: add support for rgb555 palette 2012-01-13 17:11:41 -05:00
Mans Rullgard
71b3a63e9c ARM: fix Thumb-mode simple_idct_arm
The alignment directive must obviously precede the label.
This was never noticed in ARM mode since the location is
already aligned there.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-01-13 19:09:59 +00:00
Mans Rullgard
5c5e1ea3cd ARM: 4-byte align start of all asm functions
Due to apprent bugs in the GNU assembler and/or linker, relocations
can be incorrectly processed if the alignment of a Thumb instruction
is changed in the output file compared to the input object.

This fixes crashes in h264 decoding with Thumb enabled. No effect in
ARM mode since everything is 4-byte aligned there.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-01-13 19:09:59 +00:00
Diego Biurrun
55b9ef18e4 cabac: split cabac.h into declarations and function definitions
This fixes standalone compilation of some decoders with --disable-optimizations.
cabac.h defines some inline functions that use symbols from cabac.c.  Without
optimizations these inline functions are not eliminated and linking fails with
references to non-existing symbols.

Splitting the inline functions off into their own header and only #including
it in the places where the inline functions are used allows #including cabac.h
from anywhere without ill effects.
2012-01-12 23:08:23 +01:00
Diego Biurrun
0a60780c7f cabac: Mark ff_h264_mps_state array as static, it is only used within cabac.c. 2012-01-12 22:57:42 +01:00
Diego Biurrun
64d779f2f7 cabac: Remove ff_h264_lps_state array.
It was only ever used in the cabac test program, but never initialized.
2012-01-12 22:54:24 +01:00
Alex Converse
4df30f7114 utils: Check for extradata size overflows. 2012-01-12 13:26:13 -08:00
Mans Rullgard
81dc6a2a3c ARM: rv34: fix asm syntax in dc transform functions
Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-12 22:11:13 +01:00
Janne Grunau
3547f8e8f8 rv34: fix and optimise frame dependency checking
The sporadic threading errors during fate-rv30 were caused by calling
ff_thread_await_progress with mb row -1 as argument. That returns
immediately since progress is initialized to -1. Not yet computed
motion vectors from the reference could be used for the first
macroblocks.
2012-01-12 18:38:08 +01:00
Janne Grunau
e1e369049e rv34: NEON optimised dc only inverse transform
30-50% faster than the C implementation, 0.5% overall speedup on
bourne.rmvb.
2012-01-12 18:33:55 +01:00
Anton Khirnov
f3d02a8b28 lavc: replace some remaining FF_I_TYPE with AV_PICTURE_TYPE_I 2012-01-12 18:18:23 +01:00
Anton Khirnov
a29c25a9b2 lavc: ifdef out parse_only AVOption 2012-01-12 18:18:23 +01:00
Anton Khirnov
d54f1e6407 nellymoserdec: SAMPLE_FMT -> AV_SAMPLE_FMT 2012-01-12 18:18:23 +01:00
Anton Khirnov
0c71cc6526 mpegvideo_enc: ifdef out/replace references to deprecated codec flags. 2012-01-12 18:18:22 +01:00
Kostya Shishkov
08bab32cf1 indeo4: add some missing static and const qualifiers
From the patch by Reimar Döffinger.
2012-01-12 13:54:41 +01:00
Christophe GISQUET
3faa303a47 rv34: DC-only inverse transform
When decoding coefficients, detect whether the block is DC-only, and take
advantage of this knowledge to perform DC-only inverse transform.

This is achieved by:
- first, changing the 108x4 element modulo_three_table into a 108 element
  table (kind of base4), and accessing each value using mask and shifts.
- then, checking low bits for 0 (as they represent the presence of higher
  frequency coefficients)

Also provide x86 SIMD code for the DC-only inverse transform.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-01-12 09:52:33 +01:00
Alex Converse
b5fc571e4f latmdec: Check AudioSpecificConfig length before decoding extradata.
This is different than a normal get_bits() over read because
decode_audio_specific_config() creates its own GetBitContext.

Fixes Bug 170.
2012-01-11 14:40:47 -08:00
Henrik Gramner
e7d02b04dc fft: init functions with INIT_XMM/YMM.
This is required to handle clobbering of XMM registers on Win64
correctly. Fixes FFT and all tests depending on FFT on Win64.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-11 20:12:26 +01:00
Justin Ruggles
56f22b7e16 pcmenc: set frame_size to 0.
This indicates that the actual frame size is based on the buf_size passed to
avcodec_encode_audio().
2012-01-11 09:09:56 -05:00
Justin Ruggles
82390f57d1 avcodec: add GSM parser
The WAVE demuxer returns packets with many blocks per frame, which needs to be
parsed into single blocks. This has a side-effect of fixing the timestamps.
2012-01-11 08:56:24 -05:00
Diego Biurrun
5ea20630b4 Fix a bunch of platform name and other typos. 2012-01-11 13:48:30 +01:00
Janne Grunau
f6a152db11 threads: add CODEC_CAP_AUTO_THREADS for libvpx and xavs 2012-01-11 00:23:07 +01:00
Janne Grunau
9472d37d8e rv34: frame-level multi-threading
Statistics for bourne.rmvb -an -f null

1 thread:  37.12s user 0.03s system  99% cpu 37.174 total
2 threads: 47.63s user 0.24s system 185% cpu 25.807 total
4 threads: 41.21s user 0.30s system 327% cpu 12.674 total
2012-01-10 22:51:56 +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
Alex Converse
17ce52912f aacsbr: prevent out of bounds memcpy().
Fixes Libav Bug 195.

This doesn't make the code handle sample rate or upsample/downsample
change properly but this is still a good sanity check.

Based on change by Michael Niedermayer.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
2012-01-10 13:13:34 -08:00
Aneesh Dogra
29112db8c0 bethsoftvideo: Use bytestream2 functions to prevent buffer overreads.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-10 10:34:16 -08:00
Paul B Mahol
84e5159e25 bmpenc: support for PIX_FMT_RGB444
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-10 09:29:22 -08:00
Janne Grunau
e652cc9606 rv34: use get_bits_left()
It is not necessary to store the bit stream length in a RV34DecContext
field.
2012-01-10 16:58:53 +01:00
Paul B Mahol
353a2d2164 bmpdec: support for rgb444 with bitfields compression
Do not display garbage for invalid/unsupported bitfields values.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-10 05:58:19 -08:00
Laurentiu Ion
da2e774fd6 kmvc: Use bytestream2 functions to prevent buffer overreads.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-09 17:26:33 -08:00
Alex Converse
9de3cbc182 aacps: Add missing newline in error message. 2012-01-09 11:06:14 -08:00
Alex Converse
4acd43a295 aacdec: Turn off PS for multichannel files that use PCE based configs.
Fixes al_sbr_cm_48_5.1.mp4.
2012-01-09 11:04:05 -08:00
Diego Biurrun
1ef8ff4534 cabac: remove put_cabac_u/ueg from cabac-test.
The functions are not used in any part of Libav, therefore testing them in the
cabac-test is unnecessary. Since this makes them unused, remove the functions.
2012-01-09 14:10:41 +01:00
Vitor Sessak
39df0c434c mpegaudiodec: optimized iMDCT transform
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 17:40:55 -08:00
Vitor Sessak
06677d0dd9 mpegaudiodec: change imdct window arrangment for better pointer alignment
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 17:37:23 -08:00
Vitor Sessak
6dfcf53092 mpegaudiodec: move imdct and windowing function to mpegaudiodsp
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 17:37:07 -08:00
Vitor Sessak
421c99a4a7 mpegaudiodec: interleave iMDCT buffer to simplify future SIMD implementations
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 17:37:03 -08:00
Daniel Huang
8549cf073b mjpegdec: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-08 23:33:00 +01:00
Aneesh Dogra
ccc27e2139 bfi: Use bytestream2 functions to prevent buffer overreads.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 13:26:54 -08:00
Laurentiu Ion
529a25d6e5 dpcm: Fix invalid writes
Fixes bug: #152

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 13:13:11 -08:00
Aneesh Dogra
12e984aed7 utvideo: frame multithreading.
>> time ./avconv -i file.avi -f null -
Before : real	0m7.784s
After  : real   0m3.662s

Tested on a Intel Core i3 Processor (2 cores, 4 threads).

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-08 12:21:10 -08:00
Chris Evans
afb2aa5379 vorbis: An additional defense in the Vorbis codec.
Fixes Bug: #190
Chromium Bug: #100543
Related to CVE-2011-3893

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-08 09:09:26 +01:00
Reinhard Tartler
e6d527ff72 vorbisdec: Fix decoding bug with channel handling
Fixes Bug: #191
Chromium Bug: #101458
CVE-2011-3895

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-07 23:16:52 +01:00
Diego Biurrun
badb195d13 cabac: Move code only used within the CABAC test program into the test program. 2012-01-07 22:13:14 +01:00
Diego Biurrun
1be4b8ccba vp56: Drop unnecessary cabac.h #include. 2012-01-07 22:13:12 +01:00
Diego Biurrun
a7e3cb9d32 h264-test: Initialize AVCodecContext.av_class.
This fixes a segfault on startup.

Also remove a commented-out and completely unused variable.
2012-01-07 22:13:10 +01:00
Diego Biurrun
3dc99a18d4 cosmetics: drop some pointless parentheses 2012-01-07 22:13:07 +01:00
Justin Ruggles
3f6aa85ed4 avcodec: attempt to clarify the CODEC_CAP_DELAY documentation 2012-01-07 14:33:16 -05:00
Justin Ruggles
07837e4158 avcodec: fix avcodec_encode_audio() documentation.
the previous documentation indicated how many bytes are read from the input,
not how many samples are read.
2012-01-07 14:33:15 -05:00
Justin Ruggles
cf1a259ad6 g722enc: validate AVCodecContext.trellis 2012-01-07 13:38:23 -05:00
Justin Ruggles
77c5b66cbe g722enc: set frame_size, and also handle an odd number of input samples
The fate reference is updated because the previous test skipped a sample in
each encode() call due each input frame having an odd number of samples.
2012-01-07 13:38:23 -05:00
Justin Ruggles
34093ba081 g722enc: split encoding into separate functions for trellis vs. no trellis 2012-01-07 13:38:23 -05:00
Vitor Sessak
96219141e2 mpegaudiodec: Use clearer pointer math
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-07 08:23:27 -08:00
Justin Ruggles
52e9854a83 tta: fix 24-bit decoding.
Decode to the correct output buffer.
2012-01-07 09:44:13 -05:00
Paul B Mahol
17aa02b9a1 interplayvideo: Handle changed video dimensions on the fly
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-07 15:25:38 +02:00
Martin Storsjö
c5d907b6b0 libavcodec: Handle param change side data in avcodec_decode_video2, too
Also call avcodec_set_dimensions on dimension param change packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-07 15:25:35 +02:00
Martin Storsjö
867f923df4 libavcodec: Move apply_param_change up above avcodec_decode_video2
This is in preparation to calling it from avcodec_decode_video2.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-07 15:25:30 +02:00
Janne Grunau
be540e0cb3 indeo3: check motion vectors for validity
Fixes null pointer dereferences in fuzzed files found by Oana Stratulat.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-07 09:41:11 +01:00
Michael Niedermayer
b18a0cc781 indeo5: Fix null pointer dereference.
Bug found by: Oana Stratulat

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-07 00:18:42 +01:00
Laurentiu Ion
b348c852aa flicvideo: fix invalid reads
Prevent invalid reads using bytestream2 functions.
Fixes bug #126.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-01-06 16:48:27 -05:00
Chris Evans
57cd6d7095 vorbis: Avoid some out-of-bounds reads
Fixes Bug: #190
Chromium Bug: #100543
Related to CVE-2011-3893

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-01-06 19:58:22 +01:00
Diego Biurrun
3aa3fc45fe cabac: remove unused function renorm_cabac_decoder 2012-01-06 13:37:55 +01:00
Diego Biurrun
301fb92131 h264: Only use symbols from the SVQ3 decoder under proper conditionals.
Fixes --disable-everything --enable-decoder=h264 --disable-optimizations.
2012-01-06 13:37:53 +01:00
Justin Ruggles
6e8bf6db48 add bytestream2_tell() and bytestream2_seek() functions 2012-01-05 23:36:36 -05:00
Janne Grunau
f907615f08 parsers: initialize MpegEncContext.slice_context_count to 1
The mpeg4 video, H264 and VC-1 parser hold (directly or indirectly)
a MpegEncContext in their private context. Since they do not call the
common mpegvideo init function slice_context_count has explicitly set
to 1.
Prevents a null pointer dereference in the h264 parser and fixes
bug 193.
2012-01-06 01:47:45 +01:00
Janne Grunau
696ace50ea truemotion2: check size before GetBitContext initialisation
Prevents null ptr derefence for negative sizes.
2012-01-05 23:19:13 +01:00
Janne Grunau
bb5b3940b0 adpcm: ADPCM Electronic Arts has always two channels 2012-01-05 22:29:18 +01:00
Aneesh Dogra
9b55b4bb3a 4xm: Prevent buffer overreads.
4xm decoder while decoding i2 frames can overread the buffer if proper checks
are not made.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-05 09:37:16 -08:00
Janne Grunau
e268a352af mjpegdec: parse RSTn to prevent skipping other data in mjpeg_decode_scan
Check explicitly if enough bits are left to prevent an infinite loop
when the bitstream buffer is not followed by zero-padding.

Based on patches by Michael Niedermayer <michaelni@gmx.at>.
2012-01-05 18:20:35 +01:00
Janne Grunau
9b4767e478 vp3: fix streams with non-zero last coefficient
Fixes a regression introduced in 8b94df0f20.
2012-01-05 18:18:08 +01:00
Oana Stratulat
7f09791d28 Report an error if pitch_lag is zero in AMR-NB decoder.
This fixes an infinite loop in the decoder on specially
crafted files, and fixes bug 151.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-04 21:33:14 -08:00
Ronald S. Bultje
3fa646e859 Revert "4xm: Prevent buffer overreads."
This reverts commit 295a7c0238. The
patch breaks decoding of regular files (e.g. fate-4xm-2).
2012-01-04 21:27:31 -08:00
Aneesh Dogra
295a7c0238 4xm: Prevent buffer overreads.
4xm decoder while decoding i2 frames can overread the buffer if proper checks
are not made.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-04 21:15:50 -08:00
Aneesh Dogra
4b84f68223 4xm: pass the correct remaining buffer size to decode_i2_frame().
frame_size is the number of bytes left in the packet, so if we are passing
buf-4 we can safely read frame_size+4 bytes.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-04 21:10:11 -08:00
Aneesh Dogra
893f137679 4xm: fix calculation of the next output line position in decode_i2_frame().
The current code doesn't work unless width is an exact multiple of 16.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-04 21:09:22 -08:00
Ronald S. Bultje
89d26797f5 ulti: convert to new bytestream API. 2012-01-04 10:57:37 -08:00
Diego Biurrun
00a1cdd264 Place some START_TIMER invocations in separate blocks.
This fixes compilation failures related to START_TIMER/STOP_TIMER macros and
-Werror=declaration-after-statement.  START_TIMER declares variables and thus
may not be placed after statements outside of a new block.
2012-01-04 15:05:49 +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
John Brooks
aacf6b3a2f rv34: fix invalid memory access for small video dimensions
For small video dimensions calculations of the upper bound for pixel
access may result in negative value. Using an unsigned comparison
works only if the greater operand is non-negative. This is fixed by
doing edge emulation explicitly for such conditions.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-01-04 10:32:23 +01:00
Christophe GISQUET
98f24ecd6c rv34: joint coefficient decoding and dequantization
Perform dequantization while decoding coefficients instead of performing it
on the entire coefficients buffer.

Since quantized coefficients are very sparse, this usually causes a small
speedup. Speedup of around 1% on Panda board compared to the removed here
neon code. Global speedup is probably around 3%.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-01-04 10:30:01 +01:00
Ronald S. Bultje
400ba1d735 h264: return index in buffer on end-of-sequence.
Fixes hangs if the last packet contains an end-of-sequence NAL unit,
bug 158.
2012-01-03 19:50:22 -08:00
Diego Biurrun
54e68fb3b8 Merge some declarations and initializations.
This fixes compilation failures related to START_TIMER/STOP_TIMER macros and
-Werror=declaration-after-statement.  START_TIMER declares variables and thus
may not be placed after statements outside of a new block.
2012-01-04 01:28:28 +01:00
Diego Biurrun
9dec55748c cabac: drop unused and disabled get_cabac_u() / get_cabac_ueg() functions 2012-01-04 01:09:54 +01:00
Diego Biurrun
e451c26c5f cabac: drop unused STRICT_LIMITS code branch 2012-01-04 01:09:53 +01:00
Justin Ruggles
9785082c15 libspeexenc: fix pts calculations for more than 1 frame per packet 2012-01-03 18:56:41 -05:00
Justin Ruggles
730280f90d adxdec: clear eof flag and channel states when seeking 2012-01-03 18:47:42 -05:00
Justin Ruggles
754ebd1a5b adxenc: check output buffer size before writing 2012-01-03 18:47:42 -05:00
Justin Ruggles
1fb47728cd adxenc: use bytestream functions for header writing.
also add more documentation about the header structure
2012-01-03 18:47:42 -05:00
Justin Ruggles
656e606cae adxenc: use BLOCK_SIZE and BLOCK_SAMPLES macros 2012-01-03 18:47:42 -05:00
Justin Ruggles
f1be41c63d adxenc: use a loop to encode each channel 2012-01-03 18:47:42 -05:00
Justin Ruggles
6c117bd8e0 adxenc: remove unneeded loops
avctx->frame_size is 32, so that is how many samples we process per call.
2012-01-03 18:47:42 -05:00
Justin Ruggles
613668210b adxenc: avoid stereo deinterleaving 2012-01-03 18:47:41 -05:00
Justin Ruggles
6b77f07074 adxenc: remove unnecessary setting of coded_frame->key_frame.
It is already set by avcodec_alloc_frame().
2012-01-03 18:47:41 -05:00
Justin Ruggles
cc40c056d0 adxenc: log an error message and return AVERROR(EINVAL) for invalid channels 2012-01-03 18:47:41 -05:00
Justin Ruggles
a85ab8ad45 adxenc: cosmetics: pretty-printing 2012-01-03 18:47:41 -05:00
Justin Ruggles
25edfc88e3 adxenc: change some data types 2012-01-03 18:47:41 -05:00
Justin Ruggles
c98c6e18d8 adxenc: remove unneeded log message 2012-01-03 18:47:41 -05:00
Justin Ruggles
e3d4f59f95 adxenc: remove unneeded comments 2012-01-03 18:47:41 -05:00
Michael Niedermayer
b024209b1f adx_parser: rewrite.
The previous code ended in multiple different infinite
loops. See stl_ten_1_big.sfd as example with and without zzuf

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-01-03 16:28:17 -05:00
Justin Ruggles
6fd075f180 adxdec: Validate channel count to fix a division by zero. 2012-01-03 16:28:17 -05:00
Michael Niedermayer
4f1a787744 adxdec: Do not require extradata.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-01-03 16:28:17 -05:00
Justin Ruggles
e49d21306a alacdec: implement the 2-pass prediction type.
The reference encoder does not generate any streams using this, but the
reference decoder can handle it, so we should as well.
2012-01-03 13:15:24 -05:00
Justin Ruggles
bb63475aec alacenc: implement the 2-pass prediction type.
This isn't used by the reference encoder, but it is supported by the decoder.
2012-01-03 13:15:23 -05:00
Justin Ruggles
149e1b0468 alacenc: do not generate invalid multi-channel ALAC files 2012-01-03 13:15:23 -05:00
Justin Ruggles
e76c7b856f alacdec: fill in missing or guessed info about the extradata format.
Now that there is official documentation from Apple about this, we don't have
to guess anymore.
2012-01-03 13:15:23 -05:00
Kostya Shishkov
490dcda6b6 utvideo: proper median prediction for interlaced videos 2012-01-03 17:08:49 +01:00
Shitiz Garg
f37b4efe03 dca: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-03 15:25:54 +01:00
Aneesh Dogra
2e70b2de58 dct: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-03 15:25:51 +01:00
Daniel Verkamp
02e8f4272c win32: detect number of CPUs using affinity
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-03 14:25:57 +01:00
Diego Biurrun
418f066f8c snow: Restore three mistakenly removed casts. 2012-01-03 10:27:45 +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
Janne Grunau
264808219d v410enc: fix undefined signed left shift caused by integer promotion 2012-01-02 19:20:23 +01:00
Diego Biurrun
8fd35b1aac Fix a bunch of typos. 2012-01-02 16:41:25 +01:00
Diego Biurrun
44b0edda3f Drop some pointless void* return value casts from av_malloc() invocations. 2012-01-02 16:41:24 +01:00
Justin Ruggles
3a1867deac wavpack: fix typos in previous cosmetic clean-up commit 2012-01-02 08:54:30 -05:00
Justin Ruggles
513c238fa9 wavpack: cosmetics: K&R pretty-printing 2012-01-02 08:52:59 -05:00
Hendrik Leppkes
14165fe125 wavpack: determine sample_fmt before requesting a buffer
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-01-01 23:24:15 -05:00
Justin Ruggles
8893fbdf7a bmv audio: implement new audio decoding API 2012-01-01 22:56:04 -05:00
Justin Ruggles
03fafdec82 mpegaudiodec: skip all channels when skipping granules
Also fix calculation of new position when switching buffers.
This fixes "overread" error messages when seeking.
2012-01-01 22:37:50 -05:00
Aneesh Dogra
f7e30cc13b bfi: K&R cosmetics
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-01 22:27:04 +01:00
Aneesh Dogra
87d9874864 bgmc: K&R cleanup
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-01 22:27:04 +01:00
Stefano Sabatini
28b4af8e38 rawdec: propagate pict_type information to the output frame
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-01 22:27:04 +01:00
Piotr Bandurski
d3a5c26986 rawdec: Support more QT 1bpp rawvideo files.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-01 22:27:04 +01:00
Janne Grunau
b12d217339 threads: limit the number of automatic threads to MAX_AUTO_THREADS
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.
2012-01-01 21:11:43 +01:00
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
Diego Biurrun
6fdb2ce34a x86: Tighten register constraints for decode_significance*_x86.
On 32-bit OS X with gcc 4.0/4.2 and shared libraries enabled, the ebx register
is not available, but required to assemble the functions.

This reverts commit 8742a4f to a simplified version of the original constraints.
2011-12-21 12:06:37 +01:00
Diego Biurrun
c18365402b Replace Subversion revisions in comments by Git hashes. 2011-12-21 09:04:25 +01:00
Diego Biurrun
8742a4ff87 h264_cabac: synchronize decode_significance_*_x86 conditionals
The definition and the call site where under different #ifdefs.
2011-12-21 09:04:25 +01:00
Sergey Radionov
2003a29284 w32threads: wait for the waked thread in pthread_cond_signal.
This fixes a deadlock VLC triggered with multithreaded decoding. The
wait forces one of the current waiters to wake and not the thread
which calls pthread_cond_signal() itself.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-20 20:21:10 -08:00
Alex Converse
021914e27f aacdec: Cleanup decode_ics_info.
Remove unused function argument.
Return an AVERROR.
Don't zero out ICS on failure.
2011-12-20 18:32:41 -08:00
Rafaël Carré
37c0dc626d lavc: always align height by 32 pixel
Interlaced content for most codec requires it.
This patch is a stop-gap pending a serious rework to support
codecs with non 16 pixel macroblocks.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-21 00:00:23 +01:00
Luca Barbato
91b1e6f0c6 raw: add 10bit YUV definitions
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-21 00:00:03 +01:00
Diego Biurrun
1ce1578e4e mpegvideo_enc: separate declarations and statements
libavcodec/mpegvideo_enc.c:1209: warning: ISO C90 forbids mixed declarations and code
2011-12-20 22:38:54 +01:00
Diego Biurrun
bc4d156140 vp3: Reorder some functions to fix VP3 build with Theora disabled. 2011-12-20 22:38:53 +01:00
Diego Biurrun
19277d9335 build: fix standalone compilation of ADX encoder
The encoder depends on the common code, so link against it.
2011-12-20 22:38:52 +01:00
Diego Biurrun
18725fcdc2 build: fix standalone compilation of ADPCM decoders
The generic ADPCM codes depends on the ADPCM data tables.
2011-12-20 22:38:51 +01:00
Aneesh Dogra
1443ea93d9 4xm: Use bytestream2 functions to prevent overreads
Fixes Bug 110.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2011-12-20 13:17:09 -05:00
Aneesh Dogra
fd22616c59 bytestream: add a new set of bytestream functions with overread checking
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2011-12-20 13:17:03 -05: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
Janne Grunau
729ebb2f18 h264: clear trailing bits in partially parsed NAL units
Trailing bits are likely to be non-zero if the NAL unit is truncated.
Clearing the bits make overreads of the bitstream less likely in this
case. Fixes playback of
http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4 which
has a forbidden byte sequence of 0x00 0x00 0x00 in it SPS.
2011-12-19 23:14:21 +01: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
Aneesh Dogra
00aad121d8 xl: Fix overreads
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-19 20:36:26 +02:00
Asen Lekov
25c2d76b68 qcelpdec: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-12-19 16:22:30 +01:00
Diego Biurrun
2fd291846b qcelpdec: cosmetics: drop some pointless parentheses 2011-12-19 16:22:11 +01:00