Commit Graph

16604 Commits

Author SHA1 Message Date
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
Alex Converse
122d5c526a aacdec: Don't fall back to the old output configuration when no old configuration is present.
Fixes MP4 files where the first frame is broken.
2012-08-08 16:55:41 -07:00
Dave Yeo
197439c1ef x86: pngdsp: Fix assembly for OS/2
The a.out object format does not allow aligning sections.
On OS/2 LD aligns sections to 16 bytes.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-08 15:45:09 +02:00
Kostya Shishkov
e78e6c37ef g723_1: clip argument for 15-bit version of normalize_bits()
It expects maximum value to be 32767 but calculations in scale_vector()
which uses this function can give it ABS(-32768) which leads to wrong
result and thus clipping is needed.
2012-08-08 13:24:19 +02:00
Kostya Shishkov
f86b2f3661 g723_1: use all LPC vectors in formant postfilter
Due to some mistake LPC vector for the first subframe was used for all
subframes instead of their own LPC vectors.
2012-08-08 13:23:22 +02:00
Kostya Shishkov
8f2aa89a5d mpc8: do not leave padding after last frame in buffer for the next decode call 2012-08-08 09:11:38 +02:00
Anton Khirnov
94364b7d42 mpegaudioenc: list supported channel layouts. 2012-08-08 07:53:48 +02:00
Anton Khirnov
927e92cdc7 mpegaudiodec: don't print an error on > 1 frame in a packet.
It's a perfectly normal situation, nothing to spam about.
2012-08-08 07:53:48 +02:00
Anton Khirnov
5702c8670e api-example: update to new audio encoding API. 2012-08-08 07:53:47 +02:00
Mans Rullgard
2b140a3d09 x86: use 32-bit source registers with movd instruction
yasm tolerates mismatch between movd/movq and source register size,
adjusting the instruction according to the register.  nasm is more
strict.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-07 15:21:20 +01:00
Mans Rullgard
a3df4781f4 x86: add colons after labels
nasm prints a warning if the colon is missing.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-07 15:20:56 +01:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Anton Khirnov
104e10fb42 lavc: add AV prefix to codec ids. 2012-08-07 15:56:39 +02:00
Justin Ruggles
fdbeae4490 mpc8: add a flush function
Ensures that the next frame decoded after seeking will be decoded as a
keyframe.
2012-08-06 14:39:21 -04:00
Diego Biurrun
cf22705e87 nuv: K&R formatting cosmetics 2012-08-06 19:03:33 +02:00
Janne Grunau
859a579e9b nuv: check RTjpeg header for validity
CC: libav-stable@libav.org
2012-08-06 14:34:12 +02:00
Janne Grunau
110d015ad4 Revert "nuv: check per-frame header for validity."
The check is bogus since the nuv frameheader is already skipped
and the (decompressed) RTjpeg header is checked.

This reverts commit f6afacdb3b.

CC: libav-stable@libav.org
2012-08-06 14:33:50 +02:00
Mans Rullgard
b40ea0f41d imc: remove unused field IMCContext.one_div_log2
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-06 10:20:48 +01:00
Mans Rullgard
bc90230b98 imc: fix size of a memset()
IMCContext was changed from an array to a pointer in 66b84e4,
but this memset() was not updated.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-06 10:20:42 +01:00
Mans Rullgard
2b6804328e imc: remove empty if() block
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-06 10:20:11 +01:00
Diego Biurrun
2096857551 x86: h264_idct: Rename x264_add8x4_idct_sse2 --> h264_add8x4_idct_sse2 2012-08-05 21:40:49 +02:00
Derek Buitenhuis
965efc1673 dpx: Make start offset unsigned
Some corrupted files would end up with a negative offset,
and segfault.

Fixes bug #177.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-05 12:44:30 -04:00
Derek Buitenhuis
8b8750e061 cosmetics: Fix a few switched periods and linebreaks
Based on a patch by Piotr Bandurski.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-04 16:39:27 -04:00
Derek Buitenhuis
616fd4fe5e zerocodec: Fix memleak in decode_frame
If there was a failure inflating, or reinitializing
the zstream, the current frame's buffer would be lost.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-04 15:11:06 -04:00
Derek Buitenhuis
29facc1e91 zerocodec: Cosmetics
Be consistent with error messages and code formatting.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-04 15:11:06 -04:00
Mans Rullgard
e6cd698955 ARMv6: vp8: fix stack allocation with Apple's assembler
In the GNU assembler, a relational expression, bizarrely, has the
value -1 if true, whereas in Apple's it is +1.  This patch makes
sure the correct expression is used in both cases.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-04 00:59:14 +01:00
Mans Rullgard
9829a81bcd ARM: vp56: allow inline asm to build with clang
The clang integrated assembler does not support pre-UAL syntax,
while gcc requires pre-UAL syntax for ARM code.  A patch[1] for
clang to support the old syntax as well has been ignored since
January.

This patch chooses the syntax appropriate for each compiler,
allowing both to build the code.  Notably, this change allows
building for iphone with the latest Apple Xcode update.

[1] http://llvm.org/bugs/show_bug.cgi?id=11855

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-04 00:59:14 +01:00
Ronald S. Bultje
4a8143e73c fft: 3dnow: fix register name typo in DECL_IMDCT macro
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-04 00:16:02 +02:00
Diego Biurrun
0c3ff1982c x86: dct32: port to cpuflags 2012-08-03 22:51:06 +02:00
Diego Biurrun
239fdf1b4a x86: build: replace mmx2 by mmxext
Refactoring mmx2/mmxext YASM code with cpuflags will force renames.
So switching to a consistent naming scheme beforehand is sensible.
The name "mmxext" is more official and widespread and also the name
of the CPU flag, as reported e.g. by the Linux kernel.
2012-08-03 22:51:05 +02:00
Ronald S. Bultje
66adb7ce1b Revert "wmapro: prevent division by zero when sample rate is unspecified"
This reverts commit 3693608023. It was
already applied; no idea why it didn't error out while re-applying it.
2012-08-03 12:06:38 -07:00
Sean McGovern
3693608023 wmapro: prevent division by zero when sample rate is unspecified
This fixes Bugzilla #327:

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-08-03 12:04:47 -07:00
Ronald S. Bultje
7191e1c490 lagarith: fix color plane inversion for YUY2 output. 2012-08-03 11:09:17 -07:00
Ronald S. Bultje
98d0d19208 lagarith: pad RGB buffer by 1 byte.
For left HFYU prediction, we predict from the buffer buf+1 using 8- or
16-byte reads. This means that aligning the buffer by 16 bytes is in
itself not sufficient, because if the width itself is 16- or 8-byte
aligned, the buffer will not be padded, and thus a read of size 16 at
buf+1 will overflow boundaries at the right edge. Padding the buffer by
1 byte is sufficient to not overflow its boundaries.

Fixes bug 342.
2012-08-03 11:09:17 -07:00
Ronald S. Bultje
da6505ad2f dsputil: make add_hfyu_left_prediction_sse4() support unaligned src.
This makes add_hfyu_left_prediction_sse4() handle sources that are not
16-byte aligned in its own function rather than by proxying the call to
add_hfyu_left_prediction_ssse3(). This fixes a crash on Win64, since the
sse4 version clobberes xmm6, but the ssse3 version (which uses MMX regs)
does not restore it, thus leading to XMM clobbering and RSP being off.

Fixes bug 342.
2012-08-03 11:09:14 -07:00
Mashiat Sarker Shakkhar
9cc74c9f6e vc1dec: Remove separate scaling function for interlaced field MVs
The scaling process for obtaining direct MVs from co-located field MVs
is the same for interlaced field and progressive pictures.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-03 17:21:54 +02:00
Mashiat Sarker Shakkhar
8379ea5e9f vc1dec: Invoke edge_emulation regardless of MV precision
In VC-1 interlaced field pictures, chroma motion vectors can extend beyond
picture boundary even if luma vectors are bounded. The problem shows up
only for hpel interpolated MVs, and may be due to the way motion vectors
are scaled / cropped.

Thanks to Konstantin Shishkov for suggesting the fix. This fixes
long-known segfaults in MC-VC1.ts from videolan streams archive.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-03 17:21:54 +02:00
Diego Biurrun
ca844b7be9 x86: Use consistent 3dnowext function and macro name suffixes
Currently there is a wild mix of 3dn2/3dnow2/3dnowext.  Switching to
"3dnowext", which is a more common name of the CPU flag, as reported
e.g. by the Linux kernel, unifies this.
2012-08-03 14:00:47 +02:00
Kostya Shishkov
d3e0766fc0 g723_1: scale output as supposed for the case with postfilter disabled 2012-08-03 07:07:07 +02:00
Kostya Shishkov
94bfdfd6f0 g723_1: increase excitation storage by 4
Fixed codebook mode in 5300 rate may write up to SUBFRAME_LEN + 4 and
that is considered normal by the reference decoder. Without that additional
padding it might overwrite first elements of LPC history.
2012-08-03 07:07:07 +02:00
Kostya Shishkov
802bcdcb2f g723_1: fix upper bound parameter from inverse maximum autocorrelation 2012-08-03 07:07:07 +02:00
Kostya Shishkov
8ddadea171 g723_1: make scale_vector() behave like the reference 2012-08-03 07:07:07 +02:00
Kostya Shishkov
8772d2511a g723_1: fix off-by-one error in normalize_bits() 2012-08-03 07:07:07 +02:00
Kostya Shishkov
7f92db14f9 g723_1: save/restore excitation with offset to store LPC history
The same buffer with saved data is used later in LPC reconstruction, so
it should have some head space for LPC history.
2012-08-03 07:07:06 +02:00
Sean McGovern
3680b24351 wmapro: prevent division by zero when sample rate is unspecified
This fixes Bugzilla #327:

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-03 07:07:00 +02:00
Diego Biurrun
03737412a3 x86: proresdsp: improve SIGNEXTEND macro comments 2012-08-02 22:30:44 +02:00
Diego Biurrun
81905088a1 x86: h264dsp: K&R formatting cosmetics 2012-08-02 20:20:21 +02:00
Ronald S. Bultje
c728518b3c x86: fft: fix imdct_half() for AVX
Some calculations were changed in b6a3849 to use mmsize, which was not correct
for the AVX version, which uses INIT_YMM and therefore has mmsize == 32.

Fixes Bug 341.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-08-02 13:40:11 -04:00
Mans Rullgard
cfb1091898 vc1dec: remove useless #include simple_idct.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-02 12:14:52 +01:00
Mans Rullgard
af500c08bb dct-test: always link with aandcttab.o
This allows building dct-test even if aandcttab.o is not pulled in
by any enabled codec.  The DCT with which these tables are used does
not use them directly, so building it without the tables is possible.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-02 12:14:52 +01:00
Mans Rullgard
cf5781fad0 vp8: pack struct VP8ThreadData more efficiently
Reordering the members in this struct reduces the holes required
to maintain alignment.  With this order, the only remaining, and
unavoidable, hole is 3 bytes following left_nnz.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-02 12:14:52 +01:00
Mans Rullgard
ec7c501ed5 x86: remove libmpeg2 mmx(ext) idct functions
These functions are not faster than other mmx implementations on
any hardware I have been able to test on, and they are horribly
inaccurate.  There is thus no reason to ever use them.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-02 12:14:52 +01:00
Derek Buitenhuis
a675d73d57 eamad: Use dsputils instead of a custom bswap16_buf
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-01 22:07:04 -04:00
Derek Buitenhuis
45eaac02cb Canopus Lossless decoder
At the moment it only does BGR24, but I plan to add the rest after.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-01 22:06:16 -04:00
Diego Biurrun
19cf7163c1 dca: Switch dca_sample_rates to avpriv_ prefix; it is used across libs 2012-08-01 11:43:31 +02:00
Mans Rullgard
faa788227f ARM: use =const syntax instead of explicit literal pools
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-01 10:32:24 +01:00
Mans Rullgard
998170913c ARM: use standard syntax for all LDRD/STRD instructions
The standard syntax requires two destination registers for
LDRD/STRD instructions.  Some versions of the GNU assembler
allow using only one with the second implicit, others are
more strict.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-01 10:32:24 +01:00
Ronald S. Bultje
b6a3849adb fft: port FFT/IMDCT 3dnow functions to yasm, and disable on x86-64.
64-bit CPUs always have SSE available, thus there is no need to compile
in the 3dnow functions. This results in smaller binaries.
2012-07-31 21:20:47 -07:00
Ronald S. Bultje
ddbe71b44f dct-test: allow to compile without HAVE_INLINE_ASM. 2012-07-31 20:30:29 -07:00
Ronald S. Bultje
53dfaedc01 x86/dsputilenc: bury inline asm under HAVE_INLINE_ASM. 2012-07-31 20:28:52 -07:00
Diego Biurrun
9e4bca16f8 dca: Move tables used outside of dcadec.c to a separate file. 2012-08-01 00:17:17 +02:00
Diego Biurrun
13a79cf84e dca: Rename dca.c ---> dcadec.c
This will allow adding dca.c with tables used from other files.
2012-08-01 00:17:16 +02:00
Diego Biurrun
6376a3ad24 x86: h264dsp: Remove unused variable ff_pb_3_1 2012-08-01 00:17:16 +02:00
Diego Biurrun
8728b381cb x86: h264dsp: Adjust YASM #ifdefs
This fixes compilation with YASM disabled.
2012-07-31 13:54:07 +02:00
Ronald S. Bultje
b829b4ce29 h264: convert loop filter strength dsp function to yasm.
This completes the conversion of h264dsp to yasm; note that h264 also
uses some dsputil functions, most notably qpel. Performance-wise, the
yasm-version is ~10 cycles faster (182->172) on x86-64, and ~8 cycles
faster (201->193) on x86-32.
2012-07-30 19:39:47 -07:00
Diego Biurrun
0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Ronald S. Bultje
be391fb6df h264_ps: declare array of colorspace strings on its own line. 2012-07-29 14:53:42 -07:00
Mans Rullgard
f3eb008343 eamad/eatgq/eatqi: call special EA IDCT directly
These decoders use a special non-MPEG2 IDCT.  Call it directly
instead of going through dsputil.  There is never any reason
to use a regular IDCT with these decoders or to use the EA IDCT
with other codecs.

This also fixes the bizarre situation of eamad and eatqi decoding
incorrectly if eatgq is disabled.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-29 21:30:57 +01:00
Mans Rullgard
591766a3a9 eamad: remove use of MpegEncContext
There is no sense in pulling in this monster struct just for
a handful of fields.  The code does not call any functions
expecting an MpegEncContext.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-29 21:30:47 +01:00
Mans Rullgard
87cf481aa8 mpegvideo: remove unnecessary inclusions of faandct.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-29 21:28:45 +01:00
Ronald S. Bultje
c83f44dba1 h264_idct_10bit: port x86 assembly to cpuflags. 2012-07-28 08:29:45 -07:00
Ronald S. Bultje
b3c5ae5607 fft: rename "z" to "zc" to prevent name collision.
Without this, cglobal will expand "z" to "zh" to access the high byte
in a register's word, which causes a name collision with the ZH(x) macro
further up in this file.
2012-07-28 08:29:44 -07:00
Michael Niedermayer
45838561f2 vc1dec: Override invalid macroblock quantizer
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 14:13:22 +02:00
Michael Niedermayer
2bf369b60c vc1: avoid reading beyond the last line in vc1_draw_sprites()
Fixes overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 13:35:12 +02:00
Michael Niedermayer
1100acbab2 vc1dec: check that coded slice positions and interlacing match.
This fixes out of array writes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 13:34:05 +02:00
Michael Niedermayer
0aa907cfb1 vc1dec: Do not ignore ff_vc1_parse_frame_header_adv return value
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-28 13:34:05 +02:00
Ronald S. Bultje
4d777eedfd vp3: don't compile mmx IDCT functions on x86-64.
64-bit CPUs always have SSE2, and a SSE2 version exists, thus the MMX
version will never be used.
2012-07-27 20:12:30 -07:00
Ronald S. Bultje
a5bbb1242c h264_loopfilter: port x86 simd to cpuflags. 2012-07-27 20:12:11 -07:00
Ronald S. Bultje
d07ff3cd5a h264_chromamc_10bit: port x86 simd to cpuflags. 2012-07-27 17:35:49 -07:00
Ronald S. Bultje
4a26fdd852 vp3: port x86 SIMD to cpuflags. 2012-07-27 17:35:49 -07:00
Ronald S. Bultje
76888c64b0 rv34: port x86 SIMD to cpuflags. 2012-07-27 15:13:26 -07:00
Ronald S. Bultje
158744a4cd vp56: only compile MMX SIMD on x86-32.
All x86-64 CPUs have SSE2, so the MMX version will never be used. This
leads to smaller binaries.
2012-07-27 14:40:27 -07:00
Ronald S. Bultje
2734ba787b vp56: port x86 simd to cpuflags. 2012-07-27 14:39:07 -07:00
Ronald S. Bultje
5361e10a5e proresdsp: port x86 assembly to cpuflags. 2012-07-27 11:43:06 -07:00
Justin Ruggles
81f548de57 alac: check for truncated packets
This will give a clearer error message when the error is caused by a
truncated packet.
2012-07-27 13:52:20 -04:00
Justin Ruggles
fb57e913e1 alac: reverse lpc coeff order, simplify filter
Reversing the lpc coefficient order simplifies indexing in the filter.
2012-07-27 13:52:19 -04:00
Kostya Shishkov
0cf7d849ff tscc2: fix typo in array index 2012-07-27 07:34:38 +02:00
Diego Biurrun
8784959234 build: Rename aandct component to more descriptive aandcttables 2012-07-26 23:35:21 +02:00
Ronald S. Bultje
bde73f28af mpegaudio: bury inline asm under HAVE_INLINE_ASM. 2012-07-26 13:43:16 -07:00
Ronald S. Bultje
30b45d9c38 x86inc: automatically insert vzeroupper for YMM functions. 2012-07-26 13:43:16 -07:00
Michael Bradshaw
44dc9c6af0 libopenjpeg: support YUV and deep RGB pixel formats
Based on FFmpeg version from
commit 3275981207

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-26 10:20:04 +02:00
Carl Eugen Hoyos
92566540c3 Fix typo in v410 decoder.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-26 10:08:49 +02:00
Ronald S. Bultje
48098788c2 vp8: Replace x*155/100 by x*101581>>16.
Idea stolen from webp (by Pascal Massimino) - because it's Cool.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-25 14:37:03 -04:00
Ronald S. Bultje
a1878a88a1 vp3: don't use calls to inline asm in yasm code.
Mixing yasm and inline asm is a bad idea, since if either yasm or inline
asm is not supported by your toolchain, all of the asm stops working.
Thus, better to use either one or the other alone.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-25 14:24:30 -04:00
Ronald S. Bultje
79195ce565 x86/dsputil: put inline asm under HAVE_INLINE_ASM.
This allows compiling with compilers that don't support gcc-style
inline assembly.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-25 14:24:27 -04:00
Yang Wang
845e92fd6a dsputil_mmx: fix incorrect assembly code
In ff_put_pixels_clamped_mmx(), there are two assembly code blocks.
In the first block (in the unrolled loop), the instructions
"movq 8%3, %%mm1 \n\t", and so forth, have problems.

From above instruction, it is clear what the programmer wants: a load from
p + 8. But this assembly code doesn’t guarantee that. It only works if the
compiler puts p in a register to produce an instruction like this:
"movq 8(%edi), %mm1". During compiler optimization, it is possible that the
compiler will be able to constant propagate into p. Suppose p = &x[10000].
Then operand 3 can become 10000(%edi), where %edi holds &x. And the instruction
becomes "movq 810000(%edx)". That is, it will stride by 810000 instead of 8.

This will cause a segmentation fault.

This error was fixed in the second block of the assembly code, but not in
the unrolled loop.

How to reproduce:
    This error is exposed when we build using Intel C++ Compiler, with
    IPO+PGO optimization enabled. Crashed when decoding an MJPEG video.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-25 14:22:18 -04:00
Kieran Kunhya
160a27c590 libfdk-aacenc: add LATM/LOAS encapsulation support
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-25 20:32:33 +03:00
Diego Biurrun
65d94f63ca aac: Mention abbreviation as well in long_name
Most people know the codec as "AAC" and not "Advanced Audio Coding".
2012-07-24 02:37:49 +02:00
Derek Buitenhuis
d04c5293ce v410dec: Implement explode mode support
Try and decode broken files, but still fail if explode
mode is enabled.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-23 11:36:48 -04:00
Reimar Döffinger
6c8fdfc5e5 zerocodec: fix direct rendering.
Set picture type before calling get_buffer.
This allows the DR application to make better decisions.
It also fixes a resource leak in case of missing reference frames
since it would call get_buffer but never release_buffer.
Also use FFSWAP to ensure that the AVFrame is properly initialized
in the next get_buffer (in particular that data[0] is NULL).

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-23 11:35:21 -04:00
Hendrik Leppkes
37c6ad2345 wavpack: set bits_per_raw_sample for S32 samples to properly identify 24-bit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-23 11:33:58 -04:00
Ronald S. Bultje
58db34aa1e h264: refactor NAL decode loop
Write out the NAL decoding loops in full so that they are easier
to parse for a preprocessor without it having to be aware of macros
or other such things in C code.

This also makes the code more readable.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-23 16:27:53 +02:00
Justin Ruggles
a35738f424 dsputil: ppc: cosmetics: pretty-print 2012-07-22 17:38:55 -04:00
Jason Garrett-Glaser
85a3c19ed1 dsputil: x86: add SHUFFLE_MASK_W macro
Simplifies pshufb masks that operate on words.
2012-07-22 16:56:58 -04:00
Kostya Shishkov
1470ce21ce Bump libavcodec and libavformat minor versions for G.723.1 decoder and demuxer 2012-07-22 08:43:12 +02:00
Mohamed Naufal Basheer
55c3a4f617 G.723.1 demuxer and decoder
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-22 07:58:54 +02:00
Mohamed Naufal Basheer
8aac5585fa Add a shift parameter to celp_lp_synthesis_filter()
This is intended for reuse by the G.723.1 decoder

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-07-22 07:58:53 +02:00
Luca Barbato
51a5ddfa01 libopenjpeg: K&R formatting cosmetics 2012-07-22 04:05:45 +02:00
Ronald S. Bultje
b170b323e3 ac3: don't use different names for option tables in the template file.
The variables which are declared in the teplate file are static and
therefore there is no symbol clash.
2012-07-21 16:42:36 -07:00
Ronald S. Bultje
98041afb5f adpcm: don't duplicate identical AVSampleFmt array for each encoder. 2012-07-21 16:31:15 -07:00
Luca Barbato
ce64e5bfd1 libopenjpeg: introduce lowres and lowqual private options
OpenJPEG can decode in lower resolution or decode only a number
of enhancement layers.
2012-07-20 13:23:18 +02:00
Justin Ruggles
4cd22b7738 alac: fix channel pointer assignment for 24 and 32-bit
Needs to be done separately for each element.
2012-07-19 20:14:29 -04:00
Justin Ruggles
eeb55f5f2f alac: cosmetics: general pretty-printing and comment clean up 2012-07-19 13:26:48 -04:00
Justin Ruggles
f3e5a7844b alac: calculate buffer size outside the loop in allocate_buffers() 2012-07-19 13:26:48 -04:00
Justin Ruggles
bae83f2c74 alac: change some data types to plain int 2012-07-19 13:26:48 -04:00
Justin Ruggles
2aebac6918 alac: cosmetics: rename some variables and function names 2012-07-19 13:26:48 -04:00
Andrew D'Addesio
1b3ef155d7 alac: multi-channel decoding support
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-07-19 13:26:48 -04:00
Justin Ruggles
81c9e2e6d0 alac: split element parsing into a separate function
This will make multi-channel implementation simpler.
Based partially on a patch by Andrew D'Addesio <modchipv12@gmail.com>.
2012-07-19 13:26:48 -04:00
Justin Ruggles
cd632619d9 alac: support a read sample size of up to 32
Use get_bits_long() in decode_scalar().
Use unsigned int for decoded value.
2012-07-19 13:26:48 -04:00
Justin Ruggles
73dc0db486 alac: output in planar sample format
Avoids unneeded interleaving and allows for reusing the AVFrame output buffer
as the internal buffer for 24-bit and 32-bit sample size.
2012-07-19 13:26:48 -04:00
Justin Ruggles
6482bd8831 alac: add 32-bit decoding support 2012-07-19 13:26:48 -04:00
Andrew D'Addesio
6cda74c155 alac: simplify channel interleaving
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-07-19 13:26:48 -04:00
Justin Ruggles
5138ff143f alac: use AVPacket fields directly in alac_decode_frame() 2012-07-19 13:26:47 -04:00
Justin Ruggles
7a206eb32f alac: fix check for valid max_samples_per_frame 2012-07-19 13:26:47 -04:00
Justin Ruggles
1193d3fedd alac: use get_sbits() to read LPC coefficients instead of casting 2012-07-19 13:26:47 -04:00
Justin Ruggles
7a50ec6799 alac: move the current samples per frame to the ALACContext
This will simplify the multi-channel implementation.
2012-07-19 13:26:47 -04:00
Justin Ruggles
46043962ea alac: avoid using a double-negative when checking if the frame is compressed 2012-07-19 13:26:47 -04:00
Justin Ruggles
9a6c528e08 alac: factor out output_size check in predictor_decompress_fir_adapt() 2012-07-19 13:26:47 -04:00
Justin Ruggles
ebd4c3add1 alac: factor out loading of next decoded sample in LPC prediction 2012-07-19 13:26:47 -04:00
Justin Ruggles
a4ecd41442 alac: use index into buffer_out instead of incrementing the pointer 2012-07-19 13:26:47 -04:00
Justin Ruggles
f2515cd629 alac: simplify lpc coefficient adaptation 2012-07-19 13:26:47 -04:00
Justin Ruggles
abc4376b31 alac: reduce the number of local variables needed in lpc prediction 2012-07-19 13:26:47 -04:00
Justin Ruggles
01880d287b alac: simplify 1st order prediction and reading of warm-up samples 2012-07-19 13:26:46 -04:00
Justin Ruggles
d0c0bf0d3e alac: cosmetics: reindent after last commit 2012-07-19 13:26:46 -04:00
Justin Ruggles
79def4c523 alac: remove unneeded conditionals in predictor_decompress_fir_adapt() 2012-07-19 13:26:46 -04:00
Justin Ruggles
4bcd637dcb alac: use sizeof() instead of hardcoded data sizes 2012-07-19 13:26:46 -04:00
Justin Ruggles
91620a04f1 alac: make block_size signed
It does not need to be unsigned.
2012-07-19 13:26:46 -04:00
Justin Ruggles
2fc24b3273 alac: remove a duplicate local variable 2012-07-19 13:26:46 -04:00
Justin Ruggles
5177413d20 alac: conditionally set sign_modifier to 1
It is already unconditionally set to 0 prior to this, so we can modify it
only when needed.
2012-07-19 13:26:46 -04:00
Justin Ruggles
7e6593e977 alac: eliminate 2 unneeded local variables in bastardized_rice_decompress()
x_modified is just unnecessary, and final_val can be removed by simplifying
the unsigned-to-signed conversion.
2012-07-19 13:26:46 -04:00
Justin Ruggles
6fd8a28b59 alac: adjust conditions for updating entropy decoder history
avoids some unnecessary arithmetic in certain situations
2012-07-19 13:26:46 -04:00
Justin Ruggles
a06fdadd97 alac: cosmetics: reindent after last commit 2012-07-19 13:26:46 -04:00
Justin Ruggles
d9837434a9 alac: limit the rice param before passing to decode_scalar()
reduces the number of parameters to decode_scalar() and slightly simplifies
the code
2012-07-19 13:26:45 -04:00
Justin Ruggles
6e91f62256 alac: reduce the number of parameters to bastardized_rice_decompress()
Use the ALACContext fields directly instead.
2012-07-19 13:26:45 -04:00
Justin Ruggles
836e8b9ba0 alac: cosmetics: rename some ALACContext parameters 2012-07-19 13:26:45 -04:00
Justin Ruggles
2ac1737583 alac: clean up and update comments leftover from reverse-engineering 2012-07-19 13:26:45 -04:00
Mans Rullgard
bf1cf4d5a5 flacdec: reverse lpc coeff order, simplify filter
Reversing the lpc coefficient order simplifies indexing in
the filter.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-19 10:21:32 +01:00
Diego Biurrun
9f97af2688 x86: dsputil: drop some unused CPU flag debug code 2012-07-19 10:17:56 +02:00
Mans Rullgard
ffdd93a25e ppc: fix build with altivec disabled
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-18 13:34:42 +01:00
Mans Rullgard
28f9ab7029 vp3: move idct and loop filter pointers to new vp3dsp context
This moves all VP3-specific function pointers from dsputil to a
new vp3dsp context.  There is no reason to ever use the VP3 IDCT
where an MPEG2 IDCT is expected or vice versa.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-18 10:32:19 +01:00
Mans Rullgard
ab9f987661 build: add CONFIG_VP3DSP, reduce repetition in OBJS lists
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-07-18 10:32:18 +01:00
Kostya Shishkov
4cfb0d871d tscc2: do not add/subtract 128 bias during DCT
It turns out that the reference decoder subtracts 128 from DC during block
decode but adds it back during reordering block with zigzag pattern.
Transforming block with incorrect DC caused heavy visual artifacts for
many quantisers.
2012-07-18 07:05:59 +02:00
Kostya Shishkov
3c6c19184c tscc2: fix typo in DCT 2012-07-18 07:05:53 +02:00
Michael Bradshaw
453c02f971 libopenjpeg: introduce encoding support
Based on FFmpeg version from
commit 713a7854e0

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-17 14:56:58 +02:00
Michael Bradshaw
b43a7bb4f9 libopenjpeg: rename decoder source file.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-17 14:56:22 +02:00
Kostya Shishkov
0b40153d20 tscc2: DCT output should not be clipped
This fixes decoding some TSCC2 files with large quantisers.
2012-07-17 07:21:24 +02:00
Mohammad Alsaleh
c37c383e59 libfdk-aac: Check if cutoff value is valid
Passing a cutoff value < sample_rate/256 will cause a crash.
Also, values >20000 will have no effect and 20000 will be used anyway.

Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-15 21:59:51 +03:00
Mashiat Sarker Shakkhar
082829520e vc1dec: Do not use random pred_flag if motion vector data is skipped
This fixes SA10143.vc1 from test-suite. Also partially fixes MC-VC1.ts
from videolan streams archive.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-15 14:02:38 +03:00
Martin Storsjö
25f056e6d4 vp8: Enclose pthread function calls in ifdefs
This fixes building with threads disabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-15 13:55:18 +03:00
Ronald S. Bultje
c44091a9f7 snow: refactor code to work around a compiler bug in MSVC.
This fixes the compiler error "cannot convert from 'BlockNode' to
'int16_t'".
2012-07-14 19:19:34 -07:00
Martin Storsjö
a794600c00 vp8: Include the thread headers before using the pthread types
This was unnoticed on linux, since stdlib.h apparently includes
files declaring the pthread_mutex_t and pthread_cond_t types.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-07-14 19:19:33 -07:00
Daniel Kang
951455c1c1 vp8: implement sliced threading
Testing gives 25-30% gain on HD clips with two threads and
up to 50% gain with eight threads.

Sliced threading uses more memory than single or frame threading.

Frame threading and single threading keep the previous memory
layout.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-14 20:18:54 +02:00
Daniel Kang
17343e3952 vp8: move data from VP8Context->VP8Macroblock
In preparation for sliced threading.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-14 20:18:54 +02:00
Daniel Kang
337ade52de vp8: refactor decoding a single mb_row
This is in preperation for sliced threading.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-14 20:18:54 +02:00
Janne Grunau
f30260d32a imgconvert: deprecate avcodec_find_best_pix_fmt() 2012-07-13 19:22:46 +02:00
Janne Grunau
ac29054fda imgconvert: add avcodec_find_best_pix_fmt2()
The number of pixel formats outgrew the number of available bits in
the bitmask used in avcodec_find_best_pix_fmt().
avcodec_find_best_pix_fmt2() uses a PIX_FMT_NONE terminated list
of pixel formats instead.
2012-07-13 19:22:46 +02:00
Janne Grunau
39bb27bf79 imgconvert: avoid undefined left shift in avcodec_find_best_pix_fmt
CC: libav-stable@libav.org
2012-07-13 17:29:27 +02:00