1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

19359 Commits

Author SHA1 Message Date
Anton Khirnov
d63443b968 lavc: drop the av_fast_{re,m}alloc compatibility wrappers
They were only needed until the bump.
2014-08-10 15:40:38 +00:00
Diego Elio Pettenò
2597a842a0 tiff: Improve grayscale support
Only use PAL8 if palette is present, else use GRAY8 for pixfmt.

Instead of simulating a grayscale palette, use real grayscale pixels, if no
palette is actually defined.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-10 15:21:44 +02:00
Anton Khirnov
9325d88eba lavc: remove obsolete and disabled avpriv functions 2014-08-09 16:59:34 +00:00
Anton Khirnov
472f9ed312 Remove obsolete FF_API_AVFRAME_COLORSPACE cruft. 2014-08-09 16:59:13 +00:00
Anton Khirnov
1985c2e75c Bump major versions of all libraries. 2014-08-09 16:58:33 +00:00
Anton Khirnov
f4c444e17d Postpone API-incompatible changes until the next bump. 2014-08-09 16:57:10 +00:00
Anton Khirnov
7acdd3a127 hevc_filter: avoid excessive calls to ff_hevc_get_ref_list()
1) each of the loops run within a single CTB, so the relevant reference
list is constant
2) when that CTB is, or lies on the same slice as, the current one, we
can use a simple access instead of a relatively expensive call to
ff_hevc_get_ref_list()
2014-08-09 16:15:51 +00:00
Anton Khirnov
52a2c17ec0 hevc_refs: drop the handling of negative coordinates in ff_hevc_get_ref_list()
It makes no sense and cannot happen in any place from which this
function is called.
2014-08-09 16:15:38 +00:00
Anton Khirnov
a7a17e3f19 hevc_filter: move some conditions out of loops 2014-08-09 16:15:11 +00:00
Anton Khirnov
70211539a3 hevc: deobfuscate slice/tile boundary handling for DBF
Use named constants instead of magic numbers, avoid using variables with
inverse meaning from what their name implies.
2014-08-09 16:13:48 +00:00
Anton Khirnov
5501971578 hevc_filter: drop more redundant checks
The if() around those loops ensures this condition is always false.
2014-08-09 16:13:37 +00:00
Anton Khirnov
65b8b6c476 hevc_filter: drop redundant checks
ff_hevc_deblocking_boundary_strengths() is never called if the
deblocking filter is disabled for the slice.
2014-08-09 16:13:24 +00:00
Anton Khirnov
4d1ff2a489 hevc: calculate the dbf strength in hls_pcm_sample() only if dbf is enabled 2014-08-09 16:13:11 +00: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
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
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
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
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
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
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
Diego Biurrun
990e2f3555 avcodec: Suppress deprecation warnings from DTG code scheduled for removal 2014-08-04 11:08:35 -07:00
Carl Eugen Hoyos
60cbd6ad84 tiff: support reading gray+alpha at 8 bits
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-04 12:57:39 +01:00
Vittorio Giovara
bcc5f69b33 tiff: support reading gray+alpha at 16 bits 2014-08-04 12:57:38 +01:00
Vittorio Giovara
e64f0bf2d2 png: support reading gray+alpha at 16 bits 2014-08-04 12:57:38 +01:00
Vittorio Giovara
2257165bff png: disable broken MMX/SIMD code for bpp <= 2
The decoder was producing different results when ASM was disabled.
Based on a long debug session with Kostya.
2014-08-04 12:57:38 +01:00
Vittorio Giovara
e96c3b81ca avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8
The rationale is that you have a packed format in form
<greyscale sample> <alpha sample> <greyscale sample> <alpha sample>
and shortening greyscale to 'G' might make one thing about Greenscale instead.
An alias pixel format and color space name are provided for compatibility.
2014-08-04 12:55:08 +01:00
Kieran Kunhya
1ef9e83764 avcodec: Deprecate dtg_active_format field in favor of avframe side-data
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-03 15:43:02 -07:00
Diego Biurrun
d0393d79bc huffyuv: Check and propagate function return values
Bug-Id: CVE-2013-0868

inspired by a patch from Michael Niedermayer <michaelni@gmx.at>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Diego Biurrun <diego@biurrun.de>

CC: libav-stable@libav.org
2014-08-03 15:35:30 -07:00
Diego Biurrun
6234058148 huffyuv: Return proper error codes 2014-08-03 15:18:58 -07:00
Diego Biurrun
3160bdc7f7 huffyuv: Use avpriv_report_missing_feature() where appropriate 2014-08-03 15:18:58 -07:00
Diego Biurrun
b7616f5716 huffyuv: Eliminate some pointless casts 2014-08-03 15:18:58 -07:00
Diego Biurrun
c065f4a0c6 huffyuv: K&R formatting cosmetics 2014-08-03 15:18:58 -07:00
Anton Khirnov
f89d76c103 mpeg4video: Initialize xvididct for all threads
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-03 15:18:58 -07:00
Janne Grunau
ac6b95dbc0 aarch64: add ',' between assembler macro arguments where missing
llvm's integrated assembler does not accept spaces as macro argument
delimiter when targeting darwin. Using a explicit delimiter is a good
idea in principle since it makes case like 'macro 4 -2' vs 'macro 4 - 2'
clear.
2014-08-04 00:17:21 +02:00
Diego Biurrun
9f17685dfb avcodec: Deprecate unused defines and options 2014-08-03 03:24:16 -07:00
Diego Biurrun
bad81800bb avcodec: options: Add missing deprecation ifdefs around emu_edge 2014-08-03 03:24:15 -07:00
Diego Biurrun
c697c590fb lcl: Disentangle pointers to input data and decompression buffer
This is cleaner and avoids a cast plus a related const qualifier warning.
2014-08-03 01:29:43 -07:00
Diego Biurrun
df507d5aa0 tiff: Replace deprecated PIX_FMT names by modern ones 2014-08-02 12:54:37 -07:00
Diego Biurrun
7835c24e19 dv: Update DV-profile-related functions to current public API 2014-08-02 12:54:37 -07:00
Diego Biurrun
ffa4d4ef0b ppc: fft: Build AltiVec optimizations in the standard way 2014-08-02 07:40:37 -07:00
Vittorio Giovara
7ab551f9fd h264: prevent theoretical infinite loop in SEI parsing
Properly address CVE-2011-3946 and parse bitstream as described in the spec.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-01 13:08:32 +01:00
Vittorio Giovara
92a36a6b33 pngdec: correctly indent macros 2014-08-01 13:07:53 +01:00