]> git.sesse.net Git - ffmpeg/log
ffmpeg
11 years agoMerge remote-tracking branch 'qatar/master'
Michael Niedermayer [Tue, 14 Aug 2012 13:31:43 +0000 (15:31 +0200)]
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  g723.1: simplify scale_vector()
  g723.1: simplify normalize_bits()
  vda: cosmetics: fix Doxygen comment formatting
  vda: better frame allocation
  vda: Merge implementation into one file
  vda: support synchronous decoding
  vda: Reuse the bitstream buffer and reallocate it only if needed
  build: Factor out mpegvideo encoding dependencies to CONFIG_MPEGVIDEOENC
  avprobe: Include libm.h for the log2 fallback
  proresenc: use the edge emulation buffer
  rtmp: handle bytes read reports
  configure: Fix typo in mpeg2video/svq1 decoder dependency declaration
  Use log2(x) instead of log(x) / log(2)
  x86: swscale: fix fragile memory accesses
  x86: swscale: remove disabled code
  x86: yadif: fix asm with suncc
  x86: cabac: allow building with suncc
  x86: mlpdsp: avoid taking address of void
  ARM: intmath: use native-size return types for clipping functions

Conflicts:
configure
ffprobe.c
libavcodec/Makefile
libavcodec/g723_1.c
libavcodec/v210dec.h
libavcodec/vda.h
libavcodec/vda_h264.c
libavcodec/x86/cabac.h
libavfilter/x86/yadif_template.c
libswscale/x86/rgb2rgb_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
11 years agovda: fix make checkheaders.
Sebastien Zwickert [Tue, 14 Aug 2012 08:28:22 +0000 (10:28 +0200)]
vda: fix make checkheaders.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agolavfi/asetnsamples: push as many frames as ready
Andrey Utkin [Tue, 7 Aug 2012 22:55:03 +0000 (01:55 +0300)]
lavfi/asetnsamples: push as many frames as ready

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 years agofilter_design: document ownership and permissions.
Nicolas George [Sun, 12 Aug 2012 11:58:09 +0000 (13:58 +0200)]
filter_design: document ownership and permissions.

11 years agolavfi: use min_perms and rej_perms for out pads.
Nicolas George [Sun, 12 Aug 2012 08:59:37 +0000 (10:59 +0200)]
lavfi: use min_perms and rej_perms for out pads.

There are several reasons for doing that:

1. It documents the code for the reader and helps find
   inconsistencies and bugs.

2. For rej_perms, it guarantees the change will be done
   even if the output reference can be created by several
   code paths.

3. It can be used to predict cases where a copy will,
   or will not happen and optimize buffer allocation
   (for example not request a rare direct-rendering buffer
   from a device sink if it will be copied anyway).

Note that a filter is still allowed to manage the permissions
on its own without using these fields.

11 years agodvdsubenc: reindent after recent commit.
Nicolas George [Tue, 14 Aug 2012 09:58:32 +0000 (11:58 +0200)]
dvdsubenc: reindent after recent commit.

11 years agolavc: add const to AVCodecContext.codec_descriptor.
Nicolas George [Mon, 13 Aug 2012 09:28:10 +0000 (11:28 +0200)]
lavc: add const to AVCodecContext.codec_descriptor.

11 years agolavc: reimplement avcodec_get_name with descriptors.
Nicolas George [Mon, 13 Aug 2012 09:27:20 +0000 (11:27 +0200)]
lavc: reimplement avcodec_get_name with descriptors.

11 years agoffmpeg: copy subtitles frame dimensions.
Nicolas George [Thu, 9 Aug 2012 09:55:22 +0000 (11:55 +0200)]
ffmpeg: copy subtitles frame dimensions.

The sub-movtextenc ref file changes because the dimensions
(400×60) are stored by the format.

11 years agoffmpeg: make -s work for subtitles too.
Nicolas George [Thu, 9 Aug 2012 09:51:45 +0000 (11:51 +0200)]
ffmpeg: make -s work for subtitles too.

Some codecs allow to encode the frame size and some players use it.

11 years agodvdsubenc: set frame size in extradata.
Nicolas George [Tue, 7 Aug 2012 17:05:43 +0000 (19:05 +0200)]
dvdsubenc: set frame size in extradata.

11 years agolavf: probe PGS subtitles definition.
Nicolas George [Tue, 7 Aug 2012 16:53:00 +0000 (18:53 +0200)]
lavf: probe PGS subtitles definition.

The resolution is in the packets, so decoding must happen.
Since most other formats do not set the dimension, make it
a special case for PGS. If other codecs were to have the
same requirement, using a CODEC_CAP would be preferred.

11 years agodvdsubenc: make it usable for transcoding.
Nicolas George [Mon, 6 Aug 2012 12:14:27 +0000 (14:14 +0200)]
dvdsubenc: make it usable for transcoding.

DVD subtitles packets can only encode a single rectangle:
if there are several, copy them into a big transparent one.

DVD subtitles rely on an external 16-colors palette:
use a reasonable default one, stored in the private context,
and encode it into the extradata, as specified by Matroska.
TODO: allow to change the palette with an option.

Each packet can use four colors out of the global palette.
The old logic was to map transparent colors to the color 0
and all other colors to 3, 2, 1, cyclically in descending
frequency order, completely disregarding the original color.

Select the "best" four colors from the global palette, according
to heuristics based on frequency, opacity and brightness, and
arrange them in standard DVD order: background, foreground,
outline, other.
TODO: select the alpha value more finely; see if CHG_COLCON can
allow more than 4 colors per packet.

Reference:
http://dvd.sourceforge.net/dvdinfo/spu.html

With these changes, dvdsubenc can be used to transcode DVB subtitles
and get a very decent result.

11 years agoffmpeg: add an option to fix subtitles durations.
Nicolas George [Thu, 9 Aug 2012 09:44:17 +0000 (11:44 +0200)]
ffmpeg: add an option to fix subtitles durations.

With this option, transcoding DVB subtitles becomes possible.

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

11 years agovda: merge implementation into one file.
Sebastien Zwickert [Sun, 12 Aug 2012 15:03:06 +0000 (17:03 +0200)]
vda: merge implementation into one file.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agovda: support synchronous decoding.
Sebastien Zwickert [Sun, 12 Aug 2012 15:03:05 +0000 (17:03 +0200)]
vda: support synchronous decoding.

Note that the symbols used to run the hardware decoder in asynchronous mode
has been marked as deprecated and will be dropped at a future version dump.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agomore verbose error messages at configure time
rogerdpack [Thu, 9 Aug 2012 20:12:02 +0000 (14:12 -0600)]
more verbose error messages at configure time

Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agoasfdec: ignore too tiny indexes
Michael Niedermayer [Tue, 14 Aug 2012 01:21:08 +0000 (03:21 +0200)]
asfdec: ignore too tiny indexes

Fixes Ticket1521

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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>
11 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>
11 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.

11 years agohls: Initialize stream_offset before find_stream_info.
Michael Niedermayer [Mon, 13 Aug 2012 18:37:52 +0000 (20:37 +0200)]
hls: Initialize stream_offset before find_stream_info.

find stream info causes reads that may use the offset in their callback

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agohls: check that the streams have been initialized before checking their discard flags.
Michael Niedermayer [Mon, 13 Aug 2012 18:37:04 +0000 (20:37 +0200)]
hls: check that the streams have been initialized before checking their discard flags.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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

11 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>
11 years agoProresenc: add multithreading support
Speedy Gonzales [Mon, 13 Aug 2012 15:16:47 +0000 (17:16 +0200)]
Proresenc: add multithreading support

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 years agog723_1dec: inline normalize_bits() in scale vector and optimize it.
Michael Niedermayer [Mon, 13 Aug 2012 13:18:47 +0000 (15:18 +0200)]
g723_1dec: inline normalize_bits() in scale vector and optimize it.

many branches and cases of scale_vector are irrelevant for the case here
and by inlining they can be reliably removed.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agog723_1dec: remove dead code that leaked in from libav
Michael Niedermayer [Mon, 13 Aug 2012 13:02:21 +0000 (15:02 +0200)]
g723_1dec: remove dead code that leaked in from libav

It appears someone thinks this special case can be reached
Well, it cannot, thus not only do we not need to optimize it
we dont need it at all

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agog723_1dec: remove unneeded cliping that leaked in from merge from libav
Michael Niedermayer [Mon, 13 Aug 2012 13:01:45 +0000 (15:01 +0200)]
g723_1dec: remove unneeded cliping that leaked in from merge from libav

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agog723_1dec: avoid memcpy
Michael Niedermayer [Mon, 13 Aug 2012 12:53:29 +0000 (14:53 +0200)]
g723_1dec: avoid memcpy

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agoMerge remote-tracking branch 'qatar/master'
Michael Niedermayer [Mon, 13 Aug 2012 12:38:43 +0000 (14:38 +0200)]
Merge remote-tracking branch 'qatar/master'

* qatar/master: (22 commits)
  g723.1: do not pass large structs by value
  g723.1: do not bounce intermediate values via memory
  g723.1: declare a variable in the block it is used
  g723.1: avoid saving/restoring excitation
  g723.1: avoid unnecessary memcpy() in residual_interp()
  g723.1: make postfilter write directly to output buffer
  g723.1: drop unnecessary variable buf_ptr in formant_postfilter()
  g723.1: make scale_vector() output to a separate buffer
  g723.1: make autocorr_max() work on an arbitrary buffer
  g723.1: do not needlessly use int64_t
  g723.1: use saturating addition functions
  g723.1: optimise scale_vector()
  g723.1: remove useless uses of MUL64()
  g723.1: remove unnecessary argument 'shift' from dot_product()
  g723.1: deobfuscate "(x << 4) - x" to "15 * x"
  celp: optimise ff_celp_lp_synthesis_filter()
  libavutil: add saturating addition functions
  cllc: Implement ARGB support
  cllc: Add support for QRGB
  cllc: Rename some funcs to represent what they actually do
  ...

Conflicts:
LICENSE
libavcodec/g723_1.c
libavcodec/x86/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
11 years agopaf: prevent invalid write
Paul B Mahol [Mon, 13 Aug 2012 12:26:38 +0000 (12:26 +0000)]
paf: prevent invalid write

Closes #1631.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years agobuild: extend documentation building mechanism
Stefano Sabatini [Thu, 9 Aug 2012 21:37:28 +0000 (23:37 +0200)]
build: extend documentation building mechanism

Allow to select specific documentation components, and reliably check for
component dependencies.

In particular, check for perl presence on the system.

11 years agolavfi: add hue filter
Jérémy Tran [Sun, 12 Aug 2012 11:26:17 +0000 (13:26 +0200)]
lavfi: add hue filter

This is a port of the MPlayer hue filter (libmpcodecs/vf_hue.c) by
Michael Niedermayer.

Signed-off-by: Jérémy Tran <tran.jeremy.av@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
11 years agolavc: add missing codec descriptors.
Nicolas George [Sun, 12 Aug 2012 22:59:03 +0000 (00:59 +0200)]
lavc: add missing codec descriptors.

11 years agotools: add a script to find missing codec descriptors.
Nicolas George [Sun, 12 Aug 2012 22:31:13 +0000 (00:31 +0200)]
tools: add a script to find missing codec descriptors.

11 years agoh264_cavlc: switch forgotten assert to av_assert
Michael Niedermayer [Mon, 13 Aug 2012 03:59:44 +0000 (05:59 +0200)]
h264_cavlc: switch forgotten assert to av_assert

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agoh264: fix x264 build detection
Michael Niedermayer [Mon, 13 Aug 2012 02:58:15 +0000 (04:58 +0200)]
h264: fix x264 build detection

Fixes Ticket1503

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 years agoriffenc: fix aac
Michael Niedermayer [Sun, 12 Aug 2012 23:41:55 +0000 (01:41 +0200)]
riffenc: fix aac

Fixes Ticket1435

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agolavfi: add avfilter_get_class() and iteration callbacks
Stefano Sabatini [Thu, 9 Aug 2012 12:59:10 +0000 (14:59 +0200)]
lavfi: add avfilter_get_class() and iteration callbacks

Allow iteration over filter options.

11 years agolavu/opt.h: add AV_OPT_FLAG_FILTERING_PARAM macro
Stefano Sabatini [Thu, 9 Aug 2012 14:21:07 +0000 (16:21 +0200)]
lavu/opt.h: add AV_OPT_FLAG_FILTERING_PARAM macro

11 years agodoc/texi2pod: add "use warnings" directive
Stefano Sabatini [Sun, 12 Aug 2012 08:35:03 +0000 (10:35 +0200)]
doc/texi2pod: add "use warnings" directive

The script was previously run with perl -w through the shebang
command. Now that the script is executed through direct perl invocation
the -w in the shebang command is ignored. This patch re-enables "use
warnings" whatever way the script is invoked.

Idea-By: jamal <jamrial@gmail.com>
11 years agoOptimized unscaled yuvp9/yuvp10 -> yuvp16 conversion.
Reimar Döffinger [Sat, 11 Aug 2012 12:15:09 +0000 (14:15 +0200)]
Optimized unscaled yuvp9/yuvp10 -> yuvp16 conversion.

About 30% faster on 32 bit Atom, 120% faster on 64 bit Phenom2.
This is interesting because supporting P16 is easier in e.g.
OpenGL (can misuse support for any 2-component 8 bit format),
whereas supporting p9/p10 without conversion needs a texture
format with at least 14 bits actual precision.
The shiftonly == 0 case is not optimized since the code is more
complex and the speed gain less obvious.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
11 years agooggparsetheora: fix metadata parsing
Michael Niedermayer [Sun, 12 Aug 2012 21:09:45 +0000 (23:09 +0200)]
oggparsetheora: fix metadata parsing

Fixes Ticket1508
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 years agoffplay: avoid SDL_atoi()
Michael Niedermayer [Fri, 10 Aug 2012 14:03:42 +0000 (16:03 +0200)]
ffplay: avoid SDL_atoi()

It appears this function is not available everywhere
Should fix Ticket1525

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agoFix reading past the end of frame buffer.
Boris Maksalov [Fri, 10 Aug 2012 08:50:35 +0000 (09:50 +0100)]
Fix reading past the end of frame buffer.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agomov: remux AALP tag
Piotr Bandurski [Fri, 10 Aug 2012 13:48:20 +0000 (15:48 +0200)]
mov: remux AALP tag

AALP(AALP001) tag is present in 32bpp files encoded with avid codecs

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agofate: split asyncts from aresample test
Michael Niedermayer [Sun, 12 Aug 2012 13:45:23 +0000 (15:45 +0200)]
fate: split asyncts from aresample test

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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

11 years agolavf: reimplement is_intra_only() by using the AVCodecContext codec descriptor
Michael Niedermayer [Sat, 11 Aug 2012 14:09:44 +0000 (16:09 +0200)]
lavf: reimplement is_intra_only() by using the AVCodecContext codec descriptor

This also changes behavior as the descriptor table is more complete than
the switch/case it replaces. As well as considering all non video as
intra only

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agolavc: add codec_descriptor field to AVCodecContext.
Michael Niedermayer [Sat, 11 Aug 2012 14:07:28 +0000 (16:07 +0200)]
lavc: add codec_descriptor field to AVCodecContext.

This can be used to avoid a time consuming lookup of the
descriptor

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agoMerge remote-tracking branch 'qatar/master'
Michael Niedermayer [Sun, 12 Aug 2012 11:43:03 +0000 (13:43 +0200)]
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  lavf: Detect discontinuities in timestamps for framerate/analyzeduration calculation
  lavf: Initialize the stream info timestamps in avformat_new_stream
  id3v2: Match PIC mimetype/format case-insensitively
  configure: Rename check_asm() to more fitting check_inline_asm()
  fate: Only test enabled filters
  avresample: De-doxygenize some comments where Doxygen is not appropriate
  rtmp: split chunk_size var into in_chunk_size and out_chunk_size
  rtmp: Factorize the code by adding find_tracked_method

Conflicts:
configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
11 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

11 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>
11 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>
11 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>
11 years agosgidec: fix error free end detection.
Michael Niedermayer [Sun, 12 Aug 2012 03:32:07 +0000 (05:32 +0200)]
sgidec: fix error free end detection.

Fixes Ticket1506
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agosgidec: correct end pointer
Michael Niedermayer [Sun, 12 Aug 2012 03:31:14 +0000 (05:31 +0200)]
sgidec: correct end pointer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agoffmpeg: Do not discard slightly invalid timestamps.
Michael Niedermayer [Sat, 11 Aug 2012 21:38:48 +0000 (23:38 +0200)]
ffmpeg: Do not discard slightly invalid timestamps.

Fixes Ticket1627

The fate change is due to ffmpeg no longer pushing audio timestamps
aggressively up (which is what caused the AV sync issues in the ticket)
but leaving them as they are.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agovc1dec: support debug & FF_DEBUG_PICT_INFO.
Michael Niedermayer [Sat, 11 Aug 2012 22:27:57 +0000 (00:27 +0200)]
vc1dec: support debug & FF_DEBUG_PICT_INFO.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agolavf: do not discard correct dts in favor of wrong pts for vc1-wmapro.ism
Michael Niedermayer [Sat, 11 Aug 2012 22:48:49 +0000 (00:48 +0200)]
lavf: do not discard correct dts in favor of wrong pts for vc1-wmapro.ism

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years agomov: add av_dlog() to CTTS reading code like is already done in STTS.
Michael Niedermayer [Sat, 11 Aug 2012 21:27:27 +0000 (23:27 +0200)]
mov: add av_dlog() to CTTS reading code like is already done in STTS.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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()