Commit Graph

17059 Commits

Author SHA1 Message Date
Justin Ruggles
3509eee19c cook: use AVCodecContext.channels instead of keeping a private copy 2012-11-01 11:29:14 -04:00
Justin Ruggles
a3145d0335 bmvaudio: set channel layout at init() rather than validating it 2012-11-01 11:29:14 -04:00
Justin Ruggles
a38eadf7ed atrac1: do not keep a copy of channel count in the private context 2012-11-01 11:29:14 -04:00
Justin Ruggles
4f56f9c48f dsicinaudio: set channels and channel layout 2012-11-01 11:29:14 -04:00
Justin Ruggles
ec2694d259 g722dec: set channel layout at initialization instead of validating it 2012-11-01 11:29:14 -04:00
Justin Ruggles
ee0e9678e7 amrwbdec: set channels, channel_layout, and sample_rate
Only mono 16kHz is supported.
2012-11-01 11:29:14 -04:00
Justin Ruggles
b24a4449a5 amrnbdec: set channels, channel_layout, and sample_rate
Only mono 8kHz is supported.
2012-11-01 11:29:14 -04:00
Justin Ruggles
a4202003b2 dca_parser: allow the parser to change the sample rate 2012-11-01 11:29:13 -04:00
Justin Ruggles
0366664ef9 lavc: check channel count after decoder init
Ensures the decoder did not set channel count to an insanely high value
during initialization, which could cause large memory usage when it tries to
get a buffer during decoding.
2012-11-01 11:29:13 -04:00
Justin Ruggles
bb6941af2a lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders 2012-11-01 11:29:13 -04:00
Diego Biurrun
c37322e68c x86: Move optimization suffix to end of function names
This simplifies cpuflags porting.
2012-10-31 18:21:55 +01:00
Diego Biurrun
fa8fcab1e0 x86: h264_chromamc_10bit: drop pointless PAVG %define
It is only used in one place so there is no need for the abstraction.
2012-10-31 18:21:55 +01:00
Diego Biurrun
d8eda37080 x86: mmx2 ---> mmxext in function names 2012-10-31 17:53:57 +01:00
Diego Biurrun
5707af8d0b aacdec: Drop some unused function arguments 2012-10-31 10:54:52 +01:00
Diego Biurrun
be2c456e96 x86: fmtconvert: Refactor cvtps2pi emulation through cpuflags 2012-10-31 01:05:03 +01:00
Diego Biurrun
be923ed659 x86: fmtconvert: port to cpuflags 2012-10-31 01:05:03 +01:00
Diego Biurrun
588fafe7f3 x86: MMX2 ---> MMXEXT in macro names 2012-10-31 01:04:55 +01:00
Diego Biurrun
652f518594 x86: mmx2 ---> mmxext in comments and messages 2012-10-31 00:37:42 +01:00
Diego Biurrun
04581c8c77 x86: yasm: Use complete source path for macro helper %includes
This is more consistent with the way we handle C #includes and
it simplifies the build system.
2012-10-31 00:37:42 +01:00
Diego Biurrun
6860b4081d x86: include x86inc.asm in x86util.asm
This is necessary to allow refactoring some x86util macros with cpuflags.
2012-10-31 00:37:42 +01:00
Martin Storsjö
ab9545a290 cng: Reindent some incorrectly indented lines
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:29 +02:00
Martin Storsjö
6b68223d31 cngdec: Allow flushing the decoder
After a flush, don't average the output envelope and energy with
previous iterations.

Also start directly from the target values for the first iteration
at startup.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:25 +02:00
Martin Storsjö
036e6c37d3 cngdec: Make the dbov variable have the right unit
Previously the unit of the variable was Bov, not dBov.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:21 +02:00
Martin Storsjö
cafefd889b cngdec: Fix the memset size to cover the full array
This was a leftover from previous iterations of the code, where the
refl coef arrays were statically allocated.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:16 +02:00
Martin Storsjö
9b50d20cd2 cngdec: Update the LPC coefficients after averaging the reflection coefficients
I somehow messed up the placement of this one.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:12 +02:00
Luca Barbato
7658295ba3 pixfmt: support more yuva formats
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-30 12:02:42 +01:00
Ronald S. Bultje
95c89da36e Use ptrdiff_t instead of int for intra pred "stride" function parameter.
This way, SIMD-optimized functions don't have to sign-extend their
stride argument manually to be able to do pointer arithmetic.
2012-10-29 17:49:13 -07:00
Ronald S. Bultje
bad8e33dc9 x86: use PRED4x4/8x8/8x8L/16x16 macros to declare intrapred prototypes. 2012-10-29 17:48:23 -07:00
Ronald S. Bultje
c285edd06e Remove usage of INIT_AVX in h264_intrapred_10bit.asm.
Replace INIT_AVX by INIT_XMM avx. Port the whole file to use cpuflag
based function declarations. Remove (now unused) cputype argument in
function declaration macros. Change function prototypes to have mmx2
instead of mmxext as suffix, since that's required by cpuflags.
2012-10-29 14:10:51 -07:00
Martin Storsjö
9b500b8f6c avcodec: Add a RFC 3389 comfort noise codec
This isn't too useful as a normal codec, but can be used in
voip style applications. The decoder updates the noise
generator parameters when a packet is given to it for decoding,
but if called with an empty packet, it generates more noise
according to the last parameters.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 22:00:43 +02:00
Martin Storsjö
8b25a20efb lpc: Add a function for calculating reflection coefficients from samples
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 21:53:16 +02:00
Justin Ruggles
39ef66f530 lpc: Add a function for calculating reflection coefficients from autocorrelation coefficients
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 21:53:13 +02:00
Anton Khirnov
bff5e5f8b3 indeo3: remove duplicate capabilities line. 2012-10-29 20:04:56 +01:00
Diego Biurrun
72c758f1fd aacenc: Drop some unused function arguments 2012-10-29 18:27:54 +01:00
Anton Khirnov
f174fbac3c lavc: add CODEC_CAP_DR1 to all video decoders missing them 2012-10-29 09:51:23 +01:00
Mans Rullgard
4471a24207 vp8: fix memset() crossing array boundary
Indexing across array boundaries is not allowed by C99.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 17:02:46 +01:00
Mans Rullgard
c4cccc8d3f h264: fix invalid pointer arithmetic
Subtracting a (positive) value from the address of an array violates
C99 section 6.5.6:

  If both the pointer operand and the result point to elements of the
  same array object, or one past the last element of the array object,
  the evaluation shall not produce an overflow; otherwise, the
  behavior is undefined.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 17:02:46 +01:00
Mans Rullgard
50be207759 amrwbdec: fix invalid pointer arithmetic
Subtracting a (positive) value from the address of an array violates
C99 section 6.5.6:

  If both the pointer operand and the result point to elements of the
  same array object, or one past the last element of the array object,
  the evaluation shall not produce an overflow; otherwise, the
  behavior is undefined.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 17:02:45 +01:00
Diego Biurrun
87cdd7c694 ivi_common: Drop unused function parameter from decode_band() 2012-10-26 18:28:38 +02:00
Diego Biurrun
707f58f515 cook: Remove some silly Doxygen comments 2012-10-26 18:28:38 +02:00
Diego Biurrun
8a61ba0e81 cook: Remove senseless maybe_reformat_buffer32() function 2012-10-26 18:28:38 +02:00
Diego Biurrun
f23b4a0682 cook: cosmetics: Better names for joint_decode() function parameters 2012-10-26 18:28:38 +02:00
Diego Biurrun
20015379a4 cook: cosmetics: Better name for ccpl COOKSubpacket member 2012-10-26 18:28:38 +02:00
Janne Grunau
154ff81870 h263: avoid memcpys over array bound in motion vector caching for obmc
Fixes CID602232.
2012-10-26 17:38:07 +02:00
Luca Barbato
22f7942fe7 ffv1: set the range coder state in decode_slice_header 2001-01-01 01:06:41 +01:00
Diego Biurrun
5bac2d0c30 avutil: Move memcpy_backptr() to mem.c
The function is used elsewhere and does not belong with the LZO code.
2012-10-25 11:36:57 +02:00
Anton Khirnov
5a9567631a g.723.1: add missing CODEC_CAP_DR1 2012-10-24 08:46:45 +02:00
Anton Khirnov
1bc64c2814 lavc: initialize output AVFrame before decoding.
Avoids memleaks with audio when extended_data is nontrivial and the user
doesn't reset the frame.
Shouldn't have any effect for video for now, but might be useful in the
future.
2012-10-24 08:46:45 +02:00
Justin Ruggles
c68317ebbe lavc: fix documentation for AVCodecContext.delay 2012-10-23 14:35:27 -04:00
Justin Ruggles
44d854a518 atrac3: return an error if extradata_size is not a specific known size
Also fixes 3 compiler warnings about using uninitialized variables.
2012-10-23 14:35:27 -04:00
Justin Ruggles
a5ef830b12 lavc: use the correct API version guard macro for avcodec_encode_audio() 2012-10-23 14:35:27 -04:00
Mans Rullgard
a153e45b95 dfa: use av_memcpy_backptr() where previously impossible
Since the requirement for output padding has been lifted, we can
use av_memcpy_backptr() here as well.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 18:57:24 +01:00
Diego Biurrun
e831b3b852 av_memcpy_backptr: Drop no longer necessary malloc padding
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 18:57:24 +01:00
Diego Biurrun
330b864cda dsputil: Replace AV_WNxx(AV_RNxx()) combinations by AV_COPYxxU 2012-10-23 16:54:17 +02:00
Diego Biurrun
aa91fe8091 dxtory: Replace AV_WN16A(AV_RN16A()) combination by AV_COPY16 2012-10-23 16:53:42 +02:00
Luca Barbato
9ab0874ea8 mp3: properly forward mp_decode_frame errors
The function can return either a parsing error or a memory management
error.
2012-10-23 14:22:16 +02:00
Luca Barbato
0c03cc6838 mp3: exit on parsing error in mp_decode_frame
Properly forward mp_decode_layer3 errors, mp_decode_layer1 and
mp_decode_layer2 do not return errors.

Based on a patch by Michael Niedermayer.
2012-10-23 14:22:16 +02:00
Mans Rullgard
fab0a8b2c6 libm: add fallbacks for various single-precision functions
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 12:00:21 +01:00
Michael Niedermayer
ec444c84cf mpegaudiodec: Fix buffer handling on random access 2012-10-23 10:52:25 +02:00
Diego Biurrun
2f17f265ed mpegaudio: Refactor mp3on4 flush function 2012-10-23 10:52:25 +02:00
Diego Biurrun
8f4c414df6 Improve wording and spelling of av_log_missing_feature messages. 2012-10-23 10:28:40 +02:00
Anton Khirnov
c6b25d1d5e Revert "avutil: Add a copy of ff_sqrt_tab back into avutil to restore ABI compatibility"
This reverts commit d15c21e5fa.

After the major bump this is no longer necessary.
2012-10-23 07:33:05 +02:00
Justin Ruggles
a1f4cd371a atrac3: replace a calculation with FFALIGN()
This allocates 4 bytes less than the previous code if avctx->block_align is
a multiple of 4, but the extra 4 bytes is not really needed.
2012-10-22 10:10:08 -04:00
Justin Ruggles
808686fc1e atrac3: remove unused ATRAC3Context field, sample_rate 2012-10-22 10:10:08 -04:00
Justin Ruggles
89a6c32bc1 atrac3: use sizeof(variable) instead of sizeof(type) 2012-10-22 10:10:08 -04:00
Justin Ruggles
327747de15 atrac3: simplify MDCT window calculation 2012-10-22 10:10:08 -04:00
Justin Ruggles
5d1007f74d atrac3: initialize static tables in AVCodec.init_static_data() 2012-10-22 10:10:08 -04:00
Justin Ruggles
78edce3f19 atrac3: separate window initialization from IMDCT initialization 2012-10-22 10:10:08 -04:00
Justin Ruggles
c51311b907 atrac3: move the 'frame_factor' field from ATRAC3Context to where it is used 2012-10-22 10:10:08 -04:00
Justin Ruggles
7e76f27081 atrac3: remove unused ATRAC3Context field, bit_rate 2012-10-22 10:10:07 -04:00
Justin Ruggles
a2664c91fb atrac3: move the 'samples_per_frame' field from ATRAC3Context to where it is used 2012-10-22 10:10:07 -04:00
Justin Ruggles
7c1f93afe6 atrac3: remove unused ATRAC3Context field, samples_per_channel 2012-10-22 10:10:07 -04:00
Justin Ruggles
cdd0e0de81 atrac3: use AVCodecContext.block_align instead of keeping a private copy 2012-10-22 10:10:07 -04:00
Justin Ruggles
64ebbb8f89 atrac3: move the 'delay' field from ATRAC3Context to where it is used 2012-10-22 10:10:07 -04:00
Justin Ruggles
56a9d2b44e atrac3: move the 'version' field from ATRAC3Context to where it is used 2012-10-22 10:10:06 -04:00
Justin Ruggles
5ac673b553 atrac3: use AVCodecContext.channels instead of keeping a private copy 2012-10-22 10:10:06 -04:00
Justin Ruggles
aefdb735c3 atrac3: simplify some loop indexing 2012-10-22 10:10:06 -04:00
Justin Ruggles
e55d53905f atrac3: cosmetics: pretty-printing and renaming
also does some minor refactoring.
2012-10-22 10:10:06 -04:00
Mans Rullgard
abdee95224 pcm: define AVCodec instances only for enabled codecs
This defines an AVCodec only if the corresponding CONFIG option is
enabled instead of using the broad CONFIG_ENCODERS/DECODERS.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-22 14:40:57 +01:00
Anton Khirnov
5957aefc7c libxvid: remove useless doxy comments. 2012-10-22 15:20:23 +02:00
Anton Khirnov
b691135d0c lavc: remove stats_out from the options table.
Since it is declared as a string AVOption, the generic freeing code
attempts to free it on codec close. Some codecs might have already freed
it elsewhere (or didn't even allocate it with av_malloc() in the first
place), so this might lead to an invalid free.

There is no point in having this field accessible as an AVOption, so
remove it from the options table.

Fixes Bug 380.

CC: libav-stable@libav.org
2012-10-22 14:44:07 +02:00
Anton Khirnov
d6f4fe68c8 lavc: extend frame_size doxy. 2012-10-22 08:49:58 +02:00
Justin Ruggles
46a86c6194 alacdec: set bits_per_raw_sample 2012-10-21 23:54:51 -04:00
Nathan Caldwell
c854102da7 avcodec: handle AVERROR_EXPERIMENTAL
Error out on init if a codec with CODEC_CAP_EXPERIMENTAL is requested
and strict_std_compliance is not FF_COMPLIANCE_EXPERIMENTAL.

Move the check from avconv to avcodec_open2() and return
AVERROR_EXPERIMENTAL accordingly.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-21 23:03:26 +02:00
Nathan Caldwell
a4aa20fbdb avcodec: prefer decoders without CODEC_CAP_EXPERIMENTAL
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-21 22:27:58 +02:00
Diego Biurrun
af1ede069c svq3: cosmetics: Drop useless parentheses 2012-10-20 21:10:21 +02:00
Diego Biurrun
a7d2861d36 svq3: K&R formatting cosmetics 2012-10-20 21:10:21 +02:00
Diego Biurrun
6cfca5b6ae ffv1: Add missing #includes to header file 2012-10-20 21:10:21 +02:00
Luca Barbato
0f13cd3187 ffv1: update to ffv1 version 3
Based on code from Carl Eugen Hoyos, Michael Niedermayer and Paul B Mahol.
2012-10-20 18:14:52 +02:00
Luca Barbato
4a2a4524a3 ffv1: propagate errors 2012-10-20 18:14:51 +02:00
Luca Barbato
71f7b22dba ffv1: split decoder and encoder 2012-10-20 18:14:43 +02:00
Martin Storsjö
d15c21e5fa avutil: Add a copy of ff_sqrt_tab back into avutil to restore ABI compatibility
Earlier versions of for instance of libavcodec expect this symbol to be
present in libavutil. This commit can be reverted after the next major
bump.

New shared builds of avcodec will link to the internal copy of the
table within that library, so those builds won't rely on this table
being present in avutil any longer either.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-20 14:31:55 +03:00
Mans Rullgard
f0c07be649 celp_math: rename ff_log2 to ff_log2_q15
This name is more descriptive as the function returns a fixed-point
value with 15 fraction bits.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-20 12:28:45 +01:00
Mans Rullgard
1846ddf0a7 ARM: fix overreads in neon h264 chroma mc
The loops were reading ahead one line, which could end up outside the
buffer for reference blocks at the edge of the picture.  Removing
this readahead has no measurable performance impact.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-20 01:28:38 +01:00
Diego Biurrun
c896aa984e build: Drop OBJS declaration for non-existing PCM_DVD encoder 2012-10-19 17:04:41 +02: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
Kostya Shishkov
169514c440 indeo3: do not try to output more lines than we can fit
Internally chroma planes have multiple of four height while allocated image
planes might be smaller if CODEC_FLAG_EMU_EDGE is set. Thus we should not
output more lines of chroma than frame can accept.

Also the decoder can be safely switched to direct rendering now.
2012-10-19 07:58:51 +02:00
Kostya Shishkov
8774d58358 bmv: get a new frame on every decode_frame(), so we can use direct rendering 2012-10-19 07:58:51 +02:00
Mans Rullgard
7a12d97eb1 aac: fix build with hardcoded tables
aac_tablegen.h includes aac.h for the POW_SF2_ZERO definition, but
this also pulls in a raft of other headers, some of which are not
safe to use in code built with the host compiler.

Moving POW_SF2_ZERO to aac_tablegen_decl.h, where the declaration
of the array it relates to already resides, fixes the problems.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-18 19:59:43 +01:00
Martin Storsjö
d66c52c2b3 Add support for building shared libraries with MSVC
This requires the makedef perl script by Derek, from the
c89-to-c99 repo. That scripts produces a .def file, listing
the symbols to be exported, based on the gcc version scripts
and the built object files.

To properly load non-function symbols from DLL files, the
data symbol declarations need to have the attribute
__declspec(dllimport) when building the calling code. (On mingw,
the linker can fix this up automatically, which is why it has not
been an issue so far. If this attribute is omitted, linking
actually succeeds, but reads from the table will not produce the
desired results at runtime.)

MSVC seems to manage to link DLLs (and run properly) even if
this attribute is present while building the library itself
(which normally isn't recommended) - other object files in the
same library manage to link to the symbol (with a small warning
at link time, like "warning LNK4049: locally defined symbol
_avpriv_mpa_bitrate_tab imported" - it doesn't seem to be possible
to squelch this warning), and the definition of the tables
themselves produce a warning that can be squelched ("warning C4273:
'avpriv_mpa_bitrate_tab' : inconsistent dll linkage, see previous
definition of 'avpriv_mpa_bitrate_tab').

In this setup, mingw isn't able to link object files that refer to
data symbols with __declspec(dllimport) without those symbols
actually being linked via a DLL (linking avcodec.dll ends up with
errors like "undefined reference to `__imp__avpriv_mpa_freq_tab'").
The dllimport declspec isn't needed at all in mingw, so we simply
choose not to declare it for other compilers than MSVC that requires
it. (If ICL support later requires it, the condition can be extended
later to include both of them.)

This also implies that code that is built to link to a certain
library as a DLL can't link to the same library as a static library.
Therefore, we only allow building either static or shared but not
both at the same time. (That is, static libraries as such can be,
and actually are, built - this is used for linking the test tools to
internal symbols in the libraries - but e.g. libavformat built to
link to libavcodec as a DLL cannot link statically to libavcodec.)

Also, linking to DLLs is slightly different from linking to shared
libraries on other platforms. DLLs use a thing called import
libraries, which is basically a stub library allowing the linker
to know which symbols exist in the DLL and what name the DLL will
have at runtime.

In mingw/gcc, the import library is usually named libfoo.dll.a,
which goes next to a static library named libfoo.a. This allows
gcc to pick the dynamic one, if available, from the normal -lfoo
switches, just as it does for libfoo.a vs libfoo.so on Unix. On
MSVC however, you need to literally specify the name of the import
library instead of the static library.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 14:26:15 +03:00
Martin Storsjö
eaa9b2e66c avcodec: Rename avpriv_frame_rate_tab to ff_mpeg12_frame_rate_tab
This table doesn't need to be shared with libavformat any longer.
Add mpeg12 to the name to make it less ambiguous, while renaming it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 14:26:14 +03:00
Mans Rullgard
b93e934aee mips64: mark hi/lo registers clobbered in MAC64/MLS64 macros
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-17 22:37:12 +01:00
Justin Ruggles
abd8b9e7e0 libmp3lame: resize the output buffer if needed
The LAME API documentation for the required buffer size refers to the size for
a single encode call. However, we store multiple frames in the same output
buffer but only read 1 frame at a time out of it. As a result, the buffer size
given in lame_encode_buffer() is actually smaller than what it should be.
Since we do not know how many frames it will end up buffering, it is best to
just reallocate if needed.
2012-10-17 09:59:13 -04:00
Rafaël Carré
a25d912dca avcodec_encode_audio(): fix invalid free
Since 2bc0de385, AVFrame needs to be initialized
before calling avcodec_get_frame_defaults().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-16 18:49:31 +02:00
Christian Schmidt
4a7429203a pcm-mpeg: correct bitrate calculation
Bitrate calculation is off since the bluray spec always specifies
an even number of coded channels. This was honored in the decoder,
but not for bitrate calculation.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-16 16:03:03 +02:00
Luca Barbato
9a978b334b ffv1: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-10-16 15:45:55 +02:00
Diego Biurrun
f1be514540 rangecoder-test: Drop timer output that clutters stderr 2012-10-15 21:16:36 +02:00
Diego Biurrun
c1fcfdec75 rangecoder-test: Return in case of an error 2012-10-15 21:15:17 +02:00
Justin Ruggles
f9d732c264 wmapro: use planar sample format 2012-10-14 16:48:23 -04:00
Justin Ruggles
2725ce7c7c wmalossless: output in planar sample format 2012-10-14 16:48:23 -04:00
Justin Ruggles
7ebfe5b44a wmadec: use float planar sample format output 2012-10-14 16:48:23 -04:00
Justin Ruggles
977eb7d567 shorten: use planar sample format 2012-10-14 16:48:22 -04:00
Justin Ruggles
8441909f49 lavc: update documentation for AVFrame.extended_data 2012-10-14 15:00:45 -04:00
Diego Biurrun
52d113ee06 avutil: Rename ff_set_systematic_pal2() ---> avpriv_set_systematic_pal2()
Functions used across libraries should have avpriv_ and not ff_ prefixes.
2012-10-13 19:59:20 +02:00
Mashiat Sarker Shakkhar
5d2be71b9e vc1: Use codec ID from AVCodecContext while parsing frame header
This fixes a segfault with samples that I have (both of them MPEG-TS). Looks like
avctx->codec is not being set during parsing.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-10-13 08:33:07 +02:00
Justin Ruggles
61d5313d94 dca: allocate a secondary buffer for extra channels when downmixing
The output AVFrame buffer only has data for the downmix channels.
Fixes a segfault when decoding dca with request_channels == 2.
2012-10-13 00:07:10 -04: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
717addecad Use proper return values in case of missing features 2012-10-12 20:56:54 +02:00
Diego Biurrun
4c66af6141 rangecoder-test: Set error message log level to error, instead of debug 2012-10-12 20:56:54 +02:00
Diego Biurrun
90558e848a rangecoder: K&R formatting cosmetics 2012-10-12 20:56:54 +02: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
Diego Biurrun
bc4620e5d6 Remove libmpeg2 #define remnants 2012-10-12 20:56:54 +02:00
Diego Biurrun
d5c62122a7 Move av_reverse table to libavcodec
It is only used in that library.
2012-10-12 20:39:18 +02:00
Diego Biurrun
930c9d4373 avutil: Duplicate ff_log2_tab instead of sharing it across libs
The table is so small that the space gain is not worth the
performance overhead of cross-library access.
2012-10-12 20:39:17 +02:00
Michael Niedermayer
c80b59f679 tscc2: Fix an out of array access
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-12 18:17:10 +03:00
Sami Pietila
0bf511d579 vp8: reset loopfilter delta values at keyframes.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-10-12 07:17:38 -07:00
Luca Barbato
6d5600e855 avutil: add yuva422p and yuva444p formats 2012-10-12 15:09:51 +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
Martin Storsjö
e002e3291e Use the new aes/md5/sha/tree allocation functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-11 23:35:28 +03:00
Mans Rullgard
fb32f31af7 svq3: fix pointer type warning
Fixes:
libavcodec/svq3.c:661:9: warning: passing argument 2 of 'svq3_decode_block' from incompatible pointer type
libavcodec/svq3.c:208:19: note: expected 'DCTELEM *' but argument is of type 'DCTELEM (*)[32]'

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-11 20:40:23 +01:00
Mans Rullgard
366b72f149 svq3: replace unsafe pointer casting with intreadwrite macros
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-11 20:40:23 +01:00
Diego Biurrun
9734b8ba56 Move avutil tables only used in libavcodec to libavcodec. 2012-10-11 18:29:36 +02:00
Diego Biurrun
0a75d1da23 options_table: refs option is not snow-only 2012-10-11 18:27:44 +02:00
Luca Barbato
1ec6293086 mlpdsp: adding missing file 2012-10-11 12:34:36 +02:00
Luca Barbato
2d6caade22 dsputil: split out mlp dsp function 2012-10-11 12:01:08 +02:00
Mans Rullgard
25dc79bc14 sh4: add required #include, fix build
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-11 10:55:26 +01:00
Janne Grunau
c466eb1746 flashsv: propagate inflateReset() errors
Fixes CID717493.
2012-10-10 21:24:32 +02:00
Janne Grunau
6d556e8327 indeo4/5: remove constant parameter num_bands from wavelet recomposition
Fixes bogus uninitialized value compiler and coverity warnings.
2012-10-10 21:24:32 +02:00
Mashiat Sarker Shakkhar
35a35d49d2 Double motion vector range for HPEL interlaced picture in proper place
The existing code is not in the right place and it should cover both
interlaced frame and field pictures.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:56:02 -04:00
Mashiat Sarker Shakkhar
eb657ecefd vc1dec: Set opposite to the correct value for 1REF field pictures
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:55:38 -04:00
Mashiat Sarker Shakkhar
7cc3c4e1d4 vc1dec: Invoke edge emulation regardless of MV precision for 1-MV chroma
This is required due to the way VC-1 handles chroma pull-back which may end
up causing negative chroma MV for zero luma MV. Edge emulation needs to be
invoked in such cases.

This only affects vertical component of chroma motion vector.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:54:19 -04:00
Mashiat Sarker Shakkhar
88058d9a99 vc1dec: Set chroma reference field from REFFIELD for 1REF field pictures
Interlaced field pictures can have one or two reference pictures, signaled
by NUMREF syntax element. For single reference pictures, reference picture
is determined by REFFIELD syntax element.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-10 14:50:07 -04:00
Mashiat Sarker Shakkhar
7fb35ee931 vc1dec: Use correct spelling of "opposite"
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-10-10 16:28:31 +02:00
Janne Grunau
706a559b30 a64multienc: change mc_frame_counter to unsigned
GCC cannot proof that c->mc_frame_counter is always >- 0, changing the
type from int to unsigned fixes following warning:

libavcodec/a64multienc.c: In function ‘a64multi_encode_frame’:
libavcodec/a64multienc.c:342:17: warning: ‘buf’ may be used uninitialized in this function[-Wuninitialized]

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-10-10 15:33:06 +02:00
Jean-Baptiste Kempf
507dce2536 arm: call arm-specific rv34dsp init functions under if (ARCH_ARM)
Assign NEON specific function pointers after runtime check via
av_get_cpu_flags().

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-10-10 15:28:50 +02:00
Diego Biurrun
63a46c6101 svq1: Drop a bunch of useless parentheses 2012-10-10 15:10:53 +02:00
Diego Biurrun
ada12f8366 svq1: K&R formatting cosmetics 2012-10-10 14:14:22 +02:00
Janne Grunau
f1de23faaa g722enc: fix size argument in memset
Fixes CID700725.
2012-10-09 21:05:15 +02:00
Anton Khirnov
233a5a807e lavc: split asv12 encoder/decoder 2012-10-09 20:32:35 +02:00
Janne Grunau
6f8ef5320f vc1dec: prevent memory leak in error path
Fixes CID732271.
2012-10-09 16:09:41 +02:00
Janne Grunau
714f5ab597 vc1dec: prevent memory leak on av_realloc error 2012-10-09 16:07:12 +02:00
Justin Ruggles
cbcd497f38 adxdec: use planar sample format 2012-10-09 09:03:52 -04:00
Justin Ruggles
4ebd74cec7 adpcmdec: use planar sample format for adpcm_thp 2012-10-09 09:03:52 -04:00
Justin Ruggles
327cdb04e3 adpcmdec: use planar sample format for adpcm_ea_xas 2012-10-09 09:03:52 -04:00
Justin Ruggles
da9620e8e5 adpcmdec: use planar sample format for adpcm_ea_r1/r2/r3 2012-10-09 09:03:52 -04:00
Justin Ruggles
d2b6ae02aa adpcmdec: use planar sample format for adpcm_xa 2012-10-09 09:03:52 -04:00
Justin Ruggles
8b854283c3 adpcmdec: use planar sample format for adpcm_ima_ws for vqa version 3 2012-10-09 09:03:52 -04:00
Justin Ruggles
4356d66d78 adpcmdec: use planar sample format for adpcm_4xm 2012-10-09 09:03:52 -04:00
Justin Ruggles
1b9ac72908 adpcmdec: use planar sample format for adpcm_ima_wav 2012-10-09 09:03:52 -04:00
Justin Ruggles
176db0b892 adpcmdec: use planar sample format for adpcm_ima_qt 2012-10-09 09:03:52 -04:00
Justin Ruggles
7e5f045039 pcmdec: use planar sample format for pcm_lxf 2012-10-09 09:03:51 -04:00
Justin Ruggles
c1a9cfd1fe mace: use planar sample format 2012-10-09 09:03:51 -04:00
Justin Ruggles
23d53c5473 atrac1: use planar sample format 2012-10-09 09:03:51 -04:00
Diego Biurrun
ac56ff9cc9 build: non-x86: Only compile mpegvideo optimizations when necessary 2012-10-09 14:45:59 +02:00
Janne Grunau
3fbda309e5 avcodec: free extended_data instead address of it
Fixes CID732173.
2012-10-09 14:04:46 +02:00
Diego Biurrun
f75f4194d1 Restructure av_log_missing_feature message
Some invocations include a verb in the log message, others do not.  Yet
av_log_missing_feature expects callers to provide a verb.  Change the
function to include a verb instead and update the callers accordingly.
The result is a more natural function API and correct English in the
function invocations.
2012-10-09 11:39:26 +02:00
Mans Rullgard
f79364b2c3 ppc: fix Altivec build with old compilers
The vec_splat() intrinsic requires a constant argument for the
element number, and the code relies on the compiler unrolling
the loop to provide this.  Manually unrolling the loop avoids
this reliance and works with all compilers.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-08 23:14:51 +01:00
Janne Grunau
7e522859fc x86: vc1: call ff_vc1dsp_init_x86() under if (ARCH_X86) 2012-10-08 11:54:05 +02:00
Janne Grunau
cb36febcbc x86: cavs: call ff_cavsdsp_init_x86() under if (ARCH_X86) 2012-10-08 11:54:05 +02:00
Janne Grunau
f101eab1be x86: call most of the x86 dsp init functions under if (ARCH_X86)
Rename the called dsp init functions to *_init_x86.
2012-10-08 11:54:05 +02:00
Anton Khirnov
716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Justin Ruggles
37f701f1c3 avcodec: allow either planar or interleaved sample format when encoding mono
When there is only 1 channel, the planar and interleaved formats of the same
data type should be treated as identical.
2012-10-07 16:45:50 -04:00
Justin Ruggles
5364327186 adpcmenc: ensure calls to adpcm_ima_compress_sample() are in the right order
Should fix fate-acodec-adpcm-ima_wav with several compilers.
2012-10-07 16:45:50 -04:00
Justin Ruggles
31b2262dca wmaenc: use float planar sample format 2012-10-06 13:23:13 -04:00
Justin Ruggles
b1540fc884 (e)ac3enc: use planar sample format 2012-10-06 13:23:13 -04:00
Justin Ruggles
f3e2d68df6 aacenc: use planar sample format 2012-10-06 13:23:13 -04:00
Justin Ruggles
095be4fbf6 adpcmenc: use planar sample format for adpcm_ima_wav and adpcm_ima_qt 2012-10-06 12:25:33 -04:00
Justin Ruggles
d9a13c2f56 adpcmenc: move 'ch' variable to higher scope
It is used for multiple codecs.
2012-10-06 12:25:33 -04:00
Justin Ruggles
9606f19b4e adpcmenc: fix 3 instances of variable shadowing 2012-10-06 12:25:33 -04:00
Justin Ruggles
1e35574bad adpcm_ima_wav: simplify encoding 2012-10-06 12:25:33 -04:00
Justin Ruggles
cfc0a80a1d libvorbis: use planar sample format 2012-10-06 12:25:32 -04:00
Justin Ruggles
473b297f26 libmp3lame: use planar sample formats 2012-10-06 12:25:32 -04:00
Justin Ruggles
233783e2c1 vorbisenc: use float planar sample format 2012-10-06 12:25:32 -04:00
Diego Biurrun
e4cbf7529b Give all anonymously typedeffed structs in headers a name
Anonymous structs cannot be forward declared and have no benefit.
2012-10-06 09:27:11 +02:00
Mans Rullgard
642b4efaf7 ppc: fmtconvert: kill VLA in float_to_int16_interleave_altivec()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-05 22:33:32 +01:00
Mans Rullgard
bcf07a15a0 x86: dsputil: kill VLA in gmc_mmx()
Instead of using an evil VLA, fall back to C version when edge
emulation is needed.  MPEG4 GMC is a rarely used fringe feature
so the speed loss is an acceptable cost for safer code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-05 22:33:32 +01:00
Dmitry Samonenko
f1c6a740fc libspeexenc: Updated commentary to reflect recent changes
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-05 23:29:24 +03:00
Dmitry Samonenko
978d5bd2a7 libspeexenc: Add an option for enabling DTX
Discontinuous transmission is an addition to VAD/VBR operation, that
allows to greatly reduce bitrate for silent chunks or stationary
noises.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-05 23:29:24 +03:00
Anton Khirnov
30223b3bf2 lavc: deprecate the audio resampling API.
It has been superseded by lavr.
2012-10-05 13:47:56 +02:00
Ronald S. Bultje
f6f7d15041 h264: don't touch H264Context->ref_count[] during MB decoding
The variable is copied to subsequent threads at the same time, so this
may cause wrong ref_count[] values to be copied to subsequent threads.

This bug was found using TSAN.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-05 02:49:45 +02:00
Diego Biurrun
1e164c0bcc build: Factor out mpegaudio dependencies to CONFIG_MPEGAUDIO
A new hidden config variable is added for the codecs that depend on the
mpegaudio parts.
2012-10-04 17:58:42 +02:00
Justin Ruggles
c9df48909e libspeexdec: handle NULL return value from speex_packet_to_header()
This will happen when the extradata is not a valid Speex header.
2012-10-03 18:26:25 -04: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
Justin Ruggles
45e5d0c3ac libspeexdec: properly handle DTX for multiple frames-per-packet 2012-10-03 16:03:32 -04:00
Justin Ruggles
908e22b93a libspeexdec: move the SpeexHeader from LibSpeexContext to where it is used 2012-10-03 16:03:32 -04:00
Justin Ruggles
892695c851 libspeexdec: simplify setting of frame_size 2012-10-03 16:03:32 -04:00
Justin Ruggles
27c3f9c03e libspeexdec: set channel_layout 2012-10-03 16:03:32 -04:00
Justin Ruggles
29abb04e73 libspeexdec: If the channel count is not valid, decode as stereo.
When initialized as stereo, libspeex can decode either mono or stereo packets
and will output stereo.
2012-10-03 16:03:32 -04:00
Justin Ruggles
3b061c5e10 libspeexdec: improve setting of Speex mode and sample rate
If there is no extradata and the sample rate given by the user is not valid,
decode as ultra-wideband.
2012-10-03 16:03:31 -04:00
Dmitry Samonenko
ad11681acd libspeex: Add a private option for enabling VAD
Speex detects non-speech periods and encodes them with just enough bits
to reproduce the background noise, aka ``comfort noise generation''.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-03 19:23:39 +03:00
Mans Rullgard
5e826fd65e ARM: set Tag_ABI_align_preserved in all asm files
All our ARM asm preserves alignment so setting this attribute
in a common location is simpler.  This removes numerous warnings
when linking with armcc.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-02 19:47:56 +01:00
Alex Converse
b92dfb56d4 tiffenc: Check av_malloc() results. 2012-10-01 17:46:44 -07:00
Alex Converse
9bc055e358 tiffenc: Simplify pixel format setup using AVPixFmtDescriptor. 2012-10-01 17:46:44 -07:00
Justin Ruggles
bfcd4b6a16 adpcmdec: set AVCodec.sample_fmts 2012-10-01 13:42:44 -04:00
Justin Ruggles
1478a3601e twinvq: use planar sample format 2012-10-01 13:42:44 -04:00
Justin Ruggles
a34be78546 ralf: use planar sample format 2012-10-01 13:42:44 -04:00
Justin Ruggles
1a3459033d mpc7/8: use planar sample format 2012-10-01 13:42:44 -04:00
Justin Ruggles
3fca0d7210 iac/imc: use planar sample format 2012-10-01 13:42:43 -04:00
Justin Ruggles
64c312aa29 dcadec: use float planar sample format 2012-10-01 13:42:43 -04:00
Justin Ruggles
cbf6ee7823 cook: use planar sample format 2012-10-01 13:42:43 -04:00
Justin Ruggles
9af4eaa8ea atrac3: use float planar sample format 2012-10-01 13:42:43 -04:00
Justin Ruggles
461ba7e97a apedec: output in planar sample format 2012-10-01 13:42:43 -04:00
Justin Ruggles
cf8c93ada4 8svx: use planar sample format 2012-10-01 13:42:43 -04:00
Nathan Caldwell
6cb8c85409 Opus encoder using libopus
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-10-01 14:42:40 +02:00
Diego Biurrun
d25fe4cc65 wmadec: Adjust debug printf argument length modifier 2012-10-01 12:46:41 +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
9c6cf7f2c9 avcodec: Drop silly and/or broken printf debug output 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
Diego Biurrun
14d3e7ad11 Remove some silly disabled code. 2012-10-01 10:24:28 +02:00
Justin Ruggles
56b6a43056 ac3dec: ensure get_buffer() gets a buffer for the correct number of channels
If there is an error during frame parsing, but AVCodecContext.channels was
changed and AC3DecodeContext.out_channels was set previously, the two may not
match.

Fixes CVE-2012-2802
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

CC: libav-stable@libav.org
2012-10-01 00:10:59 -04:00
Jindřich Makovička
1a8c6917f6 h264: avoid stuck buffer pointer in decode_nal_units
When decode_nal_units() previously encountered a NAL_END_SEQUENCE,
and there are some junk bytes left in the input buffer, but no start codes,
buf_index gets stuck 3 bytes before the end of the buffer.

This can trigger an infinite loop in the caller code, eg. in
try_decode_trame(), as avcodec_decode_video() then keeps returning zeroes,
with 3 bytes of the input packet still available.

With this change, the remaining bytes are skipped so the whole packet gets
consumed.

CC:libav-stable@libav.org

Signed-off-by: Jindřich Makovička <makovick@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 19:31:17 +02:00
Anton Khirnov
0f583d20d5 mpeg12: fix the semantics of the int* parameter of decode()
It is got_output, not data_size.
2012-09-29 19:18:39 +02:00
Anton Khirnov
d9a2e87b1c mpeg12: move mpeg_decode_frame() lower
Avoids a forward declaration of decode_chunks().
2012-09-29 19:18:24 +02:00
Michael Niedermayer
85f477935c avsdec: Set dimensions instead of relying on the demuxer.
The decode function assumes that the video will have those dimensions.

Fixes CVE-2012-2801

CC:libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 19:18:07 +02:00
Michael Niedermayer
d65d834731 wmalosslessdec: Reset put bit buffer when num_saved_bits is reset.
Fixes CVE-2012-2799

CC:libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 19:17:38 +02:00
Anton Khirnov
d05f72c754 dfa: improve boundary checks in decode_dds1()
Fixes CVE-2012-2798

CC:libav-stable@libav.org
2012-09-29 19:17:07 +02:00
Anton Khirnov
6a99310fce wmalosslessdec: Fix reading too many bits in decode_channel_residues()
Fixes a part of CVE-2012-2795

CC:libav-stable@libav.org

Based on a patch by Michael Niedermayer <michaelni@gmx.at>

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2012-09-29 19:16:32 +02:00
Michael Niedermayer
f48fbf2eb5 wmalosslessdec: fix a get_bits(0) in decode_ac_filter
Fixes a part of CVE-2012-2795

CC:libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 19:15:27 +02:00
Michael Niedermayer
607f57152c wmalosslessdec: make MCLMS arrays big enough for what is written into them.
Fixes a part of CVE-2012-2795

CC:libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 19:14:25 +02:00
Anton Khirnov
ae3da0ae55 indeo4/5: check empty tile size in decode_mb_info().
This prevents writing into a too small array if some parameters changed
without the tile being reallocated.

Based on a patch by Michael Niedermayer <michaelni@gmx.at>

Fixes CVE-2012-2800

CC:libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2012-09-29 19:13:45 +02:00
Anton Khirnov
5d2170c53b ivi_common: make ff_ivi_process_empty_tile() static.
It's not used outside of ivi_common.c
2012-09-29 19:12:57 +02:00
Michael Niedermayer
2d09cdbaf2 indeo5: check tile size in decode_mb_info().
This prevents writing into a too small array if some parameters changed
without the tile being reallocated.

Fixes CVE-2012-2794

CC:libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 19:12:36 +02:00
Anton Khirnov
e4d4044339 indeo3: fix out of cell write.
Fixes CVE-2012-2776.

CC:libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2012-09-29 19:12:04 +02:00
Anton Khirnov
065b3a1cfa wmalosslessdec: increase channel_coeffs/residues size
Fixes CVE-2012-2792

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2012-09-29 10:29:53 +02:00
Anton Khirnov
4a969030e4 wmalosslessdec: increase WMALL_BLOCK_MAX_BITS to 14. 2012-09-29 10:29:52 +02:00
Michael Niedermayer
b631e4ed64 lagarith: check count before writing zeros.
Fixes CVE-2012-2793

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:28:32 +02:00
Michael Niedermayer
99f392a584 wmaprodec: check num_vec_coeffs for validity
Fixes CVE-2012-2789

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:28:15 +02:00
Michael Niedermayer
b146d74730 indeo4: update AVCodecContext width/height on size change
Fixes CVE-2012-2787

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:27:32 +02:00
Anton Khirnov
ee715f49a0 dfa: check that the caller set width/height properly.
Fixes CVE-2012-2786.
2012-09-29 09:27:08 +02:00
Michael Niedermayer
891918431d indeo5dec: Make sure we have had a valid gop header.
This prevents decoding happening on a half initialized context.

Fixes CVE-2012-2779

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:26:30 +02:00
Michael Niedermayer
c20a696306 cavsdec: check for changing w/h.
Our decoder does not support changing w/h.

Fixes CVE-2012-2777 and CVE-2012-2784.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-29 09:26:04 +02:00
Anton Khirnov
12e1e83461 lavc: set channel count from channel layout in avcodec_open2().
Some decoders (e.g. nellymoser) only set channel_layout and do not set
channel count.
2012-09-29 09:25:40 +02:00
Michael Niedermayer
791b5954bc dsputil_mmx: fix reading prior of the src array in sub_hfyu_median_prediction()
This should fix the utvideoenc valgrind failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-28 12:25:07 -04:00
Luca Barbato
97cfa55eea mpegaudiodec: fix short_start calculation
The value should be always 3, as it follows from the specification.

Fix a stack buffer overflow in exponents_from_scale_factors as reported
by asan. Thanks to Dale Curtis for the sample vector.
2012-09-28 16:02:39 +02:00
Nathan Caldwell
d16860a237 libopus: Remap channels using libopus' internal remapping.
This way we can directly remap channels from Opus' channel order to
libav's internal channel order, instead of mapping channels from
Opus' order to Vorbis' order then to libav's order.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-09-28 11:03:32 +02:00
Nicolas George
44617d6ec9 Opus decoder using libopus
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-09-28 11:03:20 +02:00
Nathan Caldwell
e4aa3831b7 avcodec: document the use of AVCodecContext.delay for audio decoding
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-09-28 10:50:07 +02:00
Kostya Shishkov
4dc8c8386e vc1dec: add flush function for WMV9 and VC-1 decoders
CC: libav-stable@libav.org
2012-09-28 07:08:54 +02:00
Diego Biurrun
6c5b0517e0 h264_refs: Fix debug tprintf argument types 2012-09-27 19:10:10 +02:00
Diego Biurrun
80412997c8 golomb: const correctness for get_ue()/get_se() function arguments 2012-09-27 19:10:10 +02:00
Diego Biurrun
e00215040a get_bits: const correctness for get_bits_trace()/get_xbits_trace() arguments 2012-09-27 19:10:10 +02:00
Diego Biurrun
4e5b7f31f7 dwt: Drop unused functions spatial_compose{53|97}i() 2012-09-27 12:08:09 +02:00
Diego Biurrun
0ae3ba8daa avcodec: Drop long-deprecated imgconvert.h header 2012-09-27 12:02:33 +02:00
Andrew D'Addesio
2a3d82ab46 Add Opus codec id and codec description.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-09-27 10:48:35 +02:00
Diego Biurrun
2dc1310484 truemotion2: Request samples for old TM2 headers 2012-09-26 19:10:13 +02:00
Alexandre Colucci
92d2b909a0 xsub: feed init_get_bits the whole buffer
Do not use rlelen field for buffer size in init_get_bits, it is
only the size of the data for the first field.
Since it is not reliable, just use the size of the whole buffer.

Additional comments add removal of unused rlelen variable by
Reimar Döffinger.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-25 22:28:53 +02:00
Martin Storsjö
375bff7084 libfdk-aac: Allow setting VBR modes via a private option
This avoids using the global_quality field and QSCALE flag for
passing the VBR modes, since the value range of the global_quality
field doesn't really map cleanly to this codec's VBR modes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-25 20:51:47 +03:00
Martin Storsjö
a10190dcd8 libfdk-aac: Warn the user that the VBR modes are unsupported
These modes were not originally exposed by the library at all.
In practice, only a few of them work for each sample rate/profile
combination, and they don't work at all for the more uncommon
sample rates.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-25 20:51:46 +03:00
Derek Buitenhuis
b62d4c16c9 Revert "cbrt_tablegen: Include libm.h"
This code runs on the host and should not use libm.h, which is meant
for the target.

This reverts commit 2768b71798.
2012-09-25 12:54:26 -04:00
Anton Khirnov
7a1a9dd56c pthread: make sure AVFrame.extended_data is set properly.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-25 12:03:23 +02:00
Nathan Caldwell
c8ba8be27e libfdk-aac: reindent after last commit
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-25 08:08:05 +03:00
Nathan Caldwell
94a69dee64 libfdk-aac: Limit to supported sample rates.
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-25 08:08:05 +03:00
Derek Buitenhuis
2768b71798 cbrt_tablegen: Include libm.h
Needed for cbrtf fallback on systems which lack it.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-09-24 22:47:47 -04:00
John Van Sickle
a716006a7d libx264: change default to closed gop to match x264cli
open-gop can be enabled with "-flags -cgop"

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-24 19:23:03 +02:00
Anton Khirnov
11d1ca4b2c Use avcodec_free_frame() to free AVFrames. 2012-09-24 12:31:25 +02:00
Anton Khirnov
a42aadabc6 lavc: add avcodec_free_frame().
Since an AVFrame now has malloced members (extended_data), it must have
a destructor.
2012-09-24 12:31:24 +02:00
Anton Khirnov
b437cec143 lavc: ensure extended_data is set properly on decoding 2012-09-24 12:31:24 +02:00
Anton Khirnov
2bc0de3858 lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults() 2012-09-24 12:31:24 +02:00
Anton Khirnov
c084a975aa lavc: use av_mallocz to allocate AVFrames.
Otherwise the frame is uninitialized, so avcodec_get_frame_defaults()
cannot determine whether to free extended_data.
2012-09-24 12:31:24 +02:00
Anton Khirnov
a83499b13b lavc: rename the argument of avcodec_alloc_frame/get_frame_defaults
AVFrame is used for both audio and video, so calling the argument 'pic'
is misleading.
2012-09-24 12:31:24 +02:00
Justin Ruggles
0ccf051a9d avcodec: fix memleak in avcodec_encode_audio2()
Ensure that padded_frame is freed before returning when needed.
2012-09-22 09:24:24 -04:00
Reimar Döffinger
c54e00610f sipr: fall back to setting mode based on bit_rate.
Not all applications (e.g. MPlayer) set block_align, and
when using a different demuxer it might not even be
easily available.
So fall back to selecting mode based on bit rate as before
if block_align has not useful value.
It can't be worse than failing to decode completely.

(cherry picked from commit 1d0d63052b)

CC: libav-stable@libav.org
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2012-09-21 20:11:23 +02:00
Anton Khirnov
e52e4fe10d libx264: add forgotten ; 2012-09-21 09:20:09 +02:00
Mans Rullgard
a27a690fac ARM: swap source operands in some add instructions
This allows using a 16-bit opcode when generating Thumb2 code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-09-20 17:07:18 +01:00
Mans Rullgard
a34a609fc1 motion_est: fix use of inline on extern functions
Inline functions declared without extern do not provide an external
definition in standard C99.  This code only works because most
compilers do not implement the inline semantics correctly.  With a
stricter compiler, linking fails with unresolved references to these
functions.

Declaring the functions extern inline works correctly with some
compilers while some others still fail to create external definitions.

For maximum portability, create a static inline version with an
externally visible wrapper for ff_get_mb_score.  ff_epzs_motion_search
is so large that no sane compiler inlines it anyway, so there the
inline keyword can simply be dropped with no effect.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-09-20 10:56:30 +01:00
John Van Sickle
9bf41210a9 libx264: add support for nal-hrd, required for Blu-ray streams.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-19 20:59:24 +02:00
Alex Converse
df6c3f9fb3 tiffdec: Add support for GRAY16LE.
Tested with the GraphicsMagick TIFF archive and Libav generated files.
2012-09-19 11:05:36 -07:00
Alex Converse
298ed797e1 tiffenc: Add support for little endian RGB48 and GRAY16 2012-09-19 11:05:36 -07: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
b16d001b62 rv34: use ff_MPV_common_frame_size_change()
Specialised functionality for size changes with the advantage of
supporting frame size changes during frame-based multithreading.
2012-09-19 11:06:40 +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
Luca Barbato
419ffb2390 avcodec: cleanup utils.c 2012-09-18 15:32:52 +02:00
Justin Ruggles
ee90119e9e binkaudio: remove unneeded GET_BITS_SAFE macro
Normal get_bits() already has overread protection.
2012-09-18 09:27:23 -04:00
Justin Ruggles
7bfd1766d1 binkaudio: use float sample format
Use planar for DCT codec, interleaved for RDFT codec.
2012-09-18 09:27:23 -04:00
Justin Ruggles
0801b5979b binkaudio: use a different value for the coefficient scale for the DCT codec
Eliminates the need for vector_fmul_scalar() in each frame.
2012-09-18 09:26:56 -04:00
Clément Bœsch
ee0f53e966 alsdec: fix misplaced parentheses.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-09-17 14:17:27 -04:00
Thilo Borgmann
ac3f5a6879 alsdec: check return values.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-09-17 14:17:27 -04:00
Thilo Borgmann
66197988b1 alsdec: fix number of decoded samples in first sub-block in BGMC mode.
Fixes CVE-2012-2790

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-09-17 14:17:27 -04:00
Thilo Borgmann
97f0efbfb8 alsdec: Fix out of ltp_gain_values read.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-09-17 14:17:27 -04:00
Michael Niedermayer
5b051ec3bd alsdec: Check that quantized parcor coeffs are within range.
ALS spec:
	11.6.3.1.1 Quantization and encoding of parcor coefficients
	...
	In all cases the resulting quantized values ak are restricted to the range [-64,63].

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-09-17 14:17:27 -04:00
Michael Niedermayer
9853e41aa0 alsdec: check opt_order.
Fixes out of array write in quant_cof.
Also make sure no invalid opt_order stays in the context.

Fixes CVE-2012-2775

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-09-17 14:17:26 -04:00
Michael Niedermayer
23aae62c2c alsdec: Check k used for rice decoder.
Values that fail this check will cause failure of decode_rice()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-09-17 14:17:26 -04:00
Anton Khirnov
34ebbbfeec xsubenc: reindent 2012-09-17 15:48:20 +02:00
Anton Khirnov
466b39efaf lavc: replace AVCodecContext.encode with subtitle-specific callback
AVCodecContext.encode is currently used only for subtitles, encode2 is
used for audio and video.
2012-09-17 15:48:20 +02:00
Anton Khirnov
9f64c8219a lavc: add const to private codec class initialization.
Silences a warning about discarding const.
2012-09-17 15:48:20 +02:00
Mans Rullgard
2568646abb mpegvideo: drop unnecessary arguments to hpel_motion()
These arguments are either constants or copies of MpegEncContext
fields just as easily accessed within the function.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-09-16 11:18:21 +01:00