Commit Graph

16470 Commits

Author SHA1 Message Date
Derek Buitenhuis
aa7a565101 cllc: Pad swapped buffer
The bitstream buffer must be padded, or the bitstream reader might
read over the end.

Fixes the following valgrind warning:
    Use of uninitialised value of size 8 at 0x591BAE: cllc_decode_frame (cllc.c:166)

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-24 22:19:21 -04:00
Jan Ekström
01cb4c84f5 utvideodec: Fix single symbol mode decoding
Put the zero length check in place of code that was never used
during decoding, as zero-length slices were generally refused
in decode_frame().

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-24 13:12:31 +02:00
Mans Rullgard
081bab5ee3 truespeech: drop useless casts
These values already have the correct types.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-24 10:45:39 +01:00
Mans Rullgard
0c88e7a255 libavcodec: drop bogus dependencies from mpc[78] and qdm2
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-24 10:45:39 +01:00
Mans Rullgard
2e2b8ef8e0 mpegaudio: move ff_mpa_enwindow to a separate file
This table is used only by mpegaudiodsp and mpegaudioenc.  Separating
it allows dropping some dependencies from mpc[78] and qdm2.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-24 10:45:39 +01:00
Anton Khirnov
4d7adec8bd AVOptions: store defaults for INT64 options in int64 union member.
Double does not have enough precision to represent all int64 numbers
exactly.
2012-08-24 11:25:06 +02:00
Diego Biurrun
dc40285427 x86: mpegvideo: more sensible names for optimization file and init function 2012-08-24 02:23:16 +02:00
Diego Biurrun
d211547ddd x86: mpegvideoenc: Split optimizations off into a separate file 2012-08-24 02:23:16 +02:00
Diego Biurrun
26ce9aec03 dnxhdenc: x86: more sensible names for optimization file and init function 2012-08-24 02:23:15 +02:00
Diego Biurrun
f1e06d37c9 svq1/svq3: Move common code out of SVQ1 decoder-specific file 2012-08-24 02:23:15 +02:00
Jordi Ortiz
43da682c87 dirac: add Comments and references to the standard
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-24 02:23:14 +02:00
Justin Ruggles
a0a5fed908 vorbisenc: set AVCodecContext.bit_rate to 0
The Vorbis encoder is always VBR.
2012-08-22 19:58:46 -04:00
Justin Ruggles
890fddd0ea vorbisenc: fix quality parameter
This generates output with bitrates similar to libvorbis for a given quality
value.
2012-08-22 19:58:39 -04:00
Justin Ruggles
4b0e0f31bf lpc: fix alignment of windowed samples for odd maximum LPC order
Fixes crash on x86 due to alignment requirements for w_data in
lpc_apply_welch_window_sse2().
2012-08-22 16:41:50 -04:00
Justin Ruggles
f24cc1b2f1 alacenc: use s16p sample format as input 2012-08-22 16:41:41 -04:00
Justin Ruggles
358078d9bb alacenc: remove unneeded sample_fmt check 2012-08-22 16:41:33 -04:00
Justin Ruggles
ec7a212f9f alacenc: fix max_frame_size calculation for the final frame 2012-08-22 16:41:23 -04:00
Justin Ruggles
5d4ef004bf adpcm_swf: Use correct sample offsets when using trellis.
Fixes invalid reads when encoding mono streams when trellis is used.
2012-08-22 12:43:51 -04:00
Michael Niedermayer
ac33016158 mjpegdec: support AVRn interlaced
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-22 17:44:43 +02:00
Diego Biurrun
6fa488678f build: x86: Only compile mpegvideo optimizations when necessary 2012-08-22 01:06:33 +02:00
Diego Biurrun
4264a0dd54 build: Make the E-AC-3 encoder select the AC-3 encoder
The E-AC-3 encoder depends on almost all of the code of the AC-3
encoder, so it makes no sense to enable one without the other.
2012-08-22 01:02:17 +02:00
Jordi Ortiz
72e8d86b19 dirac: use meaningful return values
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-21 15:51:52 +02:00
Mans Rullgard
44c56a1617 flacdec: simplify sample buffer handling
Pass pointer to sample buffer instead of channel number to various
functions called from decode_subframe().  Also simplify a few
expressions within this function.
2012-08-21 11:23:13 +01:00
Mans Rullgard
ea98507db0 flacdec: simplify loop in decode_residuals() 2012-08-21 11:23:13 +01:00
Diego Biurrun
deb23777f2 build: amrwb: Drop redundant lsp dependency declaration 2012-08-20 16:21:48 +02:00
Jan Ekström
1ab5a78042 lavc: add Ut Video encoder
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-08-20 11:22:59 +02:00
Anton Khirnov
677e763a55 mpegvideo_enc: remove stray duplicate line from 7f9aaa4 2012-08-20 10:05:49 +02:00
Mans Rullgard
4855022aa1 vorbisdec: remove some pointless comments
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-19 12:59:58 +01:00
Mans Rullgard
11434c9b13 pthread: add const to AVCodec pointers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-18 14:20:57 +01:00
Anton Khirnov
7f9aaa499b mpegvideo_enc: don't use deprecated avcodec_encode_video(). 2012-08-18 08:48:30 +02:00
Anton Khirnov
91e59fea30 lavc: add avcodec_descriptor_get_by_name(). 2012-08-18 08:48:30 +02:00
Anton Khirnov
0a0f19b577 lavc: add const to AVCodec* function parameters. 2012-08-18 08:48:30 +02:00
Uoti Urpala
2e8f3cbcda h264: vdpau: fix crash with unsupported colorspace
The h264_vdpau decoder crashed if output colorspace was not 8-bit 420.
Add a check to error out instead (current hardware does not support
other colorspaces, so successful decoding is not possible).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 20:08:53 +03:00
Martin Storsjö
ca00a7e809 amrwbdec: Decode the fr_quality bit properly
The way this bit is decoded was accidentally flipped in b70feb405,
leading to warnings "Encountered a bad or corrupted frame" for each
decoded frame.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 20:08:40 +03:00
Luca Barbato
4aa3d7b3f2 libvpxenc: use the default bitrate if not set
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-17 12:47:45 +02:00
Jan Ekström
77f47e3288 utvideo: Rename utvideo.c to utvideodec.c
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-17 12:36:55 +02:00
Luca Barbato
0f64cd1e81 mjpegdec: more meaningful return values 2012-08-17 01:29:19 +02:00
Martin Storsjö
7ebe3962f3 Add missing includes for code relying on external libraries
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-16 16:47:02 +03:00
Martin Storsjö
232e35de2e Fix even more missing includes after the common.h removal
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-16 14:23:59 +03:00
Diego Biurrun
f704a079a1 build: Factor out rangecoder dependencies to CONFIG_RANGECODER
A new hidden config variable is added for the codecs that depend on
the rangecoder parts.
2012-08-16 11:05:39 +02:00
Diego Biurrun
c292f6a24d build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
A new hidden config variable is added for the codecs that depend on
the error resilience parts.
2012-08-16 11:05:38 +02:00
Diego Biurrun
6961bdface x86: avcodec: Consistently name all init files 2012-08-16 11:05:38 +02:00
Martin Storsjö
33e112847d Add more missing includes after removing the implicit common.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-16 10:49:54 +03:00
Martin Storsjö
70766c2182 Add some more missing includes after removing the implicit common.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 23:48:48 +03:00
Martin Storsjö
1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Anton Khirnov
661454aa28 api-example: use new video encoding API. 2012-08-15 08:45:27 +02:00
Diego Biurrun
29cfdd3767 x86: avcodec: Appropriately name files containing only init functions 2012-08-15 03:24:08 +02:00
Diego Biurrun
be12958937 mpegvideo_mmx_template: drop some commented-out cruft 2012-08-15 03:24:07 +02:00
Diego Biurrun
11928d24fe w32pthreads: Add missing #includes to make header compile standalone 2012-08-14 23:36:56 +02:00
Maksalov Boris
c0f4cf7798 prores: interlaced ProRes encoding
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-14 19:28:50 +02:00
Mans Rullgard
0d230e9312 g723.1: simplify scale_vector()
It is impossible for bits to be 15 here so the special case is
not needed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-14 12:08:30 +01:00
Mans Rullgard
a4b8fc3a8a g723.1: simplify normalize_bits()
This function is always called with a non-negative argument, so
those special cases are not needed.  In the places the argument
might be zero, the return value for a zero argument does not matter
since it would then be used to scale an array full of zeros.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-14 12:08:29 +01:00
Sebastien Zwickert
063910f54d vda: cosmetics: fix Doxygen comment formatting
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 12:48:52 +02:00
Sebastien Zwickert
694be29f13 vda: better frame allocation
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 12:48:46 +02:00
Sebastien Zwickert
dc87ac55ab vda: Merge implementation into one file
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 12:48:08 +02:00
Sebastien Zwickert
3c37970637 vda: support synchronous decoding
Note that the symbols used to run the hardware decoder in asynchronous mode
have been marked deprecated and will be dropped at a future version bump.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 12:47:27 +02:00
Sebastien Zwickert
cfc680ab39 vda: Reuse the bitstream buffer and reallocate it only if needed
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 12:47:15 +02:00
Diego Biurrun
ad08dfd594 build: Factor out mpegvideo encoding dependencies to CONFIG_MPEGVIDEOENC
A new hidden config variable is added for the codecs that depend on
the mpegvideo encoding parts.
2012-08-14 10:04:34 +02:00
Boris Maksalov
cee03436e6 proresenc: use the edge emulation buffer
Prevents reading past the end of frame buffer.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-13 21:04:00 +02:00
Mans Rullgard
d752509b74 Use log2(x) instead of log(x) / log(2)
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 17:59:21 +01:00
Mans Rullgard
8ec0204ee4 x86: cabac: allow building with suncc
This fixes two issues preventing suncc from building this code.

The undocumented 'a' operand modifier, causing gcc to omit a $ in
front of immediate operands (as required in addresses), is not
supported by suncc.  Luckily, the also undocumented 'c' modifer
has the same effect and is supported.

On some asm statements with a large number of operands, suncc for no
obvious reason fails to correctly substitute some of the operands.
Fortunately, some of the operands in these statements are plain
numbers which can be inserted directly into the code block instead
of passed as operands.

With these changes, the code builds correctly with both gcc and
suncc.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 14:51:52 +01:00
Mans Rullgard
c8252e80eb x86: mlpdsp: avoid taking address of void
This code contains a C array of addresses of labels defined in
inline asm.  To do this, the names must be declared as external
in C.  The declared type does not matter since only the address is
used, and for some reason, the author of the code used the 'void'
type despite taking the address of a void expression being invalid.

Changing the type to char, a reasonable choice since the alignment
of the code labels cannot be known or guaranteed, eliminates gcc
warnings and allows building with suncc.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 14:51:52 +01:00
Mans Rullgard
69665bd6f4 g723.1: do not pass large structs by value
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
138914dcd8 g723.1: do not bounce intermediate values via memory
Although a reasonable compiler will probably optimise out the
actual store and load, this operation still implies a truncation
to 16 bits which the compiler will probably not realise is not
necessary here.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
cbcf1b411f g723.1: declare a variable in the block it is used
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
35b533e4de g723.1: avoid saving/restoring excitation
Writing the scaled excitation to a scratch buffer (borrowing the
'audio' array) instead of modifying it in place avoids the need
to save and restore the unscaled values.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
4b728b4712 g723.1: avoid unnecessary memcpy() in residual_interp()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
f645710cf3 g723.1: make postfilter write directly to output buffer
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
1953264331 g723.1: drop unnecessary variable buf_ptr in formant_postfilter()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
b2af2c4bee g723.1: make scale_vector() output to a separate buffer
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
783da0d696 g723.1: make autocorr_max() work on an arbitrary buffer
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
3716105103 g723.1: do not needlessly use int64_t
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
47c73a73b0 g723.1: use saturating addition functions
Use saturating addition functions instead of 64-bit intermediates
and separate clipping.  This is much faster when dedicated
instructions are available.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
4aca716a53 g723.1: optimise scale_vector()
Firstly, nothing in this function can overflow 32 bits so the use
of a 64-bit type is completely unnecessary.  Secondly, the scale
is either a power of two or 0x7fff.  Doing separate loops for these
cases avoids using multiplications.  Finally, since only the number
of bits, not the actual value, of the maximum value is needed, the
bitwise or of all the values serves the purpose while being faster.

It is worth noting that even if overflow could happen, it was not
handled correctly anyway.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
1eb1f6f281 g723.1: remove useless uses of MUL64()
The operands in both cases are 16-bit so cannot overflow a 32-bit
destination.  In gain_scale() the inputs are reduced to 14-bit,
so even the shift cannot overflow.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
5a43eba956 g723.1: remove unnecessary argument 'shift' from dot_product()
The 'shift' argument is always 1 so there is no need to pass it
explicitly in every call.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
8b0de73464 g723.1: deobfuscate "(x << 4) - x" to "15 * x"
The compiler performs this optimisation.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Mans Rullgard
fddc5b9bea celp: optimise ff_celp_lp_synthesis_filter()
Adding instead of subtracting the products in the loop allows the
compiler to generate more efficient multiply-accumulate instructions
when 16-bit multiply-subtract is not available. ARM has only
multiply-accumulate for 16-bit operands.  In general, if only one
variant exists, it is usually accumulate rather than subtract.

In the same spirit, using the dedicated saturation function enables
use of any special optimised versions of this.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00
Derek Buitenhuis
17c11cef9f cllc: Implement ARGB support
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-12 15:21:15 -04:00
Derek Buitenhuis
7fda47d53b cllc: Add support for QRGB
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-12 15:07:00 -04:00
Derek Buitenhuis
f4bb38cc26 cllc: Rename some funcs to represent what they actually do
This is in preparation for adding support for other colorspaces
and coding types.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-12 15:07:00 -04:00
Diego Biurrun
3b9e832e17 x86: Drop silly "_yasm" suffixes from filenames 2012-08-12 17:13:05 +02:00
Anton Khirnov
51efed152d lavc: add an intra-only codec property. 2012-08-11 11:34:09 +02:00
Anton Khirnov
c223d79945 lavc: add codec descriptors.
They describe properties that are inherent to a codec (as described by
an AVCodecID) without referring to a specific implementation.
2012-08-11 11:32:11 +02:00
Anton Khirnov
2ff67c909c lavc: fix mixing CODEC_ID/AV_CODEC_ID in C++ code.
C++ does not allow to mix different enums, so e.g. code comparing
ACodecID with CodecID would fail to compile with gcc.

This very evil hack should fix this problem.
2012-08-10 18:48:40 +02:00
Mans Rullgard
05c36e0e5f g723.1: fix addition overflow
This addition must be done as 64-bit to avoid overflow and for
the subsequent clipping to be meaningful.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 12:18:38 +01:00
Mans Rullgard
52aa3015a3 g723.1: simplify and fix multiplication overflow
In 16-bit arithmetic, x * 0xffffc is simply x * -4 with extra overflows,
(and the constant was probably meant to be 0xfffc).  Combined with the
shift, this simplifies to -x >> 1.  Finally, clearing the low two bits
with a 32-bit mask and switching to a 32-bit type allows more efficient
code on 32-bit machines.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 12:18:38 +01:00
Mans Rullgard
e141cf2c57 g723.1: deobfuscate an expression
(x << 2) - x is just an optimisation of 3 * x the compiler is
perfectly capable of doing on its own.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 12:18:38 +01:00
Mans Rullgard
e2b7c5783d g723.1: remove unused #includes
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 12:18:38 +01:00
Diego Biurrun
804d7a1aa6 doxygen: Fix function parameter names to match the code 2012-08-09 20:05:55 +02:00
Mans Rullgard
0db9eba48c motion_est: drop inline from sad_hpel_motion_search()
This function is only ever called through a function pointer,
so marking it inline makes no sense.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 12:27:49 +01:00
Mans Rullgard
5bf7bc625b motion_est: remove unused macros
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 12:27:49 +01:00
Mans Rullgard
74f82f92a4 motion_est: remove useless no_motion_search() function
At both places this function is called, mb_[xy] == s->mb_[xy]
making the call together with following code equivalent to
simply assigning zeros.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 12:27:49 +01:00
Hendrik Leppkes
f9150c8ac0 lagarith: frame multithreading
About 2x speedup going from 1 to 2 threads.
1.7s to 0.85s on foreman CIF.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-08-09 10:50:27 +02:00
Diego Biurrun
36a8c43073 doxygen: qdm2: Drop documentation for non-existing function parameters 2012-08-09 03:49:44 +02:00
Mans Rullgard
f69f4036f8 mpegvideo: reduce excessive inlining of mpeg_motion()
The main benefit of inlining this function is from constant
propagation for the 'field_based' argument.  Instead of inlining
all calls, create two versions of the function for field_based
values of 0 and 1.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 01:31:37 +01:00
Mans Rullgard
7a851153d3 mpegvideo: convert mpegvideo_common.h to a .c file
This file defines a single, huge function, MPV_motion(), which
although being declared inline is not actually inlined by the
compiler (for good reason).  There is thus no sense in defining
this function in a header file, resulting in multiple copies of
it in the final library.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 01:31:37 +01:00
Mans Rullgard
18bbca1fd3 build: factor out mpegvideo.o dependencies to CONFIG_MPEGVIDEO
This adds a hidden config variable for the mpegvideo.o dependency
and selects from the codecs which require it.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 01:31:37 +01:00
Mans Rullgard
d7a4f8f8b9 Move MASK_ABS macro to libavcodec/mathops.h
This macro is only used in two places, both in libavcodec, so this
is a more sensible place for it.

Two small tweaks to the macro are made:

- removing the trailing semicolon
- dropping unnecessary 'volatile' from the x86 asm

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 00:58:20 +01:00
Mans Rullgard
c318626ce2 x86: rename libavutil/x86_cpu.h to libavutil/x86/asm.h
This puts x86-specific things in the x86/ subdirectory where they
belong.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 00:58:20 +01:00