platform/upstream/libav.git
9 years agoogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.
Andrew Stone [Tue, 12 Aug 2014 21:03:55 +0000 (17:03 -0400)]
ogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.

Originally, AVFormatContext and a metadata dict were provided to ff_vorbis_comment(),
but this presented issues if an AVStream was being updated or the metadata on
AVFormatContext wasn't actually being updated. To remedy this, ff_vorbis_stream_comment()
explicitly updates a stream's metadata and sets any necessary flags.

ff_vorbis_comment() does not modify any flags, and any calls to it that update
AVFormatContext's metadata (just a single call) must also update
AVFormatContext.event_flags after detecting any metadata changes to the provided
dictionary, as signaled by a positive return value.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agomov: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.
Andrew Stone [Tue, 12 Aug 2014 21:03:54 +0000 (17:03 -0400)]
mov: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agonutdec: update AVFormatContext.event_flags with STREAM_/METADATA_UPDATED whenever...
Andrew Stone [Tue, 12 Aug 2014 21:03:53 +0000 (17:03 -0400)]
nutdec: update AVFormatContext.event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agoflvdec: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata...
Andrew Stone [Tue, 12 Aug 2014 21:03:52 +0000 (17:03 -0400)]
flvdec: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agoExpose metadata found in onCuePoint events in .flv files.
Andrew Stone [Mon, 11 Aug 2014 17:35:09 +0000 (13:35 -0400)]
Expose metadata found in onCuePoint events in .flv files.

Currently, only onMetaData is used, but some providers (wrongly)
put metadata into onCuePoint events, and it's still nice to be
able to use that data.

onCuePoint events also present metadata slightly differently than
onMetaData events: all metadata is found inside an object called
"parameters". In order to extract this metadata, it's easiest to
recurse through the object tree and pull out anything found in
child objects and put it in the top-level metadata.

Reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/2/help.html?content=00001404.html

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agoSet protocol-level metadata in AVFormatContext any time a packet is read.
Andrew Stone [Thu, 31 Jul 2014 23:56:37 +0000 (19:56 -0400)]
Set protocol-level metadata in AVFormatContext any time a packet is read.

If any option named "metadata" is set inside the context, it is pulled up to
the context and then the option is cleared.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohttp: enable icy metadata by default.
Andrew Stone [Thu, 31 Jul 2014 23:56:36 +0000 (19:56 -0400)]
http: enable icy metadata by default.

It won't hurt servers that don't care about the header,
and those that do will include it by default.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohttp: export icecast metadata as an option with name "metadata".
Andrew Stone [Thu, 31 Jul 2014 23:56:35 +0000 (19:56 -0400)]
http: export icecast metadata as an option with name "metadata".

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agoAVOption: add support for dictionary types.
Andrew Stone [Thu, 31 Jul 2014 23:56:34 +0000 (19:56 -0400)]
AVOption: add support for dictionary types.

In order to support metadata being set as an option, it's necessary to be able
to set dictionaries as values.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agolavf: add AVFormatContext/AVStream fields for signaling to the user when events happen.
Andrew Stone [Fri, 8 Aug 2014 17:09:23 +0000 (13:09 -0400)]
lavf: add AVFormatContext/AVStream fields for signaling to the user when events happen.

The only flags, for now, indicate if metadata was updated and are set after each call to
av_read_frame(). This comes with the caveat that, on stream start, it might not be set properly
as packets might be buffered in AVFormatContext.packet_buffer before being given to the user
in av_read_frame().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agoconfigure: Check for nanosleep in headers as well, not only in libs
Martin Storsjö [Mon, 11 Aug 2014 12:02:28 +0000 (15:02 +0300)]
configure: Check for nanosleep in headers as well, not only in libs

On mingw64 with c++11 support, the link libraries do contain a
nanosleep function, while it isn't exposed via the headers. Using
check_func_headers instead of a plain check_func fixes this
misdetection.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agow32threads: Use newer thread synchronization functions when targeting Vista
Martin Storsjö [Wed, 6 Aug 2014 06:52:38 +0000 (09:52 +0300)]
w32threads: Use newer thread synchronization functions when targeting Vista

When explicitly targeting Vista or newer (which only happens if the
caller explicitly sets _WIN32_WINNT to a high enough value via the
extra cflags option - otherwise configure script sets
-D_WIN32_WINNT=0x0502), we already unconditionally link to the
ConditionVariable functions, since 4622f11f9.

Similarly use the newer -Ex versions of CreateEvent, CreateSemaphore,
InitializeCriticalSection and WaitForSingleObject, that all appeared
in Vista. When building Windows Store applications, the older versions
of these functions aren't available, only the -Ex functions. When
doing such a build, the user can set -D_WIN32_WINNT=0x0600 to
forcibly use the newer functions instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agohttp: Stop reading after receiving the whole file for non-chunked transfers
Martin Storsjö [Mon, 11 Aug 2014 07:18:28 +0000 (10:18 +0300)]
http: Stop reading after receiving the whole file for non-chunked transfers

Previously this logic was only used if the server didn't
respond with Connection: close, but use it even for that case,
if the server response is non-chunked.

Originally the http code has relied on Connection: close to close
the socket when the file/stream is received - the http protocol
code just kept reading from the socket until the socket was closed.
In f240ed18 we added a check for the file size, because some
http servers didn't respond with Connection: close (and wouldn't
close the socket) even though we requested it, which meant that the
http protocol blocked for a long time at the end of files, waiting
for a socket level timeout.

When reading over tls, trying to read at the end of the connection,
when the peer has closed the connection, can produce spurious (but
harmless) warnings. Therefore always voluntarily stop reading when
the specified file size has been received, if not using a chunked
transfer encoding. (For chunked transfers, we already return 0
as soon as we get the chunk header indicating end of stream.)

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoffv1dec: check that global parameters do not change in version 0/1
Michael Niedermayer [Fri, 30 Aug 2013 02:51:09 +0000 (04:51 +0200)]
ffv1dec: check that global parameters do not change in version 0/1

Such changes are neither allowed nor supported

Found-by: ami_stuff
Bug-Id: CVE-2013-7020
CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc_mvs: avoid deriving tmvp in amvp
Christophe Gisquet [Fri, 8 Aug 2014 18:21:04 +0000 (18:21 +0000)]
hevc_mvs: avoid deriving tmvp in amvp

Reduces the number of calls to tmvp derivation from 933685 to 586271 on
a sequence.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc: wait proper position for tmvp
Christophe Gisquet [Sun, 20 Jul 2014 07:34:58 +0000 (09:34 +0200)]
hevc: wait proper position for tmvp

The position is either rounded or not checked, so delay the wait to
check the proper value.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc: use intreadwrite
Christophe Gisquet [Fri, 8 Aug 2014 18:21:02 +0000 (18:21 +0000)]
hevc: use intreadwrite

When dealing with MVs, both components may be processed at a time.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc: derive partial merge list
Christophe Gisquet [Fri, 8 Aug 2014 18:21:01 +0000 (18:21 +0000)]
hevc: derive partial merge list

The merge list only needs to be derived up to the merge index.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc: derive partially amvp list
Christophe Gisquet [Fri, 8 Aug 2014 18:21:00 +0000 (18:21 +0000)]
hevc: derive partially amvp list

When the candidate has been found, no need to derive others.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc: simplify rounding
Christophe Gisquet [Thu, 10 Jul 2014 06:47:55 +0000 (06:47 +0000)]
hevc: simplify rounding

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agohevc: reorder loops
Christophe Gisquet [Fri, 8 Aug 2014 18:20:58 +0000 (18:20 +0000)]
hevc: reorder loops

iterate over memory in a more continuous order

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agoconfigure: Don't pass MSVC compiler options -M[TD] to armasm
Martin Storsjö [Sun, 10 Aug 2014 11:40:09 +0000 (14:40 +0300)]
configure: Don't pass MSVC compiler options -M[TD] to armasm

The -MD option (for enabling a dynamically linked crt) gets interpreted
as a cpp option for generating dependency information (into a file named
'-.d', when preprocessing to a pipe). We shouldn't be passing
any and all C compiler flags to armasm (which is a plain assembler,
only with cpp bolted on via gas-preprocessor), but these are the
main conflicting ones.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoavcodec: Postpone FF_IDCT_XVIDMMX removal until the next version bump
Diego Biurrun [Sun, 10 Aug 2014 13:44:03 +0000 (06:44 -0700)]
avcodec: Postpone FF_IDCT_XVIDMMX removal until the next version bump

9 years agolavc: drop the av_fast_{re,m}alloc compatibility wrappers
Anton Khirnov [Sun, 10 Aug 2014 10:13:30 +0000 (10:13 +0000)]
lavc: drop the av_fast_{re,m}alloc compatibility wrappers

They were only needed until the bump.

9 years agompegts: Return proper error code on invalid input data
Nidhi Makhijani [Sat, 9 Aug 2014 18:19:12 +0000 (23:49 +0530)]
mpegts: Return proper error code on invalid input data

Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years agoPrepare for 11_alpha2 Release
Reinhard Tartler [Sun, 10 Aug 2014 14:07:55 +0000 (10:07 -0400)]
Prepare for 11_alpha2 Release

9 years agoconfigure: Suggest upgrading gas-preprocessor instead of just installing
Martin Storsjö [Sun, 10 Aug 2014 13:05:41 +0000 (16:05 +0300)]
configure: Suggest upgrading gas-preprocessor instead of just installing

Older versions don't support all the features we test for now.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoconfigure: Enable gas-preprocessor on all OSes but only if available
Diego Biurrun [Sat, 9 Aug 2014 15:06:12 +0000 (08:06 -0700)]
configure: Enable gas-preprocessor on all OSes but only if available

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoconfigure: Add probe identification of MS armasm
Martin Storsjö [Sat, 9 Aug 2014 19:25:44 +0000 (22:25 +0300)]
configure: Add probe identification of MS armasm

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agotiff: Improve grayscale support
Diego Elio Pettenò [Sat, 9 Aug 2014 13:19:45 +0000 (14:19 +0100)]
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>
9 years agoavresample: Introduce AVFrame-based API v11_alpha1
Luca Barbato [Sun, 25 May 2014 15:49:15 +0000 (17:49 +0200)]
avresample: Introduce AVFrame-based API

9 years agompeg: Suppress a compiler warning on callback type
Luca Barbato [Wed, 6 Aug 2014 01:31:58 +0000 (03:31 +0200)]
mpeg: Suppress a compiler warning on callback type

9 years agolavc: remove obsolete and disabled avpriv functions
Anton Khirnov [Wed, 6 Aug 2014 20:02:11 +0000 (20:02 +0000)]
lavc: remove obsolete and disabled avpriv functions

9 years agoRemove obsolete FF_API_REFERENCE_DTS cruft.
Anton Khirnov [Wed, 6 Aug 2014 19:58:57 +0000 (19:58 +0000)]
Remove obsolete FF_API_REFERENCE_DTS cruft.

9 years agoRemove obsolete FF_API_PROBE_MIME cruft.
Anton Khirnov [Wed, 6 Aug 2014 19:58:57 +0000 (19:58 +0000)]
Remove obsolete FF_API_PROBE_MIME cruft.

9 years agoRemove obsolete FF_API_AVFRAME_COLORSPACE cruft.
Anton Khirnov [Wed, 6 Aug 2014 19:58:57 +0000 (19:58 +0000)]
Remove obsolete FF_API_AVFRAME_COLORSPACE cruft.

9 years agoBump major versions of all libraries.
Anton Khirnov [Wed, 6 Aug 2014 19:57:14 +0000 (19:57 +0000)]
Bump major versions of all libraries.

9 years agoPostpone API-incompatible changes until the next bump.
Anton Khirnov [Wed, 6 Aug 2014 19:47:54 +0000 (19:47 +0000)]
Postpone API-incompatible changes until the next bump.

9 years agohevc_filter: avoid excessive calls to ff_hevc_get_ref_list()
Anton Khirnov [Sun, 27 Jul 2014 19:40:20 +0000 (19:40 +0000)]
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()

9 years agohevc_refs: drop the handling of negative coordinates in ff_hevc_get_ref_list()
Anton Khirnov [Sun, 27 Jul 2014 18:52:12 +0000 (18:52 +0000)]
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.

9 years agohevc_filter: move some conditions out of loops
Anton Khirnov [Sun, 27 Jul 2014 18:12:24 +0000 (18:12 +0000)]
hevc_filter: move some conditions out of loops

9 years agohevc: deobfuscate slice/tile boundary handling for DBF
Anton Khirnov [Sun, 27 Jul 2014 17:49:09 +0000 (17:49 +0000)]
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.

9 years agohevc_filter: drop more redundant checks
Anton Khirnov [Sun, 27 Jul 2014 17:10:04 +0000 (17:10 +0000)]
hevc_filter: drop more redundant checks

The if() around those loops ensures this condition is always false.

9 years agohevc_filter: drop redundant checks
Anton Khirnov [Sun, 27 Jul 2014 17:06:19 +0000 (17:06 +0000)]
hevc_filter: drop redundant checks

ff_hevc_deblocking_boundary_strengths() is never called if the
deblocking filter is disabled for the slice.

9 years agohevc: calculate the dbf strength in hls_pcm_sample() only if dbf is enabled
Anton Khirnov [Sun, 27 Jul 2014 17:01:53 +0000 (17:01 +0000)]
hevc: calculate the dbf strength in hls_pcm_sample() only if dbf is enabled

9 years agoavcodec: Rename xvidmmx IDCT to xvid
Diego Biurrun [Wed, 6 Aug 2014 13:19:15 +0000 (06:19 -0700)]
avcodec: Rename xvidmmx IDCT to xvid

The Xvid IDCT is not MMX-specific.

9 years agoxvididct: Ensure that the scantable permutation is always set correctly
Diego Biurrun [Fri, 8 Aug 2014 10:10:05 +0000 (03:10 -0700)]
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.

9 years agoidct: cosmetics: Drop one unnecessary if-block level
Diego Biurrun [Thu, 7 Aug 2014 22:04:39 +0000 (15:04 -0700)]
idct: cosmetics: Drop one unnecessary if-block level

9 years agoconfigure: Only run gas checks on ARM and PowerPC
Diego Biurrun [Wed, 6 Aug 2014 12:55:33 +0000 (05:55 -0700)]
configure: Only run gas checks on ARM and PowerPC

Standalone GNU assembly is not used on x86.

9 years agoconfigure: Die if gas is unavailable under aarch64 as well as ARM
Diego Biurrun [Wed, 6 Aug 2014 12:38:43 +0000 (05:38 -0700)]
configure: Die if gas is unavailable under aarch64 as well as ARM

9 years agompeg: K&R formatting cosmetics
Luca Barbato [Wed, 6 Aug 2014 03:01:15 +0000 (05:01 +0200)]
mpeg: K&R formatting cosmetics

Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years agompegts: Use av_free() to free memory allocated by av_strdup()
Diego Biurrun [Fri, 8 Aug 2014 09:46:21 +0000 (02:46 -0700)]
mpegts: Use av_free() to free memory allocated by av_strdup()

9 years agompegts: Fix memory leaks and related crashes in mpegs_write_header()
Diego Biurrun [Wed, 6 Aug 2014 11:08:50 +0000 (04:08 -0700)]
mpegts: Fix memory leaks and related crashes in mpegs_write_header()

9 years agompegts: Avoid unnecessary variable shadowing
Diego Biurrun [Wed, 6 Aug 2014 10:28:06 +0000 (03:28 -0700)]
mpegts: Avoid unnecessary variable shadowing

9 years agompegts: Drop some unnecessary parentheses
Diego Biurrun [Wed, 6 Aug 2014 11:39:24 +0000 (04:39 -0700)]
mpegts: Drop some unnecessary parentheses

9 years agompegts: K&R formatting cosmetics
Diego Biurrun [Wed, 6 Aug 2014 01:02:18 +0000 (18:02 -0700)]
mpegts: K&R formatting cosmetics

9 years agoswscale: Undeprecate sws_getContext()
Diego Biurrun [Mon, 4 Aug 2014 17:34:30 +0000 (10:34 -0700)]
swscale: Undeprecate sws_getContext()

sws_getCachedContext is not a full replacement for the function.

9 years agoavcodec: Undeprecate reordered_opaque
Diego Biurrun [Mon, 4 Aug 2014 17:28:10 +0000 (10:28 -0700)]
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.

9 years agoh264: fix interpretation of interleved stereo modes
Felix Abecassis [Thu, 7 Aug 2014 09:42:36 +0000 (11:42 +0200)]
h264: fix interpretation of interleved stereo modes

Column and row frame packing arrangements were inverted.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agomovenc: fix QT chapter track character encoding
John Stebbins [Thu, 31 Jul 2014 18:51:40 +0000 (11:51 -0700)]
movenc: fix QT chapter track character encoding

An encoding ("encd") box is required to tell QT that the string is UTF8

9 years agomovenc: add track title to tracks
John Stebbins [Thu, 31 Jul 2014 17:00:05 +0000 (10:00 -0700)]
movenc: add track title to tracks

9 years agomovenc: remove pointless loop around BITEXACT test
John Stebbins [Wed, 6 Aug 2014 14:42:18 +0000 (07:42 -0700)]
movenc: remove pointless loop around BITEXACT test

9 years agosvq1: do not modify the input packet
Anton Khirnov [Sun, 3 Aug 2014 08:14:48 +0000 (10:14 +0200)]
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

9 years agocdgraphics: do not return 0 from the decode function
Anton Khirnov [Wed, 6 Aug 2014 10:56:34 +0000 (10:56 +0000)]
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

9 years agocdgraphics: switch to bytestream2
Anton Khirnov [Wed, 6 Aug 2014 10:46:50 +0000 (10:46 +0000)]
cdgraphics: switch to bytestream2

Fixes possible invalid memory accesses on corrupted data.

CC:libav-stable@libav.org
Bug-ID: CVE-2013-3674

9 years agoconfigure: Include the armcc build number in the compiler identification
Martin Storsjö [Mon, 28 Jul 2014 08:51:29 +0000 (11:51 +0300)]
configure: Include the armcc build number in the compiler identification

This tries to find the most expressive part of the output of
armcc --vsn to include, giving a compiler identification of
"ARM Compiler 5.04 update 2 (build 82)" instead of just
"ARM Compiler 5.04" for armcc 5.0.

4.x versions of armcc output the following, for "armcc --vsn":
ARM C/C++ Compiler, RVCT4.0 [Build 925]
For evaluation purposes only
Software supplied by: ARM Limited

ARM C/C++ Compiler, 4.1 [Build 894]
For evaluation purposes only
Software supplied by: ARM Limited

5.0 versions output this:
Product: ARM Compiler 5.04
Component: ARM Compiler 5.04 update 2 (build 82)
Tool: armcc [5040081]
For evaluation purposes only
Software supplied by: ARM Limited

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agojpeg2000: enable 4 component pixel formats
Vittorio Giovara [Wed, 6 Aug 2014 10:07:08 +0000 (11:07 +0100)]
jpeg2000: enable 4 component pixel formats

Bug-Id: 721
CC: libav-stable@libav.org
Sample-Id: 31230.mov

9 years agohuffyuvdec: check width size for yuv422p
Michael Niedermayer [Sat, 2 Aug 2014 23:54:33 +0000 (00:54 +0100)]
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>
9 years agommvideo: check horizontal coordinate too
Michael Niedermayer [Sun, 3 Aug 2014 18:24:18 +0000 (19:24 +0100)]
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>
9 years agowmalosslessdec: fix mclms_coeffs* array size
Michael Niedermayer [Fri, 7 Feb 2014 14:07:23 +0000 (15:07 +0100)]
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>
9 years agoconfigure: check $as first before using $gas as GNU as
Janne Grunau [Tue, 5 Aug 2014 10:08:09 +0000 (12:08 +0200)]
configure: check $as first before using $gas as GNU as

llvm's integrated assembler supports the AArch64 asm on darwin since
August 2014. So check $as first before using gas-preprocessor.pl via
$gas. Makes the checks specific for that the architecture specific asm
needs. PPC Altivec and AArch64 needs on ':vararg' for macro arguments.
Arm needs in addition the '.altmacro' directive.

9 years agofate: generate tests/pixfmts.mak for all targets requiring it
Janne Grunau [Tue, 5 Aug 2014 07:39:00 +0000 (09:39 +0200)]
fate: generate tests/pixfmts.mak for all targets requiring it

All subtargets which should run the fate-filter-pixdesc% need to
generate and include tests/pixfmts.mak. Most noteable missing target was
fate itself.

9 years agomovenc: Add option to disable nero chapters
John Stebbins [Mon, 4 Aug 2014 20:13:44 +0000 (13:13 -0700)]
movenc: Add option to disable nero chapters

And add flag to muxer documentation.
Nero chapters break some taggers (mp3tag and iTunes).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agompegts: Add HEVC definitions
Femi Adeyemi-Ejeye [Wed, 30 Apr 2014 15:58:09 +0000 (16:58 +0100)]
mpegts: Add HEVC definitions

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agompegts: Define the section length with a constant
Luca Barbato [Sun, 3 Aug 2014 17:27:07 +0000 (19:27 +0200)]
mpegts: Define the section length with a constant

The specification says the value is expressed in 10 bits including
the 4-byte CRC.

9 years agovc-1: Optimise parser (with special attention to ARM)
Ben Avison [Mon, 21 Jul 2014 13:53:09 +0000 (14:53 +0100)]
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>
9 years agovc-1: Add platform-specific start code search routine to VC1DSPContext.
Ben Avison [Mon, 21 Jul 2014 13:53:08 +0000 (14:53 +0100)]
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>
9 years agoh264: Move start code search functions into separate source files.
Ben Avison [Mon, 21 Jul 2014 15:25:48 +0000 (16:25 +0100)]
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>
9 years agofate: Only generate tests/pixfmts.mak if some pixfmts fate test is run
Diego Biurrun [Sun, 3 Aug 2014 13:21:15 +0000 (06:21 -0700)]
fate: Only generate tests/pixfmts.mak if some pixfmts fate test is run

9 years agoavcodec: Suppress deprecation warnings from DTG code scheduled for removal
Diego Biurrun [Mon, 4 Aug 2014 10:39:34 +0000 (03:39 -0700)]
avcodec: Suppress deprecation warnings from DTG code scheduled for removal

9 years agofate: png-suite
Vittorio Giovara [Wed, 23 Jul 2014 20:04:50 +0000 (21:04 +0100)]
fate: png-suite

Every supported format is converted to RGB.

9 years agotiff: support reading gray+alpha at 8 bits
Carl Eugen Hoyos [Sun, 20 Jul 2014 06:34:19 +0000 (02:34 -0400)]
tiff: support reading gray+alpha at 8 bits

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agotiff: support reading gray+alpha at 16 bits
Vittorio Giovara [Sun, 20 Jul 2014 21:54:35 +0000 (22:54 +0100)]
tiff: support reading gray+alpha at 16 bits

9 years agopng: support reading gray+alpha at 16 bits
Vittorio Giovara [Sun, 20 Jul 2014 21:54:27 +0000 (22:54 +0100)]
png: support reading gray+alpha at 16 bits

9 years agopng: disable broken MMX/SIMD code for bpp <= 2
Vittorio Giovara [Fri, 1 Aug 2014 18:13:55 +0000 (19:13 +0100)]
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.

9 years agoswscale: support AV_PIX_FMT_YA16 as input
Vittorio Giovara [Sun, 20 Jul 2014 05:05:35 +0000 (01:05 -0400)]
swscale: support AV_PIX_FMT_YA16 as input

Based on a long debug session with Kostya.

9 years agoavutil: add AV_PIX_FMT_YA16 pixel format
Vittorio Giovara [Tue, 29 Jul 2014 13:06:22 +0000 (14:06 +0100)]
avutil: add AV_PIX_FMT_YA16 pixel format

9 years agoavutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8
Vittorio Giovara [Tue, 29 Jul 2014 13:02:09 +0000 (14:02 +0100)]
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.

9 years agoavutil: add alias names for gray 8/16 colour spaces
Vittorio Giovara [Wed, 23 Jul 2014 20:05:31 +0000 (21:05 +0100)]
avutil: add alias names for gray 8/16 colour spaces

9 years agopixdesc: Support pixelformat aliases
Luca Barbato [Thu, 24 Jul 2014 21:17:17 +0000 (23:17 +0200)]
pixdesc: Support pixelformat aliases

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agoswscale: correctly pad destination buffer in rgb conversion
Kostya Shishkov [Sun, 3 Aug 2014 09:28:49 +0000 (10:28 +0100)]
swscale: correctly pad destination buffer in rgb conversion

Bug-Id: 772
CC: libav-stable@libav.org
Found-By: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agofate: explicitly set the default THREADS value
Janne Grunau [Mon, 4 Aug 2014 08:04:08 +0000 (10:04 +0200)]
fate: explicitly set the default THREADS value

This makes the default of '1' more explicit than defaulting to '1' in
fate-run.sh and regression-funcs.sh if THREADS is not set.
Fixes the reported thread count in fate-cpu if THREADS is not set.

9 years agoAdd Icecast protocol
Marvin Scholz [Mon, 28 Jul 2014 09:55:38 +0000 (11:55 +0200)]
Add Icecast protocol

Icecast is basically a convenience wrapper around the HTTP protocol.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoimgutils: Do not declare avpriv_set_systematic_pal2 in the public header
Diego Biurrun [Sun, 3 Aug 2014 18:06:06 +0000 (11:06 -0700)]
imgutils: Do not declare avpriv_set_systematic_pal2 in the public header

9 years agoavcodec: Deprecate dtg_active_format field in favor of avframe side-data
Kieran Kunhya [Sun, 3 Aug 2014 18:24:56 +0000 (19:24 +0100)]
avcodec: Deprecate dtg_active_format field in favor of avframe side-data

Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years agohuffyuv: Check and propagate function return values
Diego Biurrun [Sun, 3 Aug 2014 19:19:10 +0000 (12:19 -0700)]
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
9 years agohuffyuv: Return proper error codes
Diego Biurrun [Sun, 3 Aug 2014 18:22:20 +0000 (11:22 -0700)]
huffyuv: Return proper error codes

9 years agohuffyuv: Use avpriv_report_missing_feature() where appropriate
Diego Biurrun [Sun, 3 Aug 2014 18:02:22 +0000 (11:02 -0700)]
huffyuv: Use avpriv_report_missing_feature() where appropriate

9 years agohuffyuv: Eliminate some pointless casts
Diego Biurrun [Sun, 3 Aug 2014 17:57:01 +0000 (10:57 -0700)]
huffyuv: Eliminate some pointless casts

9 years agohuffyuv: K&R formatting cosmetics
Diego Biurrun [Sun, 3 Aug 2014 17:49:40 +0000 (10:49 -0700)]
huffyuv: K&R formatting cosmetics