OSDN Git Service

android-x86/external-ffmpeg.git
7 years agoavutil/hwcontext_cuda: check for missing pixel format
Timo Rothenpieler [Tue, 29 Nov 2016 16:37:13 +0000 (17:37 +0100)]
avutil/hwcontext_cuda: check for missing pixel format

7 years agoavfilter/vf_scale_npp: check ff_set_common_formats return value
Timo Rothenpieler [Tue, 29 Nov 2016 16:28:15 +0000 (17:28 +0100)]
avfilter/vf_scale_npp: check ff_set_common_formats return value

7 years agoavfilter/vf_scale_npp: move aspect ratio correction after av_frame_copy_props
Miroslav Slugeň [Sun, 27 Nov 2016 00:09:05 +0000 (01:09 +0100)]
avfilter/vf_scale_npp: move aspect ratio correction after av_frame_copy_props

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
7 years agoavcodec/nvenc: always reduce DAR width and height
Miroslav Slugeň [Sun, 27 Nov 2016 00:46:06 +0000 (01:46 +0100)]
avcodec/nvenc: always reduce DAR width and height

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
7 years agoavcodec/nvenc: Delay identification of underlying format of cuda frames
Philip Langdale [Fri, 25 Nov 2016 19:11:45 +0000 (11:11 -0800)]
avcodec/nvenc: Delay identification of underlying format of cuda frames

When input surfaces are cuda frames, we will not know what the actual
underlying format (nv12, p010, etc) is at surface allocation time.

On the other hand, we will know when the input frames are actually
registered and associated with a surface.

So, let's delay format discovery until registration time, which is
actually how we handle other frame properties, such as dimensions.

By itself, this change doesn't allow for transcoding of 10bit
content from cuvid, but it reduces the problem to the hardcoding of
the sw format in ffmpeg_cuvid.c

Signed-off-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
7 years agoffserver: Add client requested urls to the status page
Michael Niedermayer [Tue, 29 Nov 2016 21:19:50 +0000 (22:19 +0100)]
ffserver: Add client requested urls to the status page

Fixes Ticket3791

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavidec: fix leaking extradata
Andreas Cadhalpun [Mon, 28 Nov 2016 23:28:55 +0000 (00:28 +0100)]
avidec: fix leaking extradata

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agomatroskadec: prevent access of elements after freeing
Michael Schenk [Fri, 25 Nov 2016 08:36:20 +0000 (09:36 +0100)]
matroskadec: prevent access of elements after freeing

Using the decode interrupt feature of ffmpeg may cause crashes by
accessing previously freed pointers in matroska_read_close.

To prevent this reset nb_elem to zero after freeing the elements,
because ffmpeg normally tests for nb_elem.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agoavcodec/flac_parser: Update nb_headers_buffered
Michael Niedermayer [Thu, 24 Nov 2016 14:29:52 +0000 (15:29 +0100)]
avcodec/flac_parser: Update nb_headers_buffered

Fixes infinite loop
Fixes: fuzz.flac

Found-by: Frank Liberato <liberato@google.com>
Reviewed-by: Frank Liberato <liberato@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoidroqdec: fix leaking pkt on failure
Andreas Cadhalpun [Mon, 28 Nov 2016 23:43:27 +0000 (00:43 +0100)]
idroqdec: fix leaking pkt on failure

The code calls av_new_packet a few lines above and the allocated memory
has to be freed in case of an error.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agofate: update after addition of gray10 to lavc/raw
Paul B Mahol [Tue, 29 Nov 2016 23:06:53 +0000 (00:06 +0100)]
fate: update after addition of gray10 to lavc/raw

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agotests/ffserver-regression: Check the status page too
Michael Niedermayer [Tue, 29 Nov 2016 17:25:58 +0000 (18:25 +0100)]
tests/ffserver-regression: Check the status page too

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffsrever: Make the status page bitexact if any stream is bitexact
Michael Niedermayer [Tue, 29 Nov 2016 18:05:43 +0000 (19:05 +0100)]
ffsrever: Make the status page bitexact if any stream is bitexact

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffserver_config: Setup codecpar in add_codec()
Michael Niedermayer [Tue, 29 Nov 2016 17:48:40 +0000 (18:48 +0100)]
ffserver_config: Setup codecpar in add_codec()

fixes segfault in the status page code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agotests/ffserver.regression.ref: update ffserver checksums
Michael Niedermayer [Mon, 28 Nov 2016 17:03:07 +0000 (18:03 +0100)]
tests/ffserver.regression.ref: update ffserver checksums

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agotests/ffserver-regression.sh: give wget a timeout and prevent retries
Michael Niedermayer [Mon, 28 Nov 2016 17:02:37 +0000 (18:02 +0100)]
tests/ffserver-regression.sh: give wget a timeout and prevent retries

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavformat/idroqdec: Check chunk_size for being too large
Michael Niedermayer [Tue, 29 Nov 2016 01:58:34 +0000 (02:58 +0100)]
avformat/idroqdec: Check chunk_size for being too large

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavfilter/vf_masked*: add gray10 and gray12 support
Paul B Mahol [Tue, 29 Nov 2016 15:50:38 +0000 (16:50 +0100)]
avfilter/vf_masked*: add gray10 and gray12 support

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/vf_bitplanenoise: add gray10 and gray12 suppport
Paul B Mahol [Tue, 29 Nov 2016 15:32:33 +0000 (16:32 +0100)]
avfilter/vf_bitplanenoise: add gray10 and gray12 suppport

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/vf_extractplanes: add extract support for 10bit and 12bit formats
Paul B Mahol [Tue, 29 Nov 2016 13:49:01 +0000 (14:49 +0100)]
avfilter/vf_extractplanes: add extract support for 10bit and 12bit formats

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/vf_waveform: add gray10 and gray12 support
Paul B Mahol [Tue, 29 Nov 2016 10:34:48 +0000 (11:34 +0100)]
avfilter/vf_waveform: add gray10 and gray12 support

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/raw: add gray10 support in nut
Paul B Mahol [Tue, 29 Nov 2016 10:18:54 +0000 (11:18 +0100)]
avcodec/raw: add gray10 support in nut

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/msrledec: implement vertical offset in 4-bit RLE
Daniel Verkamp [Tue, 29 Nov 2016 09:54:56 +0000 (10:54 +0100)]
avcodec/msrledec: implement vertical offset in 4-bit RLE

The delta escape (2) is supposed to work the same in 4-bit RLE as in
8-bit RLE.  This is documented in the MSDN Bitmap Compression page:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183383(v=vs.85).aspx

The unchecked modification of line is safe, since the loop condition
(line >= 0) will check it before any pixel data is written.

Fixes ticket #5153 (output now matches ImageMagick for the provided sample).

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
7 years agotests: Fix running ffserver under qemu
Michael Niedermayer [Mon, 28 Nov 2016 22:28:52 +0000 (23:28 +0100)]
tests: Fix running ffserver under qemu

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agotests/Makefile: Fix ffservertest dependencies
Michael Niedermayer [Mon, 28 Nov 2016 22:07:19 +0000 (23:07 +0100)]
tests/Makefile: Fix ffservertest dependencies

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffserver: Remove last use of AVStream size
Michael Niedermayer [Sun, 27 Nov 2016 18:13:56 +0000 (19:13 +0100)]
ffserver: Remove last use of AVStream size

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffserver: Remove some deprecated API use related to codec/codecpar
Michael Niedermayer [Sun, 27 Nov 2016 17:05:07 +0000 (18:05 +0100)]
ffserver: Remove some deprecated API use related to codec/codecpar

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffserver: Remove use of AVStream as a intermediate to store parameters
Michael Niedermayer [Sun, 27 Nov 2016 16:42:50 +0000 (17:42 +0100)]
ffserver: Remove use of AVStream as a intermediate to store parameters

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffserver: drop FeedData, its unused
Michael Niedermayer [Sun, 27 Nov 2016 16:10:18 +0000 (17:10 +0100)]
ffserver: drop FeedData, its unused

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agotests/ffserver-regression.sh: Fix file truncation introduced in 508826f961caf662cadb7...
Michael Niedermayer [Mon, 28 Nov 2016 17:36:16 +0000 (18:36 +0100)]
tests/ffserver-regression.sh: Fix file truncation introduced in 508826f961caf662cadb7c253e3c0e7d75104bdd

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolibvpxenc: Report encoded VP9 level
Alex Converse [Fri, 18 Nov 2016 21:56:32 +0000 (13:56 -0800)]
libvpxenc: Report encoded VP9 level

Report the actual level of the encoded output if a level is
targeted or the level is passively tracked with a target of 0.

7 years agovf_colorspace: Forbid odd dimensions
Vittorio Giovara [Thu, 17 Nov 2016 20:51:16 +0000 (15:51 -0500)]
vf_colorspace: Forbid odd dimensions

This prevents writing past bounds.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
7 years agoffmpeg_opt: Fix starttime with ffm in bitexact mode
Michael Niedermayer [Mon, 28 Nov 2016 15:56:12 +0000 (16:56 +0100)]
ffmpeg_opt: Fix starttime with ffm in bitexact mode

This fixes some differences between runs of the ffserver tests
(in my local tree 2 runs gave the same result with this but i had other
 changes too)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agopngdec: check if previous frame exists instead of trusting sequence_number
Andreas Cadhalpun [Fri, 25 Nov 2016 21:09:51 +0000 (22:09 +0100)]
pngdec: check if previous frame exists instead of trusting sequence_number

This fixes a segmentation fault caused by calling memcpy with NULL as
second argument in handle_p_frame_apng.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agotests/ffserver.conf: Force bitexactness in the ffmpeg command
Michael Niedermayer [Sun, 27 Nov 2016 19:48:28 +0000 (20:48 +0100)]
tests/ffserver.conf: Force bitexactness in the ffmpeg command

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavformat/rmenc: Check framerate before storing
Michael Niedermayer [Sun, 27 Nov 2016 20:01:06 +0000 (21:01 +0100)]
avformat/rmenc: Check framerate before storing

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolavfi/f_ebur128: relicense to LGPL
Clément Bœsch [Sat, 26 Nov 2016 16:01:50 +0000 (17:01 +0100)]
lavfi/f_ebur128: relicense to LGPL

All copyright holders have agreed to the relicensing.

Approved-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Approved-by: David Sedacca <sedacca@comcast.net>
Approved-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Approved-by: Jean First <jeanfirst@gmail.com>
Approved-by: Kyle Swanson <k@ylo.ph>
Approved-by: Michael Niedermayer <michael@niedermayer.cc>
Approved-by: Nicolas George <george@nsup.org>
Approved-by: Paul B Mahol <onemda@gmail.com>
Approved-by: Thilo Borgmann <thilo.borgmann@mail.de>
7 years agoavcodec/me_cmp: Fix median_sad size
Michael Niedermayer [Sun, 27 Nov 2016 13:34:57 +0000 (14:34 +0100)]
avcodec/me_cmp: Fix median_sad size

Fixes out of array read
Fixes: COV1396255

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffserver: Remove extract_mpeg4_header()
Michael Niedermayer [Wed, 23 Nov 2016 17:40:25 +0000 (18:40 +0100)]
ffserver: Remove extract_mpeg4_header()

This should not be needed, our AVParsers should do this
I do not have a testcase though, please help testing this and please
add fate tests if you can.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoRevert "ffserver: use AVStream.codecpar in open_input_stream()"
Michael Niedermayer [Wed, 23 Nov 2016 18:26:38 +0000 (19:26 +0100)]
Revert "ffserver: use AVStream.codecpar in open_input_stream()"

Fixes null pointer dereference

Testcase is simply a ffmpeg instance sending a stream to ffserver while another ffmpeg reads from it

This reverts commit 6f0a1710d77dde0d803861506a2157a23f08c14c.

7 years agoconfigure: check for stdatomic.h
Anton Khirnov [Thu, 24 Nov 2016 05:54:53 +0000 (21:54 -0800)]
configure: check for stdatomic.h

Since this is a C11 feature, it requires -std=c11.

Not actually used for anything yet, that will be added in the following
commits.

This merges libav commit 13f5d2bf75b95a0bfdb9940a5e359a719e242bed.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavfilter/vf_zscale: export approximate gamma option and enable it by default
Paul B Mahol [Sun, 27 Nov 2016 10:43:54 +0000 (11:43 +0100)]
avfilter/vf_zscale: export approximate gamma option and enable it by default

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavformat/utils: Fix type mismatch
Michael Niedermayer [Sun, 27 Nov 2016 02:39:20 +0000 (03:39 +0100)]
avformat/utils: Fix type mismatch

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolavf: always forward codec_whitelist in avformat_find_stream_info
Andreas Cadhalpun [Fri, 25 Nov 2016 20:56:03 +0000 (21:56 +0100)]
lavf: always forward codec_whitelist in avformat_find_stream_info

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agodxva2_vc1: support multiple slices
Hendrik Leppkes [Tue, 15 Nov 2016 09:28:54 +0000 (10:28 +0100)]
dxva2_vc1: support multiple slices

7 years agovc1dec: support multiple slices in frame coded images with hwaccel
Hendrik Leppkes [Tue, 15 Nov 2016 09:28:10 +0000 (10:28 +0100)]
vc1dec: support multiple slices in frame coded images with hwaccel

Based on a patch by Jun Zhao <mypopydev@gmail.com>

7 years agorefine avformat/flvdec set bit_rate
Steven Liu [Sat, 26 Nov 2016 03:28:22 +0000 (11:28 +0800)]
refine avformat/flvdec set bit_rate

7 years agoavformat/flvdec: move set bit_rate from parse AMF OBJECT to
Steven Liu [Sat, 26 Nov 2016 00:56:18 +0000 (08:56 +0800)]
avformat/flvdec: move set bit_rate from parse AMF OBJECT to
 create_stream

before patch:
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x714 [SAR 1:1 DAR 640:357], 25 fps, 25 tbr, 1k tbn, 50 tbc

after patch:
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x714 [SAR 1:1 DAR 640:357], 2576 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavformat/flvenc: fix ticket 5976 and use old commit
Steven Liu [Sat, 26 Nov 2016 00:52:19 +0000 (08:52 +0800)]
avformat/flvenc: fix ticket 5976 and use old commit

mythtv have problem with non-seekable dont write duration and filesize
and there have problem with some other server and player with 0 value
duation and filesize.
So add a flv flags to fix the ticket and make a choose for users.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoswresample/soxr: fix invalid use of linear_interp
Muhammad Faiz [Fri, 25 Nov 2016 09:39:34 +0000 (16:39 +0700)]
swresample/soxr: fix invalid use of linear_interp

give very bad quality for soxr resampler.
linear_interp is intended for  using linear interpolation
between filter bank so quality will be better.

i guess this is misunderstood as 'do not use filter bank,
but directly interpolate linearly between samples'.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agoavcodec/aac_adtstoasc_bsf: validate and forward extradata if the stream is already ASC
James Almer [Fri, 25 Nov 2016 00:10:47 +0000 (21:10 -0300)]
avcodec/aac_adtstoasc_bsf: validate and forward extradata if the stream is already ASC

Fixes ticket #5973

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agomss2: only use error correction for matching block counts
Andreas Cadhalpun [Thu, 24 Nov 2016 22:57:46 +0000 (23:57 +0100)]
mss2: only use error correction for matching block counts

This fixes a heap-buffer-overflow in ff_er_frame_end when decoding mss2
with coded_width/coded_height larger than width/height.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agoavcodec/nvenc: Remove aspect-ratio decompensation logic
Philip Langdale [Wed, 23 Nov 2016 22:05:18 +0000 (14:05 -0800)]
avcodec/nvenc: Remove aspect-ratio decompensation logic

This dubious behaviour in nvenc was finally removed by nvidia, and
as we refuse to run on anything older than 7.0, we don't need to
keep it around for old versions.

7 years agoavcodec/mpeg4audio: correctly propagate meaningful error values
James Almer [Fri, 25 Nov 2016 13:40:59 +0000 (10:40 -0300)]
avcodec/mpeg4audio: correctly propagate meaningful error values

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agolavf/flvdec: Set avg_frame_rate for video streams.
Carl Eugen Hoyos [Fri, 25 Nov 2016 10:06:14 +0000 (11:06 +0100)]
lavf/flvdec: Set avg_frame_rate for video streams.

Requested-by: qw, applemax82 at 163 dot com
Reviewed-by: Steven Liu
7 years agoMAINTAINERS: Add Vittorio to "Developers with git write access who are currently...
Michael Niedermayer [Wed, 23 Nov 2016 11:04:27 +0000 (12:04 +0100)]
MAINTAINERS: Add Vittorio to "Developers with git write access who are currently not maintaining any specific part"

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoMAINTAINERS: Add developers who have git write access but are otherwise not listed
Michael Niedermayer [Mon, 21 Nov 2016 17:22:03 +0000 (18:22 +0100)]
MAINTAINERS: Add developers who have git write access but are otherwise not listed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agosoftfloat: decrease MIN_EXP to cover full float range
Andreas Cadhalpun [Thu, 24 Nov 2016 23:26:51 +0000 (00:26 +0100)]
softfloat: decrease MIN_EXP to cover full float range

floats are not necessarily normalized, so a normalized softfloat needs
MIN_EXP lowered by 23 to cover that range.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agofate/exr: add test for pxr24 with half and uint32 channel
Martin Vignali [Thu, 17 Nov 2016 20:25:19 +0000 (21:25 +0100)]
fate/exr: add test for pxr24 with half and uint32 channel

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agolibavcodec/exr: add support for uint32 channel decoding with pxr24
Martin Vignali [Thu, 17 Nov 2016 20:24:42 +0000 (21:24 +0100)]
libavcodec/exr: add support for uint32 channel decoding with pxr24

Doesn't decode the uint32 layer, but decodes the half part of the file.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agolibopusdec: default to stereo for invalid number of channels
Andreas Cadhalpun [Mon, 14 Nov 2016 20:41:45 +0000 (21:41 +0100)]
libopusdec: default to stereo for invalid number of channels

This fixes an out-of-bounds read if avc->channels is 0.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agoflvdec: require need_context_update when changing codec id
Andreas Cadhalpun [Fri, 4 Nov 2016 20:37:13 +0000 (21:37 +0100)]
flvdec: require need_context_update when changing codec id

Otherwise the codec context and codecpar might disagree on the codec id,
triggering asserts in av_parser_parse2.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agoswresample/resample: optimize exact_rational=on:linear_interp=on case
Muhammad Faiz [Thu, 24 Nov 2016 08:02:07 +0000 (15:02 +0700)]
swresample/resample: optimize exact_rational=on:linear_interp=on case

separate dsp.resample to dsp.resample_common and dsp.resample_linear
and choose to call faster resample_common even when linear_interp=on
when c->frac and c->dst_incr_mod are both zero

speed up resampling when exact_rational and linear_interp are both
enabled because exact_rational force c->frac and c->dst_incr_mod to
be zero when soft compensation does not happen

benchmark on exact_rational=on:linear_interp=on
        old     new
real    8.432s  5.097s
user    7.679s  4.989s
sys     0.125s  0.107s

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agofate/swresample: add resample exact_lin and exact_lin_async test
Muhammad Faiz [Wed, 23 Nov 2016 20:30:25 +0000 (03:30 +0700)]
fate/swresample: add resample exact_lin and exact_lin_async test

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agoavutil/tests: add cpu_init to .gitignore and tests/fate
Wan-Teh Chang [Wed, 23 Nov 2016 23:08:20 +0000 (15:08 -0800)]
avutil/tests: add cpu_init to .gitignore and tests/fate

This is a follow-up to commit d84a21207ea83055dc9b6dc1cd6a379f2ea756e7,
which added the libavutil/tests/cpu_init.c.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavfilter/tests/.gitignore: add integral
Wan-Teh Chang [Wed, 23 Nov 2016 23:08:20 +0000 (15:08 -0800)]
avfilter/tests/.gitignore: add integral

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agocuda: check for cuda.h when enabled
James Almer [Thu, 24 Nov 2016 16:39:13 +0000 (13:39 -0300)]
cuda: check for cuda.h when enabled

Fixes make checkheaders on systems without the Cuda Toolkit, which
was broken after the dynlink changes.

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoffmpeg_filter: fix several logic failures
Paul B Mahol [Thu, 24 Nov 2016 15:14:27 +0000 (16:14 +0100)]
ffmpeg_filter: fix several logic failures

Move global thread variables to better place.
Use correct variable for simple and complex filtergraphs.

This makes number of threads set per filter work again.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agopgssubdec: only set w/h/linesize when allocating data
Andreas Cadhalpun [Wed, 9 Nov 2016 22:23:16 +0000 (23:23 +0100)]
pgssubdec: only set w/h/linesize when allocating data

Rects with positive w/h/linesize but no data are invalid.

Reviewed-by: Petri Hintukainen <phintuka@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agolavfi/pan: allow negative gain parameters also for other inputs than the first named
Moritz Barsnick [Fri, 28 Oct 2016 12:13:25 +0000 (14:13 +0200)]
lavfi/pan: allow negative gain parameters also for other inputs than the first named

Expands the parser to also accept the separator '-' in addition to
'+', and take the negative sign into consideration.

The optional sign for the first factor in the expression is already
covered by parsing for an integer.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolavc/vaapi_hevc: fix scaling list duplicate transfer issue.
Jun Zhao [Tue, 22 Nov 2016 07:58:50 +0000 (15:58 +0800)]
lavc/vaapi_hevc: fix scaling list duplicate transfer issue.

scaling list is already transfered to raster scan during head parsing,
so no need to transfer it again.

And after this fix, FATE test SLIST_A_Sony_4/SLIST_B_Sony_8/
SLIST_C_Sony_3/SLIST_D_Sony_9 will pass in i965/Skylake.

Signed-off-by: Wang, Yi A <yi.a.wamg@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
7 years agoavutil/tests: Add cpu_init.c to check whether the one-time initialization in av_get_c...
Wan-Teh Chang [Wed, 23 Nov 2016 19:21:56 +0000 (11:21 -0800)]
avutil/tests: Add cpu_init.c to check whether the one-time initialization in av_get_cpu_flags() has data races.

Co-author: Dmitry Vyukov of Google

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavutil/cpu: remove the |checked| static variable
Wan-Teh Chang [Wed, 23 Nov 2016 19:21:56 +0000 (11:21 -0800)]
avutil/cpu: remove the |checked| static variable

Remove the |checked| variable because the invalid value of -1 for
|flags| can be used to indicate the same condition. Also rename |flags|
to |cpu_flags| because there are a local variable and a function
parameter named |flags| in the same file.

Co-author: Dmitry Vyukov of Google

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/cuvid: Restore initialization of pixel format in init()
Philip Langdale [Wed, 23 Nov 2016 20:10:32 +0000 (12:10 -0800)]
avcodec/cuvid: Restore initialization of pixel format in init()

I moved this into the handle_video_sequence callback because that's
the earliest time you can make an accurate decision as to what the
format should be.

However, transcoding requires that the decision between using
the accelerated PIX_FMT_CUDA vs a normal pix format happen at init()
time. There is enough information available to make that decision
and things work out with the underlying format only being discovered
in the sequence callback.

7 years agoavfilter/vf_zscale: add support for some recent new additions
Paul B Mahol [Wed, 23 Nov 2016 15:43:59 +0000 (16:43 +0100)]
avfilter/vf_zscale: add support for some recent new additions

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agofate: update fate-source ref file
James Almer [Wed, 23 Nov 2016 03:54:57 +0000 (00:54 -0300)]
fate: update fate-source ref file

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agodoc/examples/muxing: Fix av_frame_make_writable usage
Sam Hocevar [Sun, 23 Oct 2016 22:12:00 +0000 (00:12 +0200)]
doc/examples/muxing: Fix av_frame_make_writable usage

This patch moves the av_frame_make_writable() call from fill_yuv_image
to get_video_frame so that its argument can be the actual frame that
will be sent to the encoder.

This fixes data corruption issues in codecs that keep references on
one or several previous frames.

Signed-off-by: Sam Hocevar <sam@hocevar.net>
Reviewed-by: wm4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/options_table: make channel_layouts uint64
Michael Niedermayer [Sun, 20 Nov 2016 11:22:08 +0000 (12:22 +0100)]
avcodec/options_table: make channel_layouts uint64

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavutil/opt: Add AV_OPT_TYPE_UINT64
Michael Niedermayer [Sun, 20 Nov 2016 11:57:43 +0000 (12:57 +0100)]
avutil/opt: Add AV_OPT_TYPE_UINT64

Requested-by: wm4 ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64)
Requested-by: ronald ([FFmpeg-devel] [PATCH] avutil/opt: Support max > INT64_MAX in write_number() with AV_OPT_TYPE_INT64)
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agosbgdec: prevent NULL pointer access
Andreas Cadhalpun [Thu, 10 Nov 2016 21:21:20 +0000 (22:21 +0100)]
sbgdec: prevent NULL pointer access

Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agormdec: validate block alignment
Andreas Cadhalpun [Thu, 17 Nov 2016 21:46:40 +0000 (22:46 +0100)]
rmdec: validate block alignment

This fixes division by zero crashes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agosmacker: limit recursion depth of smacker_decode_bigtree
Andreas Cadhalpun [Sat, 19 Nov 2016 13:21:11 +0000 (14:21 +0100)]
smacker: limit recursion depth of smacker_decode_bigtree

This fixes segmentation faults due to stack-overflow caused by too deep
recursion.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agoavformat/mpeg: Adjust vid probe threshold to correct mis-detection
Michael Niedermayer [Tue, 15 Nov 2016 19:06:42 +0000 (20:06 +0100)]
avformat/mpeg: Adjust vid probe threshold to correct mis-detection

Fixes: _ij.mp3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agomxfdec: fix NULL pointer dereference in mxf_read_packet_old
Andreas Cadhalpun [Thu, 17 Nov 2016 21:53:51 +0000 (22:53 +0100)]
mxfdec: fix NULL pointer dereference in mxf_read_packet_old

Metadata streams have priv_data set to NULL.

Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
7 years agolibvpxenc: Support targeting a VP9 level
Alex Converse [Fri, 18 Nov 2016 21:55:45 +0000 (13:55 -0800)]
libvpxenc: Support targeting a VP9 level

Levels are specified at https://www.webmproject.org/vp9/levels/

7 years agoavcodec/cuvid: Add support for P010/P016 as an output surface format
Philip Langdale [Tue, 22 Nov 2016 16:20:37 +0000 (08:20 -0800)]
avcodec/cuvid: Add support for P010/P016 as an output surface format

The nvidia 375.xx driver introduces support for P016 output surfaces,
for 10bit and 12bit HEVC content (it's also the first driver to support
hardware decoding of 12bit content).

The cuvid api, as far as I can tell, only declares one output format
that they appear to refer to as P016 in the driver strings. Of course,
10bit content in P016 is identical to P010, and it is useful for
compatibility purposes to declare the format to be P010 to work with
other components that only know how to consume P010 (and to avoid
triggering swscale conversions that are lossy when they shouldn't be).

For simplicity, this change does not maintain the previous ability
to output dithered NV12 for 10/12 bit input video - the user will need
to update their driver to decode such videos.

7 years agolibavutil/hwcontext_cuda: Support P010 and P016 formats
Philip Langdale [Tue, 22 Nov 2016 16:18:31 +0000 (08:18 -0800)]
libavutil/hwcontext_cuda: Support P010 and P016 formats

CUVID is now capable of returning 10bit and 12bit decoded content
in P010/P016. Let's support transfering those formats.

7 years agoavutil: add P016 pixel format
Philip Langdale [Sun, 20 Nov 2016 21:55:49 +0000 (13:55 -0800)]
avutil: add P016 pixel format

P016 is the 16-bit variant of NV12 (planar luma, packed chroma), using
two bytes per component.

It may, and in fact is most likely to, be used in situations where
there are less than 16 bits of data. It is the responsibility of
the writer to zero out any unused LSBs.

7 years agoavcodec/libx264: fix forced_idr logic
Timo Rothenpieler [Wed, 12 Oct 2016 19:54:52 +0000 (21:54 +0200)]
avcodec/libx264: fix forced_idr logic

Currently, it forces IDR frames for both true and false.
Not entirely sure what the original idea behind the tri-state bool
option is.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
7 years agoavcodec/cuvid: allow setting number of used surfaces
Miroslav Slugen [Mon, 21 Nov 2016 12:16:39 +0000 (13:16 +0100)]
avcodec/cuvid: allow setting number of used surfaces

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
7 years agoavcodec/nvenc: better surface allocation alghoritm, fix rc_lookahead
Miroslav Slugeň [Mon, 21 Nov 2016 11:17:43 +0000 (12:17 +0100)]
avcodec/nvenc: better surface allocation alghoritm, fix rc_lookahead

User selectable surfaces are not working correctly, if you set number of
surfaces on cmdline, it will always use minimum 32 or 48 depends on
selected resolution, but in nvenc it is not necessary to use so many
surfaces.

So from now you can define as low as 1 surface and nvenc will still
work, it will ofcourse lower GPU memory usage by 95% and async_delay to zero

That was the easy part, now littlebit more...

Next part of this patch is to always prefer rc_lookahead to be more
important for number of surfaces, than user defined surfaces value.
Maximum rc_lookahead from nvidia documentation is 32, but could increase
in future generations so there is no limit for this yet. Value
async_depth is still accepted and prefered over rc_lookahead.

There were also bug when you request more than rc_lookahead > 31, it
will always set maximum 31, because surface numbers recalculation was
after setting lookahead, which is now fixed.

Results:
If you set -rc_lookahead 32 and -bf 3 it will now use only 40 surfaces
and lower GPU memory usage by 20%, also it will now increase PSNR by 0.012dB

Two more comments:

1. from my internal test, i don't understand addition of 4 more surfaces
when lookahead is calculated, i didn't used this and everything works as
with those 4 more extra surfaces, does anybody know what is going on
there? I looks like it was used for B frames which are calculated
separately, because B frames maximum is 4.

2. rc_lookahead is defined default to -1, but in test condition if
(ctx->rc_lookahead) which sets lookahead it will be always true, i don't
know if this is intended behavior, so in default behavior is lookahead
always on!

This is default condition when rc_lokkahead is -1 (not defined on
cmdline), whis is maybe something that is not intended:
ctx->encode_config.rcParams.enableLookahead = 1;
ctx->encode_config.rcParams.lookaheadDepth  = 0;
ctx->encode_config.rcParams.disableIadapt   = 0;
ctx->encode_config.rcParams.disableBadapt   = 0;

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
7 years agoavcodec/nvenc: maximum usable surfaces are limited to maximum registered frames
Miroslav Slugeň [Mon, 21 Nov 2016 10:07:09 +0000 (11:07 +0100)]
avcodec/nvenc: maximum usable surfaces are limited to maximum registered frames

Maximum usable surfaces is limited to MAX_REGISTERED_FRAMES constant in
nvenc.h

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
7 years agoconfigure: cuda is no longer nonfree, enable and autodetect by default
Timo Rothenpieler [Mon, 10 Oct 2016 10:58:26 +0000 (12:58 +0200)]
configure: cuda is no longer nonfree, enable and autodetect by default

7 years agoavfilter/vf_hwupload_cuda: check ff_formats_ref for errors
Timo Rothenpieler [Mon, 10 Oct 2016 10:57:29 +0000 (12:57 +0200)]
avfilter/vf_hwupload_cuda: check ff_formats_ref for errors

7 years agoavfilter/vf_hwupload_cuda: use new hwdevice allocation API
Timo Rothenpieler [Mon, 10 Oct 2016 10:56:55 +0000 (12:56 +0200)]
avfilter/vf_hwupload_cuda: use new hwdevice allocation API

7 years agoavcodec/nvenc: use dynamically loaded CUDA
Timo Rothenpieler [Mon, 10 Oct 2016 10:55:59 +0000 (12:55 +0200)]
avcodec/nvenc: use dynamically loaded CUDA

7 years agoavfilter/vf_scale_npp: use dynamically loaded CUDA
Timo Rothenpieler [Mon, 10 Oct 2016 10:54:42 +0000 (12:54 +0200)]
avfilter/vf_scale_npp: use dynamically loaded CUDA

7 years agoavcodec/cuvid: use dynamically loaded CUDA/CUVID
Timo Rothenpieler [Mon, 10 Oct 2016 10:53:49 +0000 (12:53 +0200)]
avcodec/cuvid: use dynamically loaded CUDA/CUVID

And remove the now obsolete compat headers.

7 years agoavutil/hwcontext_cuda: use dynamically loaded CUDA
Timo Rothenpieler [Mon, 10 Oct 2016 10:52:40 +0000 (12:52 +0200)]
avutil/hwcontext_cuda: use dynamically loaded CUDA

7 years agocompat/cuda: add dynamic loader
Timo Rothenpieler [Mon, 10 Oct 2016 10:47:15 +0000 (12:47 +0200)]
compat/cuda: add dynamic loader