ffmpeg.git
6 years agoavformat: export queue_attached_pictures
Michael Niedermayer [Tue, 14 Aug 2012 00:01:38 +0000 (02:01 +0200)]
avformat: export queue_attached_pictures

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agodv: fix null ptr dereference
Michael Niedermayer [Thu, 16 Aug 2012 02:25:07 +0000 (04:25 +0200)]
dv: fix null ptr dereference

Fixes Ticket1640

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agosp5xdec: fix off by 1 error causing a crash
Michael Niedermayer [Thu, 16 Aug 2012 01:15:14 +0000 (03:15 +0200)]
sp5xdec: fix off by 1 error causing a crash

Fixes Ticket1633

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoav_get_audio_frame_duration: fix ra144
Michael Niedermayer [Thu, 16 Aug 2012 00:57:11 +0000 (02:57 +0200)]
av_get_audio_frame_duration: fix ra144

Fixes Ticket1612

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agosnowdec: add 2 av_asserts to check run validity
Michael Niedermayer [Wed, 15 Aug 2012 23:35:10 +0000 (01:35 +0200)]
snowdec: add 2 av_asserts to check run validity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agosnowdec: check log in get_symbol2()
Michael Niedermayer [Wed, 15 Aug 2012 23:31:19 +0000 (01:31 +0200)]
snowdec: check log in get_symbol2()

Fixes Ticket1635

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agompegvideo: dont call draw edges on lowres
Michael Niedermayer [Wed, 15 Aug 2012 20:33:55 +0000 (22:33 +0200)]
mpegvideo: dont call draw edges on lowres

this crashes otherwise, and can happen from try_decode_frame() in the case of decoding errors
Fixes Ticket1602

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoh263penc: fix multitheraded encoding
Michael Niedermayer [Wed, 15 Aug 2012 20:14:24 +0000 (22:14 +0200)]
h263penc: fix multitheraded encoding

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agompegvideo_enc: reset mb_x/y before writing the headers
Michael Niedermayer [Wed, 15 Aug 2012 20:09:56 +0000 (22:09 +0200)]
mpegvideo_enc: reset mb_x/y before writing the headers

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agomotion_est: switch some asserts to av_assert
Michael Niedermayer [Wed, 15 Aug 2012 19:39:53 +0000 (21:39 +0200)]
motion_est: switch some asserts to av_assert

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoMerge remote-tracking branch 'qatar/master'
Michael Niedermayer [Wed, 15 Aug 2012 13:41:01 +0000 (15:41 +0200)]
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  rtmp: Add support for SWFVerification
  api-example: use new video encoding API.
  x86: avcodec: Appropriately name files containing only init functions
  mpegvideo_mmx_template: drop some commented-out cruft
  libavresample: add mix level normalization option
  w32pthreads: Add missing #includes to make header compile standalone
  rtmp: Gracefully ignore _checkbw errors by tracking them
  rtmp: Do not send _checkbw calls as notifications
  prores: interlaced ProRes encoding

Conflicts:
doc/examples/decoding_encoding.c
libavcodec/proresenc_kostya.c
libavcodec/w32pthreads.h
libavcodec/x86/Makefile
libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 agomsmpeg4v2: initialize mb_type array
Michael Niedermayer [Wed, 15 Aug 2012 03:29:28 +0000 (05:29 +0200)]
msmpeg4v2: initialize mb_type array

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agompegvideo: fix MB/MV vissualization on videos that are not mod 16 == 0
Michael Niedermayer [Wed, 15 Aug 2012 03:03:37 +0000 (05:03 +0200)]
mpegvideo: fix MB/MV vissualization on videos that are not mod 16 == 0

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 agomovdec: Try to recover from overreading atoms
Michael Niedermayer [Wed, 15 Aug 2012 01:21:19 +0000 (03:21 +0200)]
movdec: Try to recover from overreading atoms

Fixes Ticket1596

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agopafdec: fix wrong check for input buffer size.
Michael Niedermayer [Tue, 14 Aug 2012 23:58:41 +0000 (01:58 +0200)]
pafdec: fix wrong check for input buffer size.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agopafdec: fix wrong palette index check.
Michael Niedermayer [Tue, 14 Aug 2012 23:57:45 +0000 (01:57 +0200)]
pafdec: fix wrong palette index check.

Fixes Ticket1641

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 agovda: better frame allocation.
Sebastien Zwickert [Tue, 14 Aug 2012 19:22:20 +0000 (21:22 +0200)]
vda: better frame allocation.

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 agobmv_videodec: fix out of array read
Michael Niedermayer [Tue, 14 Aug 2012 16:58:49 +0000 (18:58 +0200)]
bmv_videodec: fix out of array read

Fixes Ticket1373

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoremove duplicated code
upsuper [Tue, 14 Aug 2012 15:10:45 +0000 (23:10 +0800)]
remove duplicated code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoprores_kostya: implement interlaced encoding.
Boris Maksalov [Tue, 14 Aug 2012 09:03:36 +0000 (10:03 +0100)]
prores_kostya: implement interlaced encoding.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoprores_kostya: fix incorrect picture_size field.
Boris Maksalov [Tue, 14 Aug 2012 09:05:38 +0000 (10:05 +0100)]
prores_kostya: fix incorrect picture_size field.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoAdd ICO muxer
Michael Bradshaw [Sun, 12 Aug 2012 16:29:36 +0000 (10:29 -0600)]
Add ICO muxer

Signed-off-by: Michael Bradshaw <mbradshaw@sorensonmedia.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 years agoCheck for avio fail in avformat_write_header, av_write_frame
Andrey Utkin [Tue, 14 Aug 2012 09:48:45 +0000 (12:48 +0300)]
Check for avio fail in avformat_write_header, av_write_frame

With minor changes by michael
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
6 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>
6 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>
6 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>
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 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.

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

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

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

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

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

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

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

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

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

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

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

6 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>
6 years agolavc: add missing codec descriptors.
Nicolas George [Sun, 12 Aug 2012 22:59:03 +0000 (00:59 +0200)]
lavc: add missing codec descriptors.

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

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