OSDN Git Service

android-x86/external-ffmpeg.git
8 years agolavfi: Use AV_CEIL_RSHIFT where needed
Vittorio Giovara [Thu, 21 Jan 2016 22:47:04 +0000 (17:47 -0500)]
lavfi: Use AV_CEIL_RSHIFT where needed

8 years agoyuv4mpegenc: Use AV_CEIL_RSHIFT where needed
Vittorio Giovara [Thu, 21 Jan 2016 22:47:03 +0000 (17:47 -0500)]
yuv4mpegenc: Use AV_CEIL_RSHIFT where needed

8 years agopixdesc: Use AV_CEIL_RSHIFT in documentation
Vittorio Giovara [Thu, 21 Jan 2016 23:00:15 +0000 (18:00 -0500)]
pixdesc: Use AV_CEIL_RSHIFT in documentation

8 years agopixdesc: Drop unneeded deprecation warning guards
Vittorio Giovara [Thu, 21 Jan 2016 22:46:59 +0000 (17:46 -0500)]
pixdesc: Drop unneeded deprecation warning guards

8 years agoqsvenc: Add private option to replace coder_type
Vittorio Giovara [Wed, 13 Jan 2016 20:27:00 +0000 (15:27 -0500)]
qsvenc: Add private option to replace coder_type

Missing from be00ec832c519427cd92218abac77dafdc1d5487.

8 years agoavplay: Allow to override the codec
Luca Barbato [Sat, 2 Jan 2016 11:19:32 +0000 (12:19 +0100)]
avplay: Allow to override the codec

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoavplay: Statically allocate the player state
Luca Barbato [Sat, 2 Jan 2016 11:19:31 +0000 (12:19 +0100)]
avplay: Statically allocate the player state

And move the resource deallocation in stream_open failure path.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoavplay: Rename cur_stream to player
Luca Barbato [Sat, 2 Jan 2016 11:19:30 +0000 (12:19 +0100)]
avplay: Rename cur_stream to player

The name was misleading.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoavplay: Rename VideoState to PlayerState
Luca Barbato [Sat, 2 Jan 2016 11:19:29 +0000 (12:19 +0100)]
avplay: Rename VideoState to PlayerState

The structure is not video-specific.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoavplay: Allocate the refresh thread next to the decode thread
Luca Barbato [Sat, 2 Jan 2016 11:19:28 +0000 (12:19 +0100)]
avplay: Allocate the refresh thread next to the decode thread

It does not belong to the stream setup.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoavplay: Move the stream setup in the main thread
Luca Barbato [Sat, 2 Jan 2016 11:19:27 +0000 (12:19 +0100)]
avplay: Move the stream setup in the main thread

And refactor the code in preparation of the following
patches.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agohls: eliminate ffurl_* usage
Anton Khirnov [Wed, 20 Jan 2016 10:43:18 +0000 (11:43 +0100)]
hls: eliminate ffurl_* usage

Now all IO should go through the IO callbacks and be interceptable by
the caller.

8 years agolavf: allow custom IO for all files
Anton Khirnov [Sat, 16 Jan 2016 16:53:43 +0000 (17:53 +0100)]
lavf: allow custom IO for all files

Some (de)muxers open additional files beyond the main IO context.
Currently, they call avio_open() directly, which prevents the caller
from using custom IO for such streams.

This commit adds callbacks to AVFormatContext that default to
avio_open2()/avio_close(), but can be overridden by the caller. All
muxers and demuxers using AVIO are switched to using those callbacks
instead of calling avio_open()/avio_close() directly.

(de)muxers that use the URLProtocol layer directly instead of AVIO
remain unconverted for now. This should be fixed in later commits.

8 years agoqsvenc: fix a typo
Anton Khirnov [Sat, 23 Jan 2016 20:03:31 +0000 (21:03 +0100)]
qsvenc: fix a typo

Introduced in 0e6c8532215790bbe560a9eea4f3cc82bb55cf92.

8 years agox86inc: Add debug symbols indicating sizes of compiled functions
Geza Lore [Sun, 17 Jan 2016 23:21:51 +0000 (00:21 +0100)]
x86inc: Add debug symbols indicating sizes of compiled functions

Some debuggers/profilers use this metadata to determine which function a
given instruction is in; without it they get can confused by local labels
(if you haven't stripped those). On the other hand, some tools are still
confused even with this metadata. e.g. this fixes `gdb`, but not `perf`.

Currently only implemented for ELF.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agox86inc: Avoid creating unnecessary local labels
Henrik Gramner [Sun, 17 Jan 2016 23:21:50 +0000 (00:21 +0100)]
x86inc: Avoid creating unnecessary local labels

The REP_RET workaround is only needed on old AMD cpus, and the labels clutter
up the symbol table and confuse debugging/profiling tools, so use EQU to
create SHN_ABS symbols instead of creating local labels. Furthermore, skip
the workaround completely in functions that definitely won't run on such cpus.

Note that EQU is just creating a local label when using nasm instead of yasm.
This is probably a bug, but at least it doesn't break anything.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agox86inc: Simplify AUTO_REP_RET
Henrik Gramner [Sun, 17 Jan 2016 23:21:49 +0000 (00:21 +0100)]
x86inc: Simplify AUTO_REP_RET

cpuflags is never undefined any more, it's set to 0 instead.

Also fix an incorrect comment.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agox86inc: Use more consistent indentation
Henrik Gramner [Sun, 17 Jan 2016 23:21:48 +0000 (00:21 +0100)]
x86inc: Use more consistent indentation

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agox86inc: Preserve arguments when allocating stack space
Henrik Gramner [Wed, 20 Jan 2016 23:05:15 +0000 (00:05 +0100)]
x86inc: Preserve arguments when allocating stack space

When allocating stack space with a larger alignment than the known stack
alignment a temporary register is used for storing the stack pointer.
Ensure that this isn't one of the registers used for passing arguments.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agox86inc: Improve FMA instruction handling
Henrik Gramner [Sun, 17 Jan 2016 23:21:46 +0000 (00:21 +0100)]
x86inc: Improve FMA instruction handling

 * Correctly handle FMA instructions with memory operands.
 * Print a warning if FMA instructions are used without the correct cpuflag.
 * Simplify the instantiation code.
 * Clarify documentation.

Only the last operand in FMA3 instructions can be a memory operand. When
converting FMA4 instructions to FMA3 instructions we can utilize the fact
that multiply is a commutative operation and reorder operands if necessary
to ensure that a memory operand is used only as the last operand.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agox86inc: Be more verbose in assertion failures
Henrik Gramner [Sun, 17 Jan 2016 23:21:45 +0000 (00:21 +0100)]
x86inc: Be more verbose in assertion failures

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agox86inc: Make cpuflag() and notcpuflag() return 0 or 1
Henrik Gramner [Sun, 17 Jan 2016 23:21:44 +0000 (00:21 +0100)]
x86inc: Make cpuflag() and notcpuflag() return 0 or 1

Makes it possible to use them in arithmetic expressions.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agopixdesc: fix and extend doxy for av_pix_fmt_get_chroma_sub_sample()
Anton Khirnov [Thu, 21 Jan 2016 12:28:42 +0000 (13:28 +0100)]
pixdesc: fix and extend doxy for av_pix_fmt_get_chroma_sub_sample()

The parameters in the docs are currently swapped.

8 years agoconfigure: Correctly add openssl cflags and libs
Luca Barbato [Fri, 22 Jan 2016 10:33:50 +0000 (11:33 +0100)]
configure: Correctly add openssl cflags and libs

8 years agolibavcodec: Add missing AVClass pointers
Martin Storsjö [Fri, 22 Jan 2016 08:52:06 +0000 (10:52 +0200)]
libavcodec: Add missing AVClass pointers

This fixes crashes since 243df1351.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agolavc: Move pre_me to codec private options
Vittorio Giovara [Mon, 9 Nov 2015 02:15:06 +0000 (03:15 +0100)]
lavc: Move pre_me to codec private options

This option is only used by mpegvideoenc.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move me_penalty_compensation to codec private options
Vittorio Giovara [Mon, 9 Nov 2015 02:15:06 +0000 (03:15 +0100)]
lavc: Move me_penalty_compensation to codec private options

This option is only used by mpegvideoenc.
It is a very codec-specific options, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move prediction_method to codec private options
Vittorio Giovara [Mon, 9 Nov 2015 02:15:06 +0000 (03:15 +0100)]
lavc: Move prediction_method to codec private options

This options is only used by huffyuv, ffvhuv, jpegls, mjpeg,
mpegvideoenc, png, utvideo.
It is a very codec-specific options, so deprecate the global variant.
Set proper limits to the maximum allowed values, and update utvideoenc
tests to use the new option name.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move {min,max}_prediction_order to codec private options
Vittorio Giovara [Sun, 13 Sep 2015 21:45:24 +0000 (23:45 +0200)]
lavc: Move {min,max}_prediction_order to codec private options

These options are only used by alac and flac.
They are very codec-specific options, so deprecate the global variants.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move rtp_payload_size to codec private options
Vittorio Giovara [Sun, 13 Sep 2015 21:45:24 +0000 (23:45 +0200)]
lavc: Move rtp_payload_size to codec private options

This option is only used by mpegvideoenc and openh264.
It is a very codec-specific option, so deprecate the global variant.

The openh264 option is dropped altogether since it is just a fallback
for -max_nal_size anyway.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move timecode_frame_start to codec private options
Vittorio Giovara [Sun, 13 Sep 2015 21:45:24 +0000 (23:45 +0200)]
lavc: Move timecode_frame_start to codec private options

This option is only used by mpeg2.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move context_model to codec private options
Vittorio Giovara [Sun, 13 Sep 2015 21:45:24 +0000 (23:45 +0200)]
lavc: Move context_model to codec private options

This option is only used by ffv1 and ffvhuff.
It is a very codec-specific option, so deprecate the global variant.
Improve documentation a little.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move mpeg_quant to codec private options
Vittorio Giovara [Sun, 13 Sep 2015 21:45:24 +0000 (23:45 +0200)]
lavc: Move mpeg_quant to codec private options

This option is only used by mpegvideoenc, and xvid.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move noise_reduction to codec private options
Vittorio Giovara [Sun, 13 Sep 2015 21:45:24 +0000 (23:45 +0200)]
lavc: Move noise_reduction to codec private options

This option is only used by mpegvideoenc, x264, xavs, and vpx.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move scenechange_threshold to codec private options
Vittorio Giovara [Sat, 12 Sep 2015 20:27:59 +0000 (22:27 +0200)]
lavc: Move scenechange_threshold to codec private options

This option is only used by mpegvideoenc, x264, and xavs.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move chromaoffset to codec private options
Vittorio Giovara [Sat, 12 Sep 2015 12:40:29 +0000 (14:40 +0200)]
lavc: Move chromaoffset to codec private options

This option is only used by x264 and xavs.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move frame_skip_* to codec private options
Vittorio Giovara [Fri, 11 Sep 2015 01:30:38 +0000 (03:30 +0200)]
lavc: Move frame_skip_* to codec private options

These options are only used by mpegvideoenc and vpx.
They are very codec-specific options, so deprecate the global variants.

Add an allowed value to the private options for frame_skip_cmp which
seems to have been forgotten, but perfectly working.

The libvpx frame dropping feature uses one of such option
(frame_skip_threshold) without the other three. For this reason rename
the option to something more consistent with the other libvpx variables.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move brd_scale to codec private options
Vittorio Giovara [Thu, 10 Sep 2015 22:01:12 +0000 (00:01 +0200)]
lavc: Move brd_scale to codec private options

This option is only used by mpegvideoenc,
It is a very codec-specific option, so deprecate the global variant.
Set proper limits to the maximum allowed values.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolavc: Move b_frame_strategy and b_sensitivity to codec private options
Vittorio Giovara [Wed, 9 Sep 2015 02:18:26 +0000 (04:18 +0200)]
lavc: Move b_frame_strategy and b_sensitivity to codec private options

The b_frame_strategy option is only used by mpegvideoenc, qsv, x264, and
xavs, while b_sensitivity is only used by mpegvideoenc.

These are very codec-specific options, so deprecate the global variants.
Set proper limits to the maximum allowed values.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agoriff: add C210 FourCC (Canopus C210)
Piotr Bandurski [Wed, 20 Jan 2016 16:56:30 +0000 (11:56 -0500)]
riff: add C210 FourCC (Canopus C210)

8 years agoriff: add YUYV FourCC (Drastic YUYV)
Piotr Bandurski [Wed, 20 Jan 2016 16:56:29 +0000 (11:56 -0500)]
riff: add YUYV FourCC (Drastic YUYV)

8 years agoimgconvert: Add the proper API guards to a deprecated function
Vittorio Giovara [Tue, 19 Jan 2016 21:09:52 +0000 (16:09 -0500)]
imgconvert: Add the proper API guards to a deprecated function

8 years agoimgconvert: Move AVPicture-related static function to the deprecated section
Vittorio Giovara [Tue, 19 Jan 2016 21:09:51 +0000 (16:09 -0500)]
imgconvert: Move AVPicture-related static function to the deprecated section

8 years agoimgconvert: Move the shrink functions only where needed
Vittorio Giovara [Tue, 19 Jan 2016 21:09:50 +0000 (16:09 -0500)]
imgconvert: Move the shrink functions only where needed

8 years agoimgconvert: Drop outdated comment block
Vittorio Giovara [Tue, 19 Jan 2016 21:11:42 +0000 (16:11 -0500)]
imgconvert: Drop outdated comment block

8 years agoconfigure: Force-enable select_any dependencies only on --enable
Luca Barbato [Thu, 21 Jan 2016 19:37:49 +0000 (20:37 +0100)]
configure: Force-enable select_any dependencies only on --enable

Unbreak --enable-gnutls enabling tls_openssl_protocol

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agomov: Add an option to toggle dref opening
Derek Buitenhuis [Wed, 20 Jan 2016 17:27:09 +0000 (17:27 +0000)]
mov: Add an option to toggle dref opening

This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agofate: add 10-bit v210 encoder tests
James Darnley [Fri, 15 Jan 2016 19:35:04 +0000 (20:35 +0100)]
fate: add 10-bit v210 encoder tests

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoconfigure: Improve requesting specific features
Luca Barbato [Sun, 17 Jan 2016 06:58:53 +0000 (07:58 +0100)]
configure: Improve requesting specific features

Before this patch trying to enable only https by issuing

    --disable-protocols --enable-protocol=https --enable-gnutls

does not enable https, and

    --disable-all --enable-protocols

does not enable libavformat and the protocols component.

Now the default-enabled options are set after the explicitly
disabled/enabled options are evaluated.

If an explicitly enabled option cannot be enabled configure
will fail printing an error message.

8 years agoyuv2rgb: Document the color space coefficients
Vittorio Giovara [Tue, 19 Jan 2016 22:10:59 +0000 (17:10 -0500)]
yuv2rgb: Document the color space coefficients

Based on the original documentation found in mpeg2dec (1995).

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agolibkvazaar: Set frame rate as a rational number
Arttu Ylä-Outinen [Fri, 15 Jan 2016 13:53:46 +0000 (15:53 +0200)]
libkvazaar: Set frame rate as a rational number

Updates libkvazaar to pass the exact frame rate to Kvazaar by setting
the numerator and denominator separately instead of a single floating
point number. The exact frame rate is needed for writing timing info to
the bitstream.

Requires Kvazaar version 0.8.1.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agolavc: Make sure that the effective timebase would not overflow
Arttu Ylä-Outinen [Mon, 18 Jan 2016 19:54:34 +0000 (20:54 +0100)]
lavc: Make sure that the effective timebase would not overflow

In the unlikely situation the user decides to set ticks_per_frame
and timebase to a value large enough to overflow.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoconfigure: mips: Support both-endian compilers
Luca Barbato [Mon, 18 Jan 2016 16:03:28 +0000 (17:03 +0100)]
configure: mips: Support both-endian compilers

Use mips{,64}eb to force big endian and mips{,64}el to force little
endian.

8 years agomathops: mips: Correctly enable loongson-specific assembly
Luca Barbato [Mon, 18 Jan 2016 15:53:56 +0000 (16:53 +0100)]
mathops: mips: Correctly enable loongson-specific assembly

The code wrongly assumed that the instructions used are supported
on mips64, while it is supported only on loongson cpus.

8 years agoconfigure: Use pkg-config to check for openssl
Luca Barbato [Fri, 15 Jan 2016 17:09:48 +0000 (18:09 +0100)]
configure: Use pkg-config to check for openssl

8 years agoflvdec: Add sanity checking of the last packet size
Martin Storsjö [Tue, 19 Jan 2016 08:04:32 +0000 (10:04 +0200)]
flvdec: Add sanity checking of the last packet size

For http, this avoids spurious warnings about failed requests (e.g.
HTTP error 416 Requested Range Not Satisfiable), if the last packet
is truncated and the size read is bogus.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agoflvdec: perform duration search just once
Michael Niedermayer [Fri, 3 Aug 2012 12:39:46 +0000 (14:39 +0200)]
flvdec: perform duration search just once

When loading a truncated flv file, it would previously try to do a seek to
the end of every packet read. For some input protocols (such as http), such
repeated seek attempts are cripple the reading performance.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agox86: build: Group all encoder objects together
Diego Biurrun [Mon, 18 Jan 2016 13:47:11 +0000 (14:47 +0100)]
x86: build: Group all encoder objects together

8 years agox86: ac3dsp: Drop forward declaration for nonexisting function
Diego Biurrun [Mon, 18 Jan 2016 10:38:42 +0000 (11:38 +0100)]
x86: ac3dsp: Drop forward declaration for nonexisting function

8 years agodca: fix misaligned access in ff_dca_convert_bitstream
Andreas Cadhalpun [Tue, 12 Jan 2016 23:56:39 +0000 (00:56 +0100)]
dca: fix misaligned access in ff_dca_convert_bitstream

The function is used on unaligned buffers (such as those provided
by AVPacket), accessing them as uint16_t causes SIGBUS crashes on
architectures like SPARC.

This fixes ubsan runtime error: load of misaligned address for type
'const uint16_t', which requires 2 byte alignment

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agonutdec: only copy the header if it exists
Andreas Cadhalpun [Fri, 18 Dec 2015 16:24:09 +0000 (17:24 +0100)]
nutdec: only copy the header if it exists

Fixes runtime error: null pointer passed as argument 2, which is
declared to never be null

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoxwddec: prevent overflow of lsize * avctx->height
Andreas Cadhalpun [Fri, 18 Dec 2015 18:28:51 +0000 (19:28 +0100)]
xwddec: prevent overflow of lsize * avctx->height

This is used to check if the input buffer is larger enough, so if this
overflows it can cause a false negative leading to a segmentation fault
in bytestream2_get_bufferu.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agonuv: sanitize negative fps rate
Andreas Cadhalpun [Wed, 16 Dec 2015 19:52:39 +0000 (20:52 +0100)]
nuv: sanitize negative fps rate

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoon2avc: limit number of bits to 30 in get_egolomb
Andreas Cadhalpun [Wed, 16 Dec 2015 15:48:19 +0000 (16:48 +0100)]
on2avc: limit number of bits to 30 in get_egolomb

More don't fit into the integer output.

Also use get_bits_long, since get_bits only supports reading up to 25
bits, while get_bits_long supports the full integer range.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agonvenc: generate dts properly
Anton Khirnov [Fri, 8 Jan 2016 16:08:39 +0000 (17:08 +0100)]
nvenc: generate dts properly

When there is a non-zero decoding delay due to reordering, the first dts
should be lower than the first pts (since the first packet fed to the
decoder does not produce any output).

Use the same scheme used in mpegvideo_enc (which comes from x264
originally) -- wait for first two timestamps and extrapolate linearly to
the past to produce the first dts value.

8 years agonvenc: fix encoding with B-frames
Anton Khirnov [Fri, 8 Jan 2016 14:59:41 +0000 (15:59 +0100)]
nvenc: fix encoding with B-frames

When B-frames are enabled and the encoder returns success, all currently
pending buffers immediately become valid and can be returned to the
caller. We can only return one packet at a time, so all the other
pending buffers should be transferred to a new 'ready' fifo, from where
they can be returned in subsequent calls (in which the encoder does not
produce any new output). This bug was hidden by the incorrect testing of
the encoder return value (the return value was overwritten before it was
tested).

8 years agonvenc: flush the encoder before closing it, as required by the docs
Anton Khirnov [Fri, 8 Jan 2016 11:29:38 +0000 (12:29 +0100)]
nvenc: flush the encoder before closing it, as required by the docs

Otherwise, closing the encoder can crash.

8 years agonvenc: rename encoders
Anton Khirnov [Thu, 7 Jan 2016 06:58:24 +0000 (07:58 +0100)]
nvenc: rename encoders

Change 'nvenc_<codec>' to '<codec>_nvenc', which is consistent with
other similar decoders and encoders (QSV, MMAL).

8 years agonvenc: better error handling
Anton Khirnov [Wed, 6 Jan 2016 18:52:37 +0000 (19:52 +0100)]
nvenc: better error handling

Return proper error codes and print more descriptive error messages.

8 years agomovenc-test: stop setting the GLOBAL_HEADER codec flag
Anton Khirnov [Thu, 7 Jan 2016 07:26:26 +0000 (08:26 +0100)]
movenc-test: stop setting the GLOBAL_HEADER codec flag

This test does no encoding, setting the flag was done just to silence
the warning removed in the previous commit.

8 years agomux: drop the warning about global headers
Anton Khirnov [Thu, 7 Jan 2016 07:24:54 +0000 (08:24 +0100)]
mux: drop the warning about global headers

The AVStream codec context is often not (and should not be) the actual
encoding context, so this warning will be spurious in many cases.

8 years agolavc: Use get_bitsz where needed
Andreas Cadhalpun [Mon, 11 Jan 2016 20:14:00 +0000 (21:14 +0100)]
lavc: Use get_bitsz where needed

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agolavc: Add get_bitsz()
Andreas Cadhalpun [Mon, 11 Jan 2016 20:05:55 +0000 (21:05 +0100)]
lavc: Add get_bitsz()

get_bit variant supporting 0-bits reads.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agosunrastenc: Properly load codec private options
Vittorio Giovara [Mon, 4 Jan 2016 13:13:00 +0000 (14:13 +0100)]
sunrastenc: Properly load codec private options

Initialize the private class field and give the class a more
appropriate name. Add a class member to the codec context.

8 years agoget_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL
Kieran Kunhya [Sun, 13 Dec 2015 18:02:09 +0000 (18:02 +0000)]
get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL

8 years agolavu: add AV_CEIL_RSHIFT and use it in various places
Clément Bœsch [Fri, 8 Jan 2016 15:16:10 +0000 (16:16 +0100)]
lavu: add AV_CEIL_RSHIFT and use it in various places

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agoswfdec: support compressed swf
Clément Bœsch [Wed, 2 Dec 2015 23:41:00 +0000 (18:41 -0500)]
swfdec: support compressed swf

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agoasfdec: Fix typo in comment
Alexandra Hájková [Sat, 9 Jan 2016 18:35:28 +0000 (19:35 +0100)]
asfdec: Fix typo in comment

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoAPIchanges: Add missing av_pix_fmt_get_chroma_sub_sample entry
Luca Barbato [Mon, 11 Jan 2016 19:51:51 +0000 (20:51 +0100)]
APIchanges: Add missing av_pix_fmt_get_chroma_sub_sample entry

8 years agoarm: Fix vfp dead code elimination with have_vfp_vm
Martin Storsjö [Thu, 7 Jan 2016 13:06:49 +0000 (15:06 +0200)]
arm: Fix vfp dead code elimination with have_vfp_vm

This fixes builds with --disable-vfp.

Checking for the armv6 cpu flag is incorrect, since vfpv2 isn't
armv6 specific.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agocheckasm: Check register clobbering on aarch64
Martin Storsjö [Thu, 31 Dec 2015 10:20:37 +0000 (12:20 +0200)]
checkasm: Check register clobbering on aarch64

This is disabled on iOS, since iOS uses a slightly different ABI
for vararg parameters.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agocheckasm: Check register clobbering on arm
Martin Storsjö [Wed, 30 Dec 2015 21:46:06 +0000 (23:46 +0200)]
checkasm: Check register clobbering on arm

Use two separate functions, depending on whether VFP/NEON is available.

This is set to require armv5te - it uses blx, which is only available
since armv5t, but we don't have a separate configure item for that.
(It also uses ldrd, which requires armv5te, but this could be avoided
if necessary.)

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agoavpacket: fix size check in packet_alloc
Andreas Cadhalpun [Tue, 5 Jan 2016 12:05:50 +0000 (13:05 +0100)]
avpacket: fix size check in packet_alloc

The previous check only caught sizes from -AV_INPUT_BUFFER_PADDING_SIZE
to -1.

This fixes ubsan runtime error: signed integer overflow: 2147483647 + 32
cannot be represented in type 'int'

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoasfdec: Remove unused function parameters
Alexandra Hájková [Wed, 6 Jan 2016 05:08:08 +0000 (06:08 +0100)]
asfdec: Remove unused function parameters

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoasfdec: reject size > INT64_MAX in asf_read_unknown
Andreas Cadhalpun [Wed, 6 Jan 2016 06:32:25 +0000 (07:32 +0100)]
asfdec: reject size > INT64_MAX in asf_read_unknown

Both avio_skip and detect_unknown_subobject use int64_t for the size
parameter.

This fixes a segmentation fault due to infinite recursion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoasfdec: only set asf_pkt->data_size after sanity checks
Andreas Cadhalpun [Wed, 6 Jan 2016 06:34:42 +0000 (07:34 +0100)]
asfdec: only set asf_pkt->data_size after sanity checks

Otherwise invalid values are used unchecked in the next run.
This can cause NULL pointer dereferencing.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoqsvenc: split encoding frames and reading from the async FIFO
Anton Khirnov [Wed, 6 Jan 2016 07:39:27 +0000 (08:39 +0100)]
qsvenc: split encoding frames and reading from the async FIFO

This makes sure all the frames are returned at the end.

Found-By: Maxym Dmytrychenko <maxym.dmytrychenko@intel.com>
8 years agoqsvenc: properly handle the warning from MFXVideoCORE_SyncOperation
Maxym Dmytrychenko [Fri, 18 Dec 2015 13:24:36 +0000 (14:24 +0100)]
qsvenc: properly handle the warning from MFXVideoCORE_SyncOperation

Same as what is done in 3b6473b43eb69fc3faaf69f7fd0b83b51db7607f.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoavconv: Drop an impossible check
Luca Barbato [Sat, 2 Jan 2016 13:43:13 +0000 (14:43 +0100)]
avconv: Drop an impossible check

EAGAIN is already managed in poll_filters().

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoavconv: Simplify poll_filters() return value check
Luca Barbato [Sat, 2 Jan 2016 13:43:12 +0000 (14:43 +0100)]
avconv: Simplify poll_filters() return value check

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years agoh264_refs: Remove broken trace debug code
Diego Biurrun [Fri, 11 Dec 2015 12:32:47 +0000 (13:32 +0100)]
h264_refs: Remove broken trace debug code

8 years agolavc: Add missing #includes for ff_dlog()
Diego Biurrun [Fri, 11 Dec 2015 12:17:15 +0000 (13:17 +0100)]
lavc: Add missing #includes for ff_dlog()

8 years agoqsvdec: properly handle the warning from MFXVideoCORE_SyncOperation
Maxym Dmytrychenko [Fri, 18 Dec 2015 13:24:36 +0000 (14:24 +0100)]
qsvdec: properly handle the warning from MFXVideoCORE_SyncOperation

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoqsvenc_hevc: improve the default settings
Maxym Dmytrychenko [Fri, 18 Dec 2015 08:55:13 +0000 (09:55 +0100)]
qsvenc_hevc: improve the default settings

Use 8 B-frames and modify the GOP size to be a multiple of the B-frame
count.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years agoh264: improve behaviour with invalid reference lists
Anton Khirnov [Thu, 17 Dec 2015 18:38:24 +0000 (19:38 +0100)]
h264: improve behaviour with invalid reference lists

Before 741b494fa8cd28a7d096349bac183893c236e3f9, when the reference list
modification description was invalid, the code would substitute the
corresponding reference from the initial ("default") reference list.
After that commit, it will just return an error.

Since there are apparently invalid samples in the wild that used to play
fine with the old code, it is a good idea to re-add some sort of error
resilience here. So, when the reference list modification results in a
missing frame, substitute a previous reference frame for it. The
relevant sample again decodes fine with the same output as previously.

8 years agodca: use defines for subband related constants
Alexandra Hájková [Wed, 30 Dec 2015 14:29:03 +0000 (15:29 +0100)]
dca: use defines for subband related constants

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
8 years agox86: use emms after ff_int32_to_float_fmul_scalar_sse
Janne Grunau [Tue, 29 Dec 2015 11:08:38 +0000 (12:08 +0100)]
x86: use emms after ff_int32_to_float_fmul_scalar_sse

Intel's Instruction Set Reference (as of September 2015) clearly states
that cvtpi2ps switches to MMX state. Actual CPUs do not switch if the
source is a memory location. The Instruction Set Reference from 1999
(Order Number 243191) describes this behaviour but all later versions
I've seen have make no distinction whether MMX registers or memory is
used as source.
The documentation for the matching SSE2 instruction to convert to double
(cvtpi2pd) was fixed (see the valgrind bug
https://bugs.kde.org/show_bug.cgi?id=210264).

It will take time to get a clarification and fixes in place. In the
meantime it makes sense to change ff_int32_to_float_fmul_scalar_sse to
be correct according to the documentation. The vast majority of users
will have SSE2 so a change to the SSE version has little effect.

Fixes fate-checkasm on x86 valgrind targets.

Valgrind 'bug' reported as https://bugs.kde.org/show_bug.cgi?id=357059

8 years agocheckasm: x86: post commit review fixes
Janne Grunau [Tue, 22 Dec 2015 21:51:55 +0000 (22:51 +0100)]
checkasm: x86: post commit review fixes

Check the full FPU tag word instead of only the lower half and simplify
the comparison.
Use upper-case function base name as macro name to instantiate both
checked_call variants.

8 years agox86: zero extend the 32-bit length in int32_to_float_fmul_scalar implicitly
Janne Grunau [Tue, 22 Dec 2015 21:45:42 +0000 (22:45 +0100)]
x86: zero extend the 32-bit length in int32_to_float_fmul_scalar implicitly

This reverts commit 5dfe4edad63971d669ae456b0bc40ef9364cca80.

8 years agoRemove stray line breaks from avpriv_{report_missing_feature|request_samples}
Diego Biurrun [Tue, 15 Dec 2015 18:59:14 +0000 (19:59 +0100)]
Remove stray line breaks from avpriv_{report_missing_feature|request_samples}