Commit Graph

28307 Commits

Author SHA1 Message Date
Michael Niedermayer
92cc6d5163 avcodec/mdct_template: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 15:07:31 +02:00
Michael Niedermayer
681a5b8d6f avcodec/ttaenc: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 15:04:42 +02:00
Michael Niedermayer
abbcc6b26b avcodec/utils: use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 15:03:26 +02:00
Michael Niedermayer
2f2629c870 Merge commit '6d69f9f37689c999815a65a2d99999fad3a41705'
* commit '6d69f9f37689c999815a65a2d99999fad3a41705':
  vp9: write uveob as 16-bit value for 16x16/32x32 transforms.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 13:55:44 +02:00
Ronald S. Bultje
6d69f9f376 vp9: write uveob as 16-bit value for 16x16/32x32 transforms.
This fixes make fate-vp9-00-quantizer-01 THREADS=2.
2014-04-25 07:51:39 -04:00
James Almer
c7b089048d vp9: use LOCAL_ALIGNED_32 for left/top intra_pred pointers
This is needed for future AVX2 implementations

Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 06:13:15 +02:00
Ben Avison
a0d7f9ec9a vc-1: Optimise parser (with special attention to ARM)
The previous implementation of the parser made four passes over each input
buffer (reduced to two if the container format already guaranteed the input
buffer corresponded to frames, such as with MKV). But these buffers are
often 200K in size, certainly enough to flush the data out of L1 cache, and
for many CPUs, all the way out to main memory. The passes were:

1) locate frame boundaries (not needed for MKV etc)
2) copy the data into a contiguous block (not needed for MKV etc)
3) locate the start codes within each frame
4) unescape the data between start codes

After this, the unescaped data was parsed to extract certain header fields,
but because the unescape operation was so large, this was usually also
effectively operating on uncached memory. Most of the unescaped data was
simply thrown away and never processed further. Only step 2 - because it
used memcpy - was using prefetch, making things even worse.

This patch reorganises these steps so that, aside from the copying, the
operations are performed in parallel, maximising cache utilisation. No more
than the worst-case number of bytes needed for header parsing is unescaped.
Most of the data is, in practice, only read in order to search for a start
code, for which optimised implementations already existed in the H264 codec
(notably the ARM version uses prefetch, so we end up doing both remaining
passes at maximum speed). For MKV files, we know when we've found the last
start code of interest in a given frame, so we are able to avoid doing even
that one remaining pass for most of the buffer.

In some use-cases (such as the Raspberry Pi) video decode is handled by the
GPU, but the entire elementary stream is still fed through the parser to
pick out certain elements of the header which are necessary to manage the
decode process. As you might expect, in these cases, the performance of the
parser is significant.

To measure parser performance, I used the same VC-1 elementary stream in
either an MPEG-2 transport stream or a MKV file, and fed it through ffmpeg
with -c:v copy -c:a copy -f null. These are the gperftools counts for
those streams, both filtered to only include vc1_parse() and its callees,
and unfiltered (to include the whole binary). Lower numbers are better:

                Before          After
File  Filtered  Mean   StdDev   Mean   StdDev  Confidence  Change
M2TS  No        861.7  8.2      650.5  8.1     100.0%      +32.5%
MKV   No        868.9  7.4      731.7  9.0     100.0%      +18.8%
M2TS  Yes       250.0  11.2     27.2   3.4     100.0%      +817.9%
MKV   Yes       149.0  12.8     1.7    0.8     100.0%      +8526.3%

Yes, that last case shows vc1_parse() running 86 times faster! The M2TS
case does show a larger absolute improvement though, since it was worse
to begin with.

This patch has been tested with the FATE suite (albeit on x86 for speed).

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 02:36:29 +02:00
Ben Avison
9d8ecdd8ca vc-1: Add platform-specific start code search routine to VC1DSPContext.
Initialise VC1DSPContext for parser as well as for decoder.
Note, the VC-1 code doesn't actually use the function pointer yet.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 02:36:11 +02:00
Ben Avison
270cede3f3 h264: Move search code search functions into separate source files.
This permits re-use with parsers for codecs which use similar start codes.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 02:35:56 +02:00
Michael Niedermayer
e148a5820d Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  Enable muxing ac-3 in caf.
  Use correct msvc type specifiers for ptrdiff_t and size_t.
  Fix vf_eq.c and vf_eq2.c compilation with !HAVE_6REGS.
  Fix libpostproc compilation with !HAVE_6REGS.
  Never write 0 as maximum bitrate for asf files.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 01:56:23 +02:00
Michael Niedermayer
06e664366a Merge commit 'a88e1d1c598e641eecd5d43730211d91c82787c6'
* commit 'a88e1d1c598e641eecd5d43730211d91c82787c6':
  lavu: add CHK_OFFS as AV_CHECK_OFFSET to check struct member offsets

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 00:55:40 +02:00
James Almer
5ac10d40fb x86/mpegaudiodsp: define apply_window_mp3 as SSE
None of the handwritten asm in this function seems to be SSE2

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 00:38:01 +02:00
Janne Grunau
a88e1d1c59 lavu: add CHK_OFFS as AV_CHECK_OFFSET to check struct member offsets 2014-04-24 18:28:26 +02:00
Carl Eugen Hoyos
ced0d6c14d Use correct msvc type specifiers for ptrdiff_t and size_t.
The Windows runtime aborts if it finds %t or %z.
Fixes ticket #3472.

Reviewed-by: Ronald Bultje
2014-04-24 18:01:30 +02:00
Michael Niedermayer
417ae6281b Merge commit '7cade8ea2bb19e78dae42b29720535a70fb2ae84'
* commit '7cade8ea2bb19e78dae42b29720535a70fb2ae84':
  on2avc: change a comment at #endif to match actual define

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-23 23:03:20 +02:00
Michael Niedermayer
23cd5cb18f avcodec/fic: avoid 2 additions per idct row
before:
5225 decicycles in IDCT, 32756 runs, 12 skips

after:
5057 decicycles in IDCT, 32765 runs, 3 skips

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-23 22:34:31 +02:00
Kostya Shishkov
7cade8ea2b on2avc: change a comment at #endif to match actual define 2014-04-23 20:54:29 +02:00
Michael Niedermayer
56efd98a65 Merge commit 'e2834567d73bd1e46478ba67ac133cb8ef5f50fd'
* commit 'e2834567d73bd1e46478ba67ac133cb8ef5f50fd':
  On2 AVC decoder

Conflicts:
	Changelog
	configure
	libavcodec/avcodec.h
	libavcodec/codec_desc.c
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-23 20:47:13 +02:00
Kostya Shishkov
e2834567d7 On2 AVC decoder 2014-04-23 19:57:44 +02:00
Derek Buitenhuis
14da7f9eb7 fic: Support rendering cursors
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-23 13:31:22 -04:00
Derek Buitenhuis
d7eb8f9033 fic: Make warning message more accurate
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-23 17:53:00 +01:00
Derek Buitenhuis
7596fc3d4b fic: Remove redundant clips
The equations can't overflow or underflow anyway.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-23 12:40:39 -04:00
Michael Niedermayer
1aa388d439 avcodec/jpeg2000dwt: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-23 15:52:45 +02:00
Michael Niedermayer
7de2cea8a9 avcodec/motionpixels: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-23 15:52:28 +02:00
Michael Niedermayer
c161134035 avcodec/snow_dwt: use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-23 15:51:41 +02:00
Derek Buitenhuis
e299cb2cd3 fic: Simplify alpha blending
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-22 17:51:43 -04:00
Michael Niedermayer
cc17ff8826 Merge commit '3956a5e0ea46ed7e27ca888fe11c47986ad99261'
* commit '3956a5e0ea46ed7e27ca888fe11c47986ad99261':
  aarch64: NEON vorbis_inverse_coupling

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 23:51:19 +02:00
Michael Niedermayer
59bfddfcda Merge commit '8f9fe6ae3461ce270bce6b7083fda5ec314cdad4'
* commit '8f9fe6ae3461ce270bce6b7083fda5ec314cdad4':
  aarch64: NEON fixed/floating point MPADSP apply_window

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 23:45:50 +02:00
Michael Niedermayer
ef1961e7fc Merge commit 'ee2bc5974fe64fd214f52574400ae01c85f4b855'
* commit 'ee2bc5974fe64fd214f52574400ae01c85f4b855':
  aarch64: NEON float (i)MDCT

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 23:27:02 +02:00
Michael Niedermayer
13f4428915 Merge commit '650c4300d94aa9398ff1dd4f454bf39eaa285f62'
* commit '650c4300d94aa9398ff1dd4f454bf39eaa285f62':
  aarch64: NEON float FFT

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 23:06:24 +02:00
Derek Buitenhuis
6d149d2818 fic: Use proper quantization matrix index
The matrices are not zigzagged.

Fixes artefacting.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-22 16:22:08 -04:00
Derek Buitenhuis
9155c595f1 fic: Support rendering cursors
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-22 21:20:23 +01:00
Derek Buitenhuis
40b331e1f4 fic: Use proper quantization matrix index
The matrices are not zigzagged.

Fixes artefacting.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-04-22 21:20:23 +01:00
Janne Grunau
3956a5e0ea aarch64: NEON vorbis_inverse_coupling
From the ARMv7 NEON version. 16 times faster as the C version, overall
more than 12% faster vorbis decoding on Apple's A7.
2014-04-22 22:01:45 +02:00
Janne Grunau
8f9fe6ae34 aarch64: NEON fixed/floating point MPADSP apply_window
30%/25% (fixed/float) faster mp3 decoding on Apple's A7. The floating
point decoder is approximately 7% faster.
2014-04-22 22:01:45 +02:00
Reimar Döffinger
ab14bcb104 Add "const" to avoid compiler warning.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-04-22 20:44:31 +02:00
Reimar Döffinger
8cbf0827e1 Various small spelling fixes.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-04-22 20:44:31 +02:00
Michael Niedermayer
994a582a02 avcodec/dvbsubdec: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 20:08:30 +02:00
Michael Niedermayer
ea8e089ff7 avcodec/cook: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 20:08:30 +02:00
Michael Niedermayer
b20d6cf603 avcodec/dsddec: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 20:08:30 +02:00
Janne Grunau
ee2bc5974f aarch64: NEON float (i)MDCT
Approximately as fast as the ARM NEON version on Apple's A7.
2014-04-22 19:35:41 +02:00
Janne Grunau
650c4300d9 aarch64: NEON float FFT
Approximately as fast as the ARM NEON version on Apple's A7.
2014-04-22 19:35:40 +02:00
Hendrik Leppkes
5809c2a99d vc1dsp: fix build without inline asm
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 14:01:53 +02:00
Michael Niedermayer
5e6be52bac Merge commit 'b19a5e51981be5b69cf550a3bc17fe5300d0dbc9'
* commit 'b19a5e51981be5b69cf550a3bc17fe5300d0dbc9':
  lavc: improve AVCodecContext.delay doxy

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 13:34:43 +02:00
Anton Khirnov
b19a5e5198 lavc: improve AVCodecContext.delay doxy 2014-04-22 07:44:40 +02:00
Michael Niedermayer
da621ffbcf avcodec/wma: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 02:41:05 +02:00
Michael Niedermayer
dcad6ba68a avcodec/libxavs: Use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 02:39:23 +02:00
Michael Niedermayer
78fb5f6e2a avcodec/cngenc: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 02:38:03 +02:00
Michael Niedermayer
0dadbbbfd1 avcodec/snow: use FF_ALLOC(Z)_ARRAY_OR_GOTO
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-22 02:12:02 +02:00
Michael Niedermayer
1c7b71a5bd mpegvideo: Use the current_picture pts
The picture slot can be recycled by select_input_picture and
only current_picture is populated with the valid pts.

Unbreak timestamps when in cbr mode.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-04-21 21:58:58 +02:00