Compare commits

...

74 Commits

Author SHA1 Message Date
Michael Niedermayer
c66f4d1ae6 Changelog: Fix minor formating inconsistency
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-28 03:03:39 +02:00
Michael Niedermayer
ad559492dc update for 3.0.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-28 01:40:54 +02:00
Michael Niedermayer
8d0cfa68b9 avcodec/ttaenc: Reallocate packet if its too small
Fixes assertion failure
Fixes Ticket5394

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-26 19:49:09 +02:00
Shivraj Patil
83eaaae005 configure: build fix for P5600 with mips code restructuring
Note:- backporting commit 15ef98afd10b3696d29fb6d19606ba03a9dd47ad from head

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-26 12:27:49 +02:00
Vicente Olivert Riera
a5638dbfba mips: add support for R6
Note:- backporting commit ad16eff64ba78d8dc98a8324640025c7cb2857f3 from head

Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-26 12:27:39 +02:00
Jan Ekström
666754c665 pgssubdec: fix subpicture output colorspace and range
Functionality used before didn't widen the values from limited to
full range. Additionally, now the decoder uses BT.709 where it
should be used according to the video resolution.

Default for not yet set colorimetry is BT.709 due to most observed
HDMV content being HD.

BT.709 coefficients were gathered from the first two parts of BT.709
to BT.2020 conversion guide in ARIB STD-B62 (Pt. 1, Chapter 6.2.2).
They were additionally confirmed by manually calculating values.

Fixes #4637
(cherry picked from commit 9779b6262471d553c1ed811ff7312564e39d8adf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-26 02:47:09 +02:00
Michael Niedermayer
4c896d6bd4 avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
Fixes Ticket5319

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-25 04:27:29 +02:00
Michael Niedermayer
f2e9e4757f avfilter/vf_drawtext: Check return code of load_glyph()
Fixes segfault
Fixes Ticket5347

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-24 12:41:09 +02:00
Michael Niedermayer
512c064cd9 avformat/mux: Check that deinit is set before calling it
Fixes null pointer dereference

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-24 12:40:58 +02:00
Paul B Mahol
7626fb6cbf avcodec/takdec: add code that got somehow lost in process of REing
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 38797a8033d061ade58b30b8ac86da222fe42a84)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-21 14:13:38 +02:00
Paul B Mahol
6fdd122b11 avcodec/apedec: fix decoding of stereo files with one channel full of silence
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 9149e9c0baaec122bc3da925d6068dffa60b5427)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-21 14:12:45 +02:00
Michael Niedermayer
264c9fe6aa avcodec/avpacket: Fix off by 5 error
Fixes out of array read
Fixes: mozilla bug 1266129
Found-by: Tyson Smith
Tested-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9f36ea57ae6eefb42432220feab0350494f4144c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-21 00:54:00 +02:00
Ivan
76573c5239 avcodec/h264: Fix for H.264 configuration parsing
Sometimes video fails to decode if H.264 configuration changes mid stream.
The reason is that configuration parser assumes that nal_ref_idc is equal to 11b
while actually some codecs but 01b there. The H.264 spec is somewhat
vague about this but it looks like it allows any non-zero nal_ref_idc for sps/pps.

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-17 02:40:53 +02:00
Michael Niedermayer
14fdebc4ff avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
Fixes Ticket 5438

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-14 15:29:25 +02:00
Michael Niedermayer
325d0b64d5 avcodec/pngdec: Fix alpha detection with skip_frame
Fixes Ticket4816

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-09 01:12:32 +02:00
Michael Niedermayer
6103a8453f Changelog: Make formating consistent
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-04 22:45:14 +02:00
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 c1f9734f977f59bc0034096afbe8e43e40d93a5d)

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 b6b4b0a65e02495edf9d7e5b23bef99a92921147)

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 bfc8a4dabe5a0154b31128b59dca575010176441
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8f2a1990c06df73cf58401c8ba193711eb8947e7)

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 c50be7a52bc1e8e18a0059e489743ec12a43f257)

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 d5a3578350a3901a26df39df196bb085760ec46f)
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 3ef10406e19663a78791ed1b38178fb00d4c7d88)
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 bccc81dfa08e6561df6ed37860e3a08f7d983825)
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 b60dfae7af65c4c7d255ef599352f2c54964303d)
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 0a04c2885f02f7db6b410b6d43d120e5eb48dc18)
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 bd9c58756a50b52e495b748d6ea6b0aafe397c25)
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 0cd9ff4e3aa23318a855c21d60b1c9035b2b99d2)

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 e3e6a2cff4af9542455d416faec4584d5e823d5d)

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 26811fd9468dc484402faca3ca33cacb2e58c53e)

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 50d017a28171177b89c367194ec8d02f963e7e9e)

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 efa98cdc2ff17a2f3b0ceb69e22864fd5bc433db)

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 068026b0f7845e0f1850094d974f60d181480d64)

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 fbec157ea08f61063847bbe0dba28525e6283ff5)

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 50ef7361cb5f78c94da2323f3bae86c6bbd618c8)

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 f8c34f4b8d62afad3f63cf3d9617d73735bef8c1)
(cherry picked from commit 73f3c8f73edf0a69502233b2c50fa9e7104f99ec)

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 d4066a702407352a0648af882c34ea81a404fa2b)
(cherry picked from commit 522ab0b9a92962edda7156a91a494a1e2b8a7f64)

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 bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b2ab3398f59ed18a565063584f961ff84484d699)

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 2540d884f3fd7cfac503e048112098967be2569a)

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 73d1398f0c4ce2de16790f46e05a79242137d153)

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 689211d5727231c3fe92762d224dbadebdbf4e30)

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 de1de4932419d0fb49c9c23f62e68cdbe90d0ee3)

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: e04b039b1528f4c7df5c2b93865651bfea168a19) Since this commit (2e814d0329aded98c811d0502839618f08642685)
"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 1109ed7973c7fd1e7001898adc4976590d862122)

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 db44b599805fdd96940cf2e5a336f872648bbda1)

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 c78a7267175a3d1e07b88be42f949f95124925e3)

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 554f6e930ce05a4c5449efcaae36bdafe2d9de74)

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 22dbc1caaf13e4bb17c9e0164a5b1ccaf490e428)

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 3617e69d50dd9dd07b5011dfb9477a9d1a630354)

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 c6f4720b8664e6e22eb5b3da6bb48ed5b113f746)

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 67e5bd0c501f7568fc8d93284d0f7eb40663ab06)

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 df36257a53561a51af969a6ea6319dd2579509b9)

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 1ec7a703806049265991723a8826bd61555edef4)

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 98a0053d0f90e3309dc1038b1bae3a48bbd9067c)

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 f6492a2ea8df80be0ed9591aee4019cef0e36e99)

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 d07f6e5f1c36be675e0900edba3e40a32f05f0f4)

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 346ec917646c18fc9e26bddf04bfa8f8f1e2e18f)

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 f875ba48739f59691661393eed1f7cc2371c93f1)
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 626b6b769ced6d3e55d2661985ab2a1cb89f481e)
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 58fa694978735e30f433f8ede6c7f808b9409919)
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 bdf474bcff29f5b40fe14f6fa1dbe10e69c73ab7)
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 a2f8beef2dfaee573f7c4a607afaa9e83fc2c1e0)
2016-02-23 15:58:42 +01:00
Carl Eugen Hoyos
449ff0e3fd postproc: fix unaligned access
Based on 59074310 by Andreas Cadhalpun.
Fixes ticket #5259.
(cherry picked from commit 2aa21eec1adcb3737be59f0eab7081c5a790faa9)
2016-02-23 15:58:07 +01:00
Rostislav Pehlivanov
0aa2fbddb1 vc2enc: fix use of uninitialized variables in the rate control system
Fixes: CID1352550
Fixes: CID1352549

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
(cherry picked from commit 7cdea450c67d24a3503a0eb64f491f58e474973f)
2016-02-15 15:36:59 +00:00
Michael Niedermayer
c40983a6f6 fate/source-check.sh: Use "git show" instead of git --version to test for git
This fixes fate with non git source trees

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-15 03:51:39 +01:00
Michael Niedermayer
bd0497b28b avcodec/cfhd: Temporary disable frame threading until related bugs have been fixed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-15 03:12:13 +01:00
James Almer
4d95207938 x86: use the new helper macros where useful
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 70d685a77f283b110e7b1ab565ff5de53f752d55)
2016-02-14 20:04:19 -03:00
James Almer
1e8a75fae4 x86: add some more helper macros to check for slow cpuflags
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 73a4589d4b0d97cbd6f8bf8be18b78151b657898)
2016-02-14 20:04:06 -03:00
Rostislav Pehlivanov
380980e0d2 Changelog: add entries for the SMPTE VC-2 decoder and encoder
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-14 22:12:06 +00:00
Michael Niedermayer
1fd8eb4d4f Basic updates for 3.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 23:03:41 +01:00
97 changed files with 973 additions and 512 deletions

View File

@ -1,7 +1,67 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>:
version 3.0.2:
- avcodec/ttaenc: Reallocate packet if its too small
- configure: build fix for P5600 with mips code restructuring
- mips: add support for R6
- pgssubdec: fix subpicture output colorspace and range
- avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
- avfilter/vf_drawtext: Check return code of load_glyph()
- avformat/mux: Check that deinit is set before calling it
- avcodec/takdec: add code that got somehow lost in process of REing
- avcodec/apedec: fix decoding of stereo files with one channel full of silence
- avcodec/avpacket: Fix off by 5 error
- avcodec/h264: Fix for H.264 configuration parsing
- avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
- avcodec/pngdec: Fix alpha detection with skip_frame
- Changelog: Make formating consistent
- avfilter/src_movie: fix how we check for overflows with seek_point
- avcodec/j2kenc: Add attribution to OpenJPEG project:
version 3.0.1:
- avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
- avformat/rtpdec_jpeg: fix low contrast image on low quality setting
- avformat/mpegtsenc: Fix used service
- avformat/mpegtsenc: Keep track of the program for each service
- avformat/file: Add crypto to default whitelist
- avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
- lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
- avcodec/resample: Remove disabled and faulty code
- indeo2: Fix banding artefacts
- indeo2data: K&R formatting cosmetics
- avformat/hlsenc: Fix passing options, regression since bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce
- avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
- avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
- avformat/concatdec: set safe mode to enabled instead of auto
- avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
- avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
- avcodec/dca: clear X96 channels if nothing was decoded
- fate/aac: Increase fuzz from of fate-aac-pns-encode from 72 to 74 for Loongson
- avformat/cache: Fix memleak of tree entries
- lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216
- lavf/mov: fix sidx with edit lists
- avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
- swscale/utils: Fix chrSrcHSubSample for GBRAP16
- swscale/input: Fix GBRAP16 input
- avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
- avcodec/h264: Execute error concealment before marking the frame as done.
- swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
- swscale/x86/output: Move code into yuv2planeX_mainloop
- MAINTAINERS: add myself as an OS/2 maintainer
- libwebpenc_animencoder: print library messages in verbose log levels
- libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
- configure: check for SEC_I_CONTEXT_EXPIRED before enabling SChannel
- lavf/http: Add httpproxy to the default protocol whitelist.
- doc/utils: fix typo for min() description
- ffserver&ffm: Fixed issues preventing ffserver write_index and files_size from being set correctly which was breaking ffserver streaming.
- postproc: fix unaligned access
- vc2enc: fix use of uninitialized variables in the rate control system, correctly zero out coefficient array padding
- aacenc: optimize encoding speed
- avcodec/diracdec: check bitstream size related fields for overflows
- avcodec/h264_slice: Check PPS more extensively when its not copied
version 3.0:
@ -70,6 +130,8 @@ version 3.0:
- streamselect video and astreamselect audio filter
- swaprect filter
- metadata video and ametadata audio filter
- SMPTE VC-2 HQ profile support for the Dirac decoder
- SMPTE VC-2 native encoder supporting the HQ profile
version 2.8:

View File

@ -564,6 +564,7 @@ Windows ICL Matthew Oliver
ADI/Blackfin DSP Marc Hoffman
Sparc Roman Shaposhnik
x86 Michael Niedermayer
OS/2 KO Myung-Hun
Releases

View File

@ -1 +1 @@
2.8.git
3.0.2

15
RELEASE_NOTES Normal file
View File

@ -0,0 +1,15 @@
┌─────────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 3.0 "Einstein" │
└─────────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 3.0 "Einstein", about 5
months after the release of FFmpeg 2.8.
A complete Changelog is available at the root of the project, and the
complete Git history on http://source.ffmpeg.org.
We hope you will like this release as much as we enjoyed working on it, and
as usual, if you have any questions about it, or any FFmpeg related topic,
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
on the mailing-lists.

186
configure vendored
View File

@ -913,6 +913,25 @@ void foo(void){ __asm__ volatile($code); }
EOF
}
check_inline_asm_flags(){
log check_inline_asm_flags "$@"
name="$1"
code="$2"
flags=''
shift 2
while [ "$1" != "" ]; do
append flags $1
shift
done;
disable $name
cat > $TMPC <<EOF
void foo(void){ __asm__ volatile($code); }
EOF
log_file $TMPC
check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
}
check_insn(){
log check_insn "$@"
check_inline_asm ${1}_inline "\"$2\""
@ -1657,6 +1676,7 @@ ARCH_EXT_LIST_ARM="
ARCH_EXT_LIST_MIPS="
mipsfpu
mips32r2
mips32r5
mips64r2
mips32r6
mips64r6
@ -2150,10 +2170,11 @@ mipsfpu_deps="mips"
mipsdsp_deps="mips"
mipsdspr2_deps="mips"
mips32r2_deps="mips"
mips32r5_deps="mips"
mips32r6_deps="mips"
mips64r2_deps="mips"
mips64r6_deps="mips"
msa_deps="mips"
msa_deps="mipsfpu"
mmi_deps="mips"
altivec_deps="ppc"
@ -4153,82 +4174,27 @@ elif enabled mips; then
cpuflags="-march=$cpu"
case $cpu in
24kc)
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsfpu
disable mipsdsp
disable mipsdspr2
disable msa
;;
24kf*)
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsdsp
disable mipsdspr2
disable msa
;;
24kec|34kc|1004kc)
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsfpu
disable mipsdspr2
disable msa
;;
24kef*|34kf*|1004kf*)
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsdspr2
disable msa
;;
74kc)
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsfpu
disable msa
;;
74kf)
disable mips32r6
disable mips64r2
disable mips64r6
disable msa
;;
p5600)
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsdsp
disable mipsdspr2
check_cflags "-mtune=p5600" &&
check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
add_asflags "-mfp64"
;;
i6400)
if [ "$cpu" != "generic" ]; then
disable mips32r2
disable mips32r6
disable mips32r5
disable mips64r2
disable mips32r6
disable mips64r6
disable loongson2
disable loongson3
case $cpu in
24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
enable mips32r2
disable msa
;;
p5600|i6400)
disable mipsdsp
disable mipsdspr2
check_cflags "-mtune=i6400 -mabi=64" &&
check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
check_ldflags "-mabi=64" &&
add_asflags "-mfp64"
;;
loongson*)
disable mips32r2
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsfpu
disable mipsdsp
disable mipsdspr2
disable msa
enable loongson2
enable loongson3
enable local_aligned_8 local_aligned_16 local_aligned_32
enable simd_align_16
enable fast_64bit
@ -4248,24 +4214,51 @@ elif enabled mips; then
;;
esac
;;
generic)
disable mips64r6
disable msa
;;
*)
# Unknown CPU. Disable everything.
warn "unknown CPU. Disabling all MIPS optimizations."
disable mipsfpu
disable mips32r2
disable mips32r6
disable mips64r2
disable mips64r6
disable mipsdsp
disable mipsdspr2
disable msa
disable mmi
;;
esac
case $cpu in
24kc)
disable mipsfpu
disable mipsdsp
disable mipsdspr2
;;
24kf*)
disable mipsdsp
disable mipsdspr2
;;
24kec|34kc|1004kc)
disable mipsfpu
disable mipsdspr2
;;
24kef*|34kf*|1004kf*)
disable mipsdspr2
;;
74kc)
disable mipsfpu
;;
p5600)
enable mips32r5
check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
;;
i6400)
enable mips64r6
check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
;;
esac
else
# We do not disable anything. Is up to the user to disable the unwanted features.
warn 'generic cpu selected'
fi
elif enabled ppc; then
disable ldbrx
@ -5073,27 +5066,22 @@ elif enabled mips; then
enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
# Enable minimum ISA based on selected options
if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
add_cflags "-mips64r2"
add_asflags "-mips64r2"
elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled loongson3; then
add_cflags "-mips64"
add_asflags "-mips64"
elif enabled mipsdsp || enabled mipsdspr2; then
add_cflags "-mips32r2 -mfp32"
add_asflags "-mips32r2 -mfp32"
if enabled mips64; then
enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
else
enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
fi
enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
enabled msa && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
check_inline_asm msa '"addvi.b $w0, $w1, 1"'
enabled msa && add_asflags "-mmsa"
enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa
enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
elif enabled parisc; then
@ -5659,7 +5647,7 @@ disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreF
enable securetransport; }
disabled schannel || { check_func_headers "windows.h Security.h" InitializeSecurityContext -DSECURITY_WIN32 -lSecur32 &&
enable schannel && add_extralibs -lSecur32; }
check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lSecur32; }
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
enabled makeinfo \

View File

@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 3.0.2
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55

View File

@ -104,7 +104,7 @@ All subsequent file-related directives apply to that file.
@item @code{ffconcat version 1.0}
Identify the script type and version. It also sets the @option{safe} option
to 1 if it was to its default -1.
to 1 if it was -1.
To make FFmpeg recognize the format automatically, this directive must
appears exactly as is (no extra space or byte-order-mark) on the very first
@ -192,7 +192,9 @@ component.
If set to 0, any file name is accepted.
The default is -1, it is equivalent to 1 if the format was automatically
The default is 1.
-1 is equivalent to 1 if the format was automatically
probed and 0 otherwise.
@item auto_convert

View File

@ -869,7 +869,7 @@ Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
Return the maximum between @var{x} and @var{y}.
@item min(x, y)
Return the maximum between @var{x} and @var{y}.
Return the minimum between @var{x} and @var{y}.
@item mod(x, y)
Compute the remainder of division of @var{x} by @var{y}.

View File

@ -373,8 +373,8 @@ static void ffm_set_write_index(AVFormatContext *s, int64_t pos,
int64_t file_size)
{
av_opt_set_int(s, "server_attached", 1, AV_OPT_SEARCH_CHILDREN);
av_opt_set_int(s, "write_index", pos, AV_OPT_SEARCH_CHILDREN);
av_opt_set_int(s, "file_size", file_size, AV_OPT_SEARCH_CHILDREN);
av_opt_set_int(s, "ffm_write_index", pos, AV_OPT_SEARCH_CHILDREN);
av_opt_set_int(s, "ffm_file_size", file_size, AV_OPT_SEARCH_CHILDREN);
}
static char *ctime1(char *buf2, size_t buf_size)

View File

@ -28,6 +28,7 @@
#ifndef AVCODEC_AACENC_UTILS_H
#define AVCODEC_AACENC_UTILS_H
#include "libavutil/internal.h"
#include "aac.h"
#include "aacenctab.h"
#include "aactab.h"
@ -66,13 +67,13 @@ static inline void quantize_bands(int *out, const float *in, const float *scaled
const float rounding)
{
int i;
double qc;
for (i = 0; i < size; i++) {
qc = scaled[i] * Q34;
out[i] = (int)FFMIN(qc + rounding, (double)maxval);
float qc = scaled[i] * Q34;
int tmp = (int)FFMIN(qc + rounding, (float)maxval);
if (is_signed && in[i] < 0.0f) {
out[i] = -out[i];
tmp = -tmp;
}
out[i] = tmp;
}
}
@ -90,8 +91,7 @@ static inline float find_max_val(int group_len, int swb_size, const float *scale
static inline int find_min_book(float maxval, int sf)
{
float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
float Q34 = sqrtf(Q * sqrtf(Q));
float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
int qmaxval, cb;
qmaxval = maxval * Q34 + C_QUANT;
if (qmaxval >= (FF_ARRAY_ELEMS(aac_maxval_cb)))
@ -123,7 +123,10 @@ static inline float find_form_factor(int group_len, int swb_size, float thresh,
if (s >= ethresh) {
nzl += 1.0f;
} else {
nzl += powf(s / ethresh, nzslope);
if (nzslope == 2.f)
nzl += (s / ethresh) * (s / ethresh);
else
nzl += ff_fast_powf(s / ethresh, nzslope);
}
}
if (e2 > thresh) {

View File

@ -895,13 +895,15 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
ff_eac3_default_spx_band_struct,
&s->num_spx_bands,
s->spx_band_sizes);
} else {
}
}
if (!s->eac3 || !s->spx_in_use) {
s->spx_in_use = 0;
for (ch = 1; ch <= fbw_channels; ch++) {
s->channel_uses_spx[ch] = 0;
s->first_spx_coords[ch] = 1;
}
}
}
/* spectral extension coordinates */
if (s->spx_in_use) {

View File

@ -1372,7 +1372,7 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
int32_t *decoded0 = ctx->decoded[0];
int32_t *decoded1 = ctx->decoded[1];
if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
if ((ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) == APE_FRAMECODE_STEREO_SILENCE) {
/* We are pure silence, so we're done. */
av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n");
return;

View File

@ -401,10 +401,12 @@ int av_packet_split_side_data(AVPacket *pkt){
p = pkt->data + pkt->size - 8 - 5;
for (i=1; ; i++){
size = AV_RB32(p);
if (size>INT_MAX || p - pkt->data < size)
if (size>INT_MAX - 5 || p - pkt->data < size)
return 0;
if (p[4]&128)
break;
if (p - pkt->data < size + 5)
return 0;
p-= size+5;
}
@ -415,7 +417,7 @@ int av_packet_split_side_data(AVPacket *pkt){
p= pkt->data + pkt->size - 8 - 5;
for (i=0; ; i++){
size= AV_RB32(p);
av_assert0(size<=INT_MAX && p - pkt->data >= size);
av_assert0(size<=INT_MAX - 5 && p - pkt->data >= size);
pkt->side_data[i].data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
pkt->side_data[i].size = size;
pkt->side_data[i].type = p[4]&127;

View File

@ -63,7 +63,7 @@ restart:
continue;
}
bpc->pc.frame_start_found++;
bpc->remaining_size = bpc->fsize + i - 17;
bpc->remaining_size = bpc->fsize + FFMAX(i - 17, 0);
if (bpc->pc.index + i > 17) {
next = i - 17;

View File

@ -756,6 +756,6 @@ AVCodec ff_cfhd_decoder = {
.init = cfhd_decode_init,
.close = cfhd_close_decoder,
.decode = cfhd_decode,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};

View File

@ -1760,6 +1760,7 @@ static int parse_x96_frame_exss(DCACoreDecoder *s)
return ret;
// Channel set data
s->x96_nchannels = 0;
for (i = 0, x96_base_ch = 0; i < x96_nchsets; i++) {
header_pos = get_bits_count(&s->gb);

View File

@ -173,7 +173,7 @@ typedef struct DiracContext {
struct {
unsigned prefix_bytes;
unsigned size_scaler;
uint64_t size_scaler;
} highquality;
struct {
@ -826,9 +826,15 @@ static int decode_hq_slice(AVCodecContext *avctx, void *arg)
/* Luma + 2 Chroma planes */
for (i = 0; i < 3; i++) {
int length = s->highquality.size_scaler * get_bits(gb, 8);
int bits_left = 8 * length;
int bits_end = get_bits_count(gb) + bits_left;
int64_t length = s->highquality.size_scaler * get_bits(gb, 8);
int64_t bits_left = 8 * length;
int64_t bits_end = get_bits_count(gb) + bits_left;
if (bits_end >= INT_MAX) {
av_log(s->avctx, AV_LOG_ERROR, "end too far away\n");
return AVERROR_INVALIDDATA;
}
for (level = 0; level < s->wavelet_depth; level++) {
for (orientation = !!level; orientation < 4; orientation++) {
decode_subband(s, gb, quants[level][orientation], slice->slice_x, slice->slice_y, bits_end,
@ -848,7 +854,8 @@ static int decode_hq_slice(AVCodecContext *avctx, void *arg)
static int decode_lowdelay(DiracContext *s)
{
AVCodecContext *avctx = s->avctx;
int slice_x, slice_y, bytes = 0, bufsize;
int slice_x, slice_y, bufsize;
int64_t bytes = 0;
const uint8_t *buf;
DiracSlice *slices;
int slice_num = 0;
@ -872,6 +879,11 @@ static int decode_lowdelay(DiracContext *s)
if (bytes <= bufsize/8)
bytes += buf[bytes] * s->highquality.size_scaler + 1;
}
if (bytes >= INT_MAX) {
av_log(s->avctx, AV_LOG_ERROR, "too many bytes\n");
av_free(slices);
return AVERROR_INVALIDDATA;
}
slices[slice_num].bytes = bytes;
slices[slice_num].slice_x = slice_x;
@ -1151,6 +1163,10 @@ static int dirac_unpack_idwt_params(DiracContext *s)
} else if (s->hq_picture) {
s->highquality.prefix_bytes = svq3_get_ue_golomb(gb);
s->highquality.size_scaler = svq3_get_ue_golomb(gb);
if (s->highquality.prefix_bytes >= INT_MAX / 8) {
av_log(s->avctx,AV_LOG_ERROR,"too many prefix bytes\n");
return AVERROR_INVALIDDATA;
}
}
/* [DIRAC_STD] 11.3.5 Quantisation matrices (low-delay syntax). quant_matrix() */

View File

@ -1678,6 +1678,47 @@ again:
ret = 0;
end:
#if CONFIG_ERROR_RESILIENCE
sl = h->slice_ctx;
/*
* FIXME: Error handling code does not seem to support interlaced
* when slices span multiple rows
* The ff_er_add_slice calls don't work right for bottom
* fields; they cause massive erroneous error concealing
* Error marking covers both fields (top and bottom).
* This causes a mismatched s->error_count
* and a bad error table. Further, the error count goes to
* INT_MAX when called for bottom field, because mb_y is
* past end by one (callers fault) and resync_mb_y != 0
* causes problems for the first MB line, too.
*/
if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) {
int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0];
ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
if (use_last_pic) {
ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
sl->ref_list[0][0].parent = &h->last_pic_for_ec;
memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data));
memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize));
sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
} else if (sl->ref_count[0]) {
ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);
} else
ff_h264_set_erpic(&sl->er.last_pic, NULL);
if (sl->ref_count[1])
ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent);
sl->er.ref_count = sl->ref_count[0];
ff_er_frame_end(&sl->er);
if (use_last_pic)
memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));
}
#endif /* CONFIG_ERROR_RESILIENCE */
/* clean up */
if (h->cur_pic_ptr && !h->droppable) {
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
@ -1740,7 +1781,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
const uint8_t *p= buf+6;
while(cnt--){
int nalsize= AV_RB16(p) + 2;
if(nalsize > buf_size - (p-buf) || p[2]!=0x67)
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 7)
return 0;
p += nalsize;
}
@ -1749,7 +1790,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
return 0;
while(cnt--){
int nalsize= AV_RB16(p) + 2;
if(nalsize > buf_size - (p-buf) || p[2]!=0x68)
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 8)
return 0;
p += nalsize;
}

View File

@ -186,47 +186,6 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
ff_vdpau_h264_picture_complete(h);
#endif
#if CONFIG_ERROR_RESILIENCE
av_assert0(sl == h->slice_ctx);
/*
* FIXME: Error handling code does not seem to support interlaced
* when slices span multiple rows
* The ff_er_add_slice calls don't work right for bottom
* fields; they cause massive erroneous error concealing
* Error marking covers both fields (top and bottom).
* This causes a mismatched s->error_count
* and a bad error table. Further, the error count goes to
* INT_MAX when called for bottom field, because mb_y is
* past end by one (callers fault) and resync_mb_y != 0
* causes problems for the first MB line, too.
*/
if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) {
int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0];
ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
if (use_last_pic) {
ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
sl->ref_list[0][0].parent = &h->last_pic_for_ec;
memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data));
memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize));
sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
} else if (sl->ref_count[0]) {
ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);
} else
ff_h264_set_erpic(&sl->er.last_pic, NULL);
if (sl->ref_count[1])
ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent);
sl->er.ref_count = sl->ref_count[0];
ff_er_frame_end(&sl->er);
if (use_last_pic)
memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));
}
#endif /* CONFIG_ERROR_RESILIENCE */
if (!in_setup && !h->droppable)
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
h->picture_structure == PICT_BOTTOM_FIELD);

View File

@ -1282,10 +1282,14 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
if (first_slice) {
h->pps = *h->pps_buffers[pps_id];
} else if (h->setup_finished && h->dequant_coeff_pps != pps_id) {
} else {
if (h->pps.sps_id != pps->sps_id ||
h->pps.transform_8x8_mode != pps->transform_8x8_mode ||
(h->setup_finished && h->dequant_coeff_pps != pps_id)) {
av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
return AVERROR_INVALIDDATA;
}
}
if (pps->sps_id != h->sps.sps_id ||
pps->sps_id != h->current_sps_id ||

View File

@ -232,10 +232,16 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
++buf;
--length;
if (length < 4) {
if (pkt->nb_nals > 0) {
// No more start codes: we discarded some irrelevant
// bytes at the end of the packet.
return 0;
} else {
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
return AVERROR_INVALIDDATA;
}
}
}
buf += 3;
length -= 3;

View File

@ -146,6 +146,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
AVFrame *picture = data;
AVFrame * const p = s->picture;
int start, ret;
int ltab, ctab;
if ((ret = ff_reget_buffer(avctx, p)) < 0)
return ret;
@ -168,34 +169,36 @@ static int ir2_decode_frame(AVCodecContext *avctx,
if ((ret = init_get_bits8(&s->gb, buf + start, buf_size - start)) < 0)
return ret;
ltab = buf[0x22] & 3;
ctab = buf[0x22] >> 2;
if (s->decode_delta) { /* intraframe */
if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
p->data[0], p->linesize[0],
ir2_luma_table)) < 0)
ir2_delta_table[ltab])) < 0)
return ret;
/* swapped U and V */
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
p->data[2], p->linesize[2],
ir2_luma_table)) < 0)
ir2_delta_table[ctab])) < 0)
return ret;
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
p->data[1], p->linesize[1],
ir2_luma_table)) < 0)
ir2_delta_table[ctab])) < 0)
return ret;
} else { /* interframe */
if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height,
p->data[0], p->linesize[0],
ir2_luma_table)) < 0)
ir2_delta_table[ltab])) < 0)
return ret;
/* swapped U and V */
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
p->data[2], p->linesize[2],
ir2_luma_table)) < 0)
ir2_delta_table[ctab])) < 0)
return ret;
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
p->data[1], p->linesize[1],
ir2_luma_table)) < 0)
ir2_delta_table[ctab])) < 0)
return ret;
}

View File

@ -99,12 +99,12 @@ static const uint16_t ir2_codes[IR2_CODES][2] = {
{ 0x0011, 5 }, { 0x0014, 5 }, { 0x0015, 5 }, { 0x0030, 6 },
{ 0x0037, 6 }, { 0x00E2, 8 }, { 0x00E3, 8 }, { 0x00E8, 8 },
{ 0x00EB, 8 }, { 0x00EE, 8 }, { 0x01E1, 9 }, { 0x01E4, 9 },
{0x01E7, 9}, {0x01EA, 9}, {0x01ED, 9}
{ 0x01E7, 9 }, { 0x01EA, 9 }, { 0x01ED, 9 },
#endif
};
static const uint8_t ir2_luma_table[256] = {
0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
static const uint8_t ir2_delta_table[4][256] = {
{ 0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
@ -135,7 +135,103 @@ static const uint8_t ir2_luma_table[256] = {
0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80, },
{ 0x80, 0x80, 0x85, 0x85, 0x7B, 0x7B, 0x7E, 0x87,
0x82, 0x79, 0x87, 0x7E, 0x79, 0x82, 0x8F, 0x8F,
0x71, 0x71, 0x84, 0x8F, 0x7C, 0x71, 0x8F, 0x84,
0x71, 0x7C, 0x75, 0x8B, 0x8B, 0x75, 0x8B, 0x75,
0x75, 0x8B, 0x8E, 0x9A, 0x72, 0x66, 0x9A, 0x8E,
0x66, 0x72, 0x7B, 0x93, 0x85, 0x6D, 0x93, 0x7B,
0x6D, 0x85, 0x9B, 0x9B, 0x65, 0x65, 0x82, 0x9D,
0x7E, 0x63, 0x9D, 0x82, 0x63, 0x7E, 0x9B, 0xA8,
0x65, 0x58, 0xA8, 0x9B, 0x58, 0x65, 0xA9, 0xA9,
0x57, 0x57, 0x8D, 0xAA, 0x73, 0x56, 0xAA, 0x8D,
0x56, 0x73, 0x6E, 0x99, 0x92, 0x67, 0x99, 0x6E,
0x67, 0x92, 0x76, 0xA2, 0x8A, 0x5E, 0xA2, 0x76,
0x5E, 0x8A, 0x7F, 0xAF, 0x81, 0x51, 0xAF, 0x7F,
0x51, 0x81, 0xAB, 0xBA, 0x55, 0x46, 0xBA, 0xAB,
0x46, 0x55, 0x9A, 0xBB, 0x66, 0x45, 0xBB, 0x9A,
0x45, 0x66, 0xBB, 0xBB, 0x45, 0x45, 0x60, 0xA0,
0xA0, 0x60, 0xA0, 0x60, 0x60, 0xA0, 0x8B, 0xBE,
0x75, 0x42, 0xBE, 0x8B, 0x42, 0x75, 0x66, 0xAA,
0x9A, 0x56, 0xAA, 0x66, 0x56, 0x9A, 0x70, 0xB5,
0x90, 0x4B, 0xB5, 0x70, 0x4B, 0x90, 0xBE, 0xCF,
0x42, 0x31, 0xCF, 0xBE, 0x31, 0x42, 0xAB, 0xD0,
0x55, 0x30, 0xD0, 0xAB, 0x30, 0x55, 0xD1, 0xD1,
0x2F, 0x2F, 0x9A, 0xD3, 0x66, 0x2D, 0xD3, 0x9A,
0x2D, 0x66, 0x7B, 0xC5, 0x85, 0x3B, 0xC5, 0x7B,
0x3B, 0x85, 0x54, 0xB4, 0xAC, 0x4C, 0xB4, 0x54,
0x4C, 0xAC, 0x5E, 0xBE, 0xA2, 0x42, 0xBE, 0x5E,
0x42, 0xA2, 0x87, 0xD8, 0x79, 0x28, 0xD8, 0x87,
0x28, 0x79, 0xC0, 0xE8, 0x40, 0x18, 0xE8, 0xC0,
0x18, 0x40, 0xD5, 0xE8, 0x2B, 0x18, 0xE8, 0xD5,
0x18, 0x2B, 0xAB, 0xE9, 0x55, 0x17, 0xE9, 0xAB,
0x17, 0x55, 0x68, 0xCD, 0x98, 0x33, 0xCD, 0x68,
0x33, 0x98, 0xEA, 0xEA, 0x16, 0x16, 0x80, 0x80, },
{ 0x80, 0x80, 0x86, 0x86, 0x7A, 0x7A, 0x7E, 0x88,
0x82, 0x78, 0x88, 0x7E, 0x78, 0x82, 0x92, 0x92,
0x6E, 0x6E, 0x85, 0x92, 0x7B, 0x6E, 0x92, 0x85,
0x6E, 0x7B, 0x73, 0x8D, 0x8D, 0x73, 0x8D, 0x73,
0x73, 0x8D, 0x91, 0x9E, 0x6F, 0x62, 0x9E, 0x91,
0x62, 0x6F, 0x79, 0x97, 0x87, 0x69, 0x97, 0x79,
0x69, 0x87, 0xA0, 0xA0, 0x60, 0x60, 0x83, 0xA2,
0x7D, 0x5E, 0xA2, 0x83, 0x5E, 0x7D, 0xA0, 0xB0,
0x60, 0x50, 0xB0, 0xA0, 0x50, 0x60, 0xB1, 0xB1,
0x4F, 0x4F, 0x8F, 0xB2, 0x71, 0x4E, 0xB2, 0x8F,
0x4E, 0x71, 0x6B, 0x9E, 0x95, 0x62, 0x9E, 0x6B,
0x62, 0x95, 0x74, 0xA9, 0x8C, 0x57, 0xA9, 0x74,
0x57, 0x8C, 0x7F, 0xB8, 0x81, 0x48, 0xB8, 0x7F,
0x48, 0x81, 0xB4, 0xC5, 0x4C, 0x3B, 0xC5, 0xB4,
0x3B, 0x4C, 0x9F, 0xC6, 0x61, 0x3A, 0xC6, 0x9F,
0x3A, 0x61, 0xC6, 0xC6, 0x3A, 0x3A, 0x59, 0xA7,
0xA7, 0x59, 0xA7, 0x59, 0x59, 0xA7, 0x8D, 0xCA,
0x73, 0x36, 0xCA, 0x8D, 0x36, 0x73, 0x61, 0xB2,
0x9F, 0x4E, 0xB2, 0x61, 0x4E, 0x9F, 0x6D, 0xBF,
0x93, 0x41, 0xBF, 0x6D, 0x41, 0x93, 0xCA, 0xDF,
0x36, 0x21, 0xDF, 0xCA, 0x21, 0x36, 0xB3, 0xDF,
0x4D, 0x21, 0xDF, 0xB3, 0x21, 0x4D, 0xE1, 0xE1,
0x1F, 0x1F, 0x9F, 0xE3, 0x61, 0x1D, 0xE3, 0x9F,
0x1D, 0x61, 0x7A, 0xD3, 0x86, 0x2D, 0xD3, 0x7A,
0x2D, 0x86, 0x4C, 0xBE, 0xB4, 0x42, 0xBE, 0x4C,
0x42, 0xB4, 0x57, 0xCA, 0xA9, 0x36, 0xCA, 0x57,
0x36, 0xA9, 0x88, 0xE9, 0x78, 0x17, 0xE9, 0x88,
0x17, 0x78, 0xCC, 0xFB, 0x34, 0x05, 0xFB, 0xCC,
0x05, 0x34, 0xE6, 0xFB, 0x1A, 0x05, 0xFB, 0xE6,
0x05, 0x1A, 0xB4, 0xFD, 0x4C, 0x03, 0xFD, 0xB4,
0x03, 0x4C, 0x63, 0xDC, 0x9D, 0x24, 0xDC, 0x63,
0x24, 0x9D, 0xFE, 0xFE, 0x02, 0x02, 0x80, 0x80, },
{ 0x80, 0x80, 0x87, 0x87, 0x79, 0x79, 0x7E, 0x89,
0x82, 0x77, 0x89, 0x7E, 0x77, 0x82, 0x95, 0x95,
0x6B, 0x6B, 0x86, 0x96, 0x7A, 0x6A, 0x96, 0x86,
0x6A, 0x7A, 0x70, 0x90, 0x90, 0x70, 0x90, 0x70,
0x70, 0x90, 0x94, 0xA4, 0x6C, 0x5C, 0xA4, 0x94,
0x5C, 0x6C, 0x78, 0x9B, 0x88, 0x65, 0x9B, 0x78,
0x65, 0x88, 0xA6, 0xA6, 0x5A, 0x5A, 0x83, 0xA9,
0x7D, 0x57, 0xA9, 0x83, 0x57, 0x7D, 0xA6, 0xB9,
0x5A, 0x47, 0xB9, 0xA6, 0x47, 0x5A, 0xBA, 0xBA,
0x46, 0x46, 0x92, 0xBC, 0x6E, 0x44, 0xBC, 0x92,
0x44, 0x6E, 0x67, 0xA3, 0x99, 0x5D, 0xA3, 0x67,
0x5D, 0x99, 0x72, 0xB0, 0x8E, 0x50, 0xB0, 0x72,
0x50, 0x8E, 0x7F, 0xC3, 0x81, 0x3D, 0xC3, 0x7F,
0x3D, 0x81, 0xBE, 0xD2, 0x42, 0x2E, 0xD2, 0xBE,
0x2E, 0x42, 0xA5, 0xD4, 0x5B, 0x2C, 0xD4, 0xA5,
0x2C, 0x5B, 0xD4, 0xD4, 0x2C, 0x2C, 0x52, 0xAE,
0xAE, 0x52, 0xAE, 0x52, 0x52, 0xAE, 0x8F, 0xD8,
0x71, 0x28, 0xD8, 0x8F, 0x28, 0x71, 0x5B, 0xBB,
0xA5, 0x45, 0xBB, 0x5B, 0x45, 0xA5, 0x69, 0xCB,
0x97, 0x35, 0xCB, 0x69, 0x35, 0x97, 0xD8, 0xF0,
0x28, 0x10, 0xF0, 0xD8, 0x10, 0x28, 0xBD, 0xF1,
0x43, 0x0F, 0xF1, 0xBD, 0x0F, 0x43, 0xF3, 0xF3,
0x0D, 0x0D, 0xA5, 0xF6, 0x5B, 0x0A, 0xF6, 0xA5,
0x0A, 0x5B, 0x78, 0xE2, 0x88, 0x1E, 0xE2, 0x78,
0x1E, 0x88, 0x42, 0xC9, 0xBE, 0x37, 0xC9, 0x42,
0x37, 0xBE, 0x4F, 0xD8, 0xB1, 0x28, 0xD8, 0x4F,
0x28, 0xB1, 0x8A, 0xFD, 0x76, 0x03, 0xFD, 0x8A,
0x03, 0x76, 0xDB, 0xFF, 0x25, 0x01, 0xFF, 0xDB,
0x01, 0x25, 0xF9, 0xFF, 0x07, 0x01, 0xFF, 0xF9,
0x01, 0x07, 0xBE, 0xFF, 0x42, 0x01, 0xFF, 0xBE,
0x01, 0x42, 0x5E, 0xED, 0xA2, 0x13, 0xED, 0x5E,
0x13, 0xA2, 0xFF, 0xFF, 0x01, 0x01, 0x80, 0x80, },
};
#endif /* AVCODEC_INDEO2DATA_H */

View File

@ -17,8 +17,46 @@
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* **********************************************************************************************************************
*
*
*
* This source code incorporates work covered by the following copyright and
* permission notice:
*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* JPEG2000 image encoder
* @file

View File

@ -222,9 +222,19 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data,
pic->data[0] = utv->buffer + utv->buf_size + pic->linesize[0];
break;
}
pic->width = w;
pic->height = h;
pic->format = avctx->pix_fmt;
if (avctx->refcounted_frames) {
int ret = av_frame_ref((AVFrame*)data, pic);
if (ret < 0)
return ret;
} else {
av_frame_move_ref((AVFrame*)data, pic);
}
*got_frame = 1;
av_frame_move_ref((AVFrame*)data, pic);
return avpkt->size;
}

View File

@ -41,8 +41,9 @@ static av_cold int libwebp_anim_encode_init(AVCodecContext *avctx)
int ret = ff_libwebp_encode_init_common(avctx);
if (!ret) {
LibWebPAnimContext *s = avctx->priv_data;
WebPAnimEncoderOptions enc_options;
WebPAnimEncoderOptions enc_options = { 0 };
WebPAnimEncoderOptionsInit(&enc_options);
enc_options.verbose = av_log_get_level() >= AV_LOG_VERBOSE;
// TODO(urvang): Expose some options on command-line perhaps.
s->enc = WebPAnimEncoderNew(avctx->width, avctx->height, &enc_options);
if (!s->enc)

View File

@ -66,6 +66,7 @@
#include "libavcodec/aacenc_utils.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
typedef struct BandCodingPath {
int prev_idx;
float cost;
@ -2477,10 +2478,12 @@ static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe)
#include "libavcodec/aaccoder_trellis.h"
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
void ff_aac_coder_init_mips(AACEncContext *c) {
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
AACCoefficientsEncoder *e = c->coder;
int option = c->options.coder;
@ -2494,5 +2497,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
#if HAVE_MIPSFPU
e->search_for_ms = search_for_ms_mips;
#endif /* HAVE_MIPSFPU */
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
}

View File

@ -61,6 +61,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
{
@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float *v, unsigned idx,
#define VMUL4 VMUL4_mips
#define VMUL2S VMUL2S_mips
#define VMUL4S VMUL4S_mips
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
#endif /* AVCODEC_MIPS_AACDEC_MIPS_H */

View File

@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float out[2][38][64],
}
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
{
int i;
@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float (*r)[2],
: "memory"
);
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
s->add_squares = ps_add_squares_mips;
s->mul_pair_single = ps_mul_pair_single_mips;
s->decorrelate = ps_decorrelate_mips;
s->stereo_interpolate[0] = ps_stereo_interpolate_mips;
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
}

View File

@ -59,6 +59,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM && HAVE_MIPSFPU && ( PSY_LAME_FIR_LEN == 21 )
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void calc_thr_3gpp_mips(const FFPsyWindowInfo *wi, const int num_bands,
AacPsyChannel *pch, const uint8_t *band_sizes,
const float *coefs, const int cutoff)
@ -232,5 +233,6 @@ static void psy_hp_filter_mips(const float *firbuf, float *hpfsmpl, const float
#define calc_thr_3gpp calc_thr_3gpp_mips
#define psy_hp_filter psy_hp_filter_mips
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
#endif /* AVCODEC_MIPS_AACPSY_MIPS_H */

View File

@ -311,6 +311,7 @@ static int sbr_x_gen_mips(SpectralBandReplication *sbr, float X[2][38][64],
}
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void sbr_hf_assemble_mips(float Y1[38][64][2],
const float X_high[64][40][2],
SpectralBandReplication *sbr, SBRData *ch_data,
@ -603,6 +604,7 @@ static void sbr_hf_inverse_filter_mips(SBRDSPContext *dsp,
}
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
@ -612,8 +614,10 @@ void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c)
c->sbr_lf_gen = sbr_lf_gen_mips;
c->sbr_x_gen = sbr_x_gen_mips;
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
c->sbr_hf_inverse_filter = sbr_hf_inverse_filter_mips;
c->sbr_hf_assemble = sbr_hf_assemble_mips;
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
}

View File

@ -150,6 +150,7 @@ static void sbr_qmf_analysis_mips(AVFloatDSPContext *fdsp, FFTContext *mdct,
}
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void sbr_qmf_synthesis_mips(FFTContext *mdct,
SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp,
float *out, float X[2][38][64],
@ -488,6 +489,7 @@ static void sbr_qmf_synthesis_mips(FFTContext *mdct,
#define sbr_qmf_analysis sbr_qmf_analysis_mips
#define sbr_qmf_synthesis sbr_qmf_synthesis_mips
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */

View File

@ -201,6 +201,7 @@ static void ac3_update_bap_counts_mips(uint16_t mant_cnt[16], uint8_t *bap,
#endif
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void float_to_fixed24_mips(int32_t *dst, const float *src, unsigned int len)
{
const float scale = 1 << 24;
@ -395,7 +396,8 @@ static void ac3_downmix_mips(float **samples, float (*matrix)[2],
:"memory"
);
}
#endif
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact) {
@ -405,9 +407,11 @@ void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact) {
c->update_bap_counts = ac3_update_bap_counts_mips;
#endif
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
c->float_to_fixed24 = float_to_fixed24_mips;
c->downmix = ac3_downmix_mips;
#endif
#endif
#endif
}

View File

@ -57,6 +57,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void ff_acelp_interpolatef_mips(float *out, const float *in,
const float *filter_coeffs, int precision,
int frac_pos, int filter_length, int length)
@ -206,12 +207,15 @@ static void ff_acelp_apply_order_2_transfer_function_mips(float *out, const floa
"$f12", "$f13", "$f14", "$f15", "$f16", "memory"
);
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
void ff_acelp_filter_init_mips(ACELPFContext *c)
{
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
c->acelp_interpolatef = ff_acelp_interpolatef_mips;
c->acelp_apply_order_2_transfer_function = ff_acelp_apply_order_2_transfer_function_mips;
#endif
#endif
}

View File

@ -57,6 +57,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void ff_weighted_vector_sumf_mips(
float *out, const float *in_a, const float *in_b,
float weight_coeff_a, float weight_coeff_b, int length)
@ -92,11 +93,14 @@ static void ff_weighted_vector_sumf_mips(
: "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "memory"
);
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
void ff_acelp_vectors_init_mips(ACELPVContext *c)
{
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
c->weighted_vector_sumf = ff_weighted_vector_sumf_mips;
#endif
#endif
}

View File

@ -54,6 +54,7 @@
#include "amrwbdec_mips.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
void ff_hb_fir_filter_mips(float *out, const float fir_coef[HB_FIR_SIZE + 1],
float mem[HB_FIR_SIZE], const float *in)
{
@ -184,4 +185,5 @@ void ff_hb_fir_filter_mips(float *out, const float fir_coef[HB_FIR_SIZE + 1],
}
memcpy(mem, data + AMRWB_SFR_SIZE_16k, HB_FIR_SIZE * sizeof(float));
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */

View File

@ -54,9 +54,11 @@
#include "config.h"
#if HAVE_MIPSFPU && HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
void ff_hb_fir_filter_mips(float *out, const float fir_coef[],
float mem[], const float *in);
#define hb_fir_filter ff_hb_fir_filter_mips
#endif
#endif
#endif /* AVCODEC_MIPS_AMRWBDEC_MIPS_H */

View File

@ -58,6 +58,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void ff_celp_lp_synthesis_filterf_mips(float *out,
const float *filter_coeffs,
const float* in, int buffer_length,
@ -278,12 +279,15 @@ static void ff_celp_lp_zero_synthesis_filterf_mips(float *out,
out[n] = sum_out1;
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
void ff_celp_filter_init_mips(CELPFContext *c)
{
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
c->celp_lp_synthesis_filterf = ff_celp_lp_synthesis_filterf_mips;
c->celp_lp_zero_synthesis_filterf = ff_celp_lp_zero_synthesis_filterf_mips;
#endif
#endif
}

View File

@ -56,6 +56,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static float ff_dot_productf_mips(const float* a, const float* b,
int length)
{
@ -80,11 +81,14 @@ static float ff_dot_productf_mips(const float* a, const float* b,
);
return sum;
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
void ff_celp_math_init_mips(CELPMContext *c)
{
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
c->dot_productf = ff_dot_productf_mips;
#endif
#endif
}

View File

@ -58,6 +58,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void compute_antialias_mips_float(MPADecodeContext *s,
GranuleDef *g)
{
@ -179,6 +180,7 @@ static void compute_antialias_mips_float(MPADecodeContext *s,
);
}
#define compute_antialias compute_antialias_mips_float
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
#endif /* AVCODEC_MIPS_COMPUTE_ANTIALIAS_FLOAT_H */

View File

@ -57,6 +57,7 @@
*/
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void ff_fft_calc_mips(FFTContext *s, FFTComplex *z)
{
int nbits, i, n, num_transforms, offset, step;
@ -494,6 +495,7 @@ static void ff_imdct_calc_mips(FFTContext *s, FFTSample *output, const FFTSample
output[n-k-4] = output[n2+k+3];
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
av_cold void ff_fft_init_mips(FFTContext *s)
@ -504,10 +506,12 @@ av_cold void ff_fft_init_mips(FFTContext *s)
ff_init_ff_cos_tabs(16);
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
s->fft_calc = ff_fft_calc_mips;
#if CONFIG_MDCT
s->imdct_calc = ff_imdct_calc_mips;
s->imdct_half = ff_imdct_half_mips;
#endif
#endif
#endif
}

View File

@ -55,6 +55,7 @@
#include "libavcodec/iirfilter.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
typedef struct FFIIRFilterCoeffs {
int order;
float gain;
@ -195,10 +196,13 @@ static void ff_iir_filter_flt_mips(const struct FFIIRFilterCoeffs *c,
}
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
void ff_iir_filter_init_mips(FFIIRFilterContext *f) {
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
f->filter_flt = ff_iir_filter_flt_mips;
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
}

View File

@ -55,6 +55,7 @@
#define AVCODEC_MIPS_LSP_MIPS_H
#if HAVE_MIPSFPU && HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
#include "libavutil/mips/asmdefs.h"
static av_always_inline void ff_lsp2polyf_mips(const double *lsp, double *f, int lp_half_order)
@ -107,5 +108,6 @@ static av_always_inline void ff_lsp2polyf_mips(const double *lsp, double *f, int
}
}
#define ff_lsp2polyf ff_lsp2polyf_mips
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM */
#endif /* AVCODEC_MIPS_LSP_MIPS_H */

View File

@ -57,6 +57,9 @@
#include "libavutil/mips/asmdefs.h"
#include "libavcodec/mpegaudiodsp.h"
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void ff_mpadsp_apply_window_mips_fixed(int32_t *synth_buf, int32_t *window,
int *dither_state, int16_t *samples, int incr)
{
@ -901,8 +904,15 @@ static void ff_imdct36_blocks_mips_fixed(int *out, int *buf, int *in,
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM */
void ff_mpadsp_init_mipsdsp(MPADSPContext *s)
{
#if HAVE_INLINE_ASM
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
s->apply_window_fixed = ff_mpadsp_apply_window_mips_fixed;
s->imdct36_blocks_fixed = ff_imdct36_blocks_mips_fixed;
#endif
#endif
}

View File

@ -58,6 +58,9 @@
#include "libavutil/mips/asmdefs.h"
#include "libavcodec/mpegaudiodsp.h"
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void ff_mpadsp_apply_window_mips_float(float *synth_buf, float *window,
int *dither_state, float *samples, int incr)
{
@ -1243,9 +1246,16 @@ static void ff_imdct36_blocks_mips_float(float *out, float *buf, float *in,
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
void ff_mpadsp_init_mipsfpu(MPADSPContext *s)
{
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
s->apply_window_float = ff_mpadsp_apply_window_mips_float;
s->imdct36_blocks_float = ff_imdct36_blocks_mips_float;
s->dct32_float = ff_dct32_mips_float;
#endif
#endif
}

View File

@ -166,6 +166,7 @@ static void sbr_qmf_post_shuffle_mips(float W[32][2], const float *z)
}
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void sbr_sum64x5_mips(float *z)
{
int k;
@ -882,6 +883,7 @@ static void sbr_hf_apply_noise_3_mips(float (*Y)[2], const float *s_m,
phi_sign = -phi_sign;
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
@ -891,6 +893,7 @@ void ff_sbrdsp_init_mips(SBRDSPContext *s)
s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_mips;
s->qmf_post_shuffle = sbr_qmf_post_shuffle_mips;
#if HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
s->sum64x5 = sbr_sum64x5_mips;
s->sum_square = sbr_sum_square_mips;
s->qmf_deint_bfly = sbr_qmf_deint_bfly_mips;
@ -902,6 +905,7 @@ void ff_sbrdsp_init_mips(SBRDSPContext *s)
s->hf_apply_noise[1] = sbr_hf_apply_noise_1_mips;
s->hf_apply_noise[2] = sbr_hf_apply_noise_2_mips;
s->hf_apply_noise[3] = sbr_hf_apply_noise_3_mips;
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_MIPSFPU */
#endif /* HAVE_INLINE_ASM */
}

View File

@ -1381,12 +1381,10 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
return AVERROR_INVALIDDATA;
}
if (!Al) {
// s->coefs_finished is a bitmask for coefficients coded
// ss and se are parameters telling start and end coefficients
s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
last_scan = !~s->coefs_finished[c];
}
last_scan = !Al && !~s->coefs_finished[c];
if (s->interlaced && s->bottom_field)
data += linesize >> 1;

View File

@ -122,6 +122,16 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
uint8_t *ptr;
if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
AVRational sar = avctx->sample_aspect_ratio;
if (sar.num > 65535 || sar.den > 65535) {
if (!av_reduce(&sar.num, &sar.den, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 65535))
av_log(avctx, AV_LOG_WARNING,
"Cannot store exact aspect ratio %d:%d\n",
avctx->sample_aspect_ratio.num,
avctx->sample_aspect_ratio.den);
}
/* JFIF header */
put_marker(p, APP0);
put_bits(p, 16, 16);
@ -131,8 +141,8 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
* released revision. */
put_bits(p, 16, 0x0102);
put_bits(p, 8, 0); /* units type: 0 - aspect ratio */
put_bits(p, 16, avctx->sample_aspect_ratio.num);
put_bits(p, 16, avctx->sample_aspect_ratio.den);
put_bits(p, 16, sar.num);
put_bits(p, 16, sar.den);
put_bits(p, 8, 0); /* thumbnail width */
put_bits(p, 8, 0); /* thumbnail height */
}

View File

@ -354,8 +354,14 @@ static int parse_palette_segment(AVCodecContext *avctx,
cb = bytestream_get_byte(&buf);
alpha = bytestream_get_byte(&buf);
YUV_TO_RGB1(cb, cr);
YUV_TO_RGB2(r, g, b, y);
/* Default to BT.709 colorimetry. In case of <= 576 height use BT.601 */
if (avctx->height <= 0 || avctx->height > 576) {
YUV_TO_RGB1_CCIR_BT709(cb, cr);
} else {
YUV_TO_RGB1_CCIR(cb, cr);
}
YUV_TO_RGB2_CCIR(r, g, b, y);
ff_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);

View File

@ -1136,6 +1136,7 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
case MKTAG('p', 'H', 'Y', 's'):
case MKTAG('t', 'E', 'X', 't'):
case MKTAG('I', 'D', 'A', 'T'):
case MKTAG('t', 'R', 'N', 'S'):
break;
default:
goto skip_tag;

View File

@ -291,12 +291,6 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
short *output_bak = NULL;
int lenout;
if (s->input_channels == s->output_channels && s->ratio == 1.0 && 0) {
/* nothing to do */
memcpy(output, input, nb_samples * s->input_channels * sizeof(short));
return nb_samples;
}
if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
int istride[1] = { s->sample_size[0] };
int ostride[1] = { 2 };

View File

@ -227,6 +227,7 @@ static void decode_lpc(int32_t *coeffs, int mode, int length)
int a3 = coeffs[2];
int a4 = a3 + a1;
int a5 = a4 + a2;
coeffs[2] = a5;
coeffs += 3;
for (i = 0; i < length - 3; i++) {
a3 += *coeffs;

View File

@ -114,9 +114,12 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
{
TTAEncContext *s = avctx->priv_data;
PutBitContext pb;
int ret, i, out_bytes, cur_chan = 0, res = 0, samples = 0;
int ret, i, out_bytes, cur_chan, res, samples;
int64_t pkt_size = frame->nb_samples * 2LL * avctx->channels * s->bps;
if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * avctx->channels * s->bps, 0)) < 0)
pkt_alloc:
cur_chan = 0, res = 0, samples = 0;
if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0)
return ret;
init_put_bits(&pb, avpkt->data, avpkt->size);
@ -174,6 +177,14 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
rice->k1++;
unary = 1 + (outval >> k);
if (unary + 100LL > put_bits_left(&pb)) {
if (pkt_size < INT_MAX/2) {
pkt_size *= 2;
av_packet_unref(avpkt);
goto pkt_alloc;
} else
return AVERROR(ENOMEM);
}
do {
if (unary > 31) {
put_bits(&pb, 31, 0x7FFFFFFF);

View File

@ -658,7 +658,8 @@ static int rate_control(AVCodecContext *avctx, void *arg)
VC2EncContext *s = slice_dat->ctx;
const int sx = slice_dat->x;
const int sy = slice_dat->y;
int quant_buf[2], bits_buf[2], quant = s->q_start, range = s->q_start/3;
int bits_last = INT_MAX, quant_buf[2] = {-1, -1};
int quant = s->q_start, range = s->q_start/3;
const int64_t top = slice_dat->bits_ceil;
const double percent = s->tolerance;
const double bottom = top - top*(percent/100.0f);
@ -670,14 +671,13 @@ static int rate_control(AVCodecContext *avctx, void *arg)
bits = count_hq_slice(s, sx, sy, quant);
range = av_clip(range/2, 1, s->q_ceil);
if (quant_buf[1] == quant) {
quant = bits_buf[0] < bits ? quant_buf[0] : quant;
bits = bits_buf[0] < bits ? bits_buf[0] : bits;
quant = bits_last < bits ? quant_buf[0] : quant;
bits = bits_last < bits ? bits_last : bits;
break;
}
quant_buf[1] = quant_buf[0];
quant_buf[0] = quant;
bits_buf[1] = bits_buf[0];
bits_buf[0] = bits;
bits_last = bits;
}
slice_dat->quant_idx = av_clip(quant, 0, s->q_ceil);
slice_dat->bytes = FFALIGN((bits >> 3), s->size_scaler) + 4 + s->prefix_bytes;
@ -867,7 +867,7 @@ static int dwt_plane(AVCodecContext *avctx, void *arg)
}
}
memset(buf, 0, (p->coef_stride*p->dwt_height - p->height*p->width)*sizeof(dwtcoef));
memset(buf, 0, p->coef_stride * (p->dwt_height - p->height) * sizeof(dwtcoef));
for (level = s->wavelet_depth-1; level >= 0; level--) {
const SubBand *b = &p->band[level][0];

View File

@ -753,6 +753,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
c->transform_add[3] = ff_hevc_transform_add32_8_avx;
}
if (EXTERNAL_AVX2(cpu_flags)) {
c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_8_avx2;
c->sao_band_filter[1] = ff_hevc_sao_band_filter_16_8_avx2;
}
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
c->idct_dc[2] = ff_hevc_idct16x16_dc_8_avx2;
c->idct_dc[3] = ff_hevc_idct32x32_dc_8_avx2;
if (ARCH_X86_64) {
@ -897,7 +901,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
SAO_BAND_INIT(10, avx);
}
if (EXTERNAL_AVX2(cpu_flags)) {
c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_10_avx2;
}
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
c->idct_dc[2] = ff_hevc_idct16x16_dc_10_avx2;
c->idct_dc[3] = ff_hevc_idct32x32_dc_10_avx2;
if (ARCH_X86_64) {
@ -1095,6 +1101,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
SAO_BAND_INIT(12, avx);
}
if (EXTERNAL_AVX2(cpu_flags)) {
c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_12_avx2;
}
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
c->idct_dc[2] = ff_hevc_idct16x16_dc_12_avx2;
c->idct_dc[3] = ff_hevc_idct32x32_dc_12_avx2;

View File

@ -98,7 +98,7 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c)
c->diff_bytes = ff_diff_bytes_sse2;
}
if (EXTERNAL_AVX2(cpu_flags)) {
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
c->diff_bytes = ff_diff_bytes_avx2;
}
}

View File

@ -44,7 +44,7 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
c->mct_decode[FF_DWT97] = ff_ict_float_avx;
}
if (EXTERNAL_AVX2(cpu_flags)) {
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
}
}

View File

@ -199,6 +199,6 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
#endif
if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
if (ARCH_X86_64 && EXTERNAL_AVX2(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
}

View File

@ -67,7 +67,7 @@ av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
if (EXTERNAL_AVX_FAST(cpu_flags)) {
s->synth_filter_float = synth_filter_avx;
}
if (EXTERNAL_FMA3(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_AVXSLOW)) {
if (EXTERNAL_FMA3_FAST(cpu_flags)) {
s->synth_filter_float = synth_filter_fma3;
}
#endif /* HAVE_YASM */

View File

@ -45,7 +45,7 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
if (EXTERNAL_AVX(cpu_flags))
s->pack_line_8 = ff_v210_planar_pack_8_avx;
if (EXTERNAL_AVX2(cpu_flags)) {
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
s->pack_line_8 = ff_v210_planar_pack_8_avx2;
s->pack_line_10 = ff_v210_planar_pack_10_avx2;
s->sample_factor = 2;

View File

@ -377,7 +377,7 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp, int bitexact)
init_ipred(32, avx, v, VERT);
}
if (EXTERNAL_AVX2(cpu_flags)) {
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
init_fpel_func(1, 1, 32, avg, _8, avx2);
init_fpel_func(0, 1, 64, avg, _8, avx2);
if (ARCH_X86_64) {

View File

@ -129,7 +129,7 @@ av_cold void ff_vp9dsp_init_16bpp_x86(VP9DSPContext *dsp)
init_ipred_funcs(hd, HOR_DOWN, 16, avx);
}
if (EXTERNAL_AVX2(cpu_flags)) {
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
init_fpel_func(2, 1, 32, avg, _16, avx2);
init_fpel_func(1, 1, 64, avg, _16, avx2);
init_fpel_func(0, 1, 128, avg, _16, avx2);

View File

@ -225,7 +225,7 @@ av_cold void INIT_FUNC(VP9DSPContext *dsp, int bitexact)
init_lpf_funcs(BPC, avx);
}
if (EXTERNAL_AVX2(cpu_flags)) {
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
#if HAVE_AVX2_EXTERNAL
init_subpel3_32_64(0, put, BPC, avx2);
init_subpel3_32_64(1, avg, BPC, avx2);

View File

@ -240,7 +240,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
timestamp = movie->seek_point;
// add the stream start time, should it exist
if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
if (timestamp > 0 && movie->format_ctx->start_time > INT64_MAX - timestamp) {
av_log(ctx, AV_LOG_ERROR,
"%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
movie->file_name, movie->format_ctx->start_time, movie->seek_point);

View File

@ -1222,7 +1222,9 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
dummy.code = code;
glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL);
if (!glyph) {
load_glyph(ctx, &glyph, code);
ret = load_glyph(ctx, &glyph, code);
if (ret < 0)
return ret;
}
y_min = FFMIN(glyph->bbox.yMin, y_min);

View File

@ -283,6 +283,12 @@ resolve_eof:
return ret;
}
static int enu_free(void *opaque, void *elem)
{
av_free(elem);
return 0;
}
static int cache_close(URLContext *h)
{
Context *c= h->priv_data;
@ -292,6 +298,7 @@ static int cache_close(URLContext *h)
close(c->fd);
ffurl_close(c->inner);
av_tree_enumerate(c->root, NULL, NULL, enu_free);
av_tree_destroy(c->root);
return 0;

View File

@ -710,7 +710,7 @@ static int concat_seek(AVFormatContext *avf, int stream,
static const AVOption options[] = {
{ "safe", "enable safe mode",
OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, DEC },
OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, -1, 1, DEC },
{ "auto_convert", "automatically convert bitstream format",
OFFSET(auto_convert), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC },
{ "segment_time_metadata", "output file segment start time and duration as packet metadata",

View File

@ -775,8 +775,8 @@ static int ffm_probe(AVProbeData *p)
static const AVOption options[] = {
{"server_attached", NULL, offsetof(FFMContext, server_attached), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_EXPORT },
{"ffm_write_index", NULL, offsetof(FFMContext, write_index), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, 1, AV_OPT_FLAG_EXPORT },
{"ffm_file_size", NULL, offsetof(FFMContext, file_size), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, 1, AV_OPT_FLAG_EXPORT },
{"ffm_write_index", NULL, offsetof(FFMContext, write_index), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, AV_OPT_FLAG_EXPORT },
{"ffm_file_size", NULL, offsetof(FFMContext, file_size), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, AV_OPT_FLAG_EXPORT },
{ NULL },
};

View File

@ -349,7 +349,7 @@ URLProtocol ff_file_protocol = {
.url_open_dir = file_open_dir,
.url_read_dir = file_read_dir,
.url_close_dir = file_close_dir,
.default_whitelist = "file"
.default_whitelist = "file,crypto"
};
#endif /* CONFIG_FILE_PROTOCOL */
@ -388,7 +388,7 @@ URLProtocol ff_pipe_protocol = {
.url_check = file_check,
.priv_data_size = sizeof(FileContext),
.priv_data_class = &pipe_class,
.default_whitelist = "none"
.default_whitelist = "crypto"
};
#endif /* CONFIG_PIPE_PROTOCOL */

View File

@ -396,7 +396,7 @@ static int hls_window(AVFormatContext *s, int last)
set_http_options(&options, hls);
snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", s->filename);
if ((ret = s->io_open(s, &out, temp_filename, AVIO_FLAG_WRITE, NULL)) < 0)
if ((ret = s->io_open(s, &out, temp_filename, AVIO_FLAG_WRITE, &options)) < 0)
goto fail;
for (en = hls->segments; en; en = en->next) {

View File

@ -1522,7 +1522,7 @@ URLProtocol ff_http_protocol = {
.priv_data_size = sizeof(HTTPContext),
.priv_data_class = &http_context_class,
.flags = URL_PROTOCOL_FLAG_NETWORK,
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto"
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto,httpproxy"
};
#endif /* CONFIG_HTTP_PROTOCOL */
@ -1541,7 +1541,7 @@ URLProtocol ff_https_protocol = {
.priv_data_size = sizeof(HTTPContext),
.priv_data_class = &https_context_class,
.flags = URL_PROTOCOL_FLAG_NETWORK,
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto"
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto,httpproxy"
};
#endif /* CONFIG_HTTPS_PROTOCOL */

View File

@ -3609,7 +3609,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
av_log(c->fc, AV_LOG_DEBUG, "calculated into dts %"PRId64"\n", dts);
} else {
dts = frag->time;
dts = frag->time - sc->time_offset;
av_log(c->fc, AV_LOG_DEBUG, "found frag time %"PRId64
", using it for dts\n", dts);
}
@ -3666,7 +3666,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
version = avio_r8(pb);
if (version > 1) {
avpriv_request_sample(c->fc, "sidx version %u", version);
return AVERROR_PATCHWELCOME;
return 0;
}
avio_rb24(pb); // flags
@ -3679,8 +3679,8 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
}
if (!st) {
av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %d\n", track_id);
return AVERROR_INVALIDDATA;
av_log(c->fc, AV_LOG_WARNING, "could not find corresponding track id %d\n", track_id);
return 0;
}
sc = st->priv_data;

View File

@ -56,6 +56,7 @@ typedef struct MpegTSService {
int pcr_pid;
int pcr_packet_count;
int pcr_packet_period;
AVProgram *program;
} MpegTSService;
// service_type values as defined in ETSI 300 468
@ -275,17 +276,14 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
if (s->nb_programs) {
int j, k, found = 0;
int k, found = 0;
AVProgram *program = service->program;
for (j = 0; j < s->nb_programs; j++)
if (s->programs[j]->id == service->sid) {
for (k = 0; k < s->programs[j]->nb_stream_indexes; k++)
if (s->programs[j]->stream_index[k] == i) {
for (k = 0; k < program->nb_stream_indexes; k++)
if (program->stream_index[k] == i) {
found = 1;
break;
}
break;
}
if (!found)
continue;
@ -784,6 +782,7 @@ static int mpegts_init(AVFormatContext *s)
service->pmt.write_packet = section_write_packet;
service->pmt.opaque = s;
service->pmt.cc = 15;
service->program = program;
}
}
@ -807,6 +806,7 @@ static int mpegts_init(AVFormatContext *s)
/* assign pids to each stream */
for (i = 0; i < s->nb_streams; i++) {
AVProgram *program;
st = s->streams[i];
ts_st = av_mallocz(sizeof(MpegTSWriteStream));
@ -824,6 +824,17 @@ static int mpegts_init(AVFormatContext *s)
ret = AVERROR(ENOMEM);
goto fail;
}
program = av_find_program_from_stream(s, NULL, i);
if (program) {
for (j = 0; j < ts->nb_services; j++) {
if (ts->services[j]->program == program) {
service = ts->services[j];
break;
}
}
}
ts_st->service = service;
/* MPEG pid values < 16 are reserved. Applications which set st->id in
* this range are assigned a calculated pid. */

View File

@ -400,6 +400,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if (s->oformat->init && (ret = s->oformat->init(s)) < 0) {
if (s->oformat->deinit)
s->oformat->deinit(s);
goto fail;
}

View File

@ -193,16 +193,17 @@ static void create_default_qtables(uint8_t *qtables, uint8_t q)
{
int factor = q;
int i;
uint16_t S;
factor = av_clip(q, 1, 99);
if (q < 50)
q = 5000 / factor;
S = 5000 / factor;
else
q = 200 - factor * 2;
S = 200 - factor * 2;
for (i = 0; i < 128; i++) {
int val = (default_quantizers[i] * q + 50) / 100;
int val = (default_quantizers[i] * S + 50) / 100;
/* Limit the quantizers to 1 <= q <= 255. */
val = av_clip(val, 1, 255);

View File

@ -271,7 +271,8 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye)
avio_w8(s1->pb, RTCP_SR);
avio_wb16(s1->pb, 6); /* length in words - 1 */
avio_wb32(s1->pb, s->ssrc);
avio_wb64(s1->pb, NTP_TO_RTP_FORMAT(ntp_time));
avio_wb32(s1->pb, ntp_time / 1000000);
avio_wb32(s1->pb, ((ntp_time % 1000000) << 32) / 1000000);
avio_wb32(s1->pb, rtp_ts);
avio_wb32(s1->pb, s->packet_count);
avio_wb32(s1->pb, s->octet_count);

View File

@ -48,7 +48,7 @@ static int svag_read_header(AVFormatContext *s)
if (st->codec->sample_rate <= 0)
return AVERROR_INVALIDDATA;
st->codec->channels = avio_rl32(s->pb);
if (st->codec->channels <= 0)
if (st->codec->channels <= 0 || st->codec->channels > 8)
return AVERROR_INVALIDDATA;
st->duration = size / (16 * st->codec->channels) * 28;
align = avio_rl32(s->pb);

View File

@ -1186,11 +1186,12 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
}
}
if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)) {
if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) {
st->pts_buffer[0] = pkt->pts;
for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
if(has_decode_delay_been_guessed(st))
pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts);
}
// We skipped it above so we try here.

View File

@ -94,7 +94,7 @@ static const struct {
{ "6.0(front)", 6, AV_CH_LAYOUT_6POINT0_FRONT },
{ "hexagonal", 6, AV_CH_LAYOUT_HEXAGONAL },
{ "6.1", 7, AV_CH_LAYOUT_6POINT1 },
{ "6.1", 7, AV_CH_LAYOUT_6POINT1_BACK },
{ "6.1(back)", 7, AV_CH_LAYOUT_6POINT1_BACK },
{ "6.1(front)", 7, AV_CH_LAYOUT_6POINT1_FRONT },
{ "7.0", 7, AV_CH_LAYOUT_7POINT0 },
{ "7.0(front)", 7, AV_CH_LAYOUT_7POINT0_FRONT },

View File

@ -41,6 +41,16 @@
b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
}
#define YUV_TO_RGB1_CCIR_BT709(cb1, cr1)\
{\
cb = (cb1) - 128;\
cr = (cr1) - 128;\
r_add = FIX(1.5747*255.0/224.0) * cr + ONE_HALF;\
g_add = - FIX(0.1873*255.0/224.0) * cb - FIX(0.4682*255.0/224.0) * cr + \
ONE_HALF;\
b_add = FIX(1.8556*255.0/224.0) * cb + ONE_HALF;\
}
#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
{\
y = ((y1) - 16) * FIX(255.0/219.0);\

View File

@ -24,13 +24,16 @@
#define CPUEXT_SUFFIX(flags, suffix, cpuext) \
(HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext))
#define CPUEXT_SUFFIX_FAST(flags, suffix, cpuext) \
#define CPUEXT_SUFFIX_FAST2(flags, suffix, cpuext, slow_cpuext) \
(HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext) && \
!((flags) & AV_CPU_FLAG_ ## cpuext ## SLOW))
!((flags) & AV_CPU_FLAG_ ## slow_cpuext ## SLOW))
#define CPUEXT_SUFFIX_SLOW(flags, suffix, cpuext) \
#define CPUEXT_SUFFIX_SLOW2(flags, suffix, cpuext, slow_cpuext) \
(HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext) && \
((flags) & AV_CPU_FLAG_ ## cpuext ## SLOW))
((flags) & AV_CPU_FLAG_ ## slow_cpuext ## SLOW))
#define CPUEXT_SUFFIX_FAST(flags, suffix, cpuext) CPUEXT_SUFFIX_FAST2(flags, suffix, cpuext, cpuext)
#define CPUEXT_SUFFIX_SLOW(flags, suffix, cpuext) CPUEXT_SUFFIX_SLOW2(flags, suffix, cpuext, cpuext)
#define CPUEXT(flags, cpuext) CPUEXT_SUFFIX(flags, , cpuext)
#define CPUEXT_FAST(flags, cpuext) CPUEXT_SUFFIX_FAST(flags, , cpuext)

View File

@ -313,6 +313,22 @@ static av_always_inline float ff_exp10f(float x)
return exp2f(M_LOG2_10 * x);
}
/**
* Compute x^y for floating point x, y. Note: this function is faster than the
* libm variant due to mainly 2 reasons:
* 1. It does not handle any edge cases. In particular, this is only guaranteed
* to work correctly for x > 0.
* 2. It is not as accurate as a standard nearly "correctly rounded" libm variant.
* @param x base
* @param y exponent
* @return x^y
*/
static av_always_inline float ff_fast_powf(float x, float y)
{
return expf(logf(x) * y);
}
/**
* A wrapper for open() setting O_CLOEXEC.
*/

View File

@ -56,6 +56,7 @@
#include "libavutil/mips/asmdefs.h"
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
static void vector_fmul_mips(float *dst, const float *src0, const float *src1,
int len)
{
@ -339,14 +340,17 @@ static void vector_fmul_reverse_mips(float *dst, const float *src0, const float
);
}
}
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
void ff_float_dsp_init_mips(AVFloatDSPContext *fdsp) {
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
fdsp->vector_fmul = vector_fmul_mips;
fdsp->vector_fmul_scalar = vector_fmul_scalar_mips;
fdsp->vector_fmul_window = vector_fmul_window_mips;
fdsp->butterflies_float = butterflies_float_mips;
fdsp->vector_fmul_reverse = vector_fmul_reverse_mips;
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
}

View File

@ -2275,6 +2275,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
#define FF_COLOR_GRAY 1 /**< gray color space */
#define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
#define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
#define FF_COLOR_XYZ 4
#define pixdesc_has_alpha(pixdesc) \
((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
@ -2290,6 +2291,9 @@ static int get_color_type(const AVPixFmtDescriptor *desc) {
if(desc->name && !strncmp(desc->name, "yuvj", 4))
return FF_COLOR_YUV_JPEG;
if(desc->name && !strncmp(desc->name, "xyz", 3))
return FF_COLOR_XYZ;
if(desc->flags & AV_PIX_FMT_FLAG_RGB)
return FF_COLOR_RGB;

View File

@ -97,8 +97,13 @@ static uint32_t get_generic_seed(void)
last_t = t;
}
if(TEST)
if(TEST) {
buffer[0] = buffer[1] = 0;
} else {
#ifdef AV_READ_TIME
buffer[111] += AV_READ_TIME();
#endif
}
av_sha_init(sha, 160);
av_sha_update(sha, (const uint8_t *)buffer, sizeof(buffer));

View File

@ -68,8 +68,12 @@
#define EXTERNAL_AVX_SLOW(flags) CPUEXT_SUFFIX_SLOW(flags, _EXTERNAL, AVX)
#define EXTERNAL_XOP(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, XOP)
#define EXTERNAL_FMA3(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, FMA3)
#define EXTERNAL_FMA3_FAST(flags) CPUEXT_SUFFIX_FAST2(flags, _EXTERNAL, FMA3, AVX)
#define EXTERNAL_FMA3_SLOW(flags) CPUEXT_SUFFIX_SLOW2(flags, _EXTERNAL, FMA3, AVX)
#define EXTERNAL_FMA4(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, FMA4)
#define EXTERNAL_AVX2(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, AVX2)
#define EXTERNAL_AVX2_FAST(flags) CPUEXT_SUFFIX_FAST2(flags, _EXTERNAL, AVX2, AVX)
#define EXTERNAL_AVX2_SLOW(flags) CPUEXT_SUFFIX_SLOW2(flags, _EXTERNAL, AVX2, AVX)
#define EXTERNAL_AESNI(flags) CPUEXT_SUFFIX(flags, _EXTERNAL, AESNI)
#define INLINE_AMD3DNOW(flags) CPUEXT_SUFFIX(flags, _INLINE, AMD3DNOW)

View File

@ -92,7 +92,7 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
fdsp->vector_fmul_add = ff_vector_fmul_add_avx;
fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_avx;
}
if (EXTERNAL_FMA3(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_AVXSLOW)) {
if (EXTERNAL_FMA3_FAST(cpu_flags)) {
fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_fma3;
fdsp->vector_fmul_add = ff_vector_fmul_add_fma3;
}

View File

@ -39,7 +39,7 @@ av_cold void ff_init_lls_x86(LLSModel *m)
if (EXTERNAL_AVX_FAST(cpu_flags)) {
m->update_lls = ff_update_lls_avx;
}
if (EXTERNAL_FMA3(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_AVXSLOW)) {
if (EXTERNAL_FMA3_FAST(cpu_flags)) {
m->update_lls = ff_update_lls_fma3;
}
}

View File

@ -973,7 +973,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
int i;
const int count= FFMAX(mbHeight * absQPStride, mbWidth);
for(i=0; i<(count>>2); i++){
((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F;
AV_WN32(c->stdQPTable + (i<<2), AV_RN32(QP_store + (i<<2)) >> 1 & 0x7F7F7F7F);
}
for(i<<=2; i<count; i++){
c->stdQPTable[i] = QP_store[i]>>1;

View File

@ -174,7 +174,7 @@ MULTI_CAPS_FUNC(SSE2, sse2)
ac->simd_f = ff_pack_8ch_float_to_int32_a_avx;
}
}
if(EXTERNAL_AVX2(mm_flags)) {
if(EXTERNAL_AVX2_FAST(mm_flags)) {
if( out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_FLTP)
ac->simd_f = ff_float_to_int32_a_avx2;
}

View File

@ -71,7 +71,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
c->dsp.resample = c->linear ? ff_resample_linear_float_avx
: ff_resample_common_float_avx;
}
if (EXTERNAL_FMA3(mm_flags) && !(mm_flags & AV_CPU_FLAG_AVXSLOW)) {
if (EXTERNAL_FMA3_FAST(mm_flags)) {
c->dsp.resample = c->linear ? ff_resample_linear_float_fma3
: ff_resample_common_float_fma3;
}

View File

@ -885,6 +885,19 @@ static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_sr
}
}
static av_always_inline void planar_rgb16_to_a(uint8_t *_dst, const uint8_t *_src[4],
int width, int bpc, int is_be, int32_t *rgb2yuv)
{
int i;
const uint16_t **src = (const uint16_t **)_src;
uint16_t *dst = (uint16_t *)_dst;
int shift = bpc < 16 ? bpc : 14;
for (i = 0; i < width; i++) {
dst[i] = rdpx(src[3] + i) << (14 - shift);
}
}
static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
const uint8_t *_src[4], int width,
int bpc, int is_be, int32_t *rgb2yuv)
@ -913,6 +926,11 @@ static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *s
{ \
planar_rgb16_to_y(dst, src, w, nbits, endian, rgb2yuv); \
} \
static void planar_rgb##nbits##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4], \
int w, int32_t *rgb2yuv) \
{ \
planar_rgb16_to_a(dst, src, w, nbits, endian, rgb2yuv); \
} \
static void planar_rgb##nbits##endian_name##_to_uv(uint8_t *dstU, uint8_t *dstV, \
const uint8_t *src[4], int w, int32_t *rgb2yuv) \
{ \
@ -1248,6 +1266,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->readLumPlanar = planar_rgb14le_to_y;
break;
case AV_PIX_FMT_GBRAP16LE:
c->readAlpPlanar = planar_rgb16le_to_a;
case AV_PIX_FMT_GBRP16LE:
c->readLumPlanar = planar_rgb16le_to_y;
break;
@ -1264,6 +1283,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->readLumPlanar = planar_rgb14be_to_y;
break;
case AV_PIX_FMT_GBRAP16BE:
c->readAlpPlanar = planar_rgb16be_to_a;
case AV_PIX_FMT_GBRP16BE:
c->readLumPlanar = planar_rgb16be_to_y;
break;

View File

@ -1354,6 +1354,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
srcFormat != AV_PIX_FMT_GBRP12BE && srcFormat != AV_PIX_FMT_GBRP12LE &&
srcFormat != AV_PIX_FMT_GBRP14BE && srcFormat != AV_PIX_FMT_GBRP14LE &&
srcFormat != AV_PIX_FMT_GBRP16BE && srcFormat != AV_PIX_FMT_GBRP16LE &&
srcFormat != AV_PIX_FMT_GBRAP16BE && srcFormat != AV_PIX_FMT_GBRAP16LE &&
((dstW >> c->chrDstHSubSample) <= (srcW >> 1) ||
(flags & SWS_FAST_BILINEAR)))
c->chrSrcHSubSample = 1;

View File

@ -54,6 +54,118 @@ SECTION .text
; int32_t if $output_size is 16. $filter is 12-bits. $filterSize is a multiple
; of 2. $offset is either 0 or 3. $dither holds 8 values.
;-----------------------------------------------------------------------------
%macro yuv2planeX_mainloop 2
.pixelloop_%2:
%assign %%i 0
; the rep here is for the 8bit output mmx case, where dither covers
; 8 pixels but we can only handle 2 pixels per register, and thus 4
; pixels per iteration. In order to not have to keep track of where
; we are w.r.t. dithering, we unroll the mmx/8bit loop x2.
%if %1 == 8
%assign %%repcnt 16/mmsize
%else
%assign %%repcnt 1
%endif
%rep %%repcnt
%if %1 == 8
%if ARCH_X86_32
mova m2, [rsp+mmsize*(0+%%i)]
mova m1, [rsp+mmsize*(1+%%i)]
%else ; x86-64
mova m2, m8
mova m1, m_dith
%endif ; x86-32/64
%else ; %1 == 9/10/16
mova m1, [yuv2yuvX_%1_start]
mova m2, m1
%endif ; %1 == 8/9/10/16
movsx cntr_reg, fltsizem
.filterloop_%2_ %+ %%i:
; input pixels
mov r6, [srcq+gprsize*cntr_reg-2*gprsize]
%if %1 == 16
mova m3, [r6+r5*4]
mova m5, [r6+r5*4+mmsize]
%else ; %1 == 8/9/10
mova m3, [r6+r5*2]
%endif ; %1 == 8/9/10/16
mov r6, [srcq+gprsize*cntr_reg-gprsize]
%if %1 == 16
mova m4, [r6+r5*4]
mova m6, [r6+r5*4+mmsize]
%else ; %1 == 8/9/10
mova m4, [r6+r5*2]
%endif ; %1 == 8/9/10/16
; coefficients
movd m0, [filterq+2*cntr_reg-4] ; coeff[0], coeff[1]
%if %1 == 16
pshuflw m7, m0, 0 ; coeff[0]
pshuflw m0, m0, 0x55 ; coeff[1]
pmovsxwd m7, m7 ; word -> dword
pmovsxwd m0, m0 ; word -> dword
pmulld m3, m7
pmulld m5, m7
pmulld m4, m0
pmulld m6, m0
paddd m2, m3
paddd m1, m5
paddd m2, m4
paddd m1, m6
%else ; %1 == 10/9/8
punpcklwd m5, m3, m4
punpckhwd m3, m4
SPLATD m0
pmaddwd m5, m0
pmaddwd m3, m0
paddd m2, m5
paddd m1, m3
%endif ; %1 == 8/9/10/16
sub cntr_reg, 2
jg .filterloop_%2_ %+ %%i
%if %1 == 16
psrad m2, 31 - %1
psrad m1, 31 - %1
%else ; %1 == 10/9/8
psrad m2, 27 - %1
psrad m1, 27 - %1
%endif ; %1 == 8/9/10/16
%if %1 == 8
packssdw m2, m1
packuswb m2, m2
movh [dstq+r5*1], m2
%else ; %1 == 9/10/16
%if %1 == 16
packssdw m2, m1
paddw m2, [minshort]
%else ; %1 == 9/10
%if cpuflag(sse4)
packusdw m2, m1
%else ; mmxext/sse2
packssdw m2, m1
pmaxsw m2, m6
%endif ; mmxext/sse2/sse4/avx
pminsw m2, [yuv2yuvX_%1_upper]
%endif ; %1 == 9/10/16
mov%2 [dstq+r5*2], m2
%endif ; %1 == 8/9/10/16
add r5, mmsize/2
sub wd, mmsize/2
%assign %%i %%i+2
%endrep
jg .pixelloop_%2
%endmacro
%macro yuv2planeX_fn 3
@ -123,116 +235,16 @@ cglobal yuv2planeX_%1, %3, 8, %2, filter, fltsize, src, dst, w, dither, offset
xor r5, r5
.pixelloop:
%assign %%i 0
; the rep here is for the 8bit output mmx case, where dither covers
; 8 pixels but we can only handle 2 pixels per register, and thus 4
; pixels per iteration. In order to not have to keep track of where
; we are w.r.t. dithering, we unroll the mmx/8bit loop x2.
%if %1 == 8
%assign %%repcnt 16/mmsize
%else
%assign %%repcnt 1
%endif
%rep %%repcnt
%if %1 == 8
%if ARCH_X86_32
mova m2, [rsp+mmsize*(0+%%i)]
mova m1, [rsp+mmsize*(1+%%i)]
%else ; x86-64
mova m2, m8
mova m1, m_dith
%endif ; x86-32/64
%else ; %1 == 9/10/16
mova m1, [yuv2yuvX_%1_start]
mova m2, m1
%endif ; %1 == 8/9/10/16
movsx cntr_reg, fltsizem
.filterloop_ %+ %%i:
; input pixels
mov r6, [srcq+gprsize*cntr_reg-2*gprsize]
%if %1 == 16
mova m3, [r6+r5*4]
mova m5, [r6+r5*4+mmsize]
%else ; %1 == 8/9/10
mova m3, [r6+r5*2]
%endif ; %1 == 8/9/10/16
mov r6, [srcq+gprsize*cntr_reg-gprsize]
%if %1 == 16
mova m4, [r6+r5*4]
mova m6, [r6+r5*4+mmsize]
%else ; %1 == 8/9/10
mova m4, [r6+r5*2]
%endif ; %1 == 8/9/10/16
; coefficients
movd m0, [filterq+2*cntr_reg-4] ; coeff[0], coeff[1]
%if %1 == 16
pshuflw m7, m0, 0 ; coeff[0]
pshuflw m0, m0, 0x55 ; coeff[1]
pmovsxwd m7, m7 ; word -> dword
pmovsxwd m0, m0 ; word -> dword
pmulld m3, m7
pmulld m5, m7
pmulld m4, m0
pmulld m6, m0
paddd m2, m3
paddd m1, m5
paddd m2, m4
paddd m1, m6
%else ; %1 == 10/9/8
punpcklwd m5, m3, m4
punpckhwd m3, m4
SPLATD m0
pmaddwd m5, m0
pmaddwd m3, m0
paddd m2, m5
paddd m1, m3
%endif ; %1 == 8/9/10/16
sub cntr_reg, 2
jg .filterloop_ %+ %%i
%if %1 == 16
psrad m2, 31 - %1
psrad m1, 31 - %1
%else ; %1 == 10/9/8
psrad m2, 27 - %1
psrad m1, 27 - %1
%endif ; %1 == 8/9/10/16
%if %1 == 8
packssdw m2, m1
packuswb m2, m2
movh [dstq+r5*1], m2
%else ; %1 == 9/10/16
%if %1 == 16
packssdw m2, m1
paddw m2, [minshort]
%else ; %1 == 9/10
%if cpuflag(sse4)
packusdw m2, m1
%else ; mmxext/sse2
packssdw m2, m1
pmaxsw m2, m6
%endif ; mmxext/sse2/sse4/avx
pminsw m2, [yuv2yuvX_%1_upper]
%endif ; %1 == 9/10/16
mova [dstq+r5*2], m2
%endif ; %1 == 8/9/10/16
add r5, mmsize/2
sub wd, mmsize/2
%assign %%i %%i+2
%endrep
jg .pixelloop
%if mmsize == 8 || %1 == 8
yuv2planeX_mainloop %1, a
%else ; mmsize == 16
test dstq, 15
jnz .unaligned
yuv2planeX_mainloop %1, a
REP_RET
.unaligned:
yuv2planeX_mainloop %1, u
%endif ; mmsize == 8/16
%if %1 == 8
%if ARCH_X86_32

View File

@ -175,7 +175,7 @@ fate-aac-pns-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.w
fate-aac-pns-encode: CMP_SHIFT = -4096
fate-aac-pns-encode: CMP_TARGET = 616
fate-aac-pns-encode: SIZE_TOLERANCE = 3560
fate-aac-pns-encode: FUZZ = 72
fate-aac-pns-encode: FUZZ = 74
FATE_AAC_ENCODE += fate-aac-tns-encode
fate-aac-tns-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -c:a aac -aac_tns 1 -aac_is 0 -aac_pns 0 -aac_ms 0 -b:a 128k -cutoff 22050 -fflags +bitexact -flags +bitexact

View File

@ -2,7 +2,7 @@
cd "$1"/..
git --version > /dev/null || { cat tests/ref/fate/source ; exit 0; }
git show > /dev/null 2> /dev/null || { cat tests/ref/fate/source ; exit 0; }
echo Files without standard license headers:
git grep -L -E "This file is part of FFmpeg|This file is part of libswresample|"\

View File

@ -25,9 +25,9 @@
1, 264, 264, 21, 609, 0xc0dc255c
1, 285, 285, 21, 619, 0x9ac52dd1
0, 292, 292, 41, 16751, 0xf293ab46, F=0x0
0, 292, 417, 41, 22029, 0x3696462b, F=0x0
1, 306, 306, 21, 574, 0xf6410d4d
1, 327, 327, 22, 565, 0xfd561191
0, 334, 417, 41, 22029, 0x3696462b, F=0x0
1, 350, 350, 21, 713, 0x48425147
1, 371, 371, 21, 537, 0x09bbf515
0, 375, 375, 41, 5044, 0xa0344ae6, F=0x0