Commit Graph

29491 Commits

Author SHA1 Message Date
Michael Niedermayer
3841f2ae66 Merge commit 'd35b94fbabd8beb5d566c0b5d01688aff62c3b36'
* commit 'd35b94fbabd8beb5d566c0b5d01688aff62c3b36':
  avcodec: Rename xvidmmx IDCT to xvid

Conflicts:
	doc/APIchanges
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-09 12:11:13 +02:00
Michael Niedermayer
0dcebb9f63 Merge commit '84d173d3de97c753234ab0c0b50551d51413d663'
* commit '84d173d3de97c753234ab0c0b50551d51413d663':
  xvididct: Ensure that the scantable permutation is always set correctly

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 22:17:04 +02:00
Michael Niedermayer
5ff2b33401 Merge commit '6f1960ab71b4f18551243ce22d01913108265233'
* commit '6f1960ab71b4f18551243ce22d01913108265233':
  idct: cosmetics: Drop one unnecessary if-block level

Conflicts:
	libavcodec/idctdsp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 21:53:20 +02:00
Diego Biurrun
d35b94fbab avcodec: Rename xvidmmx IDCT to xvid
The Xvid IDCT is not MMX-specific.
2014-08-08 11:13:30 -07:00
Diego Biurrun
84d173d3de xvididct: Ensure that the scantable permutation is always set correctly
This fixes cases where the scantable permuation would get overwritten by
the general idctdsp initialization.
2014-08-08 11:13:29 -07:00
Diego Biurrun
6f1960ab71 idct: cosmetics: Drop one unnecessary if-block level 2014-08-08 11:13:29 -07:00
Michael Niedermayer
a561662fb7 Merge commit 'ad1ee5fa75a3d69d54c0691048939e94ab5a7f0d'
* commit 'ad1ee5fa75a3d69d54c0691048939e94ab5a7f0d':
  avcodec: Undeprecate reordered_opaque

Conflicts:
	doc/APIchanges
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 20:43:11 +02:00
Michael Niedermayer
2bf87dcc2d Merge commit 'a7e541c9926d531a100ba0d36f4e56956dd84651'
* commit 'a7e541c9926d531a100ba0d36f4e56956dd84651':
  h264: fix interpretation of interleved stereo modes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 20:22:16 +02:00
James Almer
dd2b0c1cde lavc: remove nonexistent functions from the version file
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 13:20:59 +02:00
Diego Biurrun
ad1ee5fa75 avcodec: Undeprecate reordered_opaque
It allows attaching other external, opaque data to the frame and passing it
through the reordering process, for cases when the caller wants other data
than just the plain packet pts.  There is no way to cleanly achieve this
without the field.
2014-08-07 04:03:00 -07:00
James Almer
0ab00a75e4 avcodec/raw: add avpriv_get_raw_pix_fmt_tags()
Used to expose ff_raw_pix_fmt_tags[] to other libav* libraries

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 12:52:38 +02:00
Felix Abecassis
a7e541c992 h264: fix interpretation of interleved stereo modes
Column and row frame packing arrangements were inverted.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-07 11:31:47 +01:00
Michael Niedermayer
4213fc5b9e avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"
Add padding, clear size, use the correct pointer.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 02:27:07 +02:00
Michael Niedermayer
e55e09949e Merge commit '7b588bb691644e1b3c168b99accf74248a24e3cf'
* commit '7b588bb691644e1b3c168b99accf74248a24e3cf':
  svq1: do not modify the input packet

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 02:08:56 +02:00
Michael Niedermayer
c628627995 Merge commit 'c7d9b473e28238d4a4ef1b7e8b42c1cca256da36'
* commit 'c7d9b473e28238d4a4ef1b7e8b42c1cca256da36':
  cdgraphics: do not return 0 from the decode function

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 01:56:50 +02:00
Michael Niedermayer
91b4ed0918 Merge commit 'a1599f3f7ea8478d1f6a95e59e3bc6bc86d5f812'
* commit 'a1599f3f7ea8478d1f6a95e59e3bc6bc86d5f812':
  cdgraphics: switch to bytestream2

Conflicts:
	libavcodec/cdgraphics.c

See: ad002e1a13
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 01:45:22 +02:00
James Almer
8dfb8190d7 libavcodec/rawdec: remove old ff_find_pix_fmt() function
It's been dead code for more than a year

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 00:44:07 +02:00
Michael Niedermayer
7a34b7d80f avcodec/dca: Make ff_dca_convert_bitstream() available to libavformat, needed for dts_probe()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 22:28:35 +02:00
Anton Khirnov
7b588bb691 svq1: do not modify the input packet
The input data must remain constant, make a copy instead. This is in
theory a performance hit, but since I failed to find any samples
using this feature, this should not matter in practice.

Also, check the size of the header, avoiding invalid reads on truncated
data.

CC:libav-stable@libav.org
2014-08-06 18:59:27 +00:00
Anton Khirnov
c7d9b473e2 cdgraphics: do not return 0 from the decode function
0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable@libav.org
2014-08-06 18:32:42 +00:00
Anton Khirnov
a1599f3f7e cdgraphics: switch to bytestream2
Fixes possible invalid memory accesses on corrupted data.

CC:libav-stable@libav.org
Bug-ID: CVE-2013-3674
2014-08-06 18:32:38 +00:00
Christophe Gisquet
75837e9add x86: sbrdsp/fft: reuse ps_neg constant
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 19:25:08 +02:00
Christophe Gisquet
51dd80e751 x86: diracdsp: reuse constants
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 19:25:02 +02:00
Christophe Gisquet
6622a6cff3 x86: dwt: better share constants
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 19:24:57 +02:00
Christophe Gisquet
71db2d08b1 x86: better share ff_pw_2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 19:24:49 +02:00
Christophe Gisquet
4e128ab0b1 x86: vpx/h264/hevc/mpeg2: share constants
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 18:36:31 +02:00
Michael Niedermayer
305f72aee7 avcodec: Change get_pixels() to ptrdiff_t linesize
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 15:50:54 +02:00
Vittorio Giovara
cbc808d726 jpeg2000: enable 4 component pixel formats
Bug-Id: 721
CC: libav-stable@libav.org
Sample-Id: 31230.mov
2014-08-06 12:23:21 +01:00
Christophe Gisquet
6786848585 hevc_deblock: change tc type
The x86 asm expects int32_t so use that type.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 12:38:26 +02:00
Michael Niedermayer
296b01d7f9 Merge commit 'a7153444df9040bf6ae103e0bbf6104b66f974cb'
* commit 'a7153444df9040bf6ae103e0bbf6104b66f974cb':
  huffyuvdec: check width size for yuv422p

Conflicts:
	libavcodec/huffyuvdec.c

See: 6abb9a901f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-06 00:08:03 +02:00
Michael Niedermayer
a7153444df huffyuvdec: check width size for yuv422p
Avoid out of array accesses.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 20:01:59 +00:00
Michael Niedermayer
70cd3b8e65 mmvideo: check horizontal coordinate too
Fixes out of array accesses.

Bug-Id: CVE-2013-3672
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 19:16:12 +00:00
Michael Niedermayer
849b9d34c7 wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Bug-Id: CVE-2014-2098
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 14:58:03 +00:00
Michael Niedermayer
9988899993 Merge commit '701e8b42e12ad625c64ceae2252acb1de390278c'
* commit '701e8b42e12ad625c64ceae2252acb1de390278c':
  vc-1: Optimise parser (with special attention to ARM)

Conflicts:
	libavcodec/vc1_parser.c

See: a0d7f9ec9a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 13:37:07 +02:00
Michael Niedermayer
bf7ed956ff Merge commit 'adf8227cf4e7b4fccb2ad88e1e09b6dc00dd00ed'
* commit 'adf8227cf4e7b4fccb2ad88e1e09b6dc00dd00ed':
  vc-1: Add platform-specific start code search routine to VC1DSPContext.

Conflicts:
	configure
	libavcodec/arm/vc1dsp_init_arm.c
	libavcodec/vc1dsp.c
	libavcodec/vc1dsp.h

See: 9d8ecdd8ca
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 13:00:41 +02:00
Michael Niedermayer
77aafadc56 Merge commit 'db7f1c7c5a1d37e7f4da64a79a97bea1c4b6e9f8'
* commit 'db7f1c7c5a1d37e7f4da64a79a97bea1c4b6e9f8':
  h264: Move start code search functions into separate source files.

Conflicts:
	libavcodec/arm/Makefile
	libavcodec/arm/h264dsp_init_arm.c
	libavcodec/h264_parser.c
	libavcodec/h264dsp.c
	libavcodec/startcode.c
	libavcodec/startcode.h

See: 270cede3f3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 12:46:10 +02:00
James Almer
de417982e8 x86/vp9lpf: use fewer instructions in SPLATB_MIX
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 02:47:54 +02:00
Bernd Kuhls
bf6c84d7eb Fix compile error on bfin.
After the removal of all Blackfin architecture optimizations in
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b55d3bbeed375f7b74442c4dd274d116a3e3d2e1
some includes were left behind leading to a compile error:

CC      libavformat/adtsenc.o
In file included from ./libavcodec/get_bits.h:35,
                 from ./libavcodec/ac3_parser.h:27,
                 from libavformat/ac3dec.c:23:
./libavcodec/mathops.h:43:29: error: bfin/mathops.h: No such file or directory

This compile error was found by buildroot autobuild system:
http://autobuild.buildroot.net/results/ae0/ae056f267e907091d09d2a1546d6f1ae02fa23b9/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 01:54:47 +02:00
Michael Niedermayer
debb88776c Merge commit '990e2f3555bb0adae122d3599938ddcfee46e2d1'
* commit '990e2f3555bb0adae122d3599938ddcfee46e2d1':
  avcodec: Suppress deprecation warnings from DTG code scheduled for removal

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 01:15:11 +02:00
Michael Niedermayer
8f83fb9991 Merge commit '60cbd6ad84de0931314030b81df87b69d6196587'
* commit '60cbd6ad84de0931314030b81df87b69d6196587':
  tiff: support reading gray+alpha at 8 bits

Conflicts:
	libavcodec/tiff.c

See: f746f37901
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 22:52:01 +02:00
Michael Niedermayer
47080b6d17 Merge commit 'bcc5f69b33e27b5e11aaea8304ee02f8d895cdab'
* commit 'bcc5f69b33e27b5e11aaea8304ee02f8d895cdab':
  tiff: support reading gray+alpha at 16 bits

Conflicts:
	libavcodec/tiff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 22:45:33 +02:00
Michael Niedermayer
59412e3a07 Merge commit 'e64f0bf2d2b1347ec9461f0e82852a62e8c6ffbe'
* commit 'e64f0bf2d2b1347ec9461f0e82852a62e8c6ffbe':
  png: support reading gray+alpha at 16 bits

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 22:38:12 +02:00
Ben Avison
701e8b42e1 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 avconv
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: Luca Barbato <lu_zero@gentoo.org>
2014-08-04 22:22:54 +02:00
Ben Avison
adf8227cf4 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: Luca Barbato <lu_zero@gentoo.org>
2014-08-04 22:22:54 +02:00
Ben Avison
db7f1c7c5a h264: Move start code search functions into separate source files.
This permits re-use with parsers for codecs which use similar start codes.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-04 22:22:54 +02:00
Michael Niedermayer
4c8bc6fdee Merge commit 'e96c3b81cadd0ba84d43b1f3a54980df3785d9a5'
* commit 'e96c3b81cadd0ba84d43b1f3a54980df3785d9a5':
  avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8

Conflicts:
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/raw.c
	libavutil/pixdesc.c
	libavutil/pixfmt.h
	libavutil/version.h
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 21:48:00 +02:00
Diego Biurrun
990e2f3555 avcodec: Suppress deprecation warnings from DTG code scheduled for removal 2014-08-04 11:08:35 -07:00
Christophe Gisquet
e8c003edd2 x86: hevc_deblock: remove unnecessary masking
The unpacks/shuffles later on makes it unnecessary.

Before:
1508 decicycles in h, 2096759 runs, 393 skips
2512 decicycles in v, 2095422 runs, 1730 skips

After:
1477 decicycles in h, 2096745 runs, 407 skips
2484 decicycles in v, 2095297 runs, 1855 skips

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 17:46:04 +02:00
James Almer
b7863c972c x86/hevc_mc: use fewer instructions in hevc_put_hevc_{uni, bi}_w[24]_{8, 10, 12}
Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 14:47:15 +02:00
James Almer
b1a44e6bf5 x86/hevc_mc: remove an unnecessary pxor
Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 14:35:08 +02:00