ffmpeg.git
6 years agoswscale: x86: fix #endif comments in rgb2rgb template file
Giorgio Vazzana [Thu, 16 Aug 2012 12:35:41 +0000 (14:35 +0200)]
swscale: x86: fix #endif comments in rgb2rgb template file

Signed-off-by: Diego Biurrun <diego@biurrun.de>
6 years agoavconv: mark more options as expert.
Anton Khirnov [Wed, 15 Aug 2012 08:33:36 +0000 (10:33 +0200)]
avconv: mark more options as expert.

6 years agoavconv: split printing "main options" into global and per-file.
Anton Khirnov [Wed, 15 Aug 2012 08:31:46 +0000 (10:31 +0200)]
avconv: split printing "main options" into global and per-file.

6 years agoavconv: refactor help printing.
Anton Khirnov [Tue, 14 Aug 2012 06:56:32 +0000 (08:56 +0200)]
avconv: refactor help printing.

By default don't dump every single option on the user, but print only
the basic options.

Add -h long/full to print more options.

6 years agoavconv: print info/capabilities options in a separate help group.
Anton Khirnov [Tue, 14 Aug 2012 06:21:42 +0000 (08:21 +0200)]
avconv: print info/capabilities options in a separate help group.

6 years agoavtools: add -h demuxer/muxer
Anton Khirnov [Tue, 14 Aug 2012 05:57:56 +0000 (07:57 +0200)]
avtools: add -h demuxer/muxer

6 years agocmdutils: extend -h to allow printing codec details.
Anton Khirnov [Mon, 13 Aug 2012 18:06:25 +0000 (20:06 +0200)]
cmdutils: extend -h to allow printing codec details.

6 years agocmdutils: change semantics of show_help_options() and document it.
Anton Khirnov [Sat, 11 Aug 2012 17:45:30 +0000 (19:45 +0200)]
cmdutils: change semantics of show_help_options() and document it.

Currently it takes a mask and value, such that options for which
(flags & mask) == value.

Change it to take required flags and forbidden flags instead. This is
shorter and simpler to understand.

6 years agoavtools: move some newlines to show_help_options().
Anton Khirnov [Sat, 11 Aug 2012 17:33:27 +0000 (19:33 +0200)]
avtools: move some newlines to show_help_options().

Don't require every caller to supply them.

6 years agoavconv: deprecate -isync.
Anton Khirnov [Sat, 11 Aug 2012 17:19:53 +0000 (19:19 +0200)]
avconv: deprecate -isync.

This option does not do anything.

Also remove OPT_GRAB, since -isync is the last option using it.

6 years agoavconv: reformat the options table.
Anton Khirnov [Sat, 11 Aug 2012 15:00:30 +0000 (17:00 +0200)]
avconv: reformat the options table.

6 years agoavconv: get rid of ugly casts in the options table.
Anton Khirnov [Sat, 11 Aug 2012 14:30:26 +0000 (16:30 +0200)]
avconv: get rid of ugly casts in the options table.

6 years agoavconv: try to match codecs by codec descriptor name as a last resort.
Anton Khirnov [Sat, 11 Aug 2012 13:40:12 +0000 (15:40 +0200)]
avconv: try to match codecs by codec descriptor name as a last resort.

This allows e.g. -c:v h264 to select the libx264 encoder.

6 years agoavtools: fix show_foo() signatures.
Anton Khirnov [Sat, 11 Aug 2012 14:13:54 +0000 (16:13 +0200)]
avtools: fix show_foo() signatures.

show_foo() functions are declared as void show_foo(void), but called as
int show_foo(const char*, const char*).

6 years agovorbisdec: remove some pointless comments
Mans Rullgard [Sat, 18 Aug 2012 13:30:11 +0000 (14:30 +0100)]
vorbisdec: remove some pointless comments

Signed-off-by: Mans Rullgard <mans@mansr.com>
6 years agoavprobe: add const to AVCodec pointer
Mans Rullgard [Sat, 18 Aug 2012 12:22:57 +0000 (13:22 +0100)]
avprobe: add const to AVCodec pointer

Signed-off-by: Mans Rullgard <mans@mansr.com>
6 years agolibavformat: add const to AVCodec pointers
Mans Rullgard [Sat, 18 Aug 2012 12:22:38 +0000 (13:22 +0100)]
libavformat: add const to AVCodec pointers

Signed-off-by: Mans Rullgard <mans@mansr.com>
6 years agopthread: add const to AVCodec pointers
Mans Rullgard [Sat, 18 Aug 2012 12:20:09 +0000 (13:20 +0100)]
pthread: add const to AVCodec pointers

Signed-off-by: Mans Rullgard <mans@mansr.com>
6 years agompegvideo_enc: don't use deprecated avcodec_encode_video().
Anton Khirnov [Wed, 15 Aug 2012 07:35:18 +0000 (09:35 +0200)]
mpegvideo_enc: don't use deprecated avcodec_encode_video().

6 years agocmdutils: refactor -codecs option.
Anton Khirnov [Sat, 11 Aug 2012 13:23:22 +0000 (15:23 +0200)]
cmdutils: refactor -codecs option.

Make it print a list of AVCodecDescriptors.

Add new -decoders and -encoders options that print lists of decoders and
encoders respectively.

6 years agoavconv: make -shortest a per-output file option.
Anton Khirnov [Sat, 11 Aug 2012 09:50:32 +0000 (11:50 +0200)]
avconv: make -shortest a per-output file option.

6 years agolavc: add avcodec_descriptor_get_by_name().
Anton Khirnov [Sat, 11 Aug 2012 13:32:27 +0000 (15:32 +0200)]
lavc: add avcodec_descriptor_get_by_name().

6 years agolavc: add const to AVCodec* function parameters.
Anton Khirnov [Sat, 11 Aug 2012 12:50:36 +0000 (14:50 +0200)]
lavc: add const to AVCodec* function parameters.

6 years agoswf(dec): replace CODEC_ID with AV_CODEC_ID
Anton Khirnov [Wed, 15 Aug 2012 07:14:35 +0000 (09:14 +0200)]
swf(dec): replace CODEC_ID with AV_CODEC_ID

6 years agodvenc: don't use deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE
Anton Khirnov [Wed, 15 Aug 2012 07:11:31 +0000 (09:11 +0200)]
dvenc: don't use deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE

6 years agortmpdh: Do not generate the same private key every time when using libnettle
Samuel Pitoiset [Thu, 16 Aug 2012 20:27:15 +0000 (22:27 +0200)]
rtmpdh: Do not generate the same private key every time when using libnettle

Replace mpz_random by mpz_urandomb with a random state initialization in
order to improve the randomness.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agortp: remove ff_rtp_get_rtcp_file_handle().
Jordi Ortiz [Fri, 17 Aug 2012 16:41:26 +0000 (18:41 +0200)]
rtp: remove ff_rtp_get_rtcp_file_handle().

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agortsp.c: use ffurl_get_multi_file_handle() instead of ff_rtp_get_rtcp_file_handle()
Jordi Ortiz [Fri, 17 Aug 2012 18:06:27 +0000 (20:06 +0200)]
rtsp.c: use ffurl_get_multi_file_handle() instead of ff_rtp_get_rtcp_file_handle()

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agoavio: add (ff)url_get_multi_file_handle() for getting more than one fd
Jordi Ortiz [Fri, 17 Aug 2012 16:38:59 +0000 (18:38 +0200)]
avio: add (ff)url_get_multi_file_handle() for getting more than one fd

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agoh264: vdpau: fix crash with unsupported colorspace
Uoti Urpala [Tue, 7 Aug 2012 11:48:06 +0000 (14:48 +0300)]
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>
6 years agoamrwbdec: Decode the fr_quality bit properly
Martin Storsjö [Fri, 17 Aug 2012 11:53:52 +0000 (14:53 +0300)]
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>
6 years agolibvpxenc: use the default bitrate if not set
Luca Barbato [Thu, 16 Aug 2012 18:00:53 +0000 (20:00 +0200)]
libvpxenc: use the default bitrate if not set

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
6 years agoutvideo: Rename utvideo.c to utvideodec.c
Jan Ekström [Fri, 17 Aug 2012 10:33:52 +0000 (13:33 +0300)]
utvideo: Rename utvideo.c to utvideodec.c

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
6 years agodoc: Fix syntax errors in sample Emacs config
Jordi Ortiz [Wed, 15 Aug 2012 15:58:01 +0000 (17:58 +0200)]
doc: Fix syntax errors in sample Emacs config

Signed-off-by: Diego Biurrun <diego@biurrun.de>
6 years agomjpegdec: more meaningful return values
Luca Barbato [Thu, 16 Aug 2012 21:24:15 +0000 (23:24 +0200)]
mjpegdec: more meaningful return values

6 years agoconfigure: clean up Altivec detection
Mans Rullgard [Wed, 15 Aug 2012 23:10:33 +0000 (00:10 +0100)]
configure: clean up Altivec detection

There used to be one test for Altivec intrinsics support and a
separate test to determine which of two possible syntaxes to use
for vector literals.  Since 2008, we only support the more common
of these so the split test no longer makes sense.

This combines the tests into one and also changes the hard error on
failure to a warning.  The test can reasonably fail if no --cpu flag
is provided (or is provided with an unknown CPU) and the compiler
default target does not support Altivec.  Aborting in this case is
probably over-reacting.

Signed-off-by: Mans Rullgard <mans@mansr.com>
6 years agogetopt: Remove an unnecessary define
Martin Storsjö [Thu, 16 Aug 2012 19:14:52 +0000 (22:14 +0300)]
getopt: Remove an unnecessary define

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agortmp: Use int instead of ssize_t
Martin Storsjö [Thu, 16 Aug 2012 19:11:13 +0000 (22:11 +0300)]
rtmp: Use int instead of ssize_t

Not all compilers support ssize_t (MSVC doesn't), and none of these
variables need to be larger than 32 bit.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agogetopt: Add missing includes
Martin Storsjö [Thu, 16 Aug 2012 12:04:27 +0000 (15:04 +0300)]
getopt: Add missing includes

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agortmp: Add support for receiving incoming streams
Jordi Ortiz [Thu, 16 Aug 2012 14:04:48 +0000 (16:04 +0200)]
rtmp: Add support for receiving incoming streams

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agoAdd missing includes for code relying on external libraries
Martin Storsjö [Thu, 16 Aug 2012 11:24:26 +0000 (14:24 +0300)]
Add missing includes for code relying on external libraries

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agoFix even more missing includes after the common.h removal
Martin Storsjö [Thu, 16 Aug 2012 11:02:24 +0000 (14:02 +0300)]
Fix even more missing includes after the common.h removal

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agobuild: Factor out rangecoder dependencies to CONFIG_RANGECODER
Diego Biurrun [Mon, 13 Aug 2012 17:16:06 +0000 (19:16 +0200)]
build: Factor out rangecoder dependencies to CONFIG_RANGECODER

A new hidden config variable is added for the codecs that depend on
the rangecoder parts.

6 years agobuild: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
Diego Biurrun [Mon, 13 Aug 2012 17:13:32 +0000 (19:13 +0200)]
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.

6 years agox86: avcodec: Consistently name all init files
Diego Biurrun [Sat, 11 Aug 2012 21:07:27 +0000 (23:07 +0200)]
x86: avcodec: Consistently name all init files

6 years agoAdd more missing includes after removing the implicit common.h
Martin Storsjö [Thu, 16 Aug 2012 07:22:31 +0000 (10:22 +0300)]
Add more missing includes after removing the implicit common.h

Signed-off-by: Martin Storsjö <martin@martin.st>
6 years agoAdd some more missing includes after removing the implicit common.h
Martin Storsjö [Wed, 15 Aug 2012 20:27:52 +0000 (23:27 +0300)]
Add some more missing includes after removing the implicit common.h

Signed-off-by: Martin Storsjö <martin@martin.st>
6 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>
6 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>
6 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>
6 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.

6 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

6 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

6 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>
6 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

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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.

6 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>
6 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>
6 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.

6 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

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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

6 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

6 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>