1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00
Commit Graph

78521 Commits

Author SHA1 Message Date
Marios Titas
47f0d80ee0 avfilter/src_movie: fix how we check for overflows with seek_point
Currently, if the movie source filter is used and a seek_point is
specified on a file that has a negative start time, ffmpeg will fail.

An easy way to reproduce this is as follows:
$ ffmpeg -vsync passthrough -filter_complex 'color=d=10,setpts=PTS-1/TB' test.mp4
$ ffmpeg -filter_complex 'movie=filename=test.mp4:seek_point=2' -f null -

The problem is caused by checking for int64_t overflow the wrong way.
In general, to check whether a + b overflows, it is not enough to do:
    a > INT64_MAX - b
because b might be negative; the correct way is:
    b > 0 && > a > INT64_MAX - b

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1f9734f97)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-03 01:55:24 +02:00
Aaron Boxer
5d79566ab3 avcodec/j2kenc: Add attribution to OpenJPEG project:
http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b6b4b0a65e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-01 17:35:50 +02:00
Michael Niedermayer
fda00aa774 doc/Doxyfile: update for 3.0.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-29 04:25:48 +02:00
Michael Niedermayer
9b1b674ebe Changelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-29 04:23:42 +02:00
Michael Niedermayer
00b54d4625 avcodec/diracdec: check bitstream size related fields for overflows
Fixes segfault
Fixes Ticket5333

Regression since bfc8a4dabe
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8f2a1990c0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-29 03:25:15 +02:00
Michael Niedermayer
26d29f0c3d avcodec/h264_slice: Check PPS more extensively when its not copied
Fixes Ticket5371
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c50be7a52b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-29 03:25:15 +02:00
James Almer
7b1e020fc5 avformat/svag: fix division by zero
Fixes ticket #5386

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d5a3578350)
2016-03-28 19:10:34 -03:00
Rostislav Pehlivanov
3d9ebfd272 Changelog: update for 3.0.1's vc2enc fixes
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-28 17:04:23 +01:00
Rostislav Pehlivanov
f01919b57a vc2enc: correctly zero out coefficient array padding
Credit for figuring this out goes to James Darnley.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
(cherry picked from commit 3ef10406e1)
2016-03-28 17:02:05 +01:00
Rostislav Pehlivanov
6cb5bbc660 Changelog: update for 3.0.1's aacenc optimizations
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-28 16:59:14 +01:00
Ganesh Ajjanagadde
f281cb4ea9 lavc/aacenc_utils: replace powf(x,y) by expf(logf(x), y)
This is ~2x faster for y not an integer on Haswell+GCC, and should
generally be faster due to the fact that anyway powf essentially does
this under the hood. Made an inline function in lavu/internal.h for this
purpose.

Note that there are some accuracy differences, that should generally be
negligible. In particular, FATE still passes on this platform.

Results in ~ 7% speedup in aac encoding with -march=native, Haswell+GCC.
before:
ffmpeg -i sin.flac -acodec aac -y sin_new.aac  6.05s user 0.06s system 104% cpu 5.821 total

after:
ffmpeg -i sin.flac -acodec aac -y sin_new.aac  5.67s user 0.03s system 105% cpu 5.416 total

This is also faster than an alternative approach that pulls in powf, gets rid of
the crufty NaN checks and other special cases, exploits knowledge about the intervals, etc.
This of course does not exclude smarter approaches; just suggests that
there would need to be significant work on this front of lower utility than
searches for hotspots elsewhere.

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
(cherry picked from commit bccc81dfa0)
2016-03-28 16:57:41 +01:00
Reimar Döffinger
b176ab0556 aacenc_utils: Use temporary variable.
This ensures gcc does not create unnecessary
loads or stores and possibly even does not vectorize
the negation.
Speeds up mp3 to aac transcoding with default settings
by 10% when using "gcc (Debian 5.3.1-10) 5.3.1 20160224".

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit b60dfae7af)
2016-03-28 16:56:27 +01:00
Reimar Döffinger
1cbe4ff2ac aacenc: avoid double in quantize_bands.
I cannot see any point whatsoever to use
double here instead of float, the results
are likely identical in all cases..
Using float allows for much more
efficient use of SIMD.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 0a04c2885f)
2016-03-28 16:56:11 +01:00
Ganesh Ajjanagadde
7c2576e15d lavc/aacenc_utils: replace sqrtf(Q*sqrtf(Q)) by precomputed value
It makes no sense whatsoever to do this at each function call; we
already have a table for this.

Yields a 2x improvement in find_min_book (x86-64, Haswell+GCC):
ffmpeg -i sin.flac -acodec aac -y sin.aac
find_min_book
old
    605 decicycles in find_min_book, 8388453 runs,    155 skips.9x
    606 decicycles in find_min_book,16776912 runs,    304 skips.9x
    607 decicycles in find_min_book,33553819 runs,    613 skips.2x
    607 decicycles in find_min_book,67107668 runs,   1196 skips.3x
    607 decicycles in find_min_book,134215360 runs,   2368 skips3x

new
    359 decicycles in find_min_book, 8388552 runs,     56 skips.3x
    360 decicycles in find_min_book,16777112 runs,    104 skips.1x
    361 decicycles in find_min_book,33554218 runs,    214 skips.4x
    361 decicycles in find_min_book,67108381 runs,    483 skips.5x
    361 decicycles in find_min_book,134216725 runs,   1003 skips5x

and more importantly a non-negligible speedup (~ 8%) to overall AAC encoding:
old:
ffmpeg -i sin.flac -acodec aac -strict -2 -y sin_new.aac  6.82s user 0.03s system 104% cpu 6.565 total
new:
ffmpeg -i sin.flac -acodec aac -strict -2 -y sin_old.aac  6.24s user 0.03s system 104% cpu 5.993 total

This also improves accuracy of the expression by ~ 2 ulp in some cases.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
(cherry picked from commit bd9c58756a)
2016-03-28 16:55:59 +01:00
Michael Niedermayer
526c7b2186 Update for 3.0.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 22:37:41 +01:00
Michael Niedermayer
2d0e415482 avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
Reviewed-by: maintainer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0cd9ff4e3a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:48 +01:00
Ico Doornekamp
daa6dc0a3b avformat/rtpdec_jpeg: fix low contrast image on low quality setting
Original mail and my own followup on ffmpeg-user earlier today:

I have a device sending out a MJPEG/RTP stream on a low quality setting.
Decoding and displaying the video with libavformat results in a washed
out, low contrast, greyish image. Playing the same stream with VLC results
in proper color representation.

Screenshots for comparison:

  http://zevv.nl/div/libav/shot-ffplay.jpg
  http://zevv.nl/div/libav/shot-vlc.jpg

A pcap capture of a few seconds of video and SDP file for playing the
stream are available at

  http://zevv.nl/div/libav/mjpeg.pcap
  http://zevv.nl/div/libav/mjpeg.sdp

I believe the problem might be in the calculation of the quantization
tables in the function create_default_qtables(), the attached patch
solves the issue for me.

The problem is that the argument 'q' is of the type uint8_t. According to the
JPEG standard, if 1 <= q <= 50, the scale factor 'S' should be 5000 / Q.
Because the create_default_qtables() reuses the variable 'q' to store the
result of this calculation, for small values of q < 19, q wil subsequently
overflow and give wrong results in the calculated quantization tables. The
patch below uses a new variable 'S' (same name as in RFC2435) with the proper
range to store the result of the division.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e3e6a2cff4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:48 +01:00
Michael Niedermayer
6e5648ad42 avformat/mpegtsenc: Fix used service
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 26811fd946)

Conflicts:

	libavformat/version.h
2016-03-26 21:52:48 +01:00
Michael Niedermayer
e15a48d35a avformat/mpegtsenc: Keep track of the program for each service
Simplifies code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 50d017a281)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:48 +01:00
Michael Niedermayer
0fae52d7e3 avformat/file: Add crypto to default whitelist
Fixes Ticket5287

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit efa98cdc2f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
50a639a62a avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
Fixes Ticket5244

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 068026b0f7)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Mark Thompson
d6adcab842 lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fbec157ea0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
bf80b1d88d avcodec/resample: Remove disabled and faulty code
Fixes Ticket5345

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 50ef7361cb)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Luca Barbato
53fffc9fc4 indeo2: Fix banding artefacts
Rename luma table to delta table and change how it is used.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit f8c34f4b8d)
(cherry picked from commit 73f3c8f73e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Luca Barbato
b0e836466f indeo2data: K&R formatting cosmetics
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit d4066a7024)
(cherry picked from commit 522ab0b9a9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
e158936712 avformat/hlsenc: Fix passing options, regression since bc9a5965c8
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b2ab3398f5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
c8977ec6e9 avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
This should theoretically improve the randomness slightly

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2540d884f3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Martin Cracauer
934bc32acc avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
Trying to make heads and tails out of DTS 6.1 I can across this typo.

I also noticed that this wiki page is incorrect or misleading, the
channel order for 6.1 given does not match the source code.  At the
least it should be clarified that the layout given does not apply to
DTS.  https://trac.ffmpeg.org/wiki/AudioChannelManipulation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 73d1398f0c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
64f2b48be0 avformat/concatdec: set safe mode to enabled instead of auto
This is safer, as a selected demuxer could still mean that it was auto-detected
by a user application

Reviewed-previously-by: Nicolas George <george@nsup.org>
Reviewed-previously-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 689211d572)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
756f4b586a avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit de1de49324)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Boris Nagels
56c4dca5ae avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
RTCP synchronization packet was broken since commit in ffmpeg version > 2.8.3
(commit: e04b039b15) Since this commit (2e814d0329)
"rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps", NTP_TO_RTP_FORMAT
uses av_rescale_rnd() function to add the data to the packet.

This causes an overflow in the av_rescale_rnd() function and it will return INT64_MIN.
Causing the NTP stamp in the RTCP packet to have an invalid value.

Github: Closes #182

Reverting commit '2e814d0329aded98c811d0502839618f08642685' solves the problem.
(cherry picked from commit 1109ed7973)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
foo86
da6ccfe18e avcodec/dca: clear X96 channels if nothing was decoded
The first X96 channel set can have more channels than core, causing X96
decoding to be skipped. Clear the number of decoded X96 channels to zero
in this rudimentary case.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit db44b59980)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
27a61302b7 fate/aac: Increase fuzz from of fate-aac-pns-encode from 72 to 74 for Loongson
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c78a726717)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
b4be953c55 avformat/cache: Fix memleak of tree entries
Found-by: jamrial

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 554f6e930c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Rodger Combs
3b179b6302 lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216
(cherry picked from commit 22dbc1caaf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Rodger Combs
bf8f2fae2a lavf/mov: fix sidx with edit lists
(cherry picked from commit 3617e69d50)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
0d7343f8dd avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
Fixes: ebd58db6-dc86-11e5-91c2-59daeddf50c7.jpg

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c6f4720b86)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
fb8676eb1c swscale/utils: Fix chrSrcHSubSample for GBRAP16
Fixes part of Ticket5264

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 67e5bd0c50)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
ca5c639446 swscale/input: Fix GBRAP16 input
Fixes part of Ticket5264

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit df36257a53)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
bd79dbfa2b avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1ec7a70380)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
c4765a41b9 avcodec/h264: Execute error concealment before marking the frame as done.
Fixes race condition causing artifacts
Fixes Ticket4122

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 98a0053d0f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
be5acd6cb1 swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
Reviewed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f6492a2ea8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
c3e7a7ef3f swscale/x86/output: Move code into yuv2planeX_mainloop
Reviewed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d07f6e5f1c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
KO Myung-Hun
9e4d297ba7 MAINTAINERS: add myself as an OS/2 maintainer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 346ec91764)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:46 +01:00
James Almer
373bc77a35 libwebpenc_animencoder: print library messages in verbose log levels
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit f875ba4873)
2016-03-17 12:57:00 -03:00
James Almer
20d89a3a32 libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
This zeroes the WebPAnimEncoderOptions.verbose field, silencing library info messages
printed to stderr.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 626b6b769c)
2016-03-17 12:56:30 -03:00
Hendrik Leppkes
ee7c347935 configure: check for SEC_I_CONTEXT_EXPIRED before enabling SChannel
Fixes build on mingw32, which lacks this constant.
2016-03-16 15:32:50 +01:00
Carl Eugen Hoyos
9da31a0373 lavf/http: Add httpproxy to the default protocol whitelist.
(cherry picked from commit 58fa694978)
2016-03-14 16:39:05 +01:00
Paul B Mahol
eb46065f4a doc/utils: fix typo for min() description
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit bdf474bcff)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2016-03-02 16:43:57 -08:00
Oliver Collyer
b80083a5c1 ffserver&ffm: Fixed issues preventing ffserver write_index and files_size from being set correctly which was breaking ffserver streaming.
I discovered that ffserver streaming was broken (it seems like it has been since 20th November) and I opened a ticket for this (https://trac.ffmpeg.org/ticket/5250 <https://trac.ffmpeg.org/ticket/5250>).

I spent yesterday learning git bisect (with the kind help of cehoyos) to painstakingly track down the cause. This was made more difficult due to the presence of a segfault in ffserver during the period where the bug was introduced so I first had to identify when and how that was fixed and then retrospectively apply that fix again for each step of the second git bisect to find the actual bug.

Anyway, the fruits of my labour are the innocent looking patch below to correct a couple of typos and define a valid range for two variables.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a2f8beef2d)
2016-02-23 15:58:42 +01:00