platform/upstream/libav.git
12 years agoDon't include common.h from avutil.h
Martin Storsjö [Mon, 6 Aug 2012 13:49:32 +0000 (16:49 +0300)]
Don't include common.h from avutil.h

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agortmp: Automatically compute the hash for SWFVerification
Samuel Pitoiset [Wed, 15 Aug 2012 14:11:50 +0000 (16:11 +0200)]
rtmp: Automatically compute the hash for SWFVerification

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agortmp: Add support for SWFVerification
Samuel Pitoiset [Mon, 13 Aug 2012 15:05:00 +0000 (17:05 +0200)]
rtmp: Add support for SWFVerification

Specifies how the server verifies client SWF files before allowing the
files to connect to an application. Verifying SWF files is a security
measure that prevents someone from creating their own SWF files that can
attempt to stream your resources.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoapi-example: use new video encoding API.
Anton Khirnov [Tue, 31 Jul 2012 14:35:18 +0000 (16:35 +0200)]
api-example: use new video encoding API.

12 years agox86: avcodec: Appropriately name files containing only init functions
Diego Biurrun [Sat, 11 Aug 2012 20:45:53 +0000 (22:45 +0200)]
x86: avcodec: Appropriately name files containing only init functions

12 years agompegvideo_mmx_template: drop some commented-out cruft
Diego Biurrun [Mon, 13 Aug 2012 10:28:59 +0000 (12:28 +0200)]
mpegvideo_mmx_template: drop some commented-out cruft

12 years agolibavresample: add mix level normalization option
John Stebbins [Thu, 2 Aug 2012 18:23:06 +0000 (11:23 -0700)]
libavresample: add mix level normalization option

Provides an option to disable mix level normalization

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agow32pthreads: Add missing #includes to make header compile standalone
Diego Biurrun [Tue, 14 Aug 2012 21:17:20 +0000 (23:17 +0200)]
w32pthreads: Add missing #includes to make header compile standalone

12 years agortmp: Gracefully ignore _checkbw errors by tracking them
Samuel Pitoiset [Sat, 11 Aug 2012 10:42:17 +0000 (12:42 +0200)]
rtmp: Gracefully ignore _checkbw errors by tracking them

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agortmp: Do not send _checkbw calls as notifications
Samuel Pitoiset [Sat, 11 Aug 2012 10:41:33 +0000 (12:41 +0200)]
rtmp: Do not send _checkbw calls as notifications

The _checkbw calls were changed to use transactionId 0 in commit
82613564 so that servers would not return _result/_error about it.
While this is the strict interpretation of the spec, there are
servers that return _error about it, even if transactionId was 0.

The latest version of EvoStream Media Server (the commercial version
of crtmpserver) behaves properly as described, i.e. returning an
_error normally but not returning anything when using transactionId
0. The latest version of crtmpserver (right now at least) doesn't
behave like this though, it returns an error even if transactionId
was 0.

There are also other servers that return errors even if transactionId
is set to 0. Therefore set a proper transaction id so that the invoke
can be tracked and the error properly ignored instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoprores: interlaced ProRes encoding
Maksalov Boris [Fri, 3 Aug 2012 17:50:05 +0000 (19:50 +0200)]
prores: interlaced ProRes encoding

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years agog723.1: simplify scale_vector()
Mans Rullgard [Mon, 13 Aug 2012 22:50:10 +0000 (23:50 +0100)]
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>
12 years agog723.1: simplify normalize_bits()
Mans Rullgard [Mon, 13 Aug 2012 22:03:37 +0000 (23:03 +0100)]
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>
12 years agovda: cosmetics: fix Doxygen comment formatting
Sebastien Zwickert [Tue, 14 Aug 2012 09:48:17 +0000 (11:48 +0200)]
vda: cosmetics: fix Doxygen comment formatting

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agovda: better frame allocation
Sebastien Zwickert [Tue, 14 Aug 2012 09:47:39 +0000 (11:47 +0200)]
vda: better frame allocation

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agovda: Merge implementation into one file
Sebastien Zwickert [Tue, 14 Aug 2012 08:42:52 +0000 (10:42 +0200)]
vda: Merge implementation into one file

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agovda: support synchronous decoding
Sebastien Zwickert [Tue, 14 Aug 2012 09:45:29 +0000 (11:45 +0200)]
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>
12 years agovda: Reuse the bitstream buffer and reallocate it only if needed
Sebastien Zwickert [Mon, 13 Aug 2012 18:17:45 +0000 (20:17 +0200)]
vda: Reuse the bitstream buffer and reallocate it only if needed

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agobuild: Factor out mpegvideo encoding dependencies to CONFIG_MPEGVIDEOENC
Diego Biurrun [Mon, 13 Aug 2012 11:00:24 +0000 (13:00 +0200)]
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.

12 years agoavprobe: Include libm.h for the log2 fallback
Martin Storsjö [Mon, 13 Aug 2012 22:29:15 +0000 (01:29 +0300)]
avprobe: Include libm.h for the log2 fallback

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoproresenc: use the edge emulation buffer
Boris Maksalov [Fri, 10 Aug 2012 08:50:35 +0000 (09:50 +0100)]
proresenc: use the edge emulation buffer

Prevents reading past the end of frame buffer.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years agortmp: handle bytes read reports
Luca Barbato [Mon, 13 Aug 2012 17:46:04 +0000 (19:46 +0200)]
rtmp: handle bytes read reports

0x03 (bytes read report) is a known type and should be safely ignored
beside in debug situations.

12 years agoconfigure: Fix typo in mpeg2video/svq1 decoder dependency declaration
Diego Biurrun [Mon, 13 Aug 2012 17:01:19 +0000 (19:01 +0200)]
configure: Fix typo in mpeg2video/svq1 decoder dependency declaration

12 years agoUse log2(x) instead of log(x) / log(2)
Mans Rullgard [Sun, 5 Aug 2012 21:22:10 +0000 (22:22 +0100)]
Use log2(x) instead of log(x) / log(2)

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agox86: swscale: fix fragile memory accesses
Mans Rullgard [Sun, 12 Aug 2012 23:53:05 +0000 (00:53 +0100)]
x86: swscale: fix fragile memory accesses

To access data at multiple fixed offsets from a base address, this
code uses a single "m" operand and code of the form "32%0", relying on
the memory operand instantiation having no displacement, giving a final
result of the form "32(%rax)".  If the compiler uses a register and
displacement, e.g. "64(%rax)", the end result becomes "3264(%rax)",
which obviously does not work.

Replacing the "m" operands with "r" operands allows safe addition of a
displacement.  In theory, multiple memory operands could use a shared
base register with different index registers, "(%rax,%rbx)", potentially
making more efficient use of registers.  In the cases at hand, no such
sharing is possible since the addresses involved are entirely unrelated.

After this change, the code somewhat rudely accesses memory without
using a corresponding memory operand, which in some cases can lead to
unwanted "optimisations" of surrounding code.  However, the original
code also accesses memory not covered by a memory operand, so this is
not adding any defect not already present.  It is also hightly unlikely
that any such optimisations could be performed here since the memory
locations in questions are not accessed elsewhere in the same functions.

This fixes crashes with suncc.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agox86: swscale: remove disabled code
Mans Rullgard [Sun, 12 Aug 2012 22:38:51 +0000 (23:38 +0100)]
x86: swscale: remove disabled code

This code has been disabled since 2003.  Nobody will ever look at
it again.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agox86: yadif: fix asm with suncc
Mans Rullgard [Sun, 12 Aug 2012 18:45:46 +0000 (19:45 +0100)]
x86: yadif: fix asm with suncc

Under some circumstances, suncc will use a single register for the
address of all memory operands, inserting lea instructions loading
the correct address prior to each memory operand being used in the
code. In the yadif code, the branch in the asm block bypasses such
an lea instruction, causing an incorrect address to be used in the
following load.

This patch replaces the tmpX arrays with a single array and uses a
register operand to hold its address. Although this prevents using
offsets from the stack pointer to access these locations, the code
still builds as 32-bit PIC even with old compilers.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agox86: cabac: allow building with suncc
Mans Rullgard [Sun, 12 Aug 2012 01:18:41 +0000 (02:18 +0100)]
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>
12 years agox86: mlpdsp: avoid taking address of void
Mans Rullgard [Sun, 12 Aug 2012 01:08:46 +0000 (02:08 +0100)]
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>
12 years agoARM: intmath: use native-size return types for clipping functions
Mans Rullgard [Sat, 11 Aug 2012 03:08:15 +0000 (04:08 +0100)]
ARM: intmath: use native-size return types for clipping functions

This avoids having the compiler redundantly mask the values to
the smaller size.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: do not pass large structs by value
Mans Rullgard [Sat, 11 Aug 2012 20:04:14 +0000 (21:04 +0100)]
g723.1: do not pass large structs by value

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: do not bounce intermediate values via memory
Mans Rullgard [Sat, 11 Aug 2012 20:00:21 +0000 (21:00 +0100)]
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>
12 years agog723.1: declare a variable in the block it is used
Mans Rullgard [Sat, 11 Aug 2012 19:19:39 +0000 (20:19 +0100)]
g723.1: declare a variable in the block it is used

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: avoid saving/restoring excitation
Mans Rullgard [Sat, 11 Aug 2012 18:59:08 +0000 (19:59 +0100)]
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>
12 years agog723.1: avoid unnecessary memcpy() in residual_interp()
Mans Rullgard [Sat, 11 Aug 2012 04:23:59 +0000 (05:23 +0100)]
g723.1: avoid unnecessary memcpy() in residual_interp()

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: make postfilter write directly to output buffer
Mans Rullgard [Sat, 11 Aug 2012 21:26:38 +0000 (22:26 +0100)]
g723.1: make postfilter write directly to output buffer

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: drop unnecessary variable buf_ptr in formant_postfilter()
Mans Rullgard [Sat, 11 Aug 2012 02:39:30 +0000 (03:39 +0100)]
g723.1: drop unnecessary variable buf_ptr in formant_postfilter()

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: make scale_vector() output to a separate buffer
Mans Rullgard [Sat, 11 Aug 2012 11:21:41 +0000 (12:21 +0100)]
g723.1: make scale_vector() output to a separate buffer

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: make autocorr_max() work on an arbitrary buffer
Mans Rullgard [Sat, 11 Aug 2012 11:16:53 +0000 (12:16 +0100)]
g723.1: make autocorr_max() work on an arbitrary buffer

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: do not needlessly use int64_t
Mans Rullgard [Sat, 11 Aug 2012 01:43:14 +0000 (02:43 +0100)]
g723.1: do not needlessly use int64_t

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: use saturating addition functions
Mans Rullgard [Sat, 11 Aug 2012 00:52:10 +0000 (01:52 +0100)]
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>
12 years agog723.1: optimise scale_vector()
Mans Rullgard [Fri, 10 Aug 2012 17:15:41 +0000 (18:15 +0100)]
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>
12 years agog723.1: remove useless uses of MUL64()
Mans Rullgard [Fri, 10 Aug 2012 15:42:54 +0000 (16:42 +0100)]
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>
12 years agog723.1: remove unnecessary argument 'shift' from dot_product()
Mans Rullgard [Fri, 10 Aug 2012 14:41:47 +0000 (15:41 +0100)]
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>
12 years agog723.1: deobfuscate "(x << 4) - x" to "15 * x"
Mans Rullgard [Sat, 11 Aug 2012 00:54:15 +0000 (01:54 +0100)]
g723.1: deobfuscate "(x << 4) - x" to "15 * x"

The compiler performs this optimisation.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agocelp: optimise ff_celp_lp_synthesis_filter()
Mans Rullgard [Sat, 11 Aug 2012 03:18:53 +0000 (04:18 +0100)]
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>
12 years agolibavutil: add saturating addition functions
Mans Rullgard [Sat, 11 Aug 2012 00:15:19 +0000 (01:15 +0100)]
libavutil: add saturating addition functions

Fixed-point audio codecs often use saturating arithmetic, and
special instructions for these operations are common.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agocllc: Implement ARGB support
Derek Buitenhuis [Fri, 10 Aug 2012 16:05:49 +0000 (16:05 +0000)]
cllc: Implement ARGB support

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
12 years agocllc: Add support for QRGB
Derek Buitenhuis [Fri, 10 Aug 2012 17:19:03 +0000 (17:19 +0000)]
cllc: Add support for QRGB

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
12 years agocllc: Rename some funcs to represent what they actually do
Derek Buitenhuis [Fri, 10 Aug 2012 16:05:47 +0000 (16:05 +0000)]
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>
12 years agox86: Drop silly "_yasm" suffixes from filenames
Diego Biurrun [Tue, 7 Aug 2012 22:35:43 +0000 (00:35 +0200)]
x86: Drop silly "_yasm" suffixes from filenames

12 years agodoc: Clarify licensing issues arising from external libraries
Diego Biurrun [Sat, 21 Jul 2012 21:17:30 +0000 (21:17 +0000)]
doc: Clarify licensing issues arising from external libraries

12 years agolavf: Detect discontinuities in timestamps for framerate/analyzeduration calculation
Martin Storsjö [Sat, 11 Aug 2012 18:24:40 +0000 (21:24 +0300)]
lavf: Detect discontinuities in timestamps for framerate/analyzeduration calculation

If the dts difference is more than 1000 times the average dts
difference, restart the analysis.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agolavf: Initialize the stream info timestamps in avformat_new_stream
Martin Storsjö [Sat, 11 Aug 2012 17:06:08 +0000 (20:06 +0300)]
lavf: Initialize the stream info timestamps in avformat_new_stream

These are normally initialized to AV_NOPTS_VALUE at the start
of avformat_find_stream_info, but if a new stream is found while
this function is running (e.g. like in mpegts), the newly added
AVStreams didn't have these values properly initalized, leading
to avformat_find_stream_info terminating too soon (when the
first timestamps are far from 0).

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoid3v2: Match PIC mimetype/format case-insensitively
Mohammad Alsaleh [Fri, 10 Aug 2012 22:50:25 +0000 (01:50 +0300)]
id3v2: Match PIC mimetype/format case-insensitively

Some files' embedded art seems to have the mimetype 'image/JPG' instead
of 'image/jpg'. Libav fails to parse those because it matches
case-sensitively.

Use av_strncasecmp() to fix this behaviour.

Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years agoconfigure: Rename check_asm() to more fitting check_inline_asm()
Diego Biurrun [Tue, 7 Aug 2012 21:46:52 +0000 (23:46 +0200)]
configure: Rename check_asm() to more fitting check_inline_asm()

12 years agofate: Only test enabled filters
Diego Biurrun [Wed, 1 Aug 2012 22:35:42 +0000 (00:35 +0200)]
fate: Only test enabled filters

This fixes running FATE without --enable-gpl.

12 years agoavresample: De-doxygenize some comments where Doxygen is not appropriate
Diego Biurrun [Thu, 9 Aug 2012 01:06:23 +0000 (03:06 +0200)]
avresample: De-doxygenize some comments where Doxygen is not appropriate

12 years agortmp: split chunk_size var into in_chunk_size and out_chunk_size
Jordi Ortiz [Fri, 10 Aug 2012 17:03:22 +0000 (19:03 +0200)]
rtmp: split chunk_size var into in_chunk_size and out_chunk_size

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agortmp: Factorize the code by adding find_tracked_method
Samuel Pitoiset [Sat, 11 Aug 2012 10:41:32 +0000 (12:41 +0200)]
rtmp: Factorize the code by adding find_tracked_method

Also fix the bytestream reader size parameter to take the
offset into account.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agolavf: simplify is_intra_only() by using codec descriptors.
Anton Khirnov [Thu, 9 Aug 2012 16:39:56 +0000 (18:39 +0200)]
lavf: simplify is_intra_only() by using codec descriptors.

12 years agolavc: add an intra-only codec property.
Anton Khirnov [Thu, 9 Aug 2012 16:34:10 +0000 (18:34 +0200)]
lavc: add an intra-only codec property.

12 years agolavc: add codec descriptors.
Anton Khirnov [Sun, 5 Aug 2012 13:18:00 +0000 (15:18 +0200)]
lavc: add codec descriptors.

They describe properties that are inherent to a codec (as described by
an AVCodecID) without referring to a specific implementation.

12 years agolavc: fix mixing CODEC_ID/AV_CODEC_ID in C++ code.
Anton Khirnov [Wed, 8 Aug 2012 06:04:56 +0000 (08:04 +0200)]
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.

12 years agodict: move struct AVDictionary definition to dict.c
Mans Rullgard [Wed, 8 Aug 2012 16:31:44 +0000 (17:31 +0100)]
dict: move struct AVDictionary definition to dict.c

This makes struct AVDictionary fully opaque now that nothing
needs to access it directly any more.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agodict: add av_dict_count()
Mans Rullgard [Wed, 8 Aug 2012 16:30:15 +0000 (17:30 +0100)]
dict: add av_dict_count()

This adds a function to retrieve the number of entries in a
dictionary and updates the places directly accessing what should
be an opaque struct to use this new function instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agog723.1: fix addition overflow
Mans Rullgard [Fri, 10 Aug 2012 00:17:20 +0000 (01:17 +0100)]
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>
12 years agog723.1: simplify and fix multiplication overflow
Mans Rullgard [Fri, 10 Aug 2012 00:14:32 +0000 (01:14 +0100)]
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>
12 years agog723.1: deobfuscate an expression
Mans Rullgard [Thu, 9 Aug 2012 23:13:46 +0000 (00:13 +0100)]
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>
12 years agog723.1: remove unused #includes
Mans Rullgard [Thu, 9 Aug 2012 20:02:46 +0000 (21:02 +0100)]
g723.1: remove unused #includes

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoARM: add missing "cc" clobber in av_clipl_int32_arm()
Mans Rullgard [Thu, 9 Aug 2012 21:45:51 +0000 (22:45 +0100)]
ARM: add missing "cc" clobber in av_clipl_int32_arm()

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agortmp: Factorize the code by adding handle_invoke_error
Samuel Pitoiset [Thu, 9 Aug 2012 12:57:51 +0000 (14:57 +0200)]
rtmp: Factorize the code by adding handle_invoke_error

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years agortmp: Factorize the code by adding handle_invoke_status
Samuel Pitoiset [Thu, 9 Aug 2012 12:57:50 +0000 (14:57 +0200)]
rtmp: Factorize the code by adding handle_invoke_status

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years agortmp: Factorize the code by adding handle_invoke_result
Samuel Pitoiset [Thu, 9 Aug 2012 12:57:49 +0000 (14:57 +0200)]
rtmp: Factorize the code by adding handle_invoke_result

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years agolibavutil: remove unused av_abort() macro
Mans Rullgard [Wed, 8 Aug 2012 21:58:07 +0000 (22:58 +0100)]
libavutil: remove unused av_abort() macro

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoffmenc: replace if/abort with assert()
Mans Rullgard [Wed, 8 Aug 2012 21:57:12 +0000 (22:57 +0100)]
ffmenc: replace if/abort with assert()

The condition is trivially true, but keeping the assert() is
sensible to avoid FFM_HEADER_SIZE ever getting out of sync with
the actual code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agolibavutil: drop offsetof() fallback definition
Mans Rullgard [Wed, 8 Aug 2012 19:09:33 +0000 (20:09 +0100)]
libavutil: drop offsetof() fallback definition

The only compiler I have that does not define the standard
offsetof() macro is "Bruce's C Compiler", a simple compiler
for producing 8/16-bit 8086 code, usually for use in early
stages of PC booting.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agolibavutil: drop fallback definitions of INTxx_MIN/MAX
Mans Rullgard [Wed, 8 Aug 2012 17:18:14 +0000 (18:18 +0100)]
libavutil: drop fallback definitions of INTxx_MIN/MAX

This list is incomplete (we also use UINT16_MAX), so there does
not appear to be any system we care about that needs these.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agoconfigure: Check for a sctp struct instead of just the header
Michael Niedermayer [Wed, 8 Aug 2012 14:01:01 +0000 (16:01 +0200)]
configure: Check for a sctp struct instead of just the header

This fixes build failures on debian/kfreebsd, which has the
sctp.h header, but it is currently broken (a cpp test succeeds,
but a compile test fails), see http://bugs.debian.org/684330 for
details.

Also remove the checked item from HAVE_LIST, since the corresponding
HAVE_* define isn't used by the source code.

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agoconfigure: suncc: Add -xc99 to dependency flags, required on Solaris
Diego Biurrun [Thu, 9 Aug 2012 15:14:32 +0000 (17:14 +0200)]
configure: suncc: Add -xc99 to dependency flags, required on Solaris

12 years agodoxygen: Fix function parameter names to match the code
Diego Biurrun [Thu, 9 Aug 2012 01:06:01 +0000 (03:06 +0200)]
doxygen: Fix function parameter names to match the code

12 years agodoc: Drop obsolete shared libs cflags hint to workaround Cygwin gcc bugs
Diego Biurrun [Thu, 9 Aug 2012 13:30:24 +0000 (15:30 +0200)]
doc: Drop obsolete shared libs cflags hint to workaround Cygwin gcc bugs

12 years agoswf: Move shared table out of the header file
Diego Biurrun [Wed, 8 Aug 2012 13:54:02 +0000 (15:54 +0200)]
swf: Move shared table out of the header file

12 years agoswf: Move swf_audio_codec_tags table to the only place it is used
Diego Biurrun [Wed, 8 Aug 2012 13:51:59 +0000 (15:51 +0200)]
swf: Move swf_audio_codec_tags table to the only place it is used

12 years agofate: add G.723.1 decoder tests
Kostya Shishkov [Tue, 7 Aug 2012 17:47:55 +0000 (19:47 +0200)]
fate: add G.723.1 decoder tests

12 years agomotion_est: drop inline from sad_hpel_motion_search()
Mans Rullgard [Tue, 31 Jul 2012 13:58:09 +0000 (14:58 +0100)]
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>
12 years agomotion_est: remove unused macros
Mans Rullgard [Tue, 31 Jul 2012 13:56:28 +0000 (14:56 +0100)]
motion_est: remove unused macros

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agomotion_est: remove useless no_motion_search() function
Mans Rullgard [Tue, 31 Jul 2012 13:53:57 +0000 (14:53 +0100)]
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>
12 years agolagarith: frame multithreading
Hendrik Leppkes [Wed, 8 Aug 2012 23:03:44 +0000 (23:03 +0000)]
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>
12 years agodoxygen: qdm2: Drop documentation for non-existing function parameters
Diego Biurrun [Thu, 9 Aug 2012 01:03:26 +0000 (03:03 +0200)]
doxygen: qdm2: Drop documentation for non-existing function parameters

12 years agobuild: add HOSTOBJS to SUBDIR_VARS list
Diego Biurrun [Wed, 8 Aug 2012 13:41:36 +0000 (15:41 +0200)]
build: add HOSTOBJS to SUBDIR_VARS list

Even though HOSTOBJS are not referenced directly in subdirectory Makefile
snippets right now, robustness requires resetting the variable contents.

12 years agompegvideo: reduce excessive inlining of mpeg_motion()
Mans Rullgard [Sat, 4 Aug 2012 01:30:02 +0000 (02:30 +0100)]
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>
12 years agompegvideo: convert mpegvideo_common.h to a .c file
Mans Rullgard [Fri, 3 Aug 2012 23:50:21 +0000 (00:50 +0100)]
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>
12 years agobuild: factor out mpegvideo.o dependencies to CONFIG_MPEGVIDEO
Mans Rullgard [Fri, 3 Aug 2012 23:05:46 +0000 (00:05 +0100)]
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>
12 years agoMove MASK_ABS macro to libavcodec/mathops.h
Mans Rullgard [Wed, 8 Aug 2012 16:13:26 +0000 (17:13 +0100)]
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>
12 years agox86: move MANGLE() and related macros to libavutil/x86/asm.h
Mans Rullgard [Wed, 8 Aug 2012 13:37:57 +0000 (14:37 +0100)]
x86: move MANGLE() and related macros to libavutil/x86/asm.h

These x86-specific macros do not belong in generic code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years agox86: rename libavutil/x86_cpu.h to libavutil/x86/asm.h
Mans Rullgard [Wed, 8 Aug 2012 12:51:52 +0000 (13:51 +0100)]
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>
12 years agoaacdec: Don't fall back to the old output configuration when no old configuration...
Alex Converse [Tue, 7 Aug 2012 19:19:58 +0000 (12:19 -0700)]
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.

12 years agortmp: Add message tracking
Samuel Pitoiset [Wed, 8 Aug 2012 12:36:39 +0000 (14:36 +0200)]
rtmp: Add message tracking

Signed-off-by: Martin Storsjö <martin@martin.st>
12 years agortsp: Support mpegts in raw udp packets
Martin Storsjö [Wed, 8 Aug 2012 20:05:52 +0000 (23:05 +0300)]
rtsp: Support mpegts in raw udp packets

This is basically the same way as mpegts packets are parsed in
rtpdec.c.

Signed-off-by: Martin Storsjö <martin@martin.st>