6 years agoppc: pixblockdsp: Use the abriged vector types
Luca Barbato [Mon, 11 May 2015 22:45:37 +0000 (00:45 +0200)]
ppc: pixblockdsp: Use the abriged vector types

6 years agoppc: avutil: Use the abriged vector types
Luca Barbato [Sun, 10 May 2015 02:37:50 +0000 (04:37 +0200)]
ppc: avutil: Use the abriged vector types

6 years agoppc: avutil: Drop a potentially dangerous workaround
Luca Barbato [Sun, 10 May 2015 20:48:30 +0000 (22:48 +0200)]
ppc: avutil: Drop a potentially dangerous workaround

The compiler is free to optimize such expressions in any sort of way.

6 years agonetwork: prevent SIGPIPE on OSX
wm4 [Thu, 28 May 2015 16:23:27 +0000 (18:23 +0200)]
network: prevent SIGPIPE on OSX

OSX does not know MSG_NOSIGNAL. BSD (which OSX is based on) has got
the socket option SO_NOSIGPIPE (even if modern BSDs also support

Signed-off-by: Martin Storsjö <>
6 years agoh264: Make sure reinit failures mark the context as not initialized
Luca Barbato [Mon, 25 May 2015 20:30:10 +0000 (22:30 +0200)]
h264: Make sure reinit failures mark the context as not initialized

Bug-Id: CVE-2015-3417
6 years agomsrle: Use FFABS to determine the frame size in msrle_decode_pal4
Luca Barbato [Mon, 25 May 2015 19:53:26 +0000 (21:53 +0200)]
msrle: Use FFABS to determine the frame size in msrle_decode_pal4

As done in msrle_decode_8_16_24_32.

Bug-Id: CVE-2015-3395
6 years agortmpdh: Generate the whole private exponent using av_get_random_seed() with nettle/gmp
Martin Storsjö [Fri, 29 May 2015 07:14:39 +0000 (10:14 +0300)]
rtmpdh: Generate the whole private exponent using av_get_random_seed() with nettle/gmp

Don't use a PRNG for generating it; that defies the intended use
within the cryptograhic handshake.

Signed-off-by: Martin Storsjö <>
6 years agortmpdh: Create sufficiently long private keys for gcrypt/nettle
Martin Storsjö [Thu, 28 May 2015 08:42:44 +0000 (11:42 +0300)]
rtmpdh: Create sufficiently long private keys for gcrypt/nettle

There was a misunderstanding betewen bits and bytes for the parameter
value for generating random big numbers.

Signed-off-by: Martin Storsjö <>
6 years agortmpdh: Remove an unnecessary check in the gcrypt/nettle dh_compute_key
Martin Storsjö [Thu, 28 May 2015 08:39:45 +0000 (11:39 +0300)]
rtmpdh: Remove an unnecessary check in the gcrypt/nettle dh_compute_key

Signed-off-by: Martin Storsjö <>
6 years agortmpdh: Add fate test for the DH handshake routine
Martin Storsjö [Thu, 28 May 2015 07:54:11 +0000 (10:54 +0300)]
rtmpdh: Add fate test for the DH handshake routine

This helps if these functions need to be implemented using another
crypto API.

Signed-off-by: Martin Storsjö <>
6 years agortmpdh: Pass the actual buffer size of the output secret key
Martin Storsjö [Thu, 28 May 2015 07:11:27 +0000 (10:11 +0300)]
rtmpdh: Pass the actual buffer size of the output secret key

Signed-off-by: Martin Storsjö <>
6 years agortmpdh: Check the output buffer size in the openssl version of dh_compute_key
Martin Storsjö [Thu, 28 May 2015 07:08:27 +0000 (10:08 +0300)]
rtmpdh: Check the output buffer size in the openssl version of dh_compute_key

Signed-off-by: Martin Storsjö <>
6 years agortmpdh: Fix a local variable name in the nettle/gcrypt codepath
Martin Storsjö [Thu, 28 May 2015 07:03:39 +0000 (10:03 +0300)]
rtmpdh: Fix a local variable name in the nettle/gcrypt codepath

Signed-off-by: Martin Storsjö <>
6 years agortmpdh: Make sure ret is initialized in the nettle version of bn_hex2bn
Martin Storsjö [Thu, 28 May 2015 06:47:44 +0000 (09:47 +0300)]
rtmpdh: Make sure ret is initialized in the nettle version of bn_hex2bn

Signed-off-by: Martin Storsjö <>
6 years agopixfmt: remove misleading and broken documentation
wm4 [Thu, 28 May 2015 14:26:20 +0000 (16:26 +0200)]
pixfmt: remove misleading and broken documentation

This was probably broken some time ago. The breakage is now part of the
ABI. For example, we have:


AV_PIX_FMT_NV20LE is wrong. It has the value 113, but as little-endian
format it should be even. This must have been quite obvious when these
formats were added (because of the AV_PIX_FMT_XYZ12BE entry), but
nobody cared or knew about this.

The future libavutil major bump will also break this additionally,
because disabling FF_API_VDPAU will remove an odd number of entries from
the middle of the enum.

Signed-off-by: Luca Barbato <>
6 years agox86: cavs: Remove an unneeded scratch buffer
Michael Niedermayer [Thu, 28 May 2015 10:38:35 +0000 (12:38 +0200)]
x86: cavs: Remove an unneeded scratch buffer

Simplifies the code and makes it build on certain compilers
running out of registers on x86.

Reported-By: mudler
6 years agorl: Add error checking to ff_rl_init().
Anton Khirnov [Fri, 22 May 2015 18:50:14 +0000 (19:50 +0100)]
rl: Add error checking to ff_rl_init().

6 years agorl: Add a function for freeing dynamically allocated tables.
Anton Khirnov [Fri, 22 May 2015 18:50:13 +0000 (19:50 +0100)]
rl: Add a function for freeing dynamically allocated tables.

Such tables are not used anywhere currently, but that should change.

6 years agorl: Rename ff_*_rl() to ff_rl_*()
Anton Khirnov [Fri, 22 May 2015 18:50:12 +0000 (19:50 +0100)]
rl: Rename ff_*_rl() to ff_rl_*()

6 years agompegvideo: Move ff_*_rl functions to a separate file
Anton Khirnov [Fri, 22 May 2015 18:50:11 +0000 (19:50 +0100)]
mpegvideo: Move ff_*_rl functions to a separate file

6 years agompegvideo: Drop exchange_uv() function and use its code directly
Vittorio Giovara [Fri, 22 May 2015 18:50:10 +0000 (19:50 +0100)]
mpegvideo: Drop exchange_uv() function and use its code directly

Code is small enough that there is no advantage in a separate function.

6 years agotls_gnutls: Add missing includes for the gcrypt thread safety callbacks
Martin Storsjö [Thu, 28 May 2015 07:18:49 +0000 (10:18 +0300)]
tls_gnutls: Add missing includes for the gcrypt thread safety callbacks

This fixes building with gcrypt-backed gnutls versions, broken
in 57cde2b180.

Signed-off-by: Martin Storsjö <>
6 years agox86inc: Clear __SECT__
Timothy Gu [Mon, 25 May 2015 23:00:43 +0000 (16:00 -0700)]
x86inc: Clear __SECT__

Silences warning(s) like:

    libavcodec/x86/fft.asm:93: warning: section flags ignored on
    section redeclaration

The cause of this warning is that because `struc` and `endstruc`
attempts to revert to the previous section state [1].

The section state is stored in the macro __SECT__, defined by
x86inc.asm to be `.note.GNU-stack ...`, through the `SECTION`
directive [2].

Thus, the `.note.GNU-stack` section is defined twice
(once in x86inc.asm, once during `endstruc`), causing the warning.

That is the first part of the commit: using the primitive `[section]` format
for .note.GNU-stack etc., which does not update `__SECT__` [2].

That fixes only half of the problem. Even without any `SECTION` directives,
`__SECT__` is predefined as `.text`, which conflicting with the later
`SECTION_TEXT` (which expands to `.text align=16`).


Signed-off-by: Luca Barbato <>
6 years agolavf: move TLS-related ifdeffery to library specific files
wm4 [Tue, 26 May 2015 17:25:42 +0000 (19:25 +0200)]
lavf: move TLS-related ifdeffery to library specific files

There is no need to have this mess in network.c.

Signed-off-by: Martin Storsjö <>
6 years agolavf: split tls.c
wm4 [Tue, 26 May 2015 17:25:41 +0000 (19:25 +0200)]
lavf: split tls.c

Move the OpenSSL and GnuTLS implementations to their own files. Other
than the connection code (including options) and some boilerplate, no
code is actually shared.

Signed-off-by: Martin Storsjö <>
6 years agodoc: Fix spelling of 'Transmission'
Sebastian Ramacher [Tue, 26 May 2015 02:37:13 +0000 (04:37 +0200)]
doc: Fix spelling of 'Transmission'

Signed-off-by: Sebastian Ramacher <>
Signed-off-by: Luca Barbato <>
6 years agoD3D11va: add a Direct3D11 video decoder similar to DXVA2
Steve Lhomme [Mon, 11 May 2015 08:52:47 +0000 (10:52 +0200)]
D3D11va: add a Direct3D11 video decoder similar to DXVA2

Signed-off-by: Luca Barbato <>
6 years agompegvideo: Rework various functions not to use MpegEncContext directly
Vittorio Giovara [Mon, 27 Apr 2015 21:09:21 +0000 (22:09 +0100)]
mpegvideo: Rework various functions not to use MpegEncContext directly

6 years agompegvideo: Have ff_mpeg_ref_picture use AVCodecContext directly
Vittorio Giovara [Mon, 27 Apr 2015 21:09:20 +0000 (22:09 +0100)]
mpegvideo: Have ff_mpeg_ref_picture use AVCodecContext directly

6 years agompegvideo: Have ff_mpeg_unref_picture use AVCodecContext directly
Vittorio Giovara [Mon, 27 Apr 2015 21:09:19 +0000 (22:09 +0100)]
mpegvideo: Have ff_mpeg_unref_picture use AVCodecContext directly

This skips setting the memory to 0 but allows for reuse on different
contextes. Oracle did not report any unsual activity because of it.

6 years agompegvideo: Drop stream_codec_tag
Vittorio Giovara [Mon, 27 Apr 2015 18:13:28 +0000 (19:13 +0100)]
mpegvideo: Drop stream_codec_tag

The field is unused.

6 years agompegvideo: Drop err_recognition
Vittorio Giovara [Mon, 27 Apr 2015 18:13:27 +0000 (19:13 +0100)]
mpegvideo: Drop err_recognition

It is just a duplicate of an AVCodecContext member so use it instead.

6 years agompegvideo: Drop flags and flags2
Vittorio Giovara [Mon, 27 Apr 2015 18:13:25 +0000 (19:13 +0100)]
mpegvideo: Drop flags and flags2

They are just duplicates of AVCodecContext members so use those instead.

6 years agotls: fix compilation when both gnutls and openssl are enabled
James Almer [Fri, 22 May 2015 03:32:17 +0000 (00:32 -0300)]
tls: fix compilation when both gnutls and openssl are enabled

Signed-off-by: Martin Storsjö <>
6 years agotls: Remove all the local polling loops
Martin Storsjö [Thu, 10 Nov 2011 15:44:27 +0000 (17:44 +0200)]
tls: Remove all the local polling loops

These aren't necessary any longer.

Signed-off-by: Martin Storsjö <>
6 years agotls: Remove the nonblocking code
Martin Storsjö [Thu, 10 Nov 2011 15:35:39 +0000 (17:35 +0200)]
tls: Remove the nonblocking code

Since the underlying URLContext read functions are used,
they handle interruption, without having to handle it at
this level.

Signed-off-by: Martin Storsjö <>
6 years agotls: Use custom IO to read from the URLContext
Martin Storsjö [Thu, 10 Nov 2011 14:58:58 +0000 (16:58 +0200)]
tls: Use custom IO to read from the URLContext

This avoids hijacking the fd, by reading using the normal
URLContext functions instead. This allowing reading data that has
been buffered in the underlying URLContext.

This avoids using the libraries own send functions that can
cause SIGPIPE.

The fd is still used for polling the lowlevel socket, for
waiting for retries.

Signed-off-by: Martin Storsjö <>
7 years agohevc: make avcodec_decode_video2() fail if get_format() fails
wm4 [Thu, 14 May 2015 17:23:57 +0000 (19:23 +0200)]
hevc: make avcodec_decode_video2() fail if get_format() fails

Personally, I need the decoder to back out if get_format() returns no
usable pixel format. This didn't work because the error code was not
propagated down the call chain. This in turn happened because the
variable declaration removed in this patch shadowed the variable, whose
value is returned at the end of the function. Consequently, failures of
decode_nal_unit() were ignored in this place.

Reviewed-by: Andreas Cadhalpun <>
Signed-off-by: Michael Niedermayer <>
7 years agolavfi: Move avcodec header to the only filter needing it
Vittorio Giovara [Thu, 14 May 2015 22:37:25 +0000 (23:37 +0100)]
lavfi: Move avcodec header to the only filter needing it

af_ashowinfo, due to the enum AVAudioServiceType use.

7 years agovmnc: Delay pixel size check
Vittorio Giovara [Tue, 19 May 2015 15:57:46 +0000 (16:57 +0100)]
vmnc: Delay pixel size check

Some clients incorrectly set 24 as bits_per_coded_sample, while
the actual value is preserved in one of the codec headers.
In order to work around this, delay the check until decode_frame().

Signed-off-by: Vittorio Giovara <>
7 years agodoc: Add $branch to FATE config template
Timothy Gu [Wed, 13 May 2015 23:46:47 +0000 (16:46 -0700)]
doc: Add $branch to FATE config template

Signed-off-by: Luca Barbato <>
7 years agovda: Make output CVPixelBuffer format configurable gitorious/master
Stefano Pigozzi [Sun, 10 May 2015 19:32:59 +0000 (21:32 +0200)]
vda: Make output CVPixelBuffer format configurable

This is useful for client programs to ask for nv12 surfaces instead of the
current default (uyvy), since those are more efficient to decode to.

Signed-off-by: Luca Barbato <>
7 years agolibx265: Use the Multi-library Interface
Gopu Govindaswamy [Mon, 11 May 2015 15:25:59 +0000 (16:25 +0100)]
libx265: Use the Multi-library Interface

Use the Multi-library interface to load at runtime x265 libraries
supporting alternative bit depths (e.g. 8bit and 16bit).

The linked library will try to load the library supporting the
pixel format if it is not supported by itself.

Fallback requesting the native library (passing 0 to x265_api_get) if
a library supporting the requested bit depth is not available.

Signed-off-by: Gopu Govindaswamy <>
Signed-off-by: Derek Buitenhuis <>
Signed-off-by: Luca Barbato <>
7 years agomjpegenc: Fix JFIF header byte ordering
Shiina Hideaki [Thu, 7 May 2015 00:46:55 +0000 (01:46 +0100)]
mjpegenc: Fix JFIF header byte ordering

The header had a wrong version description.

Bug-Id: 808
Signed-off-by: Shiina Hideaki <>
Signed-off-by: Vittorio Giovara <>
7 years agodnxhd: Print unknown header when found
Vittorio Giovara [Tue, 12 May 2015 15:19:12 +0000 (16:19 +0100)]
dnxhd: Print unknown header when found

7 years agomkv: Print unsupported mov tags when found
Vittorio Giovara [Mon, 11 May 2015 16:23:43 +0000 (17:23 +0100)]
mkv: Print unsupported mov tags when found

7 years agoquickdraw: Skip the empty 512 byte header for images
Vittorio Giovara [Mon, 11 May 2015 19:11:04 +0000 (20:11 +0100)]
quickdraw: Skip the empty 512 byte header for images

Found-by: Carl Eugen Hoyos <>
7 years agoquickdraw: Make the palette opaque
Carl Eugen Hoyos [Mon, 11 May 2015 19:11:03 +0000 (20:11 +0100)]
quickdraw: Make the palette opaque

Additional overflow fix by Michael Niedermayer <>.

Signed-off-by: Vittorio Giovara <>
7 years agoriff: Add MultiScope II fourcc MSC2 as MJPEG
Carl Eugen Hoyos [Fri, 8 May 2015 14:39:23 +0000 (15:39 +0100)]
riff: Add MultiScope II fourcc MSC2 as MJPEG

Signed-off-by: Luca Barbato <>
7 years agodca_parser: Extend DTS core sync word and fix existing check
foo86 [Wed, 29 Apr 2015 08:14:55 +0000 (11:14 +0300)]
dca_parser: Extend DTS core sync word and fix existing check

The previous version checked for 14-bit streams and did not properly
work across buffer boundaries.

Use the 64-bit parser state to make extended sync word detection work
across buffer boundary and check the extended sync word for 16-bit LE
and BE core streams to reduce probability of alias sync detection.

Signed-off-by: Michael Niedermayer <>
Signed-off-by: Luca Barbato <>
7 years agodashenc: Reduce the segment duration if cutting out parts with edit lists
Martin Storsjö [Sun, 10 May 2015 07:05:37 +0000 (10:05 +0300)]
dashenc: Reduce the segment duration if cutting out parts with edit lists

This makes sure that the time + duration of the first segment
matches the start time of the next segment for e.g. AAC audio
with encoder delay.

Signed-off-by: Martin Storsjö <>
7 years agodashenc: replace attribute id with contentType for the AdaptationSet element
James Almer [Sun, 10 May 2015 06:33:37 +0000 (03:33 -0300)]
dashenc: replace attribute id with contentType for the AdaptationSet element

id should be an integer, not a string. It is also optional, so use
contentType instead which is the proper attribute for these values.

This fixes an MPD validation error.

Signed-off-by: James Almer <>
Signed-off-by: Martin Storsjö <>
7 years agofate: Reduce the number of frames used to test video filters
Luca Barbato [Sat, 9 May 2015 21:44:30 +0000 (23:44 +0200)]
fate: Reduce the number of frames used to test video filters

Use 5 frames for video filter tests and a single one for the
pixelformat tests.

Greatly reduces the test duration without reducing coverage.

7 years agoid3v2: Do not export empty APIC description
wm4 [Fri, 8 May 2015 16:19:12 +0000 (18:19 +0200)]
id3v2: Do not export empty APIC description

APIC tags always have a description. Tag writers obviously leave it
empty if there is no description. In this case, libavformat would export
"" as title. Do not set the title instead.

7 years agopng: Set the color range as full range
wm4 [Fri, 8 May 2015 15:01:50 +0000 (17:01 +0200)]
png: Set the color range as full range

The format uses full range for the gray formats.

7 years agonut: Make sure to clean up on read_header failure
Luca Barbato [Wed, 29 Apr 2015 19:29:49 +0000 (21:29 +0200)]
nut: Make sure to clean up on read_header failure

Based on Andreas Cadhalpun <> work.

7 years agoavi: Validate sample_size
Andreas Cadhalpun [Wed, 6 May 2015 00:26:57 +0000 (02:26 +0200)]
avi: Validate sample_size

And either error out or set it to 0 if it is negative.

Signed-off-by: Luca Barbato <>
7 years agonut: Check chapter creation in decode_info_header
Andreas Cadhalpun [Tue, 28 Apr 2015 18:57:59 +0000 (20:57 +0200)]
nut: Check chapter creation in decode_info_header

This fixes a segmentation fault when accessing the metadata.

Signed-off-by: Luca Barbato <>
7 years agoalac: Reject rice_limit 0 if compression is used
Andreas Cadhalpun [Thu, 23 Apr 2015 22:01:43 +0000 (00:01 +0200)]
alac: Reject rice_limit 0 if compression is used

If in compression mode rice_limit = 0 leads to call
`show_bits(gb, k)` in `decode_scalar` with k = 0.

Request a sample in case it is valid and it should be accepted.

Signed-off-by: Luca Barbato <>
7 years agoape: Support _0000 files with nblock smaller than 64
Andreas Cadhalpun [Wed, 29 Apr 2015 18:39:22 +0000 (20:39 +0200)]
ape: Support _0000 files with nblock smaller than 64

The decode_array_0000 assumed that 64 is the minimal block size
while it is not.

Signed-off-by: Luca Barbato <>
7 years agomux: Do not leave stale side data pointers in ff_interleave_add_packet()
Michael Niedermayer [Fri, 1 May 2015 22:55:42 +0000 (23:55 +0100)]
mux: Do not leave stale side data pointers in ff_interleave_add_packet()

Signed-off-by: Michael Niedermayer <>
Signed-off-by: Vittorio Giovara <>
7 years agodump: Print AVAudioServiceType side data
Vittorio Giovara [Fri, 1 May 2015 14:33:50 +0000 (15:33 +0100)]
dump: Print AVAudioServiceType side data

7 years agolibx265: Fix 'braces around scalar initializer' warning
Vittorio Giovara [Fri, 1 May 2015 14:39:26 +0000 (15:39 +0100)]
libx265: Fix 'braces around scalar initializer' warning

x265 Reordered the x265_picture fields in the commit

Now the first field is an integer and not an array.

7 years agofate: Add a PICT test
Vittorio Giovara [Sat, 18 Apr 2015 16:25:22 +0000 (17:25 +0100)]
fate: Add a PICT test

This stimulates the direct pixel mode in Quickdraw decoder.

7 years agolavf: Open PICT images with Quickdraw
Vittorio Giovara [Sat, 18 Apr 2015 16:25:21 +0000 (17:25 +0100)]
lavf: Open PICT images with Quickdraw

Update the pictor test to use the pictor codec, as both formats share
the .pic file extension.

7 years agoquickdraw: Support direct pixel blocks
Vittorio Giovara [Sat, 18 Apr 2015 16:25:20 +0000 (17:25 +0100)]
quickdraw: Support direct pixel blocks

Data is stored in separated components so rework decode_rle() to support
stepping and offsets.

7 years agoquickdraw: Switch to greedy parsing
Vittorio Giovara [Sat, 18 Apr 2015 16:25:19 +0000 (17:25 +0100)]
quickdraw: Switch to greedy parsing

Quickdraw packs data as a series of codes that the application is supposed
to handle, but it does not define any order in which they might appear.
Since it's unfeasible to support *all* opcodes defined by the spec,
only handle well-known blocks containing video data and ignore any unknown
or unsupported ones.

Move palette loading and rle decoding to separate functions to resue them
in other blocks and drop format initialization in init since it can
support more formats than pal8.

Validate width and height.

7 years agoquickdraw: Convert to bytestream2
Vittorio Giovara [Sat, 18 Apr 2015 16:25:18 +0000 (17:25 +0100)]
quickdraw: Convert to bytestream2

Add appropriate error messages and reduce r, g, b variables scope.
Drop the now redundant line checks in RLE decoding.

7 years agoxcbgrab: Accept geometries matching the screen size
Nicolas George [Wed, 6 May 2015 10:22:52 +0000 (12:22 +0200)]
xcbgrab: Accept geometries matching the screen size

Introduced in e8c4db0d4d077.

7 years agoRevert "lavfi: always check av_expr_parse_and_eval() return value"
Anton Khirnov [Sat, 2 May 2015 07:09:52 +0000 (09:09 +0200)]
Revert "lavfi: always check av_expr_parse_and_eval() return value"

This reverts commit 63be97ec403023fb664798432acedaf6e6922527.

All those calls were unchecked on purpose, as explained in the comments
in the code.

7 years agoalsdec: only adapt order for positive max_order
Andreas Cadhalpun [Wed, 22 Apr 2015 14:03:41 +0000 (16:03 +0200)]
alsdec: only adapt order for positive max_order

For max_order = 0 the clipping range is invalid. (amin = 2, amax = 1)

Signed-off-by: Andreas Cadhalpun <>
Signed-off-by: Anton Khirnov <>
7 years agoalsdec: check sample pointer range in revert_channel_correlation
Andreas Cadhalpun [Tue, 21 Apr 2015 17:28:30 +0000 (19:28 +0200)]
alsdec: check sample pointer range in revert_channel_correlation

Also change the type of begin, end and smp to ptrdiff_t to make the
comparison well-defined.

Signed-off-by: Andreas Cadhalpun <>
Signed-off-by: Anton Khirnov <>
7 years agoaacpsy: correct calculation of minath in psy_3gpp_init
Andreas Cadhalpun [Tue, 21 Apr 2015 16:43:55 +0000 (18:43 +0200)]
aacpsy: correct calculation of minath in psy_3gpp_init

The minimum of the ath(x, ATH_ADD) function depends on ATH_ADD.
This patch uses the first order approximation to determine it.

For ATH_ADD = 4 this results in the value at 3407.06812 (-5.24241638)
not the one at 3410 (-5.24237967).

Signed-off-by: Andreas Cadhalpun <>
Signed-off-by: Anton Khirnov <>
7 years agoalsdec: limit avctx->bits_per_raw_sample to 32
Andreas Cadhalpun [Sat, 18 Apr 2015 18:29:13 +0000 (20:29 +0200)]
alsdec: limit avctx->bits_per_raw_sample to 32

avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.

Signed-off-by: Andreas Cadhalpun <>
Signed-off-by: Anton Khirnov <>
7 years agoaasc: return correct buffer size from aasc_decode_frame
Andreas Cadhalpun [Thu, 16 Apr 2015 17:12:02 +0000 (19:12 +0200)]
aasc: return correct buffer size from aasc_decode_frame

Signed-off-by: Andreas Cadhalpun <>
Signed-off-by: Anton Khirnov <>
7 years agoconfigure: Allow log2 with MSVC 2013 onwards.
Matt Oliver [Sun, 11 May 2014 07:40:20 +0000 (17:40 +1000)]
configure: Allow log2 with MSVC 2013 onwards.

Only MSVC 2010 in x64 mode, in the static msvcrt, had a
stray log2 function (which wasn't available in the headers).

MSVC 2013 has got a proper log2 function though.

Signed-off-by: Martin Storsjö <>
7 years agoconfigure: Use the right local variable in the MSVC and ICL probes
Martin Storsjö [Thu, 5 Jun 2014 19:59:47 +0000 (22:59 +0300)]
configure: Use the right local variable in the MSVC and ICL probes

$cc is the compiler requested as main target compiler, while $_cc
is the actual tool tested in the probe function right now (which
can also be e.g. the host compiler).

Signed-off-by: Martin Storsjö <>
7 years agoavprobe: Print the display matrix from per-stream sidedata
Martin Storsjö [Wed, 29 Apr 2015 13:48:26 +0000 (16:48 +0300)]
avprobe: Print the display matrix from per-stream sidedata

This is printed in a separate subgroup "displaymatrix" inside a
new group named "sidedata". The subgroup has got two values,
"rotation" (which is the parsed rotation from the matrix) and
"matrix" containing the full actual values.

Signed-off-by: Martin Storsjö <>
7 years agoavprobe: Support writing arrays of integers without keys
Martin Storsjö [Sat, 2 May 2015 08:22:13 +0000 (11:22 +0300)]
avprobe: Support writing arrays of integers without keys

Signed-off-by: Martin Storsjö <>
7 years agoavconv: Add an option for automatically rotating video according to display matrix
Martin Storsjö [Wed, 29 Apr 2015 14:59:01 +0000 (17:59 +0300)]
avconv: Add an option for automatically rotating video according to display matrix

The option is enabled by default, but can be disabled.

If this is enabled, such side data isn't copied into the output stream
(except when doing stream copy).

Signed-off-by: Martin Storsjö <>
7 years agoavplay: Add support for rotated video
Martin Storsjö [Wed, 29 Apr 2015 19:28:45 +0000 (22:28 +0300)]
avplay: Add support for rotated video

This is enabled by default, but can be disbled via the -noautorotate

Based on a patch by Clément Bœsch.

Signed-off-by: Martin Storsjö <>
7 years agoavplay: Factorize code for adding filters to the filter pipeline
Martin Storsjö [Wed, 29 Apr 2015 19:24:48 +0000 (22:24 +0300)]
avplay: Factorize code for adding filters to the filter pipeline

Significantly based on a patch by Clément Bœsch.

Signed-off-by: Martin Storsjö <>
7 years agodnxhddec: Fix pixel format change
Carl Eugen Hoyos [Wed, 29 Apr 2015 16:18:37 +0000 (17:18 +0100)]
dnxhddec: Fix pixel format change

Regression introduced in 598f7d046cbf306706623210c5baafa3b7cd1df3.

Signed-off-by: Vittorio Giovara <>
7 years agoffv1enc: Add const attribute to input frame
Vittorio Giovara [Wed, 29 Apr 2015 15:35:43 +0000 (16:35 +0100)]
ffv1enc: Add const attribute to input frame

warning: assigning to 'AVFrame *' (aka 'struct AVFrame *') from
         'const AVFrame *' (aka 'const struct AVFrame *') discards
         qualifiers [-Wincompatible-pointer-types-discards-qualifiers]

7 years agoavplay: Do not print a possibly uninitialized value
Luca Barbato [Tue, 28 Apr 2015 19:24:27 +0000 (21:24 +0200)]
avplay: Do not print a possibly uninitialized value

Initialize `diff` to 0.

Signed-off-by: Luca Barbato <>
7 years agoxcbgrab: Validate the capture area
Luca Barbato [Sat, 14 Mar 2015 11:30:11 +0000 (12:30 +0100)]
xcbgrab: Validate the capture area

And notify why the capture is impossible.

Signed-off-by: Luca Barbato <>
7 years agoxcbgrab: Do not assume the non shm image data is always available
Luca Barbato [Sat, 14 Mar 2015 11:30:10 +0000 (12:30 +0100)]
xcbgrab: Do not assume the non shm image data is always available

Signed-off-by: Luca Barbato <>
7 years agorawenc: properly allocate coded_frame
Anton Khirnov [Fri, 17 Apr 2015 10:12:57 +0000 (12:12 +0200)]
rawenc: properly allocate coded_frame

7 years agoh264: use properly allocated AVFrames
Anton Khirnov [Fri, 17 Apr 2015 10:09:50 +0000 (12:09 +0200)]
h264: use properly allocated AVFrames

7 years agoh264: embed the DPB in the context
Anton Khirnov [Sun, 12 Apr 2015 19:08:34 +0000 (21:08 +0200)]
h264: embed the DPB in the context

It now has a fixed size and is initialized only once, so there is no
point in allocating it separately.

7 years agoh264: merge the init and reinit paths in update_thread_context()
Anton Khirnov [Sun, 12 Apr 2015 18:59:52 +0000 (20:59 +0200)]
h264: merge the init and reinit paths in update_thread_context()

There is no real need to handle the init case specially, everything
necessary is initialized in the reinit code as well.

7 years agoh264: drop the reinit parameter from init_slice_header()
Anton Khirnov [Sun, 12 Apr 2015 17:36:49 +0000 (19:36 +0200)]
h264: drop the reinit parameter from init_slice_header()

It is only used to decide whether to call free_tables(), but that
function is safe to call on an uninitialized context as well.

7 years agoh264: update the current bit depth/chroma type in init_slice_header()
Anton Khirnov [Sun, 12 Apr 2015 17:13:56 +0000 (19:13 +0200)]
h264: update the current bit depth/chroma type in init_slice_header()

With frame threading, it is currently only updated in the context where
the change occurs, but not in any other contexts.

7 years agoh264: copy nal_length_size in update_thread_context
Anton Khirnov [Sun, 12 Apr 2015 17:08:23 +0000 (19:08 +0200)]
h264: copy nal_length_size in update_thread_context

It does not make sense to copy is_avc without copying this as well. This
patch should not change anything for now, but will have an effect in
later commits.

7 years agoh264: drop a comment that carries no useful information
Anton Khirnov [Mon, 6 Apr 2015 19:02:17 +0000 (21:02 +0200)]
h264: drop a comment that carries no useful information

7 years agoh264: move freeing the escaped RBSP buffer to free_context()
Anton Khirnov [Mon, 6 Apr 2015 19:00:42 +0000 (21:00 +0200)]
h264: move freeing the escaped RBSP buffer to free_context()

It does not logically belong in free_tables(), since it's not allocated
in alloc_tables() and its size has nothing to do with the frame size.

7 years agoh264: eliminate ff_h264_set_parameter_from_sps()
Anton Khirnov [Mon, 6 Apr 2015 18:33:58 +0000 (20:33 +0200)]
h264: eliminate ff_h264_set_parameter_from_sps()

That function currently does two things -- reinitializing the DSP
contexts and setting low_delay based on the SPS values.

The former more appropriately belongs in h264_slice_header_init(), while
the latter only really makes sense in decode_slice_header().

The third call to ff_h264_set_parameter_from_sps(), done immediately
after parsing a new SPS, appears to serve no useful purpose, so it is
just dropped.

Also, drop now unneeded H264Context.cur_chroma_format_idc.

7 years agoh264: move context reinit lower down in update_thread_context()
Anton Khirnov [Mon, 6 Apr 2015 18:05:37 +0000 (20:05 +0200)]
h264: move context reinit lower down in update_thread_context()

It uses some fields from the SPS, which is not yet set where the reinit
is called currently.

7 years agoh264: move the DPB init/uninit to init_context()/free_context()
Anton Khirnov [Sun, 5 Apr 2015 18:51:00 +0000 (20:51 +0200)]
h264: move the DPB init/uninit to init_context()/free_context()

Currently, the DPB is initialized in alloc_tables() and uninitialized in
free_tables(), but those functions manage frame size-dependent
variables, so DPB management does not logically belong in there.

Since we want the init/uninit to happen exactly once per the context
lifetime, init_context()/free_context() are the proper place for this

7 years agoh264: drop H264Context.ouputed_poc
Anton Khirnov [Sun, 5 Apr 2015 06:49:47 +0000 (08:49 +0200)]
h264: drop H264Context.ouputed_poc

It is only set, but never used for anything.