Commit Graph

43661 Commits

Author SHA1 Message Date
Mans Rullgard
a4b8fc3a8a g723.1: simplify normalize_bits()
This function is always called with a non-negative argument, so
those special cases are not needed.  In the places the argument
might be zero, the return value for a zero argument does not matter
since it would then be used to scale an array full of zeros.

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

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 12:47:27 +02:00
Sebastien Zwickert
cfc680ab39 vda: Reuse the bitstream buffer and reallocate it only if needed
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-08-14 12:47:15 +02:00
Nicolas George
082b745d33 filter_design: document ownership and permissions. 2012-08-14 12:12:20 +02:00
Nicolas George
271ddb116c 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.
2012-08-14 12:00:35 +02:00
Nicolas George
67a804b9ac dvdsubenc: reindent after recent commit. 2012-08-14 11:58:32 +02:00
Nicolas George
2d3acbfe8c lavc: add const to AVCodecContext.codec_descriptor. 2012-08-14 11:35:30 +02:00
Nicolas George
9bb936a80e lavc: reimplement avcodec_get_name with descriptors. 2012-08-14 11:35:30 +02:00
Nicolas George
690ef618b1 ffmpeg: copy subtitles frame dimensions.
The sub-movtextenc ref file changes because the dimensions
(400×60) are stored by the format.
2012-08-14 11:17:45 +02:00
Nicolas George
e4f4d99df8 ffmpeg: make -s work for subtitles too.
Some codecs allow to encode the frame size and some players use it.
2012-08-14 11:17:45 +02:00
Nicolas George
17e40236cb dvdsubenc: set frame size in extradata. 2012-08-14 11:17:45 +02:00
Nicolas George
b1511e00f6 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.
2012-08-14 11:17:45 +02:00
Nicolas George
2dedd8f496 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.
2012-08-14 11:17:45 +02:00
Nicolas George
0cad101ea1 ffmpeg: add an option to fix subtitles durations.
With this option, transcoding DVB subtitles becomes possible.
2012-08-14 11:17:45 +02:00
Diego Biurrun
ad08dfd594 build: Factor out mpegvideo encoding dependencies to CONFIG_MPEGVIDEOENC
A new hidden config variable is added for the codecs that depend on
the mpegvideo encoding parts.
2012-08-14 10:04:34 +02:00
Sebastien Zwickert
1bfa349a8d vda: merge implementation into one file.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-14 03:39:31 +02:00
Sebastien Zwickert
7f3dfd2010 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>
2012-08-14 03:39:23 +02:00
rogerdpack
47682ddc22 more verbose error messages at configure time
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-14 03:31:50 +02:00
Michael Niedermayer
e47d979cab asfdec: ignore too tiny indexes
Fixes Ticket1521

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-14 03:21:08 +02:00
Martin Storsjö
0af85d57c1 avprobe: Include libm.h for the log2 fallback
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-14 01:37:52 +03:00
Boris Maksalov
cee03436e6 proresenc: use the edge emulation buffer
Prevents reading past the end of frame buffer.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-13 21:04:00 +02:00
Luca Barbato
fb96c1c5fe rtmp: handle bytes read reports
0x03 (bytes read report) is a known type and should be safely ignored
beside in debug situations.
2012-08-13 21:03:59 +02:00
Michael Niedermayer
5e3900c7a5 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>
2012-08-13 20:37:52 +02:00
Michael Niedermayer
cc913f7490 hls: check that the streams have been initialized before checking their discard flags.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-13 20:37:04 +02:00
Diego Biurrun
fe5fba44c5 configure: Fix typo in mpeg2video/svq1 decoder dependency declaration 2012-08-13 19:37:56 +02:00
Mans Rullgard
d752509b74 Use log2(x) instead of log(x) / log(2)
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 17:59:21 +01:00
Speedy Gonzales
ffda8f0f0f Proresenc: add multithreading support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-13 17:16:47 +02:00
Mans Rullgard
90540c2d5a 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>
2012-08-13 14:51:52 +01:00
Mans Rullgard
10b83cb653 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>
2012-08-13 14:51:52 +01:00
Mans Rullgard
480178a295 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>
2012-08-13 14:51:52 +01:00
Mans Rullgard
8ec0204ee4 x86: cabac: allow building with suncc
This fixes two issues preventing suncc from building this code.

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

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

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

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

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

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 14:51:52 +01:00
Mans Rullgard
87fa05a0da 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>
2012-08-13 14:51:52 +01:00
Michael Niedermayer
603221ebd0 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>
2012-08-13 15:18:47 +02:00
Michael Niedermayer
20035fa241 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>
2012-08-13 15:02:21 +02:00
Michael Niedermayer
84d29df013 g723_1dec: remove unneeded cliping that leaked in from merge from libav
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-13 15:01:45 +02:00
Michael Niedermayer
a9040a1167 g723_1dec: avoid memcpy
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-13 14:53:29 +02:00
Michael Niedermayer
d8c3170c9f 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>
2012-08-13 14:38:43 +02:00
Paul B Mahol
bd70a52712 paf: prevent invalid write
Closes #1631.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-08-13 12:27:58 +00:00
Stefano Sabatini
c3da2c19e4 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.
2012-08-13 12:22:02 +02:00
Jérémy Tran
ae60d2c877 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>
2012-08-13 12:00:54 +02:00
Nicolas George
03e8944fc1 lavc: add missing codec descriptors. 2012-08-13 10:45:04 +02:00
Nicolas George
f594dafc10 tools: add a script to find missing codec descriptors. 2012-08-13 10:44:59 +02:00
Michael Niedermayer
710600077d h264_cavlc: switch forgotten assert to av_assert
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-13 05:59:44 +02:00
Michael Niedermayer
e9d0ab5717 h264: fix x264 build detection
Fixes Ticket1503

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

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:25 +01:00