Compare commits

...

115 Commits

Author SHA1 Message Date
Michael Niedermayer
c9b3451da3 Update Changelog
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 01:17:17 +01:00
Andreas Cadhalpun
46f83b059b aacsbr_fixed: check for envelope scalefactors overflowing
This prevents various values from getting an insanely huge exponent.
If someone knows a cleaner solution, thats welcome!

This is similar to commit 8978c74 for aacsbr.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 0e36a14a423b7cb32d54d1b621cc9136cccc3dc5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:43:01 +01:00
Andreas Cadhalpun
ce2664f5f7 aacdec: don't return frames without data from aac_decode_er_frame
This is similar to commit ec38a1b for aac_decode_frame_int.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d7f29bfa6985e3eea2033dba0449e47b41b85928)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:42:50 +01:00
Michael Niedermayer
8364d607ac avcodec/aacsbr_fixed: Try to initialize sum[0..1] differently to fix build with VS2012
Found-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8a024f6a43444a73a3cd8d70abedde426b4e1986)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:42:43 +01:00
Michael Niedermayer
21e42d9b0d avcodec/aacsbr: Use FLOAT_0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dcf1cf5d24c85d848eabac90720d7f77d594a88c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:42:35 +01:00
Andreas Cadhalpun
e10c353ca5 softfloat: handle INT_MIN correctly in av_int2sf
Otherwise v=INT_MIN doesn't get normalized and thus triggers av_assert2
in other functions.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9ac61e73d0843ec4b83f4e3d47eded73234e406e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
72be96ac55 avutil/softfloat: Include negative numbers in cmp/gt tests
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 955cdc43a35a850afe36537c2d8739c1991ac7ec)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
6581e40e1a avutil/softfloat: Fix av_gt_sf() with large exponents try #2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 05b05a7a841c0c67cce319941104d6f11b9ecd84)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
0f9c617979 avutil/softfloat: Add test for av_gt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 791ea23e57f134559ba66fd8f1664346abbc9314)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
f9998d1994 avutil/softfloat: Extend the av_cmp_sf() test to cover a wider range of exponents
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ecfb076141d0243212143f0d7c9d4e47b56bec15)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
7ad4bf4899 avutil/softfloat: Fix overflows in shifts in av_cmp_sf() and av_gt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cee3c9d29aceec8cddd829acd6dfb56dc5f60322)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
43ada90fc5 avutil/softfloat: Add test for av_cmp_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit df2a2117d280a1579500034a8a3c79dc64b90c78)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Ganesh Ajjanagadde
476ddffccb avutil/common: add FFDIFFSIGN macro
This is of use for defining comparator callbacks. Common approaches like
return x-y are not safe due to the risks of overflow.
Furthermore, the (x > y) - (x < y) trick is optimized to branchless
code.
This also documents this macro accordingly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
(cherry picked from commit 265f83fd35977a80e93b3cc13ceb65f52f129a3c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
b533998d0a avutil/softfloat: Add tests for exponent underflows
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 596dfe7d6c6bf355aca4eca0a2386f9c5679887d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:58 +01:00
Michael Niedermayer
acd203fc0d avutil/softfloat: Fix exponent underflow in av_div_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 046218b212a076b92ed88a280457db871dafd377)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:54 +01:00
Michael Niedermayer
402c4a9f81 avutil/softfloat: Fix exponent underflow in av_mul_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a1e3303fc01b95623d7a6963686c81b076690efd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:51 +01:00
Michael Niedermayer
6e4bfbe936 avutil/softfloat: Fix typo in av_mul_sf() doxy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4135a2bfd6d0a835f57031de57ae42363d455574)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:48 +01:00
Michael Niedermayer
f38beb47da avutil/softfloat: Correctly set the exponent for 0.0 in av_sqrt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 107db5abf3211dc7579bbb67c1af5c25b0e280f6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:32 +01:00
Michael Niedermayer
efa9128556 avutil/softfloat: FLOAT_0 should use MIN_EXP
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a66b243d522344e12e3970e72e02183185a29ebe)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:27 +01:00
Michael Niedermayer
3de8521667 swresample/resample: increase precision for compensation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 351e625d60165be67c362af6e96ead6c9262623f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 18:41:01 +01:00
Rodger Combs
edf5e88eac lavf/mov: add support for sidx fragment indexes
Fixes trac #3842
(cherry picked from commit 4ab56667594842283dc5ae07f0daba2a2cb4d3af)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 02:50:39 +01:00
Michael Niedermayer
8d634be4ce update versions for 2.8.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 02:50:39 +01:00
Michael Niedermayer
9a6d581076 avformat/mxfenc: Only store user comment related tags when needed
Also support disabling them as they seem to cause problems to some
Users. They are also not allowed in IRT D-10 thus the default for
mxf_d10 is not to write them

This also decreases the filesize when no user comment are stored

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

Conflicts:

	libavformat/mxfenc.c
2015-11-11 02:21:32 +01:00
Michael Niedermayer
84f8157662 tests/fate/avformat: Fix fate-lavf
The CMP variable seems to have been inherited from fate-api-seek which set it to null

the mxf reference needed a change due to c7e14a279fa7348db10ec824bb2d67858cb1c1ca

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 11:20:21 +01:00
Simon Thelen
e5a2f5e74d doc/ffmpeg: Clarify that the sdp_file option requires an rtp output.
Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b02201efb531348406e48f9252bd39a6acebd2b7)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-09 23:58:05 +01:00
Simon Thelen
dac3598563 ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
Fixes a segfault when trying to write nonexistent rtp information.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 70fb5eadc580a82c4b977a1233d70ad0041faba0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-09 23:56:29 +01:00
Andreas Cadhalpun
c0cd8747ef apng: use correct size for output buffer
The buffer needs s->bpp bytes, at maximum currently 10.
Assert that s->bpp is not larger.

This fixes a stack buffer overflow.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 3e8e1a660ea182111057d56ec1cfad2c62250f4c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 14:11:12 +01:00
Andreas Cadhalpun
e217224456 jvdec: avoid unsigned overflow in comparison
The return type of strlen is size_t, i.e. unsigned, so if pd->buf_size
is 3, the right side overflows leading to a wrong result of the
comparison and subsequently a heap buffer overflow.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit db374790c75fa4ef947abcb5019fcf21d0b2de85)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 14:10:41 +01:00
Michael Niedermayer
56419053bc avcodec/jpeg2000dec: Clip all tile coordinates
Fixes out of array access
Fixes: b877a6b788a25c70e8b1d014f8628549/asan_heap-oob_1da2c3f_2324_5a1b329b0b3c4bb6b1d775660ac56717.r3d

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 43492ff3ab68a343c1264801baa1d5a02de10167)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 03:02:04 +01:00
Michael Niedermayer
11b4822ddb avcodec/microdvddec: Check for string end in 'P' case
Fixes out of array read
Fixes: a9502b60f4cecc19475382aee255f73c/asan_heap-oob_1e87fba_2548_a8ad47f6dde36644fe9cdc444d4632d0.sub

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c719cd6cf79ec21d974b81ba874580f4b8e9eb90)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 01:10:58 +01:00
Michael Niedermayer
2de2959305 avcodec/dirac_parser: Fix undefined memcpy() use
Fixes: 9d375e415486edd1a0c826f2307d89a4/asan_generic_4a5159_1577_faa333e83dacdd9e4dd322380aeed537.iss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit daefd8ab2f2aeb90cd53cb75445faffdc7a3cc79)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 01:10:16 +01:00
Michael Niedermayer
b93a8bd838 avformat/xmv: Discard remainder of packet on error
Fixes infinite loop
Fixes: 9c48ae2680c5f23bca3d20ff0f325fd8/asan_generic_4c254d_1374_993f1e5967dd6f844b8d72f978ce2a6c.pss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 79c4a338e4b2bf0bc6f81c9f455994f673a92f78)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 02:55:48 +01:00
Michael Niedermayer
2817eb514c avformat/xmv: factor return check out of if/else
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9b6fac11da470274d4b93d46ef66527aa1824179)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 02:55:13 +01:00
Michael Niedermayer
6e085f9a32 avcodec/mpeg12dec: Do not call show_bits() with invalid bits
Fixes assertion failure
Fixes: 63e50545709a6440d3d59f6426d58db9/signal_sigabrt_7ffff6ae7cc9_8189_3272a3010fd98ddf947c662bbde1ac13.ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 973c3dba27d0b1a88c70f6661b6a90d2f2e50665)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 01:17:00 +01:00
Michael Niedermayer
a7bbb7fb88 avcodec/faxcompr: Add missing runs check in decode_uncompressed()
Fixes out of array access
Fixes: 54e488b9da4abbceaf405d6492515697/asan_heap-oob_32769b0_160_a8755eb08ee8f9579348501945a33955.TIF

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d4a731b84a08f0f3839eaaaf82e97d8d9c67da46)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 21:50:14 +01:00
Michael Niedermayer
1290037626 libavutil/channel_layout: Check strtol*() for failure
Fixes assertion failure
Fixes: 4f5814bb15d2dda6fc18ef9791b13816/signal_sigabrt_7ffff6ae7cc9_65_7209d160d168b76f311be6cd64a548eb.wv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c9bfd6a8c35a2102e730aca12f6e09d1627f76b3)

Conflicts:

	libavutil/channel_layout.c
2015-11-05 20:47:15 +01:00
Michael Niedermayer
c7174d5204 avformat/mpegts: Only start probing data streams within probe_packets
Fixes assertion failure
Fixes: 4321db8ac331f5967ebfbfe80ce5eb78/signal_sigabrt_7ffff6ae7cc9_7213_0d6457b9d6897fa7c78507fa5de53510.ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3692d859f45fa8765fa5a330e79108b03c17c6bd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 18:23:11 +01:00
Michael Niedermayer
ff30907205 avcodec/hevc_ps: Check chroma_format_idc
Fixes out of array access
Fixes: 24d05e8b84676799c735c9e27d97895e/asan_heap-oob_1b70f6a_2955_7c3652a7f370f9f3ef40642bc2c99bb2.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 93f30f825c08477fe8f76be00539e96014cc83c8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 15:17:56 +01:00
Michael Niedermayer
a6ae88bb25 avcodec/ffv1dec: Check for 0 quant tables
Fixes assertion failure
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5745cf799a4389bc5d14f2b4daf32fe4631c50bc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 01:49:09 +01:00
Michael Niedermayer
4567cba0b8 avcodec/mjpegdec: Reinitialize IDCT on BPP changes
Fixes misaligned access
Fixes: dc9262a469f6f315f74c087a7b3a7f35/signal_sigsegv_2e95bcd_9_9c0f9f4a9ba82aa9b3ab2b91ce4d5277.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cc35f6f4768ffe57cc4fcfa56ecb89aee409e3d5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 22:16:38 +01:00
Michael Niedermayer
fdb8842639 avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
Fixes: 04715144ba237443010554be0d05343f/asan_heap-oob_1eafc76_1737_c685b48041a563461839e4e7ab97abb8.jpg
Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d24888ef19ba38b787b11d1ee091a3d94920c76a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 19:42:29 +01:00
Tobias Rapp
c6c801d993 avutil/file_open: avoid file handle inheritance on Windows
Avoids inheritance of file handles on Windows systems similar to the
O_CLOEXEC/FD_CLOEXEC flag on Linux.

Fixes file lock issues in Windows applications when a child process
is started with handle inheritance enabled (standard input/output
redirection) while a FFmpeg transcoding is running in the parent
process.

Links relevant to the subject:

https://msdn.microsoft.com/en-us/library/w7sa2b22.aspx

Describes the _wsopen() function and the O_NOINHERIT flag. File handles
opened by _wsopen() are inheritable by default.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx

Describes handle inheritance when creating new processes. Handle
inheritance must be enabled (bInheritHandles = TRUE) e.g. when you want
to pass handles for stdin/stdout via lpStartupInfo.

Signed-off-by: Tobias Rapp <t.rapp@noa-audio.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 474665346616e446ecd1407002fdf5f88201bf72)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-02 19:15:32 +01:00
Michael Niedermayer
aa34146e41 avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet
Fixes null pointer dereference
Fixes part of Ticket4977

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 22:57:52 +01:00
Lucas de Andrade
fcb8ee98f6 avformat/hls: update cookies on setcookie response
Context cookies must be updated when a playlist response return Setcookie header.

See: 770dd105044d00263da041f509a08b316296a78e
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 18:12:30 +01:00
Kieran Kunhya
2f5f940bef opusdec: Don't run vector_fmul_scalar on zero length arrays
Fixes crashes on fuzzed files
Fixes Ticket4969 part2

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
6ac9d6303f avcodec/opusdec: Fix extra samples read index
Fixes crash
Fixes Ticket4969 part 1

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
81a2ad762b avcodec/ffv1: Initialize vlc_state on allocation
This ensures that they are always set to valid values
Fixes Ticket4939

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
c8a1324d1e avcodec/ffv1dec: update progress in case of broken pointer chains
Fixes deadlock
Fixes Ticket4932

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
6a0e10ae0d avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
Fixes Ticket4931

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Martin Storsjö
3f3e12c768 rtsp: Allow $ as interleaved packet indicator before a complete response header
Some RTSP servers ("HiIpcam/V100R003 VodServer/1.0.0") respond to
our keepalive GET_PARAMETER request by a truncated RTSP header
(lacking the final empty line to indicate a complete response
header). Prior to 764ec70149, this worked just fine since we
reacted to the $ as interleaved packet indicator anywhere.

Since $ is a valid character within the response header lines,
764ec70149 changed it to be ignored there. But to keep
compatibility with such broken servers, we need to at least
allow reacting to it at the start of lines.

Fixes ticket #4952.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e02dcdf6bb6835ef4b49986b85a67efcb3495a7f)
2015-10-27 13:40:06 +01:00
Ronald S. Bultje
6616762134 videodsp: don't overread edges in vfix3 emu_edge.
Fixes trac ticket 3226. Also see Andreas' analysis in
https://bugs.debian.org/801745, which was very helpful.
(cherry picked from commit 52f84d82bdf1851ecfcc412c1719e5f6f3396209)
2015-10-25 01:05:31 +02:00
wm4
96b87d5cfa avformat/mp3dec: improve junk skipping heuristic
Commit 2b3e9bbfb529e6bde238aeb511b55ebe461664c8 caused problems for a
certain API user:

https://code.google.com/p/chromium/issues/detail?id=537725
https://code.google.com/p/chromium/issues/detail?id=542032

The problem seems rather arbitrary, because if there's junk, anything
can happen. In this case, the imperfect junk skipping just caused it to
read different junk, from what I can see.

We can improve the accuracy of junk detection by a lot by checking if 2
consecutive frames use the same configuration. While in theory it might
be completely fine for the 1st frame to have a different format than the
2nd frame, it's exceedingly unlikely, and I can't think of a legitimate
use-case.

This is approximately the same mpg123 does for junk skipping. The
set of compared header bits is the same as the libavcodec mp3 parser
uses for similar purposes.
(cherry picked from commit de1b1a7da9e6ddf42447271e519099a88b389e4a)
2015-10-20 12:35:43 +02:00
Marton Balint
e0e28dad90 concatdec: fix file_start_time calculation regression
Fixes ticket #4924.

Found-by: Jaroslav Šnajdr <jsnajdr@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit df239b76195156f179618ddb8b167d5bf1245247)
2015-10-17 22:36:33 +02:00
周晓勇
1a67b0f9ae avcodec: loongson optimize h264dsp idct and loop filter with mmi
Change-Id: Ic87fb8f5cd22a502ff9dbbc5a5a8ea97cfc8a1dd
Signed-off-by: ZhouXiaoyong <zhouxiaoyong@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-16 14:47:56 +02:00
Michael Niedermayer
e3fcd88f08 avcodec/jpeg2000dec: Clear properties in jpeg2000_dec_cleanup() too
Fixes: Ticket4878

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-16 14:47:56 +02:00
Anssi Hannula
68a6178ef0 avformat/hls: add support for EXT-X-MAP
Without EXT-X-MAP support we miss the first bytes of some streams.

These streams worked by luck before byte-ranged segment support was added in
da7759b3579de3e98deb1ac58e642b861280ba54

Fixes ticket #4797.
(cherry picked from commit 909907948846dedf57a730a4d115d04d1117f9e5)

Conflicts:
	libavformat/hls.c
2015-10-15 14:27:20 +02:00
Anssi Hannula
d51ddd45b2 avformat/hls: fix segment selection regression on track changes of live streams
Commit ad701326b43078b90 ("avformat/hls: open playlists immediately when
AVDISCARD_ALL is dropped") inadvertently caused first_packet to never be
cleared, causing select_cur_seq_no() to not use the specific code for
live streams.

In practice this means that when the user selects a different audio
track during live stream (i.e. non-VOD) playback, there may be some
additional delay as the code might select an incorrect segment at first,
and we have to wait for video to catch audio (if too late segment was
selected) or to download more following audio segments (if too early
segment was selected).

Fix that by restoring the zeroing of first_packet.
(cherry picked from commit fd74d45d5158812675105a3b4aeb29c67b82f7e8)
2015-10-15 14:21:29 +02:00
Carl Eugen Hoyos
c2db8ebc08 configure: Require libkvazaar < 0.7.
Fixes ticket #4925.

Reviewed-by: Arttu Ylä-Outinen
2015-10-14 14:15:30 +02:00
Michael Niedermayer
b46efcb293 avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
The variable is not a constant and can lead to race conditions

Fixes: repro.webm (not reproducable with FFmpeg alone)

Found-by: Dale Curtis <dalecurtis@google.com>
Tested-by: Dale Curtis <dalecurtis@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dabea74d0e82ea80cd344f630497cafcb3ef872c)
2015-10-14 14:15:11 +02:00
Michael Niedermayer
40934e0e9b Update for 2.8.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-13 20:44:52 +02:00
Pedro Arthur
bb3b4ad460 swscale: fix ticket #4881
When scaling only a slice of a frame the output was written always
in the first lines leaving the rest of the frame black.
(cherry picked from commit 5bd62a1b3c3356b84818efca3fcaf52da27a32af)
2015-10-13 20:11:42 +02:00
Andreas Cadhalpun
13d3749424 doc: fix spelling errors
Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 8d6625642db064a45224cb7a8e037f6e79a6554d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-12 21:46:54 +02:00
Andreas Cadhalpun
173053a125 hls: only seek if there is an offset
If there is no #EXT-X-BYTERANGE specified, there is no need to seek.
Seeking fails anyway for rtmp, because this protocol does not support
url_seek.

This fixes CNN.m3u from trac ticket 4797 (i.e. Debian bug #798189).

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f9f0b4c08e7dc2c178ede137af4f64ca84ab2deb)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-12 21:46:54 +02:00
Alexandra Hájková
8118fdf8bb asfdec: add more checks for size left in asf packet buffer
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit c0a49077ea4ff3a0ad30b9e33f1bb06ba9112aaa)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-12 21:46:54 +02:00
Alexandra Hájková
f235f511a0 asfdec: alloc enough space for storing name in asf_read_metadata_obj
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 77cf23668991bfd1fb69339f13e1511b4186b7b3)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-12 21:46:54 +02:00
Michael Niedermayer
c149a4afee avcodec/pngdec: Check blend_op.
Fixes CID1322359, CID1322358

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-12 02:23:36 +02:00
赵宇龙
02d8abf0f5 h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc
the pps offset is used to locate pps in the spspps_buf; however, the
current calc method is wrong because it is the offset of the original
avctx->extradata;
when there is only one sps in the avcc; the value is correct by
coincidence, however, it will
fail in avcc with multi sps

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-12 02:23:36 +02:00
Michael Niedermayer
9579550b2b avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_buf
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3d126ef188639e0b55bdbbb755eafced66f23352)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-12 02:23:36 +02:00
Michael Niedermayer
7ec05ae969 avformat/avidec: Workaround broken initial frame
Fixes Ticket4851

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e2ef00394b8079e93835d47c993868229f07502)
2015-10-09 21:15:15 +02:00
wm4
b9841ba98c avformat/hls: fix some cases of HLS streams which require cookies
Broken by commit ba12ba859aabfa7153ba397d869db13acdaba340. This only
happens with HLS streams which use encryption and require preserving
cookies sent by the server.

Fixes trac issue #4846.
(cherry picked from commit 26eb2940079d0ec433cf9b2deae24560707cbcf8)
2015-10-09 21:14:23 +02:00
Paul B Mahol
39df4d2475 avcodec/pngdec: reset has_trns after every decode_frame_png()
Fixes #4887.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 1d0487f77f07663c510207eb6e946675b71823cb)
2015-10-09 21:14:02 +02:00
Przemysław Sobala
635831c087 lavf/img2dec: Fix memory leak
Fixes #4886

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 01dd7e025c246d9001f1a30f4a5d8fa2936d1a5e)
2015-10-09 21:13:49 +02:00
wm4
291a2f1ea7 avcodec/mp3: fix skipping zeros
Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3
packets. This code forgot to report to the user that data was skipped at
all.

Since audio codecs allow partial packet decoding, the user application
has to rely on the return value. It will remove the data reported as
consumed by the decoder, and feed it to the decoder again. This resulted
in the mp3 frame after the zero region to be decoded over and over
again, until the zero region was finally skipped by the application.

Fix this by including the amount of skipped bytes to the number of
consumed bytes returned by the decode call.

Fixes trac ticket #4890.
(cherry picked from commit cb1da9fb8d71bb611a7b0028914c97afc3f5711d)
2015-10-09 21:12:30 +02:00
Clément Bœsch
ee1bcd3436 avformat/srtdec: make sure we probe a number
Fixes regression since 7218352e0228028dfa009a3799ec93fd041065f1: WebVTT
files were matching the SRT probing.

(cherry picked from commit 40d9d6de90c3652f4c468ab14976c7faf5e40c07)
2015-10-09 10:56:31 +02:00
James Almer
408240267a configure: check for ID3D11VideoContext
Should fix compilation with mingw-w64 trunk, where ID3D11VideoDecoder is available
but ID3D11VideoContext still isn't.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit b8e4df46ab5a6b8333dbcd872e4f161fc9bba83a)
2015-10-08 17:08:04 -03:00
wm4
eca7b0dcce avformat/vobsub: compare correct packet stream IDs
The stream ID is essentially an arbitrary number defined by the .idx
file headers. They have to match the IDs in the .sub stream. The vobsub
demuxer assumed the IDs would just start from 0, increassing by 1 for
each stream. This is not correct. In the sample I had, the IDs were
starting from 1, leading to no subtitles being displayed at all.

Fix this by using the correct stream ID.

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 15:21:45 +02:00
Clément Bœsch
64b659673a avformat/srtdec: more lenient first line probing
Fixes Ticket #4898
(cherry picked from commit 7218352e0228028dfa009a3799ec93fd041065f1)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 15:21:39 +02:00
Clément Bœsch
1d9d300d65 avformat/srtdec: fix number check for the first character
(cherry picked from commit d161a2a72b083c51ec8fad33a29283703f5fd0cc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 15:21:24 +02:00
Shivraj Patil
a931ad554d avcodec/mips: build fix for MSA 64bit
Modified datatype of function argument (pitch from int32_t to ptrdiff_t).

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Commit in master: 322e960dbf32b846b26f95afa6c0e652bc04e90d
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 14:32:05 +02:00
Shivraj Patil
7236080d27 avcodec/mips: build fix for MSA
Modified sps and pps access from old HEVCContext(s) structure to newly introduced HEVCParamSets(ps).

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Commit in master: b0732b0214a40cdbcaf49d72cc6f25a7e9e5f115
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 14:31:49 +02:00
Andrey Utkin
6dcd2ebd34 avformat/httpauth: Add space after commas in HTTP/RTSP auth header
This fixes access to Grandstream cameras, which return 401 to ffmpeg
otherwise.
VLC sends Authorization: header with spaces between parameters, and it
is known to work with Grandstream devices and broad range of other HTTP
and RTSP servers, so author considers switching to such behaviour safe.
Just for record - RFC 2617 (HTTP Auth) does not specify the need in
spaces, so this is not a bug of FFmpeg.

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
DHE
83d75c70df libavformat/hlsenc: Use of uninitialized memory unlinking old files
Fixes ticket#4900

Signed-off-by: DHE <git@dehacked.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 76e3f8242d607ac0394b7894196f83f8d02ce5ca)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
818ebcbf5c avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
Fixes crash
Fixes: flicker-1.scout3d21443372922.28.m4a

Found-by: Dale Curtis <dalecurtis@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1b82b934a166e60f64e966eaa97512ba9dcb615b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
837113ab5f avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
Fixes: invalid_read.nut
Found-by: Paul B Mahol <onemda@gmail.com>

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
97340bdfa3 avcodec/ffv1dec: Explicitly check read_quant_table() return value
Forwards the error code, avoids potential integer overflow

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Jeremy James
61fd5a3072 dnxhddata: correct weight tables
CID 1260 (as evidenced by incorrect decoding of a sample from ticket
4876) seems to use incorrect weight tables. It appears those tables
were not zigzag-scanned.

Apply zigzag on weight tables for new CIDs 1258, 1259, and 1260, and
fix an incorrect chroma table for CID 1256.

Fixes last issue from ticket #4876.

Found-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 428424fe75206753ab2039e624031c9643623ea0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Christophe Gisquet
f5f9c166a1 dnxhddec: decode and use interlace mb flag
This bit is 1 in some samples, and seems to coincide with interlaced
mbs and CID1260. 2008 specs do not know about it, and maintain qscale
is 11 bits. This looks oversized, but may help larger bitdepths.

Currently, it leads to an obviously incorrect qscale value, meaning
its syntax is shifted by 1. However, reading 11 bits also leads to
obviously incorrect decoding: qscale seems to be 10 bits.

However, as most profiles still have 11bits qscale, the feature is
restricted to the CID1260 profile.

The encoder writes 12 bits of syntax, last and first bits always 0,
which is now somewhat inconsistent with the decoder, but ends up with
the same effect (progressive + reserved bit).

Partially fixes ticket #4876.

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Pedro Arthur
01bf0a178d swscale: fix ticket #4877
(cherry picked from commit a8602dde5e0a9858b9cee7e3788bef8efc43d950)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
3cd1be9702 avcodec/rangecoder: Check e
Fixes hang.nut

Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b2955b6c5aed11026ec5c7164462899a10cdb937)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
d4b1fe72c2 avcodec/ffv1: seperate slice_count from max_slice_count
Fix segfault with too large slice_count
Fixes Ticket4879

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Pedro Arthur
a8d0dcbafa swscale: fix ticket 4850
(cherry picked from commit 77367f61b38dbdf17c31aa6a6b3edccb2ebf5354)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
2a6103a082 cmdutils: Filter dst/srcw/h
Dimensions / pixel formats for scaling must be set through the -s / pix_fmt options
or the scale / format filters. Otherwise there are mismatches between whet is
in/output to the scaler and for what the scaler is configured

Fixes Ticket4856

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Ganesh Ajjanagadde
3fedd64d4b avutil/log: fix zero length gnu_printf format string warning
This should fix warning reported by fate client:
http://fate.ffmpeg.org/report.cgi?time=20150917113121&slot=x86_32-linux-gnu-gcc-4.5.1-have_6regs.
Untested.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 63cdb6e4a59e296e27a78ac08f15500b42cd27fc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Simon Thelen
9bbcd1cc7b lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
Not requiring this can end up producing hilariously broken files
together with -c:s copy (e.g. a webvtt file containing binary subtitle data).

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b84232694ef0c6897e82b52326c9ea4027c69ec4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
9801c9524a swscale/swscale: Fix "unused variable" warning
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0ae40c5a70490f102f7b1c62018746d3b424fa07)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
08fc0d771a avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 055e56e9f76da3298f1b59bf5ea46f570e844600)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
a3db85581e MAINTAINERS: add 2.8, drop 2.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
James Almer
ddbb8d5eda doc: mention libavcodec can decode Opus natively
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit fd9ac48dc8aebcbd601af34336234d5102b36e21)
2015-09-20 23:30:50 -03:00
Hendrik Leppkes
41aa6b2095 hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
Fixes ticket #4185.

Reviewed-By: Mickael Raulet <Mickael.Raulet@insa-rennes.fr>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-20 00:18:57 +02:00
Paul B Mahol
fb0d41932d avfilter/af_ladspa: process all channels for nb_handles > 1
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit dc1050a3e8557fc423023036f698cc476fb675b4)
2015-09-16 12:50:13 +00:00
Ricardo Constantino
aa46ae8848 configure: add libsoxr to swresample's pkgconfig
Fixes linking in FFMS and f265 at least, when ffmpeg is compiled with
libsoxr.

Signed-off-by: Ricardo Constantino <wiiaboo@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2641eeeefe93767e812d0acb9e3cb9bf157e6e95)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2015-09-09 07:41:33 -07:00
Hendrik Schreiber
c3021738fc lavc: Fix compilation with --disable-everything --enable-parser=mpeg4video.
(cherry picked from commit 9d742d23d28c11749f90128aee0522270fd93a81)
2015-09-09 16:23:26 +02:00
Michael Niedermayer
b72c184194 avcodec/h264_sei: Remove "Subtitles with data type 0x%02x" sample request
Suggested-by: Carl and Hendrik
2015-09-08 23:02:00 +02:00
Michael Niedermayer
d86c5f8de8 RELEASE_NOTES based on 2.7
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-08 22:33:04 +02:00
周晓勇
0752e44b1f avcodec: loongson delete invalid simple idct put and add optimization
Change-Id: I23a36c65915f01a1cf20e317c14b8eaaa62958b4
Signed-off-by: ZhouXiaoyong <zhouxiaoyong@loongson.cn>

Fixes Decoding of http://loongnix.org/ftp/multimedia/testing/nanocore_720p_24fps_mpeg4_ac3_short.avi

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-08 22:31:44 +02:00
Michael Niedermayer
1d42df7292 Add NOA credits 2015-09-08 22:31:44 +02:00
Gwenole Beauchesne
eaabfe8ef8 vaapi: fix local header include.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit aea611dc3e9e8e40c43b2b89f1af957c383cb0f3)
2015-09-07 15:32:56 +02:00
Michael Niedermayer
90d29c3d04 Changelog: Add 2.8
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-06 16:00:01 +02:00
Michael Niedermayer
48211b0c0d set version to 2.8
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-06 15:48:55 +02:00
Ganesh Ajjanagadde
aa661d3672 avfilter/af_asyncts: use llabs for int64_t
long may not be 64 bit on all platforms; so labs on int64_t is unsafe.
This fixes a warning reported in:
http://fate.ffmpeg.org/log.cgi?time=20150905071512&log=compile&slot=i386-darwin-clang-polly-3.7

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d74123d03eb1047b844bc39fbde26f199c72cbcb)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-06 12:11:23 +02:00
Zhang Rui
8cd24f8fe7 avformat/async: replace strerror with av_err2str
Fixes CID1322337

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-06 11:56:54 +02:00
Rostislav Pehlivanov
7e853879ce fate: increase the fuzz of the AAC encoder aref test
Almost fine on SunOS without yasm but 5 wasn't enough.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 00:27:08 +02:00
Michael Niedermayer
f598ca088e doc/APIchanges: Fill in missing fields and correct one lavu version
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0acd4e75fdad1b6656a8722e386679ec9f8b0ba7)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 18:34:01 +02:00
Michael Niedermayer
2710c14a83 doc/APIchanges: add 2.8 cut line
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 982e235d76d3b436e5a247e2083c7dec16040eee)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 18:33:58 +02:00
James Almer
1a56be9cdc avutil: undo FF_API_CRYPTO_CONTEXT deprecation for 2.8 release
There's no consensus yet if this deprecation is desired, so it's removed
from this release for the time being

Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-05 13:02:29 -03:00
106 changed files with 3587 additions and 662 deletions

View File

@ -1,7 +1,95 @@
Entries are sorted chronologically from oldest to youngest within each release, Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest. releases are sorted from youngest to oldest.
version <next>: version 2.8.2
- various fixes in the aac_fixed decoder
- various fixes in softfloat
- swresample/resample: increase precision for compensation
- lavf/mov: add support for sidx fragment indexes
- avformat/mxfenc: Only store user comment related tags when needed
- tests/fate/avformat: Fix fate-lavf
- doc/ffmpeg: Clarify that the sdp_file option requires an rtp output.
- ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
- apng: use correct size for output buffer
- jvdec: avoid unsigned overflow in comparison
- avcodec/jpeg2000dec: Clip all tile coordinates
- avcodec/microdvddec: Check for string end in 'P' case
- avcodec/dirac_parser: Fix undefined memcpy() use
- avformat/xmv: Discard remainder of packet on error
- avformat/xmv: factor return check out of if/else
- avcodec/mpeg12dec: Do not call show_bits() with invalid bits
- avcodec/faxcompr: Add missing runs check in decode_uncompressed()
- libavutil/channel_layout: Check strtol*() for failure
- avformat/mpegts: Only start probing data streams within probe_packets
- avcodec/hevc_ps: Check chroma_format_idc
- avcodec/ffv1dec: Check for 0 quant tables
- avcodec/mjpegdec: Reinitialize IDCT on BPP changes
- avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
- avutil/file_open: avoid file handle inheritance on Windows
- avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet
- avformat/hls: update cookies on setcookie response
- opusdec: Don't run vector_fmul_scalar on zero length arrays
- avcodec/opusdec: Fix extra samples read index
- avcodec/ffv1: Initialize vlc_state on allocation
- avcodec/ffv1dec: update progress in case of broken pointer chains
- avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
- rtsp: Allow $ as interleaved packet indicator before a complete response header
- videodsp: don't overread edges in vfix3 emu_edge.
- avformat/mp3dec: improve junk skipping heuristic
- concatdec: fix file_start_time calculation regression
- avcodec: loongson optimize h264dsp idct and loop filter with mmi
- avcodec/jpeg2000dec: Clear properties in jpeg2000_dec_cleanup() too
- avformat/hls: add support for EXT-X-MAP
- avformat/hls: fix segment selection regression on track changes of live streams
- configure: Require libkvazaar < 0.7.
- avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
version 2.8.1:
- swscale: fix ticket #4881
- doc: fix spelling errors
- hls: only seek if there is an offset
- asfdec: add more checks for size left in asf packet buffer
- asfdec: alloc enough space for storing name in asf_read_metadata_obj
- avcodec/pngdec: Check blend_op.
- h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc
- avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_buf
- avformat/avidec: Workaround broken initial frame
- avformat/hls: fix some cases of HLS streams which require cookies
- avcodec/pngdec: reset has_trns after every decode_frame_png()
- lavf/img2dec: Fix memory leak
- avcodec/mp3: fix skipping zeros
- avformat/srtdec: make sure we probe a number
- configure: check for ID3D11VideoContext
- avformat/vobsub: compare correct packet stream IDs
- avformat/srtdec: more lenient first line probing
- avformat/srtdec: fix number check for the first character
- avcodec/mips: build fix for MSA 64bit
- avcodec/mips: build fix for MSA
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
- libavformat/hlsenc: Use of uninitialized memory unlinking old files
- avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
- avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
- avcodec/ffv1dec: Explicitly check read_quant_table() return value
- dnxhddata: correct weight tables
- dnxhddec: decode and use interlace mb flag
- swscale: fix ticket #4877
- avcodec/rangecoder: Check e
- avcodec/ffv1: separate slice_count from max_slice_count
- swscale: fix ticket 4850
- cmdutils: Filter dst/srcw/h
- avutil/log: fix zero length gnu_printf format string warning
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
- swscale/swscale: Fix "unused variable" warning
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
- MAINTAINERS: add 2.8, drop 2.2
- doc: mention libavcodec can decode Opus natively
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
- avfilter/af_ladspa: process all channels for nb_handles > 1
- configure: add libsoxr to swresample's pkgconfig
- lavc: Fix compilation with --disable-everything --enable-parser=mpeg4video.
version 2.8:
- colorkey video filter - colorkey video filter
- BFSTM/BCSTM demuxer - BFSTM/BCSTM demuxer
- little-endian ADPCM_THP decoder - little-endian ADPCM_THP decoder

View File

@ -564,11 +564,11 @@ x86 Michael Niedermayer
Releases Releases
======== ========
2.8 Michael Niedermayer
2.7 Michael Niedermayer 2.7 Michael Niedermayer
2.6 Michael Niedermayer 2.6 Michael Niedermayer
2.5 Michael Niedermayer 2.5 Michael Niedermayer
2.4 Michael Niedermayer 2.4 Michael Niedermayer
2.2 Michael Niedermayer
If you want to maintain an older release, please contact us If you want to maintain an older release, please contact us

View File

@ -1 +1 @@
2.7.git 2.8.2

15
RELEASE_NOTES Normal file
View File

@ -0,0 +1,15 @@
┌────────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 2.8 "Feynman" │
└────────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 2.8 "Feynman", about 3
months after the release of FFmpeg 2.7.
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.

View File

@ -563,6 +563,12 @@ int opt_default(void *optctx, const char *opt, const char *arg)
struct SwsContext *sws = sws_alloc_context(); struct SwsContext *sws = sws_alloc_context();
int ret = av_opt_set(sws, opt, arg, 0); int ret = av_opt_set(sws, opt, arg, 0);
sws_freeContext(sws); sws_freeContext(sws);
if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
!strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
!strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
return AVERROR(EINVAL);
}
if (ret < 0) { if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
return ret; return ret;

9
configure vendored
View File

@ -2374,7 +2374,7 @@ zmbv_encoder_select="zlib"
# hardware accelerators # hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h" crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder" d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode" dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
vaapi_deps="va_va_h" vaapi_deps="va_va_h"
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads CoreServices_CoreServices_h" vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads CoreServices_CoreServices_h"
@ -5147,6 +5147,7 @@ check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
check_type "windows.h d3d11.h" "ID3D11VideoDecoder" check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
check_type "windows.h d3d11.h" "ID3D11VideoContext"
check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602 check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
check_type "va/va.h" "VAPictureParameterBufferHEVC" check_type "va/va.h" "VAPictureParameterBufferHEVC"
@ -5239,7 +5240,7 @@ enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
check_lib "${gsm_hdr}" gsm_create -lgsm && break; check_lib "${gsm_hdr}" gsm_create -lgsm && break;
done || die "ERROR: libgsm not found"; } done || die "ERROR: libgsm not found"; }
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
enabled libkvazaar && require_pkg_config kvazaar kvazaar.h kvz_api_get enabled libkvazaar && require_pkg_config "kvazaar < 0.7.0" kvazaar.h kvz_api_get
enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
@ -5261,7 +5262,7 @@ enabled libshine && require_pkg_config shine shine/layer3.h shine_encod
enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init || enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
require smbclient libsmbclient.h smbc_init -lsmbclient; } require smbclient libsmbclient.h smbc_init -lsmbclient; }
enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
@ -6264,4 +6265,4 @@ pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVF
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM" pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR"

View File

@ -15,27 +15,29 @@ libavutil: 2014-08-09
API changes, most recent first: API changes, most recent first:
2015-xx-xx - lavc 56.58.100 - vaapi.h -------- 8< --------- FFmpeg 2.8 was cut here -------- 8< ---------
2015-08-27 - 1dd854e1 - lavc 56.58.100 - vaapi.h
Deprecate old VA-API context (vaapi_context) fields that were only Deprecate old VA-API context (vaapi_context) fields that were only
set and used by libavcodec. They are all managed internally now. set and used by libavcodec. They are all managed internally now.
2015-xx-xx - lavu 54.31.100 - pixfmt.h 2015-08-19 - 9f8e57ef - lavu 54.31.100 - pixfmt.h
Add a unique pixel format for VA-API (AV_PIX_FMT_VAAPI) that Add a unique pixel format for VA-API (AV_PIX_FMT_VAAPI) that
indicates the nature of the underlying storage: a VA surface. This indicates the nature of the underlying storage: a VA surface. This
yields the same value as AV_PIX_FMT_VAAPI_VLD. yields the same value as AV_PIX_FMT_VAAPI_VLD.
Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO, Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO,
AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD. AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD.
2015-xx-xx - lavu 54.30.0 2015-08-02 - lavu 54.30.100 / 54.17.0
xxxxxxx - Add av_blowfish_alloc(). 9ed59f1 / 7a7df34c - Add av_blowfish_alloc().
xxxxxxx - Add av_rc4_alloc(). a130ec9 / ae365453 - Add av_rc4_alloc().
xxxxxxx - Add av_xtea_alloc(). 9ca1997 / 5d8bea3b - Add av_xtea_alloc().
xxxxxxx - Add av_des_alloc(). 3cf08e9 / d9e8b47e - Add av_des_alloc().
2015-xx-xx - lavc 56.35.0 - avcodec.h 2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h
xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*. 94d68a4 / 7c6eb0a1 - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
xxxxxxxxx - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*. 444e987 / def97856 - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
xxxxxxxxx - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE 29d147c / 059a9348 - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE. to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.
2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h 2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h

View File

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

View File

@ -1353,7 +1353,7 @@ can be selected with @code{-pred 1}.
@table @option @table @option
@item format @item format
Can be set to either @code{j2k} or @code{jp2} (the default) that Can be set to either @code{j2k} or @code{jp2} (the default) that
allows to store non-rgb pix_fmts. makes it possible to store non-rgb pix_fmts.
@end table @end table

View File

@ -1205,9 +1205,9 @@ The option is intended for cases where features are needed that cannot be
specified to @command{ffserver} but can be to @command{ffmpeg}. specified to @command{ffserver} but can be to @command{ffmpeg}.
@item -sdp_file @var{file} (@emph{global}) @item -sdp_file @var{file} (@emph{global})
Print sdp information to @var{file}. Print sdp information for an output stream to @var{file}.
This allows dumping sdp information when at least one output isn't an This allows dumping sdp information when at least one output isn't an
rtp stream. rtp stream. (Requires at least one of the output formats to be rtp).
@item -discard (@emph{input}) @item -discard (@emph{input})
Allows discarding specific streams or frames of streams at the demuxer. Allows discarding specific streams or frames of streams at the demuxer.

View File

@ -1032,7 +1032,7 @@ Number_of_samples
For example full key look like this @code{lavfi.astats.1.DC_offset} or For example full key look like this @code{lavfi.astats.1.DC_offset} or
this @code{lavfi.astats.Overall.Peak_count}. this @code{lavfi.astats.Overall.Peak_count}.
For description what each key means read bellow. For description what each key means read below.
@item reset @item reset
Set number of frame after which stats are going to be recalculated. Set number of frame after which stats are going to be recalculated.
@ -2199,7 +2199,7 @@ Amount of milliseconds the signal has to rise above the threshold before gain
reduction starts. Default is 20. Range is between 0.01 and 2000. reduction starts. Default is 20. Range is between 0.01 and 2000.
@item release @item release
Amount of milliseconds the signal has to fall bellow the threshold before Amount of milliseconds the signal has to fall below the threshold before
reduction is decreased again. Default is 250. Range is between 0.01 and 9000. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
@item makeup @item makeup
@ -4118,7 +4118,7 @@ It accepts the following options:
@item threshold1 @item threshold1
@item threshold2 @item threshold2
@item threshold3 @item threshold3
Allows to limit the maximum change for each plane, default is 65535. Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged. If 0, plane will remain unchanged.
@end table @end table
@ -4321,7 +4321,7 @@ It accepts the following options:
@item threshold1 @item threshold1
@item threshold2 @item threshold2
@item threshold3 @item threshold3
Allows to limit the maximum change for each plane, default is 65535. Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged. If 0, plane will remain unchanged.
@item coordinates @item coordinates
@ -5206,7 +5206,7 @@ It accepts the following options:
@item threshold1 @item threshold1
@item threshold2 @item threshold2
@item threshold3 @item threshold3
Allows to limit the maximum change for each plane, default is 65535. Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged. If 0, plane will remain unchanged.
@item coordinates @item coordinates
@ -6900,7 +6900,7 @@ It accepts the following options:
@item threshold1 @item threshold1
@item threshold2 @item threshold2
@item threshold3 @item threshold3
Allows to limit the maximum change for each plane, default is 65535. Limit the maximum change for each plane, default is 65535.
If 0, plane will remain unchanged. If 0, plane will remain unchanged.
@end table @end table
@ -9881,7 +9881,7 @@ stereo3d=sbsl:aybd
@end example @end example
@item @item
Convert input video from above bellow (left eye above, right eye below) to side by side crosseye. Convert input video from above below (left eye above, right eye below) to side by side crosseye.
@example @example
stereo3d=abl:sbsr stereo3d=abl:sbsr
@end example @end example

View File

@ -983,8 +983,8 @@ following image formats are supported:
@item Musepack SV8 @tab @tab X @item Musepack SV8 @tab @tab X
@item Nellymoser Asao @tab X @tab X @item Nellymoser Asao @tab X @tab X
@item On2 AVC (Audio for Video Codec) @tab @tab X @item On2 AVC (Audio for Video Codec) @tab @tab X
@item Opus @tab E @tab E @item Opus @tab E @tab X
@tab supported through external library libopus @tab encoding supported through external library libopus
@item PCM A-law @tab X @tab X @item PCM A-law @tab X @tab X
@item PCM mu-law @tab X @tab X @item PCM mu-law @tab X @tab X
@item PCM signed 8-bit planar @tab X @tab X @item PCM signed 8-bit planar @tab X @tab X

View File

@ -839,6 +839,21 @@ ffmpeg -i file.mpg -c copy \
-y out.ts -y out.ts
@end example @end example
@section mxf, mxf_d10
MXF muxer.
@subsection Options
The muxer options are:
@table @option
@item store_user_comments @var{bool}
Set if user comments should be stored if available or never.
IRT D-10 does not allow user comments. The default is thus to write them for
mxf but not for mxf_d10
@end table
@section null @section null
Null muxer. Null muxer.

View File

@ -2447,6 +2447,9 @@ static void print_sdp(void)
} }
} }
if (!j)
goto fail;
av_sdp_create(avc, j, sdp, sizeof(sdp)); av_sdp_create(avc, j, sdp, sizeof(sdp));
if (!sdp_filename) { if (!sdp_filename) {
@ -2462,6 +2465,7 @@ static void print_sdp(void)
} }
} }
fail:
av_freep(&avc); av_freep(&avc);
} }

View File

@ -861,7 +861,7 @@ OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \ OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
mpeg4videodec.o mpeg4video.o \ mpeg4videodec.o mpeg4video.o \
ituh263dec.o h263dec.o ituh263dec.o h263dec.o h263data.o
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \ OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
mpegaudiodecheader.o mpegaudiodata.o mpegaudiodecheader.o mpegaudiodata.o

View File

@ -2889,6 +2889,11 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
spectral_to_sample(ac, samples); spectral_to_sample(ac, samples);
if (!ac->frame->data[0] && samples) {
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
return AVERROR_INVALIDDATA;
}
ac->frame->nb_samples = samples; ac->frame->nb_samples = samples;
ac->frame->sample_rate = avctx->sample_rate; ac->frame->sample_rate = avctx->sample_rate;
*got_frame_ptr = 1; *got_frame_ptr = 1;

View File

@ -169,6 +169,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
else else
temp1.mant = 0x20000000; temp1.mant = 0x20000000;
temp1.exp = (temp1.exp >> 1) + 1; temp1.exp = (temp1.exp >> 1) + 1;
if (temp1.exp > 66) { // temp1 > 1E20
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = FLOAT_1;
}
temp2.exp = (pan_offset - sbr->data[1].env_facs[e][k].mant) * alpha; temp2.exp = (pan_offset - sbr->data[1].env_facs[e][k].mant) * alpha;
if (temp2.exp & 1) if (temp2.exp & 1)
@ -188,6 +192,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
temp1.exp = NOISE_FLOOR_OFFSET - \ temp1.exp = NOISE_FLOOR_OFFSET - \
sbr->data[0].noise_facs[e][k].mant + 2; sbr->data[0].noise_facs[e][k].mant + 2;
temp1.mant = 0x20000000; temp1.mant = 0x20000000;
if (temp1.exp > 66) { // temp1 > 1E20
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = FLOAT_1;
}
temp2.exp = 12 - sbr->data[1].noise_facs[e][k].mant + 1; temp2.exp = 12 - sbr->data[1].noise_facs[e][k].mant + 1;
temp2.mant = 0x20000000; temp2.mant = 0x20000000;
fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2)); fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
@ -208,7 +216,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
else else
temp1.mant = 0x20000000; temp1.mant = 0x20000000;
temp1.exp = (temp1.exp >> 1) + 1; temp1.exp = (temp1.exp >> 1) + 1;
if (temp1.exp > 66) { // temp1 > 1E20
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
temp1 = FLOAT_1;
}
sbr->data[ch].env_facs[e][k] = temp1; sbr->data[ch].env_facs[e][k] = temp1;
} }
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++) for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
@ -397,7 +408,8 @@ static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
int delta = !((e == e_a[1]) || (e == e_a[0])); int delta = !((e == e_a[1]) || (e == e_a[0]));
for (k = 0; k < sbr->n_lim; k++) { for (k = 0; k < sbr->n_lim; k++) {
SoftFloat gain_boost, gain_max; SoftFloat gain_boost, gain_max;
SoftFloat sum[2] = { { 0, 0}, { 0, 0 } }; SoftFloat sum[2];
sum[0] = sum[1] = FLOAT_0;
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) { for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
const SoftFloat temp = av_div_sf(sbr->e_origmapped[e][m], const SoftFloat temp = av_div_sf(sbr->e_origmapped[e][m],
av_add_sf(FLOAT_1, sbr->q_mapped[e][m])); av_add_sf(FLOAT_1, sbr->q_mapped[e][m]));

View File

@ -1412,7 +1412,7 @@ static void sbr_env_estimate(AAC_FLOAT (*e_curr)[48], INTFLOAT X_high[64][40][2]
for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) { for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) {
#if USE_FIXED #if USE_FIXED
SoftFloat sum = { 0, 0 }; SoftFloat sum = FLOAT_0;
const SoftFloat den = av_int2sf(0x20000000 / (env_size * (table[p + 1] - table[p])), 29); const SoftFloat den = av_int2sf(0x20000000 / (env_size * (table[p + 1] - table[p])), 29);
for (k = table[p]; k < table[p + 1]; k++) { for (k = table[p]; k < table[p + 1]; k++) {
sum = av_add_sf(sum, sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb)); sum = av_add_sf(sum, sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb));

View File

@ -123,7 +123,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
DiracParseContext *pc = s->priv_data; DiracParseContext *pc = s->priv_data;
if (pc->overread_index) { if (pc->overread_index) {
memcpy(pc->buffer, pc->buffer + pc->overread_index, memmove(pc->buffer, pc->buffer + pc->overread_index,
pc->index - pc->overread_index); pc->index - pc->overread_index);
pc->index -= pc->overread_index; pc->index -= pc->overread_index;
pc->overread_index = 0; pc->overread_index = 0;

View File

@ -48,7 +48,7 @@ static const uint8_t dnxhd_1235_chroma_weight[] = {
90, 90, 85, 79, 73, 73, 73, 73, 90, 90, 85, 79, 73, 73, 73, 73,
}; };
/* Used in CID 1237, 1253 */ /* Used in CID 1237, 1253, 1259 */
static const uint8_t dnxhd_1237_luma_weight[] = { static const uint8_t dnxhd_1237_luma_weight[] = {
0, 32, 33, 34, 34, 36, 37, 36, 0, 32, 33, 34, 34, 36, 37, 36,
36, 37, 38, 38, 38, 39, 41, 44, 36, 37, 38, 38, 38, 39, 41, 44,
@ -60,7 +60,7 @@ static const uint8_t dnxhd_1237_luma_weight[] = {
97, 100, 104, 102, 98, 98, 99, 99, 97, 100, 104, 102, 98, 98, 99, 99,
}; };
/* Used in CID 1237, 1253 */ /* Used in CID 1237, 1253, 1259 */
static const uint8_t dnxhd_1237_chroma_weight[] = { static const uint8_t dnxhd_1237_chroma_weight[] = {
0, 32, 36, 39, 39, 38, 39, 41, 0, 32, 36, 39, 39, 38, 39, 41,
45, 51, 57, 58, 53, 48, 47, 51, 45, 51, 57, 58, 53, 48, 47, 51,
@ -204,6 +204,7 @@ static const uint8_t dnxhd_1251_chroma_weight[] = {
61, 59, 59, 59, 61, 62, 62, 62, 61, 59, 59, 59, 61, 62, 62, 62,
}; };
/* Used in CID 1252, 1258 */
static const uint8_t dnxhd_1252_luma_weight[] = { static const uint8_t dnxhd_1252_luma_weight[] = {
0, 32, 34, 35, 36, 36, 36, 37, 0, 32, 34, 35, 36, 36, 36, 37,
36, 37, 39, 40, 41, 40, 40, 40, 36, 37, 39, 40, 41, 40, 40, 40,
@ -214,6 +215,8 @@ static const uint8_t dnxhd_1252_luma_weight[] = {
71, 82, 90, 90, 88, 87, 90, 95, 71, 82, 90, 90, 88, 87, 90, 95,
100, 107, 103, 97, 95, 93, 99, 99, 100, 107, 103, 97, 95, 93, 99, 99,
}; };
/* Used in CID 1252, 1258 */
static const uint8_t dnxhd_1252_chroma_weight[] = { static const uint8_t dnxhd_1252_chroma_weight[] = {
0, 32, 35, 36, 37, 37, 38, 40, 0, 32, 35, 36, 37, 37, 38, 40,
42, 46, 49, 50, 50, 49, 49, 53, 42, 46, 49, 50, 50, 49, 49, 53,
@ -226,80 +229,36 @@ static const uint8_t dnxhd_1252_chroma_weight[] = {
}; };
static const uint8_t dnxhd_1256_chroma_weight[] = { static const uint8_t dnxhd_1256_chroma_weight[] = {
0, 32, 32, 32, 32, 32, 32, 33, 0, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 34, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 33, 37, 32, 32, 32, 32, 32, 32, 37, 32,
32, 32, 32, 32, 32, 32, 36, 39, 32, 32, 32, 32, 33, 32, 32, 32,
32, 32, 32, 32, 32, 34, 39, 44, 32, 32, 33, 34, 37, 36, 32, 32,
32, 37, 32, 32, 35, 40, 43, 49, 32, 33, 34, 37, 36, 34, 35, 36,
32, 33, 36, 36, 40, 43, 50, 60, 39, 44, 40, 40, 39, 39, 44, 43,
34, 37, 39, 44, 51, 56, 61, 70, 43, 51, 56, 50, 49, 60, 61, 70,
};
static const uint8_t dnxhd_1258_luma_weight[] = {
0, 32, 36, 36, 40, 40, 55, 60,
34, 36, 37, 40, 41, 48, 57, 82,
35, 36, 41, 41, 46, 52, 73, 82,
37, 40, 42, 45, 50, 65, 80, 87,
39, 41, 44, 49, 62, 78, 88, 90,
41, 44, 49, 58, 73, 90, 95, 95,
43, 52, 55, 68, 90, 100, 97, 93,
52, 53, 71, 82, 107, 103, 99, 99,
};
static const uint8_t dnxhd_1258_chroma_weight[] = {
0, 32, 37, 38, 49, 53, 65, 66,
35, 37, 40, 49, 56, 64, 65, 82,
36, 42, 50, 56, 64, 67, 73, 85,
46, 50, 57, 63, 71, 72, 89, 87,
49, 58, 65, 72, 78, 88, 88, 90,
60, 64, 74, 81, 84, 90, 95, 134,
62, 74, 77, 80, 90, 114, 129, 125,
74, 74, 90, 100, 128, 125, 116, 116,
};
static const uint8_t dnxhd_1259_luma_weight[] = {
0, 32, 36, 37, 41, 44, 54, 60,
33, 34, 36, 39, 43, 51, 62, 78,
34, 36, 38, 41, 49, 59, 73, 79,
37, 38, 40, 47, 55, 66, 80, 95,
38, 41, 46, 54, 63, 79, 93, 96,
46, 47, 56, 64, 78, 90, 97, 98,
49, 58, 66, 78, 89, 97, 102, 98,
61, 65, 82, 87, 100, 104, 99, 99,
};
static const uint8_t dnxhd_1259_chroma_weight[] = {
0, 32, 38, 39, 47, 51, 77, 83,
36, 39, 41, 48, 55, 74, 85, 95,
39, 45, 53, 58, 72, 83, 105, 89,
51, 58, 66, 73, 82, 109, 92, 95,
57, 75, 78, 89, 105, 95, 93, 96,
81, 82, 99, 99, 94, 90, 97, 98,
83, 96, 97, 93, 89, 97, 102, 98,
90, 94, 92, 88, 100, 104, 99, 99,
}; };
static const uint8_t dnxhd_1260_luma_weight[] = { static const uint8_t dnxhd_1260_luma_weight[] = {
0, 32, 37, 37, 40, 41, 52, 53, 0, 32, 33, 34, 36, 37, 37, 36,
33, 36, 36, 38, 40, 48, 49, 52, 34, 33, 34, 35, 37, 38, 40, 41,
34, 34, 37, 39, 44, 47, 49, 54, 40, 39, 38, 37, 34, 33, 34, 37,
33, 35, 38, 40, 45, 46, 54, 51, 40, 44, 48, 52, 53, 49, 47, 45,
34, 37, 37, 42, 44, 49, 52, 48, 42, 38, 36, 36, 38, 41, 43, 44,
34, 34, 38, 43, 44, 51, 50, 50, 46, 49, 52, 54, 54, 49, 44, 44,
33, 36, 41, 44, 51, 52, 50, 54, 44, 47, 51, 51, 52, 51, 48, 50,
36, 38, 44, 47, 53, 53, 54, 54, 52, 53, 53, 50, 50, 54, 54, 54,
}; };
static const uint8_t dnxhd_1260_chroma_weight[] = { static const uint8_t dnxhd_1260_chroma_weight[] = {
0, 32, 40, 38, 42, 40, 45, 45, 0, 32, 34, 38, 42, 40, 38, 36,
34, 42, 36, 43, 38, 46, 46, 49, 35, 35, 38, 42, 43, 43, 42, 40,
38, 35, 43, 39, 44, 47, 47, 49, 38, 39, 43, 43, 42, 41, 43, 43,
35, 42, 43, 42, 46, 47, 49, 52, 42, 44, 46, 45, 45, 46, 47, 46,
38, 43, 43, 44, 50, 49, 56, 50, 44, 44, 45, 46, 46, 46, 50, 50,
42, 43, 44, 50, 51, 57, 52, 53, 47, 47, 49, 49, 49, 49, 51, 53,
41, 45, 46, 53, 53, 56, 53, 54, 51, 49, 53, 57, 56, 52, 50, 52,
46, 46, 51, 49, 56, 53, 58, 58, 56, 56, 53, 53, 53, 54, 58, 58,
}; };
/* Used in CID 1235, 1241, 1250, 1256 */ /* Used in CID 1235, 1241, 1250, 1256 */
@ -1090,14 +1049,14 @@ const CIDEntry ff_dnxhd_cid_table[] = {
{ 350, 390, 440, 730, 880 }, { 350, 390, 440, 730, 880 },
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } }, { { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
{ 1258, 960, 720, 0, 212992, 212992, 4, 8, 5, { 1258, 960, 720, 0, 212992, 212992, 4, 8, 5,
dnxhd_1258_luma_weight, dnxhd_1258_chroma_weight, dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
dnxhd_1237_dc_codes, dnxhd_1237_dc_bits, dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level, dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
dnxhd_1252_ac_flags, dnxhd_1252_ac_flags,
dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run, dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
{ 42, 60, 75, 115 } }, { 42, 60, 75, 115 } },
{ 1259, 1440, 1080, 0, 417792, 417792, 4, 8, 3, { 1259, 1440, 1080, 0, 417792, 417792, 4, 8, 3,
dnxhd_1259_luma_weight, dnxhd_1259_chroma_weight, dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
dnxhd_1237_dc_codes, dnxhd_1237_dc_bits, dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level, dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
dnxhd_1237_ac_flags, dnxhd_1237_ac_flags,

View File

@ -349,7 +349,12 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
uint8_t *dest_y, *dest_u, *dest_v; uint8_t *dest_y, *dest_u, *dest_v;
int dct_y_offset, dct_x_offset; int dct_y_offset, dct_x_offset;
int qscale, i; int qscale, i;
int interlaced_mb = 0;
if (ctx->cid_table->cid == 1260) {
interlaced_mb = get_bits1(&ctx->gb);
qscale = get_bits(&ctx->gb, 10);
} else
qscale = get_bits(&ctx->gb, 11); qscale = get_bits(&ctx->gb, 11);
skip_bits1(&ctx->gb); skip_bits1(&ctx->gb);
@ -386,8 +391,12 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
dest_u += frame->linesize[1]; dest_u += frame->linesize[1];
dest_v += frame->linesize[2]; dest_v += frame->linesize[2];
} }
if (interlaced_mb) {
dct_linesize_luma <<= 1;
dct_linesize_chroma <<= 1;
}
dct_y_offset = dct_linesize_luma << 3; dct_y_offset = interlaced_mb ? frame->linesize[0] : (dct_linesize_luma << 3);
dct_x_offset = 8 << shift1; dct_x_offset = 8 << shift1;
if (!ctx->is_444) { if (!ctx->is_444) {
ctx->idsp.idct_put(dest_y, dct_linesize_luma, ctx->blocks[0]); ctx->idsp.idct_put(dest_y, dct_linesize_luma, ctx->blocks[0]);
@ -396,7 +405,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]); ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) { if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
dct_y_offset = dct_linesize_chroma << 3; dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]); ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
ctx->idsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[3]); ctx->idsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[3]);
ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]); ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]);
@ -409,7 +418,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]); ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]);
if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) { if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
dct_y_offset = dct_linesize_chroma << 3; dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]); ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
ctx->idsp.idct_put(dest_u + dct_x_offset, dct_linesize_chroma, ctx->blocks[3]); ctx->idsp.idct_put(dest_u + dct_x_offset, dct_linesize_chroma, ctx->blocks[3]);
ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[8]); ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[8]);

View File

@ -189,6 +189,10 @@ static int decode_uncompressed(AVCodecContext *avctx, GetBitContext *gb,
*mode = !*mode; *mode = !*mode;
if (newmode != *mode) { //FIXME CHECK if (newmode != *mode) { //FIXME CHECK
*(*runs)++ = 0; *(*runs)++ = 0;
if (*runs >= runend) {
av_log(avctx, AV_LOG_ERROR, "uncompressed run overrun\n");
return AVERROR_INVALIDDATA;
}
*mode = newmode; *mode = newmode;
} }
return 0; return 0;

View File

@ -66,7 +66,7 @@ av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
{ {
int j; int j, i;
fs->plane_count = f->plane_count; fs->plane_count = f->plane_count;
fs->transparency = f->transparency; fs->transparency = f->transparency;
@ -80,10 +80,15 @@ av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
if (!p->state) if (!p->state)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} else { } else {
if (!p->vlc_state) if (!p->vlc_state) {
p->vlc_state = av_malloc_array(p->context_count, sizeof(VlcState)); p->vlc_state = av_mallocz_array(p->context_count, sizeof(VlcState));
if (!p->vlc_state) if (!p->vlc_state)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
for (i = 0; i < p->context_count; i++) {
p->vlc_state[i].error_sum = 4;
p->vlc_state[i].count = 1;
}
}
} }
} }
@ -101,7 +106,7 @@ av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
av_cold int ff_ffv1_init_slices_state(FFV1Context *f) av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
{ {
int i, ret; int i, ret;
for (i = 0; i < f->slice_count; i++) { for (i = 0; i < f->max_slice_count; i++) {
FFV1Context *fs = f->slice_context[i]; FFV1Context *fs = f->slice_context[i];
if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0) if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -113,10 +118,10 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
{ {
int i; int i;
f->slice_count = f->num_h_slices * f->num_v_slices; f->max_slice_count = f->num_h_slices * f->num_v_slices;
av_assert0(f->slice_count > 0); av_assert0(f->max_slice_count > 0);
for (i = 0; i < f->slice_count; i++) { for (i = 0; i < f->max_slice_count; i++) {
int sx = i % f->num_h_slices; int sx = i % f->num_h_slices;
int sy = i / f->num_h_slices; int sy = i / f->num_h_slices;
int sxs = f->avctx->width * sx / f->num_h_slices; int sxs = f->avctx->width * sx / f->num_h_slices;
@ -210,7 +215,7 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx)
ff_thread_release_buffer(avctx, &s->last_picture); ff_thread_release_buffer(avctx, &s->last_picture);
av_frame_free(&s->last_picture.f); av_frame_free(&s->last_picture.f);
for (j = 0; j < s->slice_count; j++) { for (j = 0; j < s->max_slice_count; j++) {
FFV1Context *fs = s->slice_context[j]; FFV1Context *fs = s->slice_context[j];
for (i = 0; i < s->plane_count; i++) { for (i = 0; i < s->plane_count; i++) {
PlaneContext *p = &fs->plane[i]; PlaneContext *p = &fs->plane[i];
@ -224,14 +229,14 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx)
av_freep(&avctx->stats_out); av_freep(&avctx->stats_out);
for (j = 0; j < s->quant_table_count; j++) { for (j = 0; j < s->quant_table_count; j++) {
av_freep(&s->initial_states[j]); av_freep(&s->initial_states[j]);
for (i = 0; i < s->slice_count; i++) { for (i = 0; i < s->max_slice_count; i++) {
FFV1Context *sf = s->slice_context[i]; FFV1Context *sf = s->slice_context[i];
av_freep(&sf->rc_stat2[j]); av_freep(&sf->rc_stat2[j]);
} }
av_freep(&s->rc_stat2[j]); av_freep(&s->rc_stat2[j]);
} }
for (i = 0; i < s->slice_count; i++) for (i = 0; i < s->max_slice_count; i++)
av_freep(&s->slice_context[i]); av_freep(&s->slice_context[i]);
return 0; return 0;

View File

@ -118,6 +118,7 @@ typedef struct FFV1Context {
struct FFV1Context *slice_context[MAX_SLICES]; struct FFV1Context *slice_context[MAX_SLICES];
int slice_count; int slice_count;
int max_slice_count;
int num_v_slices; int num_v_slices;
int num_h_slices; int num_h_slices;
int slice_width; int slice_width;

View File

@ -47,8 +47,11 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
else { else {
int i, e, a; int i, e, a;
e = 0; e = 0;
while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10 while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10
e++; e++;
if (e > 31)
return AVERROR_INVALIDDATA;
}
a = 1; a = 1;
for (i = e - 1; i >= 0; i--) for (i = e - 1; i >= 0; i--)
@ -302,7 +305,7 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
for (i = 0; i < f->plane_count; i++) { for (i = 0; i < f->plane_count; i++) {
PlaneContext * const p = &fs->plane[i]; PlaneContext * const p = &fs->plane[i];
int idx = get_symbol(c, state, 0); int idx = get_symbol(c, state, 0);
if (idx > (unsigned)f->quant_table_count) { if (idx >= (unsigned)f->quant_table_count) {
av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n"); av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
return -1; return -1;
} }
@ -405,6 +408,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
if (ff_ffv1_init_slice_state(f, fs) < 0) if (ff_ffv1_init_slice_state(f, fs) < 0)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
if (decode_slice_header(f, fs) < 0) { if (decode_slice_header(f, fs) < 0) {
fs->slice_x = fs->slice_y = fs->slice_height = fs->slice_width = 0;
fs->slice_damaged = 1; fs->slice_damaged = 1;
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -499,7 +503,10 @@ static int read_quant_tables(RangeCoder *c,
int context_count = 1; int context_count = 1;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
context_count *= read_quant_table(c, quant_table[i], context_count); int ret = read_quant_table(c, quant_table[i], context_count);
if (ret < 0)
return ret;
context_count *= ret;
if (context_count > 32768U) { if (context_count > 32768U) {
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -562,7 +569,7 @@ static int read_extra_header(FFV1Context *f)
} }
f->quant_table_count = get_symbol(c, state, 0); f->quant_table_count = get_symbol(c, state, 0);
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES) if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
for (i = 0; i < f->quant_table_count; i++) { for (i = 0; i < f->quant_table_count; i++) {
@ -775,6 +782,7 @@ static int read_header(FFV1Context *f)
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n"); av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
f->slice_count = f->max_slice_count;
} else if (f->version < 3) { } else if (f->version < 3) {
f->slice_count = get_symbol(c, state, 0); f->slice_count = get_symbol(c, state, 0);
} else { } else {
@ -789,8 +797,8 @@ static int read_header(FFV1Context *f)
p -= size + trailer; p -= size + trailer;
} }
} }
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) { if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0 || f->slice_count > f->max_slice_count) {
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n", f->slice_count); av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid (max=%d)\n", f->slice_count, f->max_slice_count);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -932,6 +940,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
else v = buf_p - c->bytestream_start; else v = buf_p - c->bytestream_start;
if (buf_p - c->bytestream_start < v) { if (buf_p - c->bytestream_start < v) {
av_log(avctx, AV_LOG_ERROR, "Slice pointer chain broken\n"); av_log(avctx, AV_LOG_ERROR, "Slice pointer chain broken\n");
ff_thread_report_progress(&f->picture, INT_MAX, 0);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
buf_p -= v; buf_p -= v;
@ -1016,6 +1025,7 @@ static int init_thread_copy(AVCodecContext *avctx)
f->picture.f = NULL; f->picture.f = NULL;
f->last_picture.f = NULL; f->last_picture.f = NULL;
f->sample_buffer = NULL; f->sample_buffer = NULL;
f->max_slice_count = 0;
f->slice_count = 0; f->slice_count = 0;
for (i = 0; i < f->quant_table_count; i++) { for (i = 0; i < f->quant_table_count; i++) {
@ -1091,7 +1101,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
av_assert0(!fdst->sample_buffer); av_assert0(!fdst->sample_buffer);
} }
av_assert1(fdst->slice_count == fsrc->slice_count); av_assert1(fdst->max_slice_count == fsrc->max_slice_count);
ff_thread_release_buffer(dst, &fdst->picture); ff_thread_release_buffer(dst, &fdst->picture);

View File

@ -977,6 +977,7 @@ slices_ok:
if ((ret = ff_ffv1_init_slice_contexts(s)) < 0) if ((ret = ff_ffv1_init_slice_contexts(s)) < 0)
return ret; return ret;
s->slice_count = s->max_slice_count;
if ((ret = ff_ffv1_init_slices_state(s)) < 0) if ((ret = ff_ffv1_init_slices_state(s)) < 0)
return ret; return ret;
@ -986,7 +987,7 @@ slices_ok:
if (!avctx->stats_out) if (!avctx->stats_out)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
for (i = 0; i < s->quant_table_count; i++) for (i = 0; i < s->quant_table_count; i++)
for (j = 0; j < s->slice_count; j++) { for (j = 0; j < s->max_slice_count; j++) {
FFV1Context *sf = s->slice_context[j]; FFV1Context *sf = s->slice_context[j];
av_assert0(!sf->rc_stat2[i]); av_assert0(!sf->rc_stat2[i]);
sf->rc_stat2[i] = av_mallocz(s->context_count[i] * sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
@ -1210,6 +1211,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
for (i = 0; i < f->quant_table_count; i++) for (i = 0; i < f->quant_table_count; i++)
memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i])); memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i]));
av_assert0(f->slice_count == f->max_slice_count);
for (j = 0; j < f->slice_count; j++) { for (j = 0; j < f->slice_count; j++) {
FFV1Context *fs = f->slice_context[j]; FFV1Context *fs = f->slice_context[j];
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {

View File

@ -32,7 +32,7 @@
/** /**
* G.726 11bit float. * G.726 11bit float.
* G.726 Standard uses rather odd 11bit floating point arithmentic for * G.726 Standard uses rather odd 11bit floating point arithmetic for
* numerous occasions. It's a mystery to me why they did it this way * numerous occasions. It's a mystery to me why they did it this way
* instead of simply using 32bit integer arithmetic. * instead of simply using 32bit integer arithmetic.
*/ */

View File

@ -122,7 +122,7 @@ pps:
if (!unit_nb && !sps_done++) { if (!unit_nb && !sps_done++) {
unit_nb = *extradata++; /* number of pps unit(s) */ unit_nb = *extradata++; /* number of pps unit(s) */
if (unit_nb) { if (unit_nb) {
ctx->pps_offset = (extradata - 1) - (avctx->extradata + 4); ctx->pps_offset = total_size;
pps_seen = 1; pps_seen = 1;
} }
} }
@ -276,7 +276,7 @@ static void h264_mp4toannexb_filter_close(AVBitStreamFilterContext *bsfc)
{ {
H264BSFContext *ctx = bsfc->priv_data; H264BSFContext *ctx = bsfc->priv_data;
if (ctx->private_spspps) if (ctx->private_spspps)
av_free(ctx->spspps_buf); av_freep(&ctx->spspps_buf);
} }
AVBitStreamFilter ff_h264_mp4toannexb_bsf = { AVBitStreamFilter ff_h264_mp4toannexb_bsf = {

View File

@ -182,8 +182,6 @@ static int decode_registered_user_data_closed_caption(H264Context *h, int size)
} }
} else { } else {
int i; int i;
avpriv_request_sample(h->avctx, "Subtitles with data type 0x%02x",
user_data_type_code);
for (i = 0; i < size - 1; i++) for (i = 0; i < size - 1; i++)
skip_bits(&h->gb, 8); skip_bits(&h->gb, 8);
} }

View File

@ -1177,6 +1177,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n"); av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (h->max_contexts > 1) {
if (!h->single_decode_warning) {
av_log(h->avctx, AV_LOG_WARNING, "Cannot decode multiple access units as slice threads\n");
h->single_decode_warning = 1;
}
h->max_contexts = 1;
return SLICE_SINGLETHREAD;
}
if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) { if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
ret = ff_h264_field_end(h, h->slice_ctx, 1); ret = ff_h264_field_end(h, h->slice_ctx, 1);
h->current_slice = 0; h->current_slice = 0;

View File

@ -809,6 +809,8 @@ static int hls_slice_header(HEVCContext *s)
s->HEVClc->tu.cu_qp_offset_cb = 0; s->HEVClc->tu.cu_qp_offset_cb = 0;
s->HEVClc->tu.cu_qp_offset_cr = 0; s->HEVClc->tu.cu_qp_offset_cr = 0;
s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || (s->nal_unit_type == NAL_CRA_NUT && s->last_eos);
return 0; return 0;
} }
@ -3135,6 +3137,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
s->pocTid0 = s0->pocTid0; s->pocTid0 = s0->pocTid0;
s->max_ra = s0->max_ra; s->max_ra = s0->max_ra;
s->eos = s0->eos; s->eos = s0->eos;
s->no_rasl_output_flag = s0->no_rasl_output_flag;
s->is_nalff = s0->is_nalff; s->is_nalff = s0->is_nalff;
s->nal_length_size = s0->nal_length_size; s->nal_length_size = s0->nal_length_size;
@ -3239,6 +3242,7 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
s->enable_parallel_tiles = 0; s->enable_parallel_tiles = 0;
s->picture_struct = 0; s->picture_struct = 0;
s->eos = 1;
if(avctx->active_thread_type & FF_THREAD_SLICE) if(avctx->active_thread_type & FF_THREAD_SLICE)
s->threads_number = avctx->thread_count; s->threads_number = avctx->thread_count;
@ -3280,6 +3284,7 @@ static void hevc_decode_flush(AVCodecContext *avctx)
HEVCContext *s = avctx->priv_data; HEVCContext *s = avctx->priv_data;
ff_hevc_flush_dpb(s); ff_hevc_flush_dpb(s);
s->max_ra = INT_MAX; s->max_ra = INT_MAX;
s->eos = 1;
} }
#define OFFSET(x) offsetof(HEVCContext, x) #define OFFSET(x) offsetof(HEVCContext, x)

View File

@ -866,6 +866,7 @@ typedef struct HEVCContext {
int bs_height; int bs_height;
int is_decoded; int is_decoded;
int no_rasl_output_flag;
HEVCPredContext hpc; HEVCPredContext hpc;
HEVCDSPContext hevcdsp; HEVCDSPContext hevcdsp;

View File

@ -834,6 +834,10 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
} }
sps->chroma_format_idc = get_ue_golomb_long(gb); sps->chroma_format_idc = get_ue_golomb_long(gb);
if (sps->chroma_format_idc > 3U) {
av_log(avctx, AV_LOG_ERROR, "chroma_format_idc %d is invalid\n", sps->chroma_format_idc);
return AVERROR_INVALIDDATA;
}
if (sps->chroma_format_idc == 3) if (sps->chroma_format_idc == 3)
sps->separate_colour_plane_flag = get_bits1(gb); sps->separate_colour_plane_flag = get_bits1(gb);

View File

@ -174,7 +174,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
int min_poc = INT_MAX; int min_poc = INT_MAX;
int i, min_idx, ret; int i, min_idx, ret;
if (s->sh.no_output_of_prior_pics_flag == 1) { if (s->sh.no_output_of_prior_pics_flag == 1 && s->no_rasl_output_flag == 1) {
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) { for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
HEVCFrame *frame = &s->DPB[i]; HEVCFrame *frame = &s->DPB[i];
if (!(frame->flags & HEVC_FRAME_FLAG_BUMPING) && frame->poc != s->poc && if (!(frame->flags & HEVC_FRAME_FLAG_BUMPING) && frame->poc != s->poc &&

View File

@ -826,10 +826,10 @@ static int init_tile(Jpeg2000DecoderContext *s, int tileno)
if (!tile->comp) if (!tile->comp)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
tile->coord[0][0] = FFMAX(tilex * s->tile_width + s->tile_offset_x, s->image_offset_x); tile->coord[0][0] = av_clip(tilex * s->tile_width + s->tile_offset_x, s->image_offset_x, s->width);
tile->coord[0][1] = FFMIN((tilex + 1) * s->tile_width + s->tile_offset_x, s->width); tile->coord[0][1] = av_clip((tilex + 1) * s->tile_width + s->tile_offset_x, s->image_offset_x, s->width);
tile->coord[1][0] = FFMAX(tiley * s->tile_height + s->tile_offset_y, s->image_offset_y); tile->coord[1][0] = av_clip(tiley * s->tile_height + s->tile_offset_y, s->image_offset_y, s->height);
tile->coord[1][1] = FFMIN((tiley + 1) * s->tile_height + s->tile_offset_y, s->height); tile->coord[1][1] = av_clip((tiley + 1) * s->tile_height + s->tile_offset_y, s->image_offset_y, s->height);
for (compno = 0; compno < s->ncomponents; compno++) { for (compno = 0; compno < s->ncomponents; compno++) {
Jpeg2000Component *comp = tile->comp + compno; Jpeg2000Component *comp = tile->comp + compno;
@ -1809,6 +1809,7 @@ static void jpeg2000_dec_cleanup(Jpeg2000DecoderContext *s)
av_freep(&s->tile); av_freep(&s->tile);
memset(s->codsty, 0, sizeof(s->codsty)); memset(s->codsty, 0, sizeof(s->codsty));
memset(s->qntsty, 0, sizeof(s->qntsty)); memset(s->qntsty, 0, sizeof(s->qntsty));
memset(s->properties, 0, sizeof(s->properties));
memset(&s->poc , 0, sizeof(s->poc)); memset(&s->poc , 0, sizeof(s->poc));
s->numXtiles = s->numYtiles = 0; s->numXtiles = s->numYtiles = 0;
} }

View File

@ -164,6 +164,8 @@ static char *microdvd_load_tags(struct microdvd_tag *tags, char *s)
/* Position */ /* Position */
case 'P': case 'P':
if (!*s)
break;
tag.persistent = MICRODVD_PERSISTENT_ON; tag.persistent = MICRODVD_PERSISTENT_ON;
tag.data1 = (*s++ == '1'); tag.data1 = (*s++ == '1');
if (*s != '}') if (*s != '}')

View File

@ -82,11 +82,33 @@ static av_cold void h264dsp_init_msa(H264DSPContext *c,
#endif // #if HAVE_MSA #endif // #if HAVE_MSA
#if HAVE_MMI #if HAVE_MMI
static av_cold void h264dsp_init_mmi(H264DSPContext * c, static av_cold void h264dsp_init_mmi(H264DSPContext * c, const int bit_depth,
const int bit_depth,
const int chroma_format_idc) const int chroma_format_idc)
{ {
if (bit_depth == 8) { if (bit_depth == 8) {
c->h264_add_pixels4_clear = ff_h264_add_pixels4_8_mmi;
c->h264_idct_add = ff_h264_idct_add_8_mmi;
c->h264_idct8_add = ff_h264_idct8_add_8_mmi;
c->h264_idct_dc_add = ff_h264_idct_dc_add_8_mmi;
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmi;
c->h264_idct_add16 = ff_h264_idct_add16_8_mmi;
c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmi;
c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmi;
if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_8_mmi;
else
c->h264_idct_add8 = ff_h264_idct_add8_422_8_mmi;
c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_8_mmi;
if (chroma_format_idc <= 1)
c->h264_chroma_dc_dequant_idct =
ff_h264_chroma_dc_dequant_idct_8_mmi;
else
c->h264_chroma_dc_dequant_idct =
ff_h264_chroma422_dc_dequant_idct_8_mmi;
c->weight_h264_pixels_tab[0] = ff_h264_weight_pixels16_8_mmi; c->weight_h264_pixels_tab[0] = ff_h264_weight_pixels16_8_mmi;
c->weight_h264_pixels_tab[1] = ff_h264_weight_pixels8_8_mmi; c->weight_h264_pixels_tab[1] = ff_h264_weight_pixels8_8_mmi;
c->weight_h264_pixels_tab[2] = ff_h264_weight_pixels4_8_mmi; c->weight_h264_pixels_tab[2] = ff_h264_weight_pixels4_8_mmi;
@ -94,6 +116,21 @@ static av_cold void h264dsp_init_mmi(H264DSPContext * c,
c->biweight_h264_pixels_tab[0] = ff_h264_biweight_pixels16_8_mmi; c->biweight_h264_pixels_tab[0] = ff_h264_biweight_pixels16_8_mmi;
c->biweight_h264_pixels_tab[1] = ff_h264_biweight_pixels8_8_mmi; c->biweight_h264_pixels_tab[1] = ff_h264_biweight_pixels8_8_mmi;
c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi; c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi;
c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_mmi;
c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmi;
if (chroma_format_idc <= 1) {
c->h264_h_loop_filter_chroma =
ff_deblock_h_chroma_8_mmi;
c->h264_h_loop_filter_chroma_intra =
ff_deblock_h_chroma_intra_8_mmi;
}
c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_mmi;
c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmi;
c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_mmi;
c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmi;
} }
} }
#endif /* HAVE_MMI */ #endif /* HAVE_MMI */

View File

@ -319,6 +319,26 @@ void ff_vp8_pred8x8_129_dc_8_msa(uint8_t *src, ptrdiff_t stride);
void ff_vp8_pred16x16_127_dc_8_msa(uint8_t *src, ptrdiff_t stride); void ff_vp8_pred16x16_127_dc_8_msa(uint8_t *src, ptrdiff_t stride);
void ff_vp8_pred16x16_129_dc_8_msa(uint8_t *src, ptrdiff_t stride); void ff_vp8_pred16x16_129_dc_8_msa(uint8_t *src, ptrdiff_t stride);
void ff_h264_add_pixels4_8_mmi(uint8_t *_dst, int16_t *_src, int stride);
void ff_h264_idct_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct8_dc_add_8_mmi(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct_add16_8_mmi(uint8_t *dst, const int *block_offset,
int16_t *block, int stride, const uint8_t nnzc[15*8]);
void ff_h264_idct_add16intra_8_mmi(uint8_t *dst, const int *block_offset,
int16_t *block, int stride, const uint8_t nnzc[15*8]);
void ff_h264_idct8_add4_8_mmi(uint8_t *dst, const int *block_offset,
int16_t *block, int stride, const uint8_t nnzc[15*8]);
void ff_h264_idct_add8_8_mmi(uint8_t **dest, const int *block_offset,
int16_t *block, int stride, const uint8_t nnzc[15*8]);
void ff_h264_idct_add8_422_8_mmi(uint8_t **dest, const int *block_offset,
int16_t *block, int stride, const uint8_t nnzc[15*8]);
void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input,
int qmul);
void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
void ff_h264_chroma422_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height, void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height,
int log2_denom, int weight, int offset); int log2_denom, int weight, int offset);
void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src,
@ -335,6 +355,27 @@ void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src,
int stride, int height, int log2_denom, int weightd, int weights, int stride, int height, int log2_denom, int weightd, int weights,
int offset); int offset);
void ff_deblock_v_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
int8_t *tc0);
void ff_deblock_v_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
int beta);
void ff_deblock_h_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
int8_t *tc0);
void ff_deblock_h_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
int beta);
void ff_deblock_v_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
int8_t *tc0);
void ff_deblock_v_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
int beta);
void ff_deblock_h_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
int8_t *tc0);
void ff_deblock_h_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
int beta);
void ff_deblock_v8_luma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
int8_t *tc0);
void ff_deblock_v8_luma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
int beta);
void ff_put_h264_qpel16_mc00_mmi(uint8_t *dst, const uint8_t *src, void ff_put_h264_qpel16_mc00_mmi(uint8_t *dst, const uint8_t *src,
ptrdiff_t dst_stride); ptrdiff_t dst_stride);
void ff_put_h264_qpel16_mc10_mmi(uint8_t *dst, const uint8_t *src, void ff_put_h264_qpel16_mc10_mmi(uint8_t *dst, const uint8_t *src,

File diff suppressed because it is too large Load Diff

View File

@ -1915,24 +1915,24 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
v16u8 vec0; v16u8 vec0;
HEVCLocalContext *lc = s->HEVClc; HEVCLocalContext *lc = s->HEVClc;
int i; int i;
int hshift = s->sps->hshift[c_idx]; int hshift = s->ps.sps->hshift[c_idx];
int vshift = s->sps->vshift[c_idx]; int vshift = s->ps.sps->vshift[c_idx];
int size_in_luma_h = 16 << hshift; int size_in_luma_h = 16 << hshift;
int size_in_tbs_h = size_in_luma_h >> s->sps->log2_min_tb_size; int size_in_tbs_h = size_in_luma_h >> s->ps.sps->log2_min_tb_size;
int size_in_luma_v = 16 << vshift; int size_in_luma_v = 16 << vshift;
int size_in_tbs_v = size_in_luma_v >> s->sps->log2_min_tb_size; int size_in_tbs_v = size_in_luma_v >> s->ps.sps->log2_min_tb_size;
int x = x0 >> hshift; int x = x0 >> hshift;
int y = y0 >> vshift; int y = y0 >> vshift;
int x_tb = (x0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask; int x_tb = (x0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
int y_tb = (y0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask; int y_tb = (y0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
int cur_tb_addr = int cur_tb_addr =
s->pps->min_tb_addr_zs[(y_tb) * (s->sps->tb_mask + 2) + (x_tb)]; s->ps.pps->min_tb_addr_zs[(y_tb) * (s->ps.sps->tb_mask + 2) + (x_tb)];
ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(uint8_t); ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(uint8_t);
uint8_t *src = (uint8_t *) s->frame->data[c_idx] + x + y * stride; uint8_t *src = (uint8_t *) s->frame->data[c_idx] + x + y * stride;
int min_pu_width = s->sps->min_pu_width; int min_pu_width = s->ps.sps->min_pu_width;
enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c : enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c :
lc->tu.intra_pred_mode; lc->tu.intra_pred_mode;
@ -1948,41 +1948,41 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
uint8_t *filtered_top = filtered_top_array + 1; uint8_t *filtered_top = filtered_top_array + 1;
int cand_bottom_left = lc->na.cand_bottom_left int cand_bottom_left = lc->na.cand_bottom_left
&& cur_tb_addr > && cur_tb_addr >
s->pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->sps->tb_mask) * s->ps.pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->ps.sps->tb_mask) *
(s->sps->tb_mask + 2) + (x_tb - 1)]; (s->ps.sps->tb_mask + 2) + (x_tb - 1)];
int cand_left = lc->na.cand_left; int cand_left = lc->na.cand_left;
int cand_up_left = lc->na.cand_up_left; int cand_up_left = lc->na.cand_up_left;
int cand_up = lc->na.cand_up; int cand_up = lc->na.cand_up;
int cand_up_right = lc->na.cand_up_right int cand_up_right = lc->na.cand_up_right
&& cur_tb_addr > && cur_tb_addr >
s->pps->min_tb_addr_zs[(y_tb - 1) * (s->sps->tb_mask + 2) + s->ps.pps->min_tb_addr_zs[(y_tb - 1) * (s->ps.sps->tb_mask + 2) +
((x_tb + size_in_tbs_h) & s->sps->tb_mask)]; ((x_tb + size_in_tbs_h) & s->ps.sps->tb_mask)];
int bottom_left_size = int bottom_left_size =
(((y0 + 2 * size_in_luma_v) > (((y0 + 2 * size_in_luma_v) >
(s->sps->height) ? (s->sps->height) : (y0 + (s->ps.sps->height) ? (s->ps.sps->height) : (y0 +
2 * size_in_luma_v)) - 2 * size_in_luma_v)) -
(y0 + size_in_luma_v)) >> vshift; (y0 + size_in_luma_v)) >> vshift;
int top_right_size = int top_right_size =
(((x0 + 2 * size_in_luma_h) > (((x0 + 2 * size_in_luma_h) >
(s->sps->width) ? (s->sps->width) : (x0 + 2 * size_in_luma_h)) - (s->ps.sps->width) ? (s->ps.sps->width) : (x0 + 2 * size_in_luma_h)) -
(x0 + size_in_luma_h)) >> hshift; (x0 + size_in_luma_h)) >> hshift;
if (s->pps->constrained_intra_pred_flag == 1) { if (s->ps.pps->constrained_intra_pred_flag == 1) {
int size_in_luma_pu_v = ((size_in_luma_v) >> s->sps->log2_min_pu_size); int size_in_luma_pu_v = ((size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
int size_in_luma_pu_h = ((size_in_luma_h) >> s->sps->log2_min_pu_size); int size_in_luma_pu_h = ((size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1)); int on_pu_edge_x = !(x0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1)); int on_pu_edge_y = !(y0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
if (!size_in_luma_pu_h) if (!size_in_luma_pu_h)
size_in_luma_pu_h++; size_in_luma_pu_h++;
if (cand_bottom_left == 1 && on_pu_edge_x) { if (cand_bottom_left == 1 && on_pu_edge_x) {
int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size); int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
int y_bottom_pu = int y_bottom_pu =
((y0 + size_in_luma_v) >> s->sps->log2_min_pu_size); ((y0 + size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_v) > ((size_in_luma_pu_v) >
(s->sps->min_pu_height - (s->ps.sps->min_pu_height -
y_bottom_pu) ? (s->sps->min_pu_height - y_bottom_pu) ? (s->ps.sps->min_pu_height -
y_bottom_pu) : (size_in_luma_pu_v)); y_bottom_pu) : (size_in_luma_pu_v));
cand_bottom_left = 0; cand_bottom_left = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -1993,12 +1993,12 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
PF_INTRA); PF_INTRA);
} }
if (cand_left == 1 && on_pu_edge_x) { if (cand_left == 1 && on_pu_edge_x) {
int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size); int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
int y_left_pu = ((y0) >> s->sps->log2_min_pu_size); int y_left_pu = ((y0) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_v) > ((size_in_luma_pu_v) >
(s->sps->min_pu_height - (s->ps.sps->min_pu_height -
y_left_pu) ? (s->sps->min_pu_height - y_left_pu) ? (s->ps.sps->min_pu_height -
y_left_pu) : (size_in_luma_pu_v)); y_left_pu) : (size_in_luma_pu_v));
cand_left = 0; cand_left = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -2009,20 +2009,20 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
PF_INTRA); PF_INTRA);
} }
if (cand_up_left == 1) { if (cand_up_left == 1) {
int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size); int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size); int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
cand_up_left = cand_up_left =
(s->ref->tab_mvf[(x_left_pu) + (s->ref->tab_mvf[(x_left_pu) +
(y_top_pu) * min_pu_width]).pred_flag == (y_top_pu) * min_pu_width]).pred_flag ==
PF_INTRA; PF_INTRA;
} }
if (cand_up == 1 && on_pu_edge_y) { if (cand_up == 1 && on_pu_edge_y) {
int x_top_pu = ((x0) >> s->sps->log2_min_pu_size); int x_top_pu = ((x0) >> s->ps.sps->log2_min_pu_size);
int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size); int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_h) > ((size_in_luma_pu_h) >
(s->sps->min_pu_width - (s->ps.sps->min_pu_width -
x_top_pu) ? (s->sps->min_pu_width - x_top_pu) ? (s->ps.sps->min_pu_width -
x_top_pu) : (size_in_luma_pu_h)); x_top_pu) : (size_in_luma_pu_h));
cand_up = 0; cand_up = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -2032,13 +2032,13 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
min_pu_width]).pred_flag == PF_INTRA); min_pu_width]).pred_flag == PF_INTRA);
} }
if (cand_up_right == 1 && on_pu_edge_y) { if (cand_up_right == 1 && on_pu_edge_y) {
int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size); int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
int x_right_pu = int x_right_pu =
((x0 + size_in_luma_h) >> s->sps->log2_min_pu_size); ((x0 + size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_h) > ((size_in_luma_pu_h) >
(s->sps->min_pu_width - (s->ps.sps->min_pu_width -
x_right_pu) ? (s->sps->min_pu_width - x_right_pu) ? (s->ps.sps->min_pu_width -
x_right_pu) : (size_in_luma_pu_h)); x_right_pu) : (size_in_luma_pu_h));
cand_up_right = 0; cand_up_right = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -2093,56 +2093,56 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
} while (0); } while (0);
} }
if (s->pps->constrained_intra_pred_flag == 1) { if (s->ps.pps->constrained_intra_pred_flag == 1) {
if (cand_bottom_left || cand_left || cand_up_left || cand_up if (cand_bottom_left || cand_left || cand_up_left || cand_up
|| cand_up_right) { || cand_up_right) {
int size_max_x = int size_max_x =
x0 + ((2 * 16) << hshift) < x0 + ((2 * 16) << hshift) <
s->sps->width ? 2 * 16 : (s->sps->width - x0) >> hshift; s->ps.sps->width ? 2 * 16 : (s->ps.sps->width - x0) >> hshift;
int size_max_y = int size_max_y =
y0 + ((2 * 16) << vshift) < y0 + ((2 * 16) << vshift) <
s->sps->height ? 2 * 16 : (s->sps->height - y0) >> vshift; s->ps.sps->height ? 2 * 16 : (s->ps.sps->height - y0) >> vshift;
int j = 16 + (cand_bottom_left ? bottom_left_size : 0) - 1; int j = 16 + (cand_bottom_left ? bottom_left_size : 0) - 1;
if (!cand_up_right) { if (!cand_up_right) {
size_max_x = x0 + ((16) << hshift) < s->sps->width ? size_max_x = x0 + ((16) << hshift) < s->ps.sps->width ?
16 : (s->sps->width - x0) >> hshift; 16 : (s->ps.sps->width - x0) >> hshift;
} }
if (!cand_bottom_left) { if (!cand_bottom_left) {
size_max_y = y0 + ((16) << vshift) < s->sps->height ? size_max_y = y0 + ((16) << vshift) < s->ps.sps->height ?
16 : (s->sps->height - y0) >> vshift; 16 : (s->ps.sps->height - y0) >> vshift;
} }
if (cand_bottom_left || cand_left || cand_up_left) { if (cand_bottom_left || cand_left || cand_up_left) {
while (j > -1 while (j > -1
&& &&
!((s->ref->tab_mvf[(((x0 + !((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((j) << ((j) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
j--; j--;
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((j) log2_min_pu_size)) + (((y0 + ((j)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == PF_INTRA)) { * min_pu_width]).pred_flag == PF_INTRA)) {
j = 0; j = 0;
while (j < size_max_x while (j < size_max_x
&& &&
!((s->ref->tab_mvf[(((x0 + !((s->ref->tab_mvf[(((x0 +
((j) << hshift)) >> s->sps-> ((j) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((-1) << ((-1) <<
vshift)) vshift))
>> s-> >> s->
sps-> ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2151,12 +2151,12 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i - ((i -
1) << hshift)) >> s->sps-> 1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((-1) << ((-1) <<
vshift)) vshift))
>> s-> >> s->
sps-> ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2168,11 +2168,11 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
while (j < size_max_x while (j < size_max_x
&& &&
!((s->ref->tab_mvf[(((x0 + !((s->ref->tab_mvf[(((x0 +
((j) << hshift)) >> s->sps-> ((j) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((-1) log2_min_pu_size)) + (((y0 + ((-1)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2184,11 +2184,11 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i - ((i -
1) << hshift)) >> 1) << hshift)) >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
+ (((y0 + ((-1) + (((y0 + ((-1)
<< vshift)) << vshift))
>> >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
* *
min_pu_width]).pred_flag == min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2199,11 +2199,11 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i - ((i -
1) << hshift)) >> 1) << hshift)) >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
+ (((y0 + ((-1) + (((y0 + ((-1)
<< vshift)) << vshift))
>> >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
* *
min_pu_width]).pred_flag == min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2218,11 +2218,11 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
for (i = 0; i < (0) + (size_max_y); i += 4) for (i = 0; i < (0) + (size_max_y); i += 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((i) << ((i) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2247,12 +2247,12 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
i > (size_max_y - 1) - (size_max_y); i -= 4) i > (size_max_y - 1) - (size_max_y); i -= 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((i - ((i -
3) << 3) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2261,11 +2261,11 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
a = ((left[i - 3]) * 0x01010101U); a = ((left[i - 3]) * 0x01010101U);
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((-1) log2_min_pu_size)) + (((y0 + ((-1)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == PF_INTRA)) * min_pu_width]).pred_flag == PF_INTRA))
left[-1] = left[0]; left[-1] = left[0];
@ -2281,12 +2281,12 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
i > (size_max_y - 1) - (size_max_y); i -= 4) i > (size_max_y - 1) - (size_max_y); i -= 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((i - ((i -
3) << 3) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2300,11 +2300,11 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
for (i = 0; i < (0) + (size_max_x); i += 4) for (i = 0; i < (0) + (size_max_x); i += 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i) << hshift)) >> s->sps-> ((i) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((-1) log2_min_pu_size)) + (((y0 + ((-1)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2376,8 +2376,8 @@ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
top[-1] = left[-1]; top[-1] = left[-1];
if (!s->sps->intra_smoothing_disabled_flag if (!s->ps.sps->intra_smoothing_disabled_flag
&& (c_idx == 0 || s->sps->chroma_format_idc == 3)) { && (c_idx == 0 || s->ps.sps->chroma_format_idc == 3)) {
if (mode != INTRA_DC && 16 != 4) { if (mode != INTRA_DC && 16 != 4) {
int intra_hor_ver_dist_thresh[] = { 7, 1, 0 }; int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
int min_dist_vert_hor = int min_dist_vert_hor =
@ -2432,24 +2432,24 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
v8i16 mul_val1 = { 1, 2, 3, 4, 5, 6, 7, 8 }; v8i16 mul_val1 = { 1, 2, 3, 4, 5, 6, 7, 8 };
HEVCLocalContext *lc = s->HEVClc; HEVCLocalContext *lc = s->HEVClc;
int i; int i;
int hshift = s->sps->hshift[c_idx]; int hshift = s->ps.sps->hshift[c_idx];
int vshift = s->sps->vshift[c_idx]; int vshift = s->ps.sps->vshift[c_idx];
int size_in_luma_h = 32 << hshift; int size_in_luma_h = 32 << hshift;
int size_in_tbs_h = size_in_luma_h >> s->sps->log2_min_tb_size; int size_in_tbs_h = size_in_luma_h >> s->ps.sps->log2_min_tb_size;
int size_in_luma_v = 32 << vshift; int size_in_luma_v = 32 << vshift;
int size_in_tbs_v = size_in_luma_v >> s->sps->log2_min_tb_size; int size_in_tbs_v = size_in_luma_v >> s->ps.sps->log2_min_tb_size;
int x = x0 >> hshift; int x = x0 >> hshift;
int y = y0 >> vshift; int y = y0 >> vshift;
int x_tb = (x0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask; int x_tb = (x0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
int y_tb = (y0 >> s->sps->log2_min_tb_size) & s->sps->tb_mask; int y_tb = (y0 >> s->ps.sps->log2_min_tb_size) & s->ps.sps->tb_mask;
int cur_tb_addr = int cur_tb_addr =
s->pps->min_tb_addr_zs[(y_tb) * (s->sps->tb_mask + 2) + (x_tb)]; s->ps.pps->min_tb_addr_zs[(y_tb) * (s->ps.sps->tb_mask + 2) + (x_tb)];
ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(uint8_t); ptrdiff_t stride = s->frame->linesize[c_idx] / sizeof(uint8_t);
uint8_t *src = (uint8_t *) s->frame->data[c_idx] + x + y * stride; uint8_t *src = (uint8_t *) s->frame->data[c_idx] + x + y * stride;
int min_pu_width = s->sps->min_pu_width; int min_pu_width = s->ps.sps->min_pu_width;
enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c : enum IntraPredMode mode = c_idx ? lc->tu.intra_pred_mode_c :
lc->tu.intra_pred_mode; lc->tu.intra_pred_mode;
@ -2465,41 +2465,41 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
uint8_t *filtered_top = filtered_top_array + 1; uint8_t *filtered_top = filtered_top_array + 1;
int cand_bottom_left = lc->na.cand_bottom_left int cand_bottom_left = lc->na.cand_bottom_left
&& cur_tb_addr > && cur_tb_addr >
s->pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->sps->tb_mask) * s->ps.pps->min_tb_addr_zs[((y_tb + size_in_tbs_v) & s->ps.sps->tb_mask) *
(s->sps->tb_mask + 2) + (x_tb - 1)]; (s->ps.sps->tb_mask + 2) + (x_tb - 1)];
int cand_left = lc->na.cand_left; int cand_left = lc->na.cand_left;
int cand_up_left = lc->na.cand_up_left; int cand_up_left = lc->na.cand_up_left;
int cand_up = lc->na.cand_up; int cand_up = lc->na.cand_up;
int cand_up_right = lc->na.cand_up_right int cand_up_right = lc->na.cand_up_right
&& cur_tb_addr > && cur_tb_addr >
s->pps->min_tb_addr_zs[(y_tb - 1) * (s->sps->tb_mask + 2) + s->ps.pps->min_tb_addr_zs[(y_tb - 1) * (s->ps.sps->tb_mask + 2) +
((x_tb + size_in_tbs_h) & s->sps->tb_mask)]; ((x_tb + size_in_tbs_h) & s->ps.sps->tb_mask)];
int bottom_left_size = int bottom_left_size =
(((y0 + 2 * size_in_luma_v) > (((y0 + 2 * size_in_luma_v) >
(s->sps->height) ? (s->sps->height) : (y0 + (s->ps.sps->height) ? (s->ps.sps->height) : (y0 +
2 * size_in_luma_v)) - 2 * size_in_luma_v)) -
(y0 + size_in_luma_v)) >> vshift; (y0 + size_in_luma_v)) >> vshift;
int top_right_size = int top_right_size =
(((x0 + 2 * size_in_luma_h) > (((x0 + 2 * size_in_luma_h) >
(s->sps->width) ? (s->sps->width) : (x0 + 2 * size_in_luma_h)) - (s->ps.sps->width) ? (s->ps.sps->width) : (x0 + 2 * size_in_luma_h)) -
(x0 + size_in_luma_h)) >> hshift; (x0 + size_in_luma_h)) >> hshift;
if (s->pps->constrained_intra_pred_flag == 1) { if (s->ps.pps->constrained_intra_pred_flag == 1) {
int size_in_luma_pu_v = ((size_in_luma_v) >> s->sps->log2_min_pu_size); int size_in_luma_pu_v = ((size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
int size_in_luma_pu_h = ((size_in_luma_h) >> s->sps->log2_min_pu_size); int size_in_luma_pu_h = ((size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1)); int on_pu_edge_x = !(x0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1)); int on_pu_edge_y = !(y0 & ((1 << s->ps.sps->log2_min_pu_size) - 1));
if (!size_in_luma_pu_h) if (!size_in_luma_pu_h)
size_in_luma_pu_h++; size_in_luma_pu_h++;
if (cand_bottom_left == 1 && on_pu_edge_x) { if (cand_bottom_left == 1 && on_pu_edge_x) {
int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size); int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
int y_bottom_pu = int y_bottom_pu =
((y0 + size_in_luma_v) >> s->sps->log2_min_pu_size); ((y0 + size_in_luma_v) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_v) > ((size_in_luma_pu_v) >
(s->sps->min_pu_height - (s->ps.sps->min_pu_height -
y_bottom_pu) ? (s->sps->min_pu_height - y_bottom_pu) ? (s->ps.sps->min_pu_height -
y_bottom_pu) : (size_in_luma_pu_v)); y_bottom_pu) : (size_in_luma_pu_v));
cand_bottom_left = 0; cand_bottom_left = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -2510,12 +2510,12 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
PF_INTRA); PF_INTRA);
} }
if (cand_left == 1 && on_pu_edge_x) { if (cand_left == 1 && on_pu_edge_x) {
int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size); int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
int y_left_pu = ((y0) >> s->sps->log2_min_pu_size); int y_left_pu = ((y0) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_v) > ((size_in_luma_pu_v) >
(s->sps->min_pu_height - (s->ps.sps->min_pu_height -
y_left_pu) ? (s->sps->min_pu_height - y_left_pu) ? (s->ps.sps->min_pu_height -
y_left_pu) : (size_in_luma_pu_v)); y_left_pu) : (size_in_luma_pu_v));
cand_left = 0; cand_left = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -2526,20 +2526,20 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
PF_INTRA); PF_INTRA);
} }
if (cand_up_left == 1) { if (cand_up_left == 1) {
int x_left_pu = ((x0 - 1) >> s->sps->log2_min_pu_size); int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size); int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
cand_up_left = cand_up_left =
(s->ref->tab_mvf[(x_left_pu) + (s->ref->tab_mvf[(x_left_pu) +
(y_top_pu) * min_pu_width]).pred_flag == (y_top_pu) * min_pu_width]).pred_flag ==
PF_INTRA; PF_INTRA;
} }
if (cand_up == 1 && on_pu_edge_y) { if (cand_up == 1 && on_pu_edge_y) {
int x_top_pu = ((x0) >> s->sps->log2_min_pu_size); int x_top_pu = ((x0) >> s->ps.sps->log2_min_pu_size);
int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size); int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_h) > ((size_in_luma_pu_h) >
(s->sps->min_pu_width - (s->ps.sps->min_pu_width -
x_top_pu) ? (s->sps->min_pu_width - x_top_pu) ? (s->ps.sps->min_pu_width -
x_top_pu) : (size_in_luma_pu_h)); x_top_pu) : (size_in_luma_pu_h));
cand_up = 0; cand_up = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -2549,13 +2549,13 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
min_pu_width]).pred_flag == PF_INTRA); min_pu_width]).pred_flag == PF_INTRA);
} }
if (cand_up_right == 1 && on_pu_edge_y) { if (cand_up_right == 1 && on_pu_edge_y) {
int y_top_pu = ((y0 - 1) >> s->sps->log2_min_pu_size); int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
int x_right_pu = int x_right_pu =
((x0 + size_in_luma_h) >> s->sps->log2_min_pu_size); ((x0 + size_in_luma_h) >> s->ps.sps->log2_min_pu_size);
int max = int max =
((size_in_luma_pu_h) > ((size_in_luma_pu_h) >
(s->sps->min_pu_width - (s->ps.sps->min_pu_width -
x_right_pu) ? (s->sps->min_pu_width - x_right_pu) ? (s->ps.sps->min_pu_width -
x_right_pu) : (size_in_luma_pu_h)); x_right_pu) : (size_in_luma_pu_h));
cand_up_right = 0; cand_up_right = 0;
for (i = 0; i < max; i += 2) for (i = 0; i < max; i += 2)
@ -2608,56 +2608,56 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
} while (0); } while (0);
} }
if (s->pps->constrained_intra_pred_flag == 1) { if (s->ps.pps->constrained_intra_pred_flag == 1) {
if (cand_bottom_left || cand_left || cand_up_left || cand_up if (cand_bottom_left || cand_left || cand_up_left || cand_up
|| cand_up_right) { || cand_up_right) {
int size_max_x = int size_max_x =
x0 + ((2 * 32) << hshift) < x0 + ((2 * 32) << hshift) <
s->sps->width ? 2 * 32 : (s->sps->width - x0) >> hshift; s->ps.sps->width ? 2 * 32 : (s->ps.sps->width - x0) >> hshift;
int size_max_y = int size_max_y =
y0 + ((2 * 32) << vshift) < y0 + ((2 * 32) << vshift) <
s->sps->height ? 2 * 32 : (s->sps->height - y0) >> vshift; s->ps.sps->height ? 2 * 32 : (s->ps.sps->height - y0) >> vshift;
int j = 32 + (cand_bottom_left ? bottom_left_size : 0) - 1; int j = 32 + (cand_bottom_left ? bottom_left_size : 0) - 1;
if (!cand_up_right) { if (!cand_up_right) {
size_max_x = x0 + ((32) << hshift) < s->sps->width ? size_max_x = x0 + ((32) << hshift) < s->ps.sps->width ?
32 : (s->sps->width - x0) >> hshift; 32 : (s->ps.sps->width - x0) >> hshift;
} }
if (!cand_bottom_left) { if (!cand_bottom_left) {
size_max_y = y0 + ((32) << vshift) < s->sps->height ? size_max_y = y0 + ((32) << vshift) < s->ps.sps->height ?
32 : (s->sps->height - y0) >> vshift; 32 : (s->ps.sps->height - y0) >> vshift;
} }
if (cand_bottom_left || cand_left || cand_up_left) { if (cand_bottom_left || cand_left || cand_up_left) {
while (j > -1 while (j > -1
&& &&
!((s->ref->tab_mvf[(((x0 + !((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((j) << ((j) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
j--; j--;
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((j) log2_min_pu_size)) + (((y0 + ((j)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == PF_INTRA)) { * min_pu_width]).pred_flag == PF_INTRA)) {
j = 0; j = 0;
while (j < size_max_x while (j < size_max_x
&& &&
!((s->ref->tab_mvf[(((x0 + !((s->ref->tab_mvf[(((x0 +
((j) << hshift)) >> s->sps-> ((j) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((-1) << ((-1) <<
vshift)) vshift))
>> s-> >> s->
sps-> ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2666,12 +2666,12 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i - ((i -
1) << hshift)) >> s->sps-> 1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((-1) << ((-1) <<
vshift)) vshift))
>> s-> >> s->
sps-> ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2683,11 +2683,11 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
while (j < size_max_x while (j < size_max_x
&& &&
!((s->ref->tab_mvf[(((x0 + !((s->ref->tab_mvf[(((x0 +
((j) << hshift)) >> s->sps-> ((j) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((-1) log2_min_pu_size)) + (((y0 + ((-1)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2699,11 +2699,11 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i - ((i -
1) << hshift)) >> 1) << hshift)) >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
+ (((y0 + ((-1) + (((y0 + ((-1)
<< vshift)) << vshift))
>> >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
* *
min_pu_width]).pred_flag == min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2714,11 +2714,11 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i - ((i -
1) << hshift)) >> 1) << hshift)) >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
+ (((y0 + ((-1) + (((y0 + ((-1)
<< vshift)) << vshift))
>> >>
s->sps->log2_min_pu_size)) s->ps.sps->log2_min_pu_size))
* *
min_pu_width]).pred_flag == min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2733,11 +2733,11 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
for (i = 0; i < (0) + (size_max_y); i += 4) for (i = 0; i < (0) + (size_max_y); i += 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((i) << ((i) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2761,12 +2761,12 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
i > (size_max_y - 1) - (size_max_y); i -= 4) i > (size_max_y - 1) - (size_max_y); i -= 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((i - ((i -
3) << 3) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2775,11 +2775,11 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
a = ((left[i - 3]) * 0x01010101U); a = ((left[i - 3]) * 0x01010101U);
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((-1) log2_min_pu_size)) + (((y0 + ((-1)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == PF_INTRA)) * min_pu_width]).pred_flag == PF_INTRA))
left[-1] = left[0]; left[-1] = left[0];
@ -2795,12 +2795,12 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
i > (size_max_y - 1) - (size_max_y); i -= 4) i > (size_max_y - 1) - (size_max_y); i -= 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((-1) << hshift)) >> s->sps-> ((-1) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + log2_min_pu_size)) + (((y0 +
((i - ((i -
3) << 3) <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2814,11 +2814,11 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
for (i = 0; i < (0) + (size_max_x); i += 4) for (i = 0; i < (0) + (size_max_x); i += 4)
if (! if (!
((s->ref->tab_mvf[(((x0 + ((s->ref->tab_mvf[(((x0 +
((i) << hshift)) >> s->sps-> ((i) << hshift)) >> s->ps.sps->
log2_min_pu_size)) + (((y0 + ((-1) log2_min_pu_size)) + (((y0 + ((-1)
<< <<
vshift)) vshift))
>> s->sps-> >> s->ps.sps->
log2_min_pu_size)) log2_min_pu_size))
* min_pu_width]).pred_flag == * min_pu_width]).pred_flag ==
PF_INTRA)) PF_INTRA))
@ -2893,8 +2893,8 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
top[-1] = left[-1]; top[-1] = left[-1];
if (!s->sps->intra_smoothing_disabled_flag if (!s->ps.sps->intra_smoothing_disabled_flag
&& (c_idx == 0 || s->sps->chroma_format_idc == 3)) { && (c_idx == 0 || s->ps.sps->chroma_format_idc == 3)) {
if (mode != INTRA_DC && 32 != 4) { if (mode != INTRA_DC && 32 != 4) {
int intra_hor_ver_dist_thresh[] = { 7, 1, 0 }; int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
int min_dist_vert_hor = int min_dist_vert_hor =
@ -2908,7 +2908,7 @@ void ff_intra_pred_8_32x32_msa(HEVCContext *s, int x0, int y0, int c_idx)
0 ? ((int) (mode - 26U)) : (-((int) (mode - 26U)))))); 0 ? ((int) (mode - 26U)) : (-((int) (mode - 26U))))));
if (min_dist_vert_hor > intra_hor_ver_dist_thresh[5 - 3]) { if (min_dist_vert_hor > intra_hor_ver_dist_thresh[5 - 3]) {
int threshold = 1 << (8 - 5); int threshold = 1 << (8 - 5);
if (s->sps->sps_strong_intra_smoothing_enable_flag if (s->ps.sps->sps_strong_intra_smoothing_enable_flag
&& c_idx == 0 && c_idx == 0
&& ((top[-1] + top[63] - 2 * top[31]) >= && ((top[-1] + top[63] - 2 * top[31]) >=
0 ? (top[-1] + top[63] - 0 ? (top[-1] + top[63] -

View File

@ -49,8 +49,6 @@ static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
(avctx->bits_per_raw_sample != 10) && (avctx->bits_per_raw_sample != 10) &&
(avctx->bits_per_raw_sample != 12) && (avctx->bits_per_raw_sample != 12) &&
(avctx->idct_algo == FF_IDCT_AUTO)) { (avctx->idct_algo == FF_IDCT_AUTO)) {
c->idct_put = ff_simple_idct_put_mmi;
c->idct_add = ff_simple_idct_add_mmi;
c->idct = ff_simple_idct_mmi; c->idct = ff_simple_idct_mmi;
c->perm_type = FF_IDCT_PERM_NONE; c->perm_type = FF_IDCT_PERM_NONE;
} }

View File

@ -54,7 +54,7 @@ DECLARE_ALIGNED(8, static const int16_t, coeffs)[]= {
C3, -C1, C3, -C1 C3, -C1, C3, -C1
}; };
static void simple_idct_mmi(int16_t *block) void ff_simple_idct_mmi(int16_t *block)
{ {
DECLARE_ALIGNED(8, int64_t, align_tmp)[16]; DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
int16_t * const temp= (int16_t*)align_tmp; int16_t * const temp= (int16_t*)align_tmp;
@ -814,20 +814,3 @@ static void simple_idct_mmi(int16_t *block)
: "$10","$11" : "$10","$11"
); );
} }
void ff_simple_idct_mmi(int16_t *block)
{
simple_idct_mmi(block);
}
void ff_simple_idct_put_mmi(uint8_t *dest, int32_t line_size, int16_t *block)
{
simple_idct_mmi(block);
ff_put_pixels_clamped_mmi(block, dest, line_size);
}
void ff_simple_idct_add_mmi(uint8_t *dest, int32_t line_size, int16_t *block)
{
simple_idct_mmi(block);
ff_add_pixels_clamped_mmi(block, dest, line_size);
}

View File

@ -259,7 +259,7 @@
mask_out = __msa_xori_b(mask_out, 0xff); \ mask_out = __msa_xori_b(mask_out, 0xff); \
} }
void ff_loop_filter_v_4_8_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_4_8_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -288,7 +288,7 @@ void ff_loop_filter_v_4_8_msa(uint8_t *src, int32_t pitch,
} }
void ff_loop_filter_v_44_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_44_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -318,7 +318,7 @@ void ff_loop_filter_v_44_16_msa(uint8_t *src, int32_t pitch,
ST_UB4(p1, p0, q0, q1, (src - 2 * pitch), pitch); ST_UB4(p1, p0, q0, q1, (src - 2 * pitch), pitch);
} }
void ff_loop_filter_v_8_8_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_8_8_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -392,7 +392,7 @@ void ff_loop_filter_v_8_8_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_v_88_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_88_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -471,7 +471,7 @@ void ff_loop_filter_v_88_16_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_v_84_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_84_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -542,7 +542,7 @@ void ff_loop_filter_v_84_16_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_v_48_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_48_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -614,7 +614,7 @@ void ff_loop_filter_v_48_16_msa(uint8_t *src, int32_t pitch,
} }
} }
static int32_t vp9_hz_lpf_t4_and_t8_16w(uint8_t *src, int32_t pitch, static int32_t vp9_hz_lpf_t4_and_t8_16w(uint8_t *src, ptrdiff_t pitch,
uint8_t *filter48, uint8_t *filter48,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
@ -689,7 +689,7 @@ static int32_t vp9_hz_lpf_t4_and_t8_16w(uint8_t *src, int32_t pitch,
} }
} }
static void vp9_hz_lpf_t16_16w(uint8_t *src, int32_t pitch, uint8_t *filter48) static void vp9_hz_lpf_t16_16w(uint8_t *src, ptrdiff_t pitch, uint8_t *filter48)
{ {
v16u8 flat, flat2, filter8; v16u8 flat, flat2, filter8;
v16i8 zero = { 0 }; v16i8 zero = { 0 };
@ -1021,7 +1021,7 @@ static void vp9_hz_lpf_t16_16w(uint8_t *src, int32_t pitch, uint8_t *filter48)
} }
} }
void ff_loop_filter_v_16_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_16_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1037,7 +1037,7 @@ void ff_loop_filter_v_16_16_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_v_16_8_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_v_16_8_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1261,7 +1261,7 @@ void ff_loop_filter_v_16_8_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_h_4_8_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_4_8_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1290,7 +1290,7 @@ void ff_loop_filter_h_4_8_msa(uint8_t *src, int32_t pitch,
ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch); ST4x4_UB(vec3, vec3, 0, 1, 2, 3, src, pitch);
} }
void ff_loop_filter_h_44_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_44_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1337,7 +1337,7 @@ void ff_loop_filter_h_44_16_msa(uint8_t *src, int32_t pitch,
ST4x8_UB(tmp4, tmp5, src, pitch); ST4x8_UB(tmp4, tmp5, src, pitch);
} }
void ff_loop_filter_h_8_8_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_8_8_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1417,7 +1417,7 @@ void ff_loop_filter_h_8_8_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_h_88_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_88_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1531,7 +1531,7 @@ void ff_loop_filter_h_88_16_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_h_84_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_84_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1635,7 +1635,7 @@ void ff_loop_filter_h_84_16_msa(uint8_t *src, int32_t pitch,
} }
} }
void ff_loop_filter_h_48_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_48_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -1912,7 +1912,7 @@ static int32_t vp9_vt_lpf_t4_and_t8_8w(uint8_t *src, uint8_t *filter48,
} }
} }
static int32_t vp9_vt_lpf_t16_8w(uint8_t *src, uint8_t *src_org, int32_t pitch, static int32_t vp9_vt_lpf_t16_8w(uint8_t *src, uint8_t *src_org, ptrdiff_t pitch,
uint8_t *filter48) uint8_t *filter48)
{ {
v16i8 zero = { 0 }; v16i8 zero = { 0 };
@ -2136,7 +2136,7 @@ static int32_t vp9_vt_lpf_t16_8w(uint8_t *src, uint8_t *src_org, int32_t pitch,
} }
} }
void ff_loop_filter_h_16_8_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_16_8_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -2162,7 +2162,7 @@ void ff_loop_filter_h_16_8_msa(uint8_t *src, int32_t pitch,
} }
static int32_t vp9_vt_lpf_t4_and_t8_16w(uint8_t *src, uint8_t *filter48, static int32_t vp9_vt_lpf_t4_and_t8_16w(uint8_t *src, uint8_t *filter48,
uint8_t *src_org, int32_t pitch, uint8_t *src_org, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)
@ -2246,7 +2246,7 @@ static int32_t vp9_vt_lpf_t4_and_t8_16w(uint8_t *src, uint8_t *filter48,
} }
} }
static int32_t vp9_vt_lpf_t16_16w(uint8_t *src, uint8_t *src_org, int32_t pitch, static int32_t vp9_vt_lpf_t16_16w(uint8_t *src, uint8_t *src_org, ptrdiff_t pitch,
uint8_t *filter48) uint8_t *filter48)
{ {
v16u8 flat, flat2, filter8; v16u8 flat, flat2, filter8;
@ -2573,7 +2573,7 @@ static int32_t vp9_vt_lpf_t16_16w(uint8_t *src, uint8_t *src_org, int32_t pitch,
} }
} }
void ff_loop_filter_h_16_16_msa(uint8_t *src, int32_t pitch, void ff_loop_filter_h_16_16_msa(uint8_t *src, ptrdiff_t pitch,
int32_t b_limit_ptr, int32_t b_limit_ptr,
int32_t limit_ptr, int32_t limit_ptr,
int32_t thresh_ptr) int32_t thresh_ptr)

View File

@ -98,6 +98,15 @@ static void parse_avid(MJpegDecodeContext *s, uint8_t *buf, int len)
av_log(s->avctx, AV_LOG_INFO, "AVID: len:%d %d\n", len, len > 14 ? buf[12] : -1); av_log(s->avctx, AV_LOG_INFO, "AVID: len:%d %d\n", len, len > 14 ? buf[12] : -1);
} }
static void init_idct(AVCodecContext *avctx)
{
MJpegDecodeContext *s = avctx->priv_data;
ff_idctdsp_init(&s->idsp, avctx);
ff_init_scantable(s->idsp.idct_permutation, &s->scantable,
ff_zigzag_direct);
}
av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
{ {
MJpegDecodeContext *s = avctx->priv_data; MJpegDecodeContext *s = avctx->priv_data;
@ -112,9 +121,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
s->avctx = avctx; s->avctx = avctx;
ff_blockdsp_init(&s->bdsp, avctx); ff_blockdsp_init(&s->bdsp, avctx);
ff_hpeldsp_init(&s->hdsp, avctx->flags); ff_hpeldsp_init(&s->hdsp, avctx->flags);
ff_idctdsp_init(&s->idsp, avctx); init_idct(avctx);
ff_init_scantable(s->idsp.idct_permutation, &s->scantable,
ff_zigzag_direct);
s->buffer_size = 0; s->buffer_size = 0;
s->buffer = NULL; s->buffer = NULL;
s->start_code = -1; s->start_code = -1;
@ -267,7 +274,6 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* XXX: verify len field validity */ /* XXX: verify len field validity */
len = get_bits(&s->gb, 16); len = get_bits(&s->gb, 16);
s->avctx->bits_per_raw_sample =
bits = get_bits(&s->gb, 8); bits = get_bits(&s->gb, 8);
if (bits > 16 || bits < 1) { if (bits > 16 || bits < 1) {
@ -275,6 +281,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (s->avctx->bits_per_raw_sample != bits) {
av_log(s->avctx, AV_LOG_INFO, "Changeing bps to %d\n", bits);
s->avctx->bits_per_raw_sample = bits;
init_idct(s->avctx);
}
if (s->pegasus_rct) if (s->pegasus_rct)
bits = 9; bits = 9;
if (bits == 9 && !s->pegasus_rct) if (bits == 9 && !s->pegasus_rct)
@ -995,7 +1006,14 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
skip_bits(&s->gb, 16); /* skip RSTn */ skip_bits(&s->gb, 16); /* skip RSTn */
} }
} }
if (s->nb_components == 4) { if (s->rct && s->nb_components == 4) {
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
ptr[4*mb_x + 2] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200) >> 2);
ptr[4*mb_x + 1] = buffer[mb_x][1] + ptr[4*mb_x + 2];
ptr[4*mb_x + 3] = buffer[mb_x][2] + ptr[4*mb_x + 2];
ptr[4*mb_x + 0] = buffer[mb_x][3];
}
} else if (s->nb_components == 4) {
for(i=0; i<nb_components; i++) { for(i=0; i<nb_components; i++) {
int c= s->comp_index[i]; int c= s->comp_index[i];
if (s->bits <= 8) { if (s->bits <= 8) {
@ -1086,7 +1104,10 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
dc = mjpeg_decode_dc(s, s->dc_index[i]); dc = mjpeg_decode_dc(s, s->dc_index[i]);
if(dc == 0xFFFFF) if(dc == 0xFFFFF)
return -1; return -1;
if(bits<=8){ if ( h * mb_x + x >= s->width
|| v * mb_y + y >= s->height) {
// Nothing to do
} else if (bits<=8) {
ptr = s->picture_ptr->data[c] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap ptr = s->picture_ptr->data[c] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
if(y==0 && toprow){ if(y==0 && toprow){
if(x==0 && leftcol){ if(x==0 && leftcol){
@ -1154,7 +1175,10 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
dc = mjpeg_decode_dc(s, s->dc_index[i]); dc = mjpeg_decode_dc(s, s->dc_index[i]);
if(dc == 0xFFFFF) if(dc == 0xFFFFF)
return -1; return -1;
if(bits<=8){ if ( h * mb_x + x >= s->width
|| v * mb_y + y >= s->height) {
// Nothing to do
} else if (bits<=8) {
ptr = s->picture_ptr->data[c] + ptr = s->picture_ptr->data[c] +
(linesize * (v * mb_y + y)) + (linesize * (v * mb_y + y)) +
(h * mb_x + x); //FIXME optimize this crap (h * mb_x + x); //FIXME optimize this crap

View File

@ -1953,7 +1953,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
(left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10) || (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10) ||
((avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) && left > 8)) { ((avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) && left > 8)) {
av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n", av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n",
left, show_bits(&s->gb, FFMIN(left, 23))); left, left>0 ? show_bits(&s->gb, FFMIN(left, 23)) : 0);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} else } else
goto eos; goto eos;

View File

@ -1657,9 +1657,11 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
uint32_t header; uint32_t header;
int ret; int ret;
int skipped = 0;
while(buf_size && !*buf){ while(buf_size && !*buf){
buf++; buf++;
buf_size--; buf_size--;
skipped++;
} }
if (buf_size < HEADER_SIZE) if (buf_size < HEADER_SIZE)
@ -1714,7 +1716,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
return ret; return ret;
} }
s->frame_size = 0; s->frame_size = 0;
return buf_size; return buf_size + skipped;
} }
static void mp_flush(MPADecodeContext *ctx) static void mp_flush(MPADecodeContext *ctx)

View File

@ -20,6 +20,8 @@
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* non linear quantizers with large QPs and VBV with restrictive qmin fixes sponsored by NOA GmbH
*/ */
/** /**

View File

@ -565,8 +565,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
if (buffer_samples) { if (buffer_samples) {
float *buf[2] = { c->out[2 * i + 0] ? c->out[2 * i + 0] : (float*)frame->extended_data[0], float *buf[2] = { c->out[2 * i + 0] ? c->out[2 * i + 0] : (float*)frame->extended_data[0],
c->out[2 * i + 1] ? c->out[2 * i + 1] : (float*)frame->extended_data[0] }; c->out[2 * i + 1] ? c->out[2 * i + 1] : (float*)frame->extended_data[0] };
buf[0] += buffer_samples; buf[0] += decoded_samples;
buf[1] += buffer_samples; buf[1] += decoded_samples;
ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, buffer_samples); ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, buffer_samples);
if (ret < 0) if (ret < 0)
return ret; return ret;
@ -585,7 +585,7 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
memset(frame->extended_data[i], 0, frame->linesize[0]); memset(frame->extended_data[i], 0, frame->linesize[0]);
} }
if (c->gain_i) { if (c->gain_i && decoded_samples > 0) {
c->fdsp->vector_fmul_scalar((float*)frame->extended_data[i], c->fdsp->vector_fmul_scalar((float*)frame->extended_data[i],
(float*)frame->extended_data[i], (float*)frame->extended_data[i],
c->gain, FFALIGN(decoded_samples, 8)); c->gain, FFALIGN(decoded_samples, 8));

View File

@ -912,6 +912,11 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s,
cur_w > s->width - x_offset|| cur_h > s->height - y_offset) cur_w > s->width - x_offset|| cur_h > s->height - y_offset)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (blend_op != APNG_BLEND_OP_OVER && blend_op != APNG_BLEND_OP_SOURCE) {
av_log(avctx, AV_LOG_ERROR, "Invalid blend_op %d\n", blend_op);
return AVERROR_INVALIDDATA;
}
if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS) { if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
// No previous frame to revert to for the first frame // No previous frame to revert to for the first frame
// Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND // Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND
@ -1007,7 +1012,7 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
for (x = s->x_offset; x < s->x_offset + s->cur_w; ++x, foreground += s->bpp, background += s->bpp) { for (x = s->x_offset; x < s->x_offset + s->cur_w; ++x, foreground += s->bpp, background += s->bpp) {
size_t b; size_t b;
uint8_t foreground_alpha, background_alpha, output_alpha; uint8_t foreground_alpha, background_alpha, output_alpha;
uint8_t output[4]; uint8_t output[10];
// Since we might be blending alpha onto alpha, we use the following equations: // Since we might be blending alpha onto alpha, we use the following equations:
// output_alpha = foreground_alpha + (1 - foreground_alpha) * background_alpha // output_alpha = foreground_alpha + (1 - foreground_alpha) * background_alpha
@ -1047,6 +1052,8 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
output_alpha = foreground_alpha + FAST_DIV255((255 - foreground_alpha) * background_alpha); output_alpha = foreground_alpha + FAST_DIV255((255 - foreground_alpha) * background_alpha);
av_assert0(s->bpp <= 10);
for (b = 0; b < s->bpp - 1; ++b) { for (b = 0; b < s->bpp - 1; ++b) {
if (output_alpha == 0) { if (output_alpha == 0) {
output[b] = 0; output[b] = 0;
@ -1254,7 +1261,7 @@ static int decode_frame_png(AVCodecContext *avctx,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->y = s->state = 0; s->y = s->state = s->has_trns = 0;
/* init the zlib */ /* init the zlib */
s->zstream.zalloc = ff_png_zalloc; s->zstream.zalloc = ff_png_zalloc;

View File

@ -565,6 +565,8 @@ static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
e= 0; e= 0;
while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10 while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
e++; e++;
if (e > 31)
return AVERROR_INVALIDDATA;
} }
a= 1; a= 1;

View File

@ -31,7 +31,7 @@
*/ */
#include <stdint.h> #include <stdint.h>
#include <libavutil/attributes.h> #include "libavutil/attributes.h"
#include "version.h" #include "version.h"
/** /**

View File

@ -205,7 +205,7 @@ static void fill_picture_parameters(const HEVCContext *h, VAPictureParameterBuff
pp->pps_tc_offset_div2 = h->ps.pps->tc_offset / 2; pp->pps_tc_offset_div2 = h->ps.pps->tc_offset / 2;
pp->log2_parallel_merge_level_minus2 = h->ps.pps->log2_parallel_merge_level - 2; pp->log2_parallel_merge_level_minus2 = h->ps.pps->log2_parallel_merge_level - 2;
/* Diffrent chroma/luma bit depths are currently not supported by ffmpeg. */ /* Different chroma/luma bit depths are currently not supported by ffmpeg. */
pp->bit_depth_luma_minus8 = h->ps.sps->bit_depth - 8; pp->bit_depth_luma_minus8 = h->ps.sps->bit_depth - 8;
pp->bit_depth_chroma_minus8 = h->ps.sps->bit_depth - 8; pp->bit_depth_chroma_minus8 = h->ps.sps->bit_depth - 8;

View File

@ -164,7 +164,7 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
s->mb_height = (s->avctx->coded_height + 15) / 16; s->mb_height = (s->avctx->coded_height + 15) / 16;
s->mb_layout = is_vp7 || avctx->active_thread_type == FF_THREAD_SLICE && s->mb_layout = is_vp7 || avctx->active_thread_type == FF_THREAD_SLICE &&
FFMIN(s->num_coeff_partitions, avctx->thread_count) > 1; avctx->thread_count > 1;
if (!s->mb_layout) { // Frame threading and one thread if (!s->mb_layout) { // Frame threading and one thread
s->macroblocks_base = av_mallocz((s->mb_width + s->mb_height * 2 + 1) * s->macroblocks_base = av_mallocz((s->mb_width + s->mb_height * 2 + 1) *
sizeof(*s->macroblocks)); sizeof(*s->macroblocks));

View File

@ -382,6 +382,7 @@ apply_noise_main:
%else %else
%define count m_maxq %define count m_maxq
%endif %endif
movsxdifnidn noiseq, noised
dec noiseq dec noiseq
shl count, 2 shl count, 2
%ifdef PIC %ifdef PIC

View File

@ -194,8 +194,12 @@ hvar_fn
%elif (%2-%%off) == 2 %elif (%2-%%off) == 2
mov valw, [srcq+%2-2] mov valw, [srcq+%2-2]
%elifidn %1, body %elifidn %1, body
mov vald, [srcq+%2-3] mov valb, [srcq+%2-1]
%else sal vald, 16
mov valw, [srcq+%2-3]
%elifidn %1, bottom
movd mm %+ %%mmx_idx, [srcq+%2-4]
%else ; top
movd mm %+ %%mmx_idx, [srcq+%2-3] movd mm %+ %%mmx_idx, [srcq+%2-3]
%endif %endif
%endif ; (%2-%%off) >= 1 %endif ; (%2-%%off) >= 1
@ -251,12 +255,15 @@ hvar_fn
mov [dstq+%2-2], valw mov [dstq+%2-2], valw
%elifidn %1, body %elifidn %1, body
mov [dstq+%2-3], valw mov [dstq+%2-3], valw
shr vald, 16 sar vald, 16
mov [dstq+%2-1], valb mov [dstq+%2-1], valb
%else %else
movd vald, mm %+ %%mmx_idx movd vald, mm %+ %%mmx_idx
%ifidn %1, bottom
sar vald, 8
%endif
mov [dstq+%2-3], valw mov [dstq+%2-3], valw
shr vald, 16 sar vald, 16
mov [dstq+%2-1], valb mov [dstq+%2-1], valb
%endif %endif
%endif ; (%2-%%off) >= 1 %endif ; (%2-%%off) >= 1

View File

@ -205,7 +205,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
delta = pts - s->pts - get_delay(s); delta = pts - s->pts - get_delay(s);
out_size = avresample_available(s->avr); out_size = avresample_available(s->avr);
if (labs(delta) > s->min_delta || if (llabs(delta) > s->min_delta ||
(s->first_frame && delta && s->first_pts != AV_NOPTS_VALUE)) { (s->first_frame && delta && s->first_pts != AV_NOPTS_VALUE)) {
av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\n", delta); av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\n", delta);
out_size = av_clipl_int32((int64_t)out_size + delta); out_size = av_clipl_int32((int64_t)out_size + delta);

View File

@ -142,7 +142,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterContext *ctx = inlink->dst; AVFilterContext *ctx = inlink->dst;
LADSPAContext *s = ctx->priv; LADSPAContext *s = ctx->priv;
AVFrame *out; AVFrame *out;
int i, h; int i, h, p;
if (!s->nb_outputs || if (!s->nb_outputs ||
(av_frame_is_writable(in) && s->nb_inputs == s->nb_outputs && (av_frame_is_writable(in) && s->nb_inputs == s->nb_outputs &&
@ -159,13 +159,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
for (h = 0; h < s->nb_handles; h++) { for (h = 0; h < s->nb_handles; h++) {
for (i = 0; i < s->nb_inputs; i++) { for (i = 0; i < s->nb_inputs; i++) {
p = s->nb_handles > 1 ? h : i;
s->desc->connect_port(s->handles[h], s->ipmap[i], s->desc->connect_port(s->handles[h], s->ipmap[i],
(LADSPA_Data*)in->extended_data[i]); (LADSPA_Data*)in->extended_data[p]);
} }
for (i = 0; i < s->nb_outputs; i++) { for (i = 0; i < s->nb_outputs; i++) {
p = s->nb_handles > 1 ? h : i;
s->desc->connect_port(s->handles[h], s->opmap[i], s->desc->connect_port(s->handles[h], s->opmap[i],
(LADSPA_Data*)out->extended_data[i]); (LADSPA_Data*)out->extended_data[p]);
} }
s->desc->run(s->handles[h], in->nb_samples); s->desc->run(s->handles[h], in->nb_samples);

View File

@ -359,7 +359,7 @@ cglobal rg_fl_mode_6, 4, 5, 16, 0, dst, src, stride, pixels
paddw m2, m7 ; c2 paddw m2, m7 ; c2
paddw m3, m6 ; c3 paddw m3, m6 ; c3
paddw m4, m5 ; c4 paddw m4, m5 ; c4
; As the differences (d1..d4) can only be postive, there is no need to ; As the differences (d1..d4) can only be positive, there is no need to
; clip to zero. Also, the maximum positive value is less than 768. ; clip to zero. Also, the maximum positive value is less than 768.
pminsw m1, m2 pminsw m1, m2
@ -485,7 +485,7 @@ cglobal rg_fl_mode_8, 4, 5, 16, 0, dst, src, stride, pixels
paddw m2, m7 ; c1 paddw m2, m7 ; c1
paddw m3, m6 ; c1 paddw m3, m6 ; c1
paddw m4, m5 ; c1 paddw m4, m5 ; c1
; As the differences (d1..d4) can only be postive, there is no need to ; As the differences (d1..d4) can only be positive, there is no need to
; clip to zero. Also, the maximum positive value is less than 768. ; clip to zero. Also, the maximum positive value is less than 768.
pminsw m1, m2 pminsw m1, m2

View File

@ -583,7 +583,7 @@ static int asf_read_metadata_obj(AVFormatContext *s, const GUIDParseTable *g)
break; break;
type = avio_rl16(pb); type = avio_rl16(pb);
val_len = avio_rl32(pb); val_len = avio_rl32(pb);
name = av_malloc(name_len); name = av_malloc(buflen);
if (!name) if (!name)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
avio_get_str16le(pb, name_len, name, avio_get_str16le(pb, name_len, name,
@ -1042,8 +1042,8 @@ static const GUIDParseTable gdef[] = {
{ "Mutex Language", { 0xD6, 0xE2, 0x2A, 0x00, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 }, { "Mutex Language", { 0xD6, 0xE2, 0x2A, 0x00, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
{ "Mutex Bitrate", { 0xD6, 0xE2, 0x2A, 0x01, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 }, { "Mutex Bitrate", { 0xD6, 0xE2, 0x2A, 0x01, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
{ "Mutex Unknown", { 0xD6, 0xE2, 0x2A, 0x02, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 }, { "Mutex Unknown", { 0xD6, 0xE2, 0x2A, 0x02, 0x25, 0xDA, 0x11, 0xD1, 0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE }, asf_read_unknown, 1 },
{ "Bandwith Sharing Exclusive", { 0xAF, 0x60, 0x60, 0xAA, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 }, { "Bandwidth Sharing Exclusive", { 0xAF, 0x60, 0x60, 0xAA, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
{ "Bandwith Sharing Partial", { 0xAF, 0x60, 0x60, 0xAB, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 }, { "Bandwidth Sharing Partial", { 0xAF, 0x60, 0x60, 0xAB, 0x51, 0x97, 0x11, 0xD2, 0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9 }, asf_read_unknown, 1 },
{ "Payload Extension System Timecode", { 0x39, 0x95, 0x95, 0xEC, 0x86, 0x67, 0x4E, 0x2D, 0x8F, 0xDB, 0x98, 0x81, 0x4C, 0xE7, 0x6C, 0x1E }, asf_read_unknown, 1 }, { "Payload Extension System Timecode", { 0x39, 0x95, 0x95, 0xEC, 0x86, 0x67, 0x4E, 0x2D, 0x8F, 0xDB, 0x98, 0x81, 0x4C, 0xE7, 0x6C, 0x1E }, asf_read_unknown, 1 },
{ "Payload Extension System File Name", { 0xE1, 0x65, 0xEC, 0x0E, 0x19, 0xED, 0x45, 0xD7, 0xB4, 0xA7, 0x25, 0xCB, 0xD1, 0xE2, 0x8E, 0x9B }, asf_read_unknown, 1 }, { "Payload Extension System File Name", { 0xE1, 0x65, 0xEC, 0x0E, 0x19, 0xED, 0x45, 0xD7, 0xB4, 0xA7, 0x25, 0xCB, 0xD1, 0xE2, 0x8E, 0x9B }, asf_read_unknown, 1 },
{ "Payload Extension System Content Type", { 0xD5, 0x90, 0xDC, 0x20, 0x07, 0xBC, 0x43, 0x6C, 0x9C, 0xF7, 0xF3, 0xBB, 0xFB, 0xF1, 0xA4, 0xDC }, asf_read_unknown, 1 }, { "Payload Extension System Content Type", { 0xD5, 0x90, 0xDC, 0x20, 0x07, 0xBC, 0x43, 0x6C, 0x9C, 0xF7, 0xF3, 0xBB, 0xFB, 0xF1, 0xA4, 0xDC }, asf_read_unknown, 1 },
@ -1141,7 +1141,7 @@ static int asf_read_replicated_data(AVFormatContext *s, ASFPacket *asf_pkt)
if (!asf_pkt->data_size) { if (!asf_pkt->data_size) {
asf_pkt->data_size = asf_pkt->size_left = avio_rl32(pb); // read media object size asf_pkt->data_size = asf_pkt->size_left = avio_rl32(pb); // read media object size
if (asf_pkt->data_size <= 0) if (asf_pkt->data_size <= 0)
return AVERROR_EOF; return AVERROR_INVALIDDATA;
if ((ret = av_new_packet(&asf_pkt->avpkt, asf_pkt->data_size)) < 0) if ((ret = av_new_packet(&asf_pkt->avpkt, asf_pkt->data_size)) < 0)
return ret; return ret;
} else } else
@ -1163,7 +1163,7 @@ static int asf_read_multiple_payload(AVFormatContext *s, AVPacket *pkt,
int ret; int ret;
int skip = 0; int skip = 0;
// if replicated lenght is 1, subpayloads are present // if replicated length is 1, subpayloads are present
if (asf->rep_data_len == 1) { if (asf->rep_data_len == 1) {
asf->sub_left = 1; asf->sub_left = 1;
asf->state = READ_MULTI_SUB; asf->state = READ_MULTI_SUB;
@ -1190,6 +1190,8 @@ static int asf_read_multiple_payload(AVFormatContext *s, AVPacket *pkt,
skip = pay_len - asf_pkt->size_left; skip = pay_len - asf_pkt->size_left;
pay_len = asf_pkt->size_left; pay_len = asf_pkt->size_left;
} }
if (asf_pkt->size_left <= 0)
return AVERROR_INVALIDDATA;
if ((ret = avio_read(pb, p, pay_len)) < 0) if ((ret = avio_read(pb, p, pay_len)) < 0)
return ret; return ret;
if (s->key && s->keylen == 20) if (s->key && s->keylen == 20)
@ -1237,7 +1239,7 @@ static int asf_read_single_payload(AVFormatContext *s, AVPacket *pkt,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
p = asf_pkt->avpkt.data + asf_pkt->data_size - asf_pkt->size_left; p = asf_pkt->avpkt.data + asf_pkt->data_size - asf_pkt->size_left;
if (size > asf_pkt->size_left) if (size > asf_pkt->size_left || asf_pkt->size_left <= 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (asf_pkt->size_left > size) if (asf_pkt->size_left > size)
asf_pkt->size_left -= size; asf_pkt->size_left -= size;

View File

@ -170,7 +170,7 @@ static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **
c->interrupt_callback = h->interrupt_callback; c->interrupt_callback = h->interrupt_callback;
ret = ffurl_open(&c->inner, arg, flags, &interrupt_callback, options); ret = ffurl_open(&c->inner, arg, flags, &interrupt_callback, options);
if (ret != 0) { if (ret != 0) {
av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", strerror(ret), arg); av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", av_err2str(ret), arg);
goto url_fail; goto url_fail;
} }
@ -179,25 +179,25 @@ static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **
ret = pthread_mutex_init(&c->mutex, NULL); ret = pthread_mutex_init(&c->mutex, NULL);
if (ret != 0) { if (ret != 0) {
av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", strerror(ret)); av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", av_err2str(ret));
goto mutex_fail; goto mutex_fail;
} }
ret = pthread_cond_init(&c->cond_wakeup_main, NULL); ret = pthread_cond_init(&c->cond_wakeup_main, NULL);
if (ret != 0) { if (ret != 0) {
av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", strerror(ret)); av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
goto cond_wakeup_main_fail; goto cond_wakeup_main_fail;
} }
ret = pthread_cond_init(&c->cond_wakeup_background, NULL); ret = pthread_cond_init(&c->cond_wakeup_background, NULL);
if (ret != 0) { if (ret != 0) {
av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", strerror(ret)); av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
goto cond_wakeup_background_fail; goto cond_wakeup_background_fail;
} }
ret = pthread_create(&c->async_buffer_thread, NULL, async_buffer_task, h); ret = pthread_create(&c->async_buffer_thread, NULL, async_buffer_task, h);
if (ret) { if (ret) {
av_log(h, AV_LOG_ERROR, "pthread_create failed : %s\n", strerror(ret)); av_log(h, AV_LOG_ERROR, "pthread_create failed : %s\n", av_err2str(ret));
goto thread_fail; goto thread_fail;
} }
@ -229,7 +229,7 @@ static int async_close(URLContext *h)
ret = pthread_join(c->async_buffer_thread, NULL); ret = pthread_join(c->async_buffer_thread, NULL);
if (ret != 0) if (ret != 0)
av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", strerror(ret)); av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", av_err2str(ret));
pthread_cond_destroy(&c->cond_wakeup_background); pthread_cond_destroy(&c->cond_wakeup_background);
pthread_cond_destroy(&c->cond_wakeup_main); pthread_cond_destroy(&c->cond_wakeup_main);

View File

@ -1581,6 +1581,7 @@ static int avi_read_idx1(AVFormatContext *s, int size)
ast = st->priv_data; ast = st->priv_data;
if (first_packet && first_packet_pos) { if (first_packet && first_packet_pos) {
if (avi->movi_list + 4 != pos || pos + 500 > first_packet_pos)
data_offset = first_packet_pos - pos; data_offset = first_packet_pos - pos;
first_packet = 0; first_packet = 0;
} }

View File

@ -314,7 +314,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
file->start_time = !fileno ? 0 : file->start_time = !fileno ? 0 :
cat->files[fileno - 1].start_time + cat->files[fileno - 1].start_time +
cat->files[fileno - 1].duration; cat->files[fileno - 1].duration;
file->file_start_time = (avf->start_time == AV_NOPTS_VALUE) ? 0 : avf->start_time; file->file_start_time = (cat->avf->start_time == AV_NOPTS_VALUE) ? 0 : cat->avf->start_time;
file->file_inpoint = (file->inpoint == AV_NOPTS_VALUE) ? file->file_start_time : file->inpoint; file->file_inpoint = (file->inpoint == AV_NOPTS_VALUE) ? file->file_start_time : file->inpoint;
if ((ret = match_streams(avf)) < 0) if ((ret = match_streams(avf)) < 0)
return ret; return ret;

View File

@ -151,7 +151,7 @@ static int ffm_read_data(AVFormatContext *s,
return size1 - size; return size1 - size;
} }
/* ensure that acutal seeking happens between FFM_PACKET_SIZE /* ensure that actual seeking happens between FFM_PACKET_SIZE
and file_size - FFM_PACKET_SIZE */ and file_size - FFM_PACKET_SIZE */
static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1) static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1)
{ {

View File

@ -73,6 +73,8 @@ struct segment {
char *key; char *key;
enum KeyType key_type; enum KeyType key_type;
uint8_t iv[16]; uint8_t iv[16];
/* associated Media Initialization Section, treated as a segment */
struct segment *init_section;
}; };
struct rendition; struct rendition;
@ -110,6 +112,13 @@ struct playlist {
int64_t cur_seg_offset; int64_t cur_seg_offset;
int64_t last_load_time; int64_t last_load_time;
/* Currently active Media Initialization Section */
struct segment *cur_init_section;
uint8_t *init_sec_buf;
unsigned int init_sec_buf_size;
unsigned int init_sec_data_len;
unsigned int init_sec_buf_read_offset;
char key_url[MAX_URL_SIZE]; char key_url[MAX_URL_SIZE];
uint8_t key[16]; uint8_t key[16];
@ -135,6 +144,11 @@ struct playlist {
* multiple (playlist-less) renditions associated with them. */ * multiple (playlist-less) renditions associated with them. */
int n_renditions; int n_renditions;
struct rendition **renditions; struct rendition **renditions;
/* Media Initialization Sections (EXT-X-MAP) associated with this
* playlist, if any. */
int n_init_sections;
struct segment **init_sections;
}; };
/* /*
@ -205,16 +219,29 @@ static void free_segment_list(struct playlist *pls)
pls->n_segments = 0; pls->n_segments = 0;
} }
static void free_init_section_list(struct playlist *pls)
{
int i;
for (i = 0; i < pls->n_init_sections; i++) {
av_freep(&pls->init_sections[i]->url);
av_freep(&pls->init_sections[i]);
}
av_freep(&pls->init_sections);
pls->n_init_sections = 0;
}
static void free_playlist_list(HLSContext *c) static void free_playlist_list(HLSContext *c)
{ {
int i; int i;
for (i = 0; i < c->n_playlists; i++) { for (i = 0; i < c->n_playlists; i++) {
struct playlist *pls = c->playlists[i]; struct playlist *pls = c->playlists[i];
free_segment_list(pls); free_segment_list(pls);
free_init_section_list(pls);
av_freep(&pls->renditions); av_freep(&pls->renditions);
av_freep(&pls->id3_buf); av_freep(&pls->id3_buf);
av_dict_free(&pls->id3_initial); av_dict_free(&pls->id3_initial);
ff_id3v2_free_extra_meta(&pls->id3_deferred_extra); ff_id3v2_free_extra_meta(&pls->id3_deferred_extra);
av_freep(&pls->init_sec_buf);
av_free_packet(&pls->pkt); av_free_packet(&pls->pkt);
av_freep(&pls->pb.buffer); av_freep(&pls->pb.buffer);
if (pls->input) if (pls->input)
@ -352,6 +379,60 @@ static void handle_key_args(struct key_info *info, const char *key,
} }
} }
struct init_section_info {
char uri[MAX_URL_SIZE];
char byterange[32];
};
static struct segment *new_init_section(struct playlist *pls,
struct init_section_info *info,
const char *url_base)
{
struct segment *sec;
char *ptr;
char tmp_str[MAX_URL_SIZE];
if (!info->uri[0])
return NULL;
sec = av_mallocz(sizeof(*sec));
if (!sec)
return NULL;
ff_make_absolute_url(tmp_str, sizeof(tmp_str), url_base, info->uri);
sec->url = av_strdup(tmp_str);
if (!sec->url) {
av_free(sec);
return NULL;
}
if (info->byterange[0]) {
sec->size = atoi(info->byterange);
ptr = strchr(info->byterange, '@');
if (ptr)
sec->url_offset = atoi(ptr+1);
} else {
/* the entire file is the init section */
sec->size = -1;
}
dynarray_add(&pls->init_sections, &pls->n_init_sections, sec);
return sec;
}
static void handle_init_section_args(struct init_section_info *info, const char *key,
int key_len, char **dest, int *dest_len)
{
if (!strncmp(key, "URI=", key_len)) {
*dest = info->uri;
*dest_len = sizeof(info->uri);
} else if (!strncmp(key, "BYTERANGE=", key_len)) {
*dest = info->byterange;
*dest_len = sizeof(info->byterange);
}
}
struct rendition_info { struct rendition_info {
char type[16]; char type[16];
char uri[MAX_URL_SIZE]; char uri[MAX_URL_SIZE];
@ -516,19 +597,23 @@ static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *o
av_dict_copy(&tmp, opts, 0); av_dict_copy(&tmp, opts, 0);
av_dict_copy(&tmp, opts2, 0); av_dict_copy(&tmp, opts2, 0);
if ((ret = av_opt_set_dict(pls->input, &tmp)) < 0) if ((ret = ffurl_connect(pls->input, &tmp)) < 0) {
goto fail;
if ((ret = ffurl_connect(pls->input, NULL)) < 0) {
ffurl_close(pls->input); ffurl_close(pls->input);
pls->input = NULL; pls->input = NULL;
} }
fail:
av_dict_free(&tmp); av_dict_free(&tmp);
return ret; return ret;
} }
static void update_options(char **dest, const char *name, void *src)
{
av_freep(dest);
av_opt_get(src, name, 0, (uint8_t**)dest);
if (*dest && !strlen(*dest))
av_freep(dest);
}
static int open_url(HLSContext *c, URLContext **uc, const char *url, AVDictionary *opts) static int open_url(HLSContext *c, URLContext **uc, const char *url, AVDictionary *opts)
{ {
AVDictionary *tmp = NULL; AVDictionary *tmp = NULL;
@ -538,6 +623,12 @@ static int open_url(HLSContext *c, URLContext **uc, const char *url, AVDictionar
av_dict_copy(&tmp, opts, 0); av_dict_copy(&tmp, opts, 0);
ret = ffurl_open(uc, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp); ret = ffurl_open(uc, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp);
if( ret >= 0) {
// update cookies on http response with setcookies.
URLContext *u = *uc;
update_options(&c->cookies, "cookies", u->priv_data);
av_dict_set(&opts, "cookies", c->cookies, 0);
}
av_dict_free(&tmp); av_dict_free(&tmp);
@ -561,6 +652,7 @@ static int parse_playlist(HLSContext *c, const char *url,
uint8_t *new_url = NULL; uint8_t *new_url = NULL;
struct variant_info variant_info; struct variant_info variant_info;
char tmp_str[MAX_URL_SIZE]; char tmp_str[MAX_URL_SIZE];
struct segment *cur_init_section = NULL;
if (!in) { if (!in) {
#if 1 #if 1
@ -646,6 +738,14 @@ static int parse_playlist(HLSContext *c, const char *url,
pls->type = PLS_TYPE_EVENT; pls->type = PLS_TYPE_EVENT;
else if (!strcmp(ptr, "VOD")) else if (!strcmp(ptr, "VOD"))
pls->type = PLS_TYPE_VOD; pls->type = PLS_TYPE_VOD;
} else if (av_strstart(line, "#EXT-X-MAP:", &ptr)) {
struct init_section_info info = {{0}};
ret = ensure_playlist(c, &pls, url);
if (ret < 0)
goto fail;
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_init_section_args,
&info);
cur_init_section = new_init_section(pls, &info, url);
} else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) { } else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
if (pls) if (pls)
pls->finished = 1; pls->finished = 1;
@ -724,6 +824,8 @@ static int parse_playlist(HLSContext *c, const char *url,
seg->url_offset = 0; seg->url_offset = 0;
seg_offset = 0; seg_offset = 0;
} }
seg->init_section = cur_init_section;
} }
} }
} }
@ -737,17 +839,22 @@ fail:
return ret; return ret;
} }
static struct segment *current_segment(struct playlist *pls)
{
return pls->segments[pls->cur_seq_no - pls->start_seq_no];
}
enum ReadFromURLMode { enum ReadFromURLMode {
READ_NORMAL, READ_NORMAL,
READ_COMPLETE, READ_COMPLETE,
}; };
/* read from URLContext, limiting read to current segment */ /* read from URLContext, limiting read to current segment */
static int read_from_url(struct playlist *pls, uint8_t *buf, int buf_size, static int read_from_url(struct playlist *pls, struct segment *seg,
uint8_t *buf, int buf_size,
enum ReadFromURLMode mode) enum ReadFromURLMode mode)
{ {
int ret; int ret;
struct segment *seg = pls->segments[pls->cur_seq_no - pls->start_seq_no];
/* limit read if the segment was only a part of a file */ /* limit read if the segment was only a part of a file */
if (seg->size >= 0) if (seg->size >= 0)
@ -870,12 +977,13 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
int bytes; int bytes;
int id3_buf_pos = 0; int id3_buf_pos = 0;
int fill_buf = 0; int fill_buf = 0;
struct segment *seg = current_segment(pls);
/* gather all the id3 tags */ /* gather all the id3 tags */
while (1) { while (1) {
/* see if we can retrieve enough data for ID3 header */ /* see if we can retrieve enough data for ID3 header */
if (*len < ID3v2_HEADER_SIZE && buf_size >= ID3v2_HEADER_SIZE) { if (*len < ID3v2_HEADER_SIZE && buf_size >= ID3v2_HEADER_SIZE) {
bytes = read_from_url(pls, buf + *len, ID3v2_HEADER_SIZE - *len, READ_COMPLETE); bytes = read_from_url(pls, seg, buf + *len, ID3v2_HEADER_SIZE - *len, READ_COMPLETE);
if (bytes > 0) { if (bytes > 0) {
if (bytes == ID3v2_HEADER_SIZE - *len) if (bytes == ID3v2_HEADER_SIZE - *len)
@ -896,7 +1004,6 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
break; break;
if (ff_id3v2_match(buf, ID3v2_DEFAULT_MAGIC)) { if (ff_id3v2_match(buf, ID3v2_DEFAULT_MAGIC)) {
struct segment *seg = pls->segments[pls->cur_seq_no - pls->start_seq_no];
int64_t maxsize = seg->size >= 0 ? seg->size : 1024*1024; int64_t maxsize = seg->size >= 0 ? seg->size : 1024*1024;
int taglen = ff_id3v2_tag_len(buf); int taglen = ff_id3v2_tag_len(buf);
int tag_got_bytes = FFMIN(taglen, *len); int tag_got_bytes = FFMIN(taglen, *len);
@ -928,7 +1035,7 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
if (remaining > 0) { if (remaining > 0) {
/* read the rest of the tag in */ /* read the rest of the tag in */
if (read_from_url(pls, pls->id3_buf + id3_buf_pos, remaining, READ_COMPLETE) != remaining) if (read_from_url(pls, seg, pls->id3_buf + id3_buf_pos, remaining, READ_COMPLETE) != remaining)
break; break;
id3_buf_pos += remaining; id3_buf_pos += remaining;
av_log(pls->ctx, AV_LOG_DEBUG, "Stripped additional %d HLS ID3 bytes\n", remaining); av_log(pls->ctx, AV_LOG_DEBUG, "Stripped additional %d HLS ID3 bytes\n", remaining);
@ -942,7 +1049,7 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
/* re-fill buffer for the caller unless EOF */ /* re-fill buffer for the caller unless EOF */
if (*len >= 0 && (fill_buf || *len == 0)) { if (*len >= 0 && (fill_buf || *len == 0)) {
bytes = read_from_url(pls, buf + *len, buf_size - *len, READ_NORMAL); bytes = read_from_url(pls, seg, buf + *len, buf_size - *len, READ_NORMAL);
/* ignore error if we already had some data */ /* ignore error if we already had some data */
if (bytes >= 0) if (bytes >= 0)
@ -962,20 +1069,10 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
pls->is_id3_timestamped = (pls->id3_mpegts_timestamp != AV_NOPTS_VALUE); pls->is_id3_timestamped = (pls->id3_mpegts_timestamp != AV_NOPTS_VALUE);
} }
static void update_options(char **dest, const char *name, void *src) static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg)
{
av_freep(dest);
av_opt_get(src, name, 0, (uint8_t**)dest);
if (*dest && !strlen(*dest))
av_freep(dest);
}
static int open_input(HLSContext *c, struct playlist *pls)
{ {
AVDictionary *opts = NULL; AVDictionary *opts = NULL;
AVDictionary *opts2 = NULL;
int ret; int ret;
struct segment *seg = pls->segments[pls->cur_seq_no - pls->start_seq_no];
// broker prior HTTP options that should be consistent across requests // broker prior HTTP options that should be consistent across requests
av_dict_set(&opts, "user-agent", c->user_agent, 0); av_dict_set(&opts, "user-agent", c->user_agent, 0);
@ -983,9 +1080,6 @@ static int open_input(HLSContext *c, struct playlist *pls)
av_dict_set(&opts, "headers", c->headers, 0); av_dict_set(&opts, "headers", c->headers, 0);
av_dict_set(&opts, "seekable", "0", 0); av_dict_set(&opts, "seekable", "0", 0);
// Same opts for key request (ffurl_open mutilates the opts so it cannot be used twice)
av_dict_copy(&opts2, opts, 0);
if (seg->size >= 0) { if (seg->size >= 0) {
/* try to restrict the HTTP request to the part we want /* try to restrict the HTTP request to the part we want
* (if this is in fact a HTTP request) */ * (if this is in fact a HTTP request) */
@ -1003,14 +1097,12 @@ static int open_input(HLSContext *c, struct playlist *pls)
char iv[33], key[33], url[MAX_URL_SIZE]; char iv[33], key[33], url[MAX_URL_SIZE];
if (strcmp(seg->key, pls->key_url)) { if (strcmp(seg->key, pls->key_url)) {
URLContext *uc; URLContext *uc;
if (open_url(pls->parent->priv_data, &uc, seg->key, opts2) == 0) { if (open_url(pls->parent->priv_data, &uc, seg->key, opts) == 0) {
if (ffurl_read_complete(uc, pls->key, sizeof(pls->key)) if (ffurl_read_complete(uc, pls->key, sizeof(pls->key))
!= sizeof(pls->key)) { != sizeof(pls->key)) {
av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n", av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
seg->key); seg->key);
} }
update_options(&c->cookies, "cookies", uc->priv_data);
av_dict_set(&opts, "cookies", c->cookies, 0);
ffurl_close(uc); ffurl_close(uc);
} else { } else {
av_log(NULL, AV_LOG_ERROR, "Unable to open key file %s\n", av_log(NULL, AV_LOG_ERROR, "Unable to open key file %s\n",
@ -1047,7 +1139,7 @@ static int open_input(HLSContext *c, struct playlist *pls)
/* Seek to the requested position. If this was a HTTP request, the offset /* Seek to the requested position. If this was a HTTP request, the offset
* should already be where want it to, but this allows e.g. local testing * should already be where want it to, but this allows e.g. local testing
* without a HTTP server. */ * without a HTTP server. */
if (ret == 0 && seg->key_type == KEY_NONE) { if (ret == 0 && seg->key_type == KEY_NONE && seg->url_offset) {
int seekret = ffurl_seek(pls->input, seg->url_offset, SEEK_SET); int seekret = ffurl_seek(pls->input, seg->url_offset, SEEK_SET);
if (seekret < 0) { if (seekret < 0) {
av_log(pls->parent, AV_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url); av_log(pls->parent, AV_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url);
@ -1059,11 +1151,70 @@ static int open_input(HLSContext *c, struct playlist *pls)
cleanup: cleanup:
av_dict_free(&opts); av_dict_free(&opts);
av_dict_free(&opts2);
pls->cur_seg_offset = 0; pls->cur_seg_offset = 0;
return ret; return ret;
} }
static int update_init_section(struct playlist *pls, struct segment *seg)
{
static const int max_init_section_size = 1024*1024;
HLSContext *c = pls->parent->priv_data;
int64_t sec_size;
int64_t urlsize;
int ret;
if (seg->init_section == pls->cur_init_section)
return 0;
pls->cur_init_section = NULL;
if (!seg->init_section)
return 0;
/* this will clobber playlist URLContext stuff, so this should be
* called between segments only */
ret = open_input(c, pls, seg->init_section);
if (ret < 0) {
av_log(pls->parent, AV_LOG_WARNING,
"Failed to open an initialization section in playlist %d\n",
pls->index);
return ret;
}
if (seg->init_section->size >= 0)
sec_size = seg->init_section->size;
else if ((urlsize = ffurl_size(pls->input)) >= 0)
sec_size = urlsize;
else
sec_size = max_init_section_size;
av_log(pls->parent, AV_LOG_DEBUG,
"Downloading an initialization section of size %"PRId64"\n",
sec_size);
sec_size = FFMIN(sec_size, max_init_section_size);
av_fast_malloc(&pls->init_sec_buf, &pls->init_sec_buf_size, sec_size);
ret = read_from_url(pls, seg->init_section, pls->init_sec_buf,
pls->init_sec_buf_size, READ_COMPLETE);
ffurl_close(pls->input);
pls->input = NULL;
if (ret < 0)
return ret;
pls->cur_init_section = seg->init_section;
pls->init_sec_data_len = ret;
pls->init_sec_buf_read_offset = 0;
/* spec says audio elementary streams do not have media initialization
* sections, so there should be no ID3 timestamps */
pls->is_id3_timestamped = 0;
return 0;
}
static int64_t default_reload_interval(struct playlist *pls) static int64_t default_reload_interval(struct playlist *pls)
{ {
return pls->n_segments > 0 ? return pls->n_segments > 0 ?
@ -1084,6 +1235,7 @@ restart:
if (!v->input) { if (!v->input) {
int64_t reload_interval; int64_t reload_interval;
struct segment *seg;
/* Check that the playlist is still needed before opening a new /* Check that the playlist is still needed before opening a new
* segment. */ * segment. */
@ -1137,7 +1289,14 @@ reload:
goto reload; goto reload;
} }
ret = open_input(c, v); seg = current_segment(v);
/* load/update Media Initialization Section, if any */
ret = update_init_section(v, seg);
if (ret)
return ret;
ret = open_input(c, v, seg);
if (ret < 0) { if (ret < 0) {
if (ff_check_interrupt(c->interrupt_callback)) if (ff_check_interrupt(c->interrupt_callback))
return AVERROR_EXIT; return AVERROR_EXIT;
@ -1149,7 +1308,15 @@ reload:
just_opened = 1; just_opened = 1;
} }
ret = read_from_url(v, buf, buf_size, READ_NORMAL); if (v->init_sec_buf_read_offset < v->init_sec_data_len) {
/* Push init section out first before first actual segment */
int copy_size = FFMIN(v->init_sec_data_len - v->init_sec_buf_read_offset, buf_size);
memcpy(buf, v->init_sec_buf, copy_size);
v->init_sec_buf_read_offset += copy_size;
return copy_size;
}
ret = read_from_url(v, current_segment(v), buf, buf_size, READ_NORMAL);
if (ret > 0) { if (ret > 0) {
if (just_opened && v->is_id3_timestamped != 0) { if (just_opened && v->is_id3_timestamped != 0) {
/* Intercept ID3 tags here, elementary audio streams are required /* Intercept ID3 tags here, elementary audio streams are required
@ -1617,6 +1784,7 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, i, minplaylist = -1; int ret, i, minplaylist = -1;
recheck_discard_flags(s, c->first_packet); recheck_discard_flags(s, c->first_packet);
c->first_packet = 0;
for (i = 0; i < c->n_playlists; i++) { for (i = 0; i < c->n_playlists; i++) {
struct playlist *pls = c->playlists[i]; struct playlist *pls = c->playlists[i];

View File

@ -163,12 +163,6 @@ static int hls_delete_old_segments(HLSContext *hls) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail; goto fail;
} }
sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
sub_path = av_malloc(sub_path_size);
if (!sub_path) {
ret = AVERROR(ENOMEM);
goto fail;
}
av_strlcpy(path, dirname, path_size); av_strlcpy(path, dirname, path_size);
av_strlcat(path, segment->filename, path_size); av_strlcat(path, segment->filename, path_size);
@ -177,14 +171,23 @@ static int hls_delete_old_segments(HLSContext *hls) {
path, strerror(errno)); path, strerror(errno));
} }
if (segment->sub_filename[0] != '\0') {
sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
sub_path = av_malloc(sub_path_size);
if (!sub_path) {
ret = AVERROR(ENOMEM);
goto fail;
}
av_strlcpy(sub_path, dirname, sub_path_size); av_strlcpy(sub_path, dirname, sub_path_size);
av_strlcat(sub_path, segment->sub_filename, sub_path_size); av_strlcat(sub_path, segment->sub_filename, sub_path_size);
if (unlink(sub_path) < 0) { if (unlink(sub_path) < 0) {
av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n", av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
sub_path, strerror(errno)); sub_path, strerror(errno));
} }
av_freep(&path);
av_free(sub_path); av_free(sub_path);
}
av_freep(&path);
previous_segment = segment; previous_segment = segment;
segment = previous_segment->next; segment = previous_segment->next;
av_free(previous_segment); av_free(previous_segment);
@ -310,6 +313,8 @@ static int hls_append_segment(HLSContext *hls, double duration, int64_t pos,
if(hls->has_subtitle) if(hls->has_subtitle)
av_strlcpy(en->sub_filename, av_basename(hls->vtt_avf->filename), sizeof(en->sub_filename)); av_strlcpy(en->sub_filename, av_basename(hls->vtt_avf->filename), sizeof(en->sub_filename));
else
en->sub_filename[0] = '\0';
en->duration = duration; en->duration = duration;
en->pos = pos; en->pos = pos;

View File

@ -220,21 +220,21 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
/* TODO: Escape the quoted strings properly. */ /* TODO: Escape the quoted strings properly. */
av_strlcatf(authstr, len, "username=\"%s\"", username); av_strlcatf(authstr, len, "username=\"%s\"", username);
av_strlcatf(authstr, len, ",realm=\"%s\"", state->realm); av_strlcatf(authstr, len, ", realm=\"%s\"", state->realm);
av_strlcatf(authstr, len, ",nonce=\"%s\"", digest->nonce); av_strlcatf(authstr, len, ", nonce=\"%s\"", digest->nonce);
av_strlcatf(authstr, len, ",uri=\"%s\"", uri); av_strlcatf(authstr, len, ", uri=\"%s\"", uri);
av_strlcatf(authstr, len, ",response=\"%s\"", response); av_strlcatf(authstr, len, ", response=\"%s\"", response);
// we are violating the RFC and use "" because all others seem to do that too. // we are violating the RFC and use "" because all others seem to do that too.
if (digest->algorithm[0]) if (digest->algorithm[0])
av_strlcatf(authstr, len, ",algorithm=\"%s\"", digest->algorithm); av_strlcatf(authstr, len, ", algorithm=\"%s\"", digest->algorithm);
if (digest->opaque[0]) if (digest->opaque[0])
av_strlcatf(authstr, len, ",opaque=\"%s\"", digest->opaque); av_strlcatf(authstr, len, ", opaque=\"%s\"", digest->opaque);
if (digest->qop[0]) { if (digest->qop[0]) {
av_strlcatf(authstr, len, ",qop=\"%s\"", digest->qop); av_strlcatf(authstr, len, ", qop=\"%s\"", digest->qop);
av_strlcatf(authstr, len, ",cnonce=\"%s\"", cnonce); av_strlcatf(authstr, len, ", cnonce=\"%s\"", cnonce);
av_strlcatf(authstr, len, ",nc=%s", nc); av_strlcatf(authstr, len, ", nc=%s", nc);
} }
av_strlcatf(authstr, len, "\r\n"); av_strlcatf(authstr, len, "\r\n");

View File

@ -444,14 +444,17 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
} }
res = av_new_packet(pkt, size[0] + size[1] + size[2]); res = av_new_packet(pkt, size[0] + size[1] + size[2]);
if (res < 0) if (res < 0) {
return res; goto fail;
}
pkt->stream_index = 0; pkt->stream_index = 0;
pkt->flags |= AV_PKT_FLAG_KEY; pkt->flags |= AV_PKT_FLAG_KEY;
if (s->ts_from_file) { if (s->ts_from_file) {
struct stat img_stat; struct stat img_stat;
if (stat(filename, &img_stat)) if (stat(filename, &img_stat)) {
return AVERROR(EIO); res = AVERROR(EIO);
goto fail;
}
pkt->pts = (int64_t)img_stat.st_mtime; pkt->pts = (int64_t)img_stat.st_mtime;
#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC #if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
if (s->ts_from_file == 2) if (s->ts_from_file == 2)
@ -485,18 +488,29 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) { if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
av_free_packet(pkt); av_free_packet(pkt);
if (ret[0] < 0) { if (ret[0] < 0) {
return ret[0]; res = ret[0];
} else if (ret[1] < 0) { } else if (ret[1] < 0) {
return ret[1]; res = ret[1];
} else if (ret[2] < 0) } else if (ret[2] < 0) {
return ret[2]; res = ret[2];
return AVERROR_EOF; } else {
res = AVERROR_EOF;
}
goto fail;
} else { } else {
s->img_count++; s->img_count++;
s->img_number++; s->img_number++;
s->pts++; s->pts++;
return 0; return 0;
} }
fail:
if (!s->is_pipe) {
for (i = 0; i < 3; i++) {
avio_closep(&f[i]);
}
}
return res;
} }
static int img_read_close(struct AVFormatContext* s1) static int img_read_close(struct AVFormatContext* s1)

View File

@ -103,6 +103,7 @@ typedef struct MOVSbgp {
typedef struct MOVFragmentIndexItem { typedef struct MOVFragmentIndexItem {
int64_t moof_offset; int64_t moof_offset;
int64_t time; int64_t time;
int headers_read;
} MOVFragmentIndexItem; } MOVFragmentIndexItem;
typedef struct MOVFragmentIndex { typedef struct MOVFragmentIndex {
@ -197,6 +198,7 @@ typedef struct MOVContext {
int has_looked_for_mfra; int has_looked_for_mfra;
MOVFragmentIndex** fragment_index_data; MOVFragmentIndex** fragment_index_data;
unsigned fragment_index_count; unsigned fragment_index_count;
int fragment_index_complete;
int atom_depth; int atom_depth;
unsigned int aax_mode; ///< 'aax' file has been detected unsigned int aax_mode; ///< 'aax' file has been detected
uint8_t file_key[20]; uint8_t file_key[20];

View File

@ -54,7 +54,7 @@ typedef struct JVDemuxContext {
static int read_probe(AVProbeData *pd) static int read_probe(AVProbeData *pd)
{ {
if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && strlen(MAGIC) <= pd->buf_size - 4 && if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && strlen(MAGIC) + 4 <= pd->buf_size &&
!memcmp(pd->buf + 4, MAGIC, strlen(MAGIC))) !memcmp(pd->buf + 4, MAGIC, strlen(MAGIC)))
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;
return 0; return 0;

View File

@ -838,9 +838,9 @@ static int mov_read_adrm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
} }
/* drm blob processing */ /* drm blob processing */
avio_read(pb, output, 8); // go to offset 8, absolute postion 0x251 avio_read(pb, output, 8); // go to offset 8, absolute position 0x251
avio_read(pb, input, DRM_BLOB_SIZE); avio_read(pb, input, DRM_BLOB_SIZE);
avio_read(pb, output, 4); // go to offset 4, absolute postion 0x28d avio_read(pb, output, 4); // go to offset 4, absolute position 0x28d
avio_read(pb, file_checksum, 20); avio_read(pb, file_checksum, 20);
av_log(c->fc, AV_LOG_INFO, "[aax] file checksum == "); // required by external tools av_log(c->fc, AV_LOG_INFO, "[aax] file checksum == "); // required by external tools
@ -3294,7 +3294,7 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
MOVFragment *frag = &c->fragment; MOVFragment *frag = &c->fragment;
MOVTrackExt *trex = NULL; MOVTrackExt *trex = NULL;
MOVFragmentIndex* index = NULL; MOVFragmentIndex* index = NULL;
int flags, track_id, i; int flags, track_id, i, found = 0;
avio_r8(pb); /* version */ avio_r8(pb); /* version */
flags = avio_rb24(pb); flags = avio_rb24(pb);
@ -3312,15 +3312,6 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_ERROR, "could not find corresponding trex\n"); av_log(c->fc, AV_LOG_ERROR, "could not find corresponding trex\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
for (i = 0; i < c->fragment_index_count; i++) {
MOVFragmentIndex* candidate = c->fragment_index_data[i];
if (candidate->track_id == frag->track_id) {
av_log(c->fc, AV_LOG_DEBUG,
"found fragment index for track %u\n", frag->track_id);
index = candidate;
break;
}
}
frag->base_data_offset = flags & MOV_TFHD_BASE_DATA_OFFSET ? frag->base_data_offset = flags & MOV_TFHD_BASE_DATA_OFFSET ?
avio_rb64(pb) : flags & MOV_TFHD_DEFAULT_BASE_IS_MOOF ? avio_rb64(pb) : flags & MOV_TFHD_DEFAULT_BASE_IS_MOOF ?
@ -3334,24 +3325,33 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
frag->flags = flags & MOV_TFHD_DEFAULT_FLAGS ? frag->flags = flags & MOV_TFHD_DEFAULT_FLAGS ?
avio_rb32(pb) : trex->flags; avio_rb32(pb) : trex->flags;
frag->time = AV_NOPTS_VALUE; frag->time = AV_NOPTS_VALUE;
if (index) { for (i = 0; i < c->fragment_index_count; i++) {
int i, found = 0; int j;
for (i = index->current_item; i < index->item_count; i++) { MOVFragmentIndex* candidate = c->fragment_index_data[i];
if (frag->implicit_offset == index->items[i].moof_offset) { if (candidate->track_id == frag->track_id) {
av_log(c->fc, AV_LOG_DEBUG,
"found fragment index for track %u\n", frag->track_id);
index = candidate;
for (j = index->current_item; j < index->item_count; j++) {
if (frag->implicit_offset == index->items[j].moof_offset) {
av_log(c->fc, AV_LOG_DEBUG, "found fragment index entry " av_log(c->fc, AV_LOG_DEBUG, "found fragment index entry "
"for track %u and moof_offset %"PRId64"\n", "for track %u and moof_offset %"PRId64"\n",
frag->track_id, index->items[i].moof_offset); frag->track_id, index->items[j].moof_offset);
frag->time = index->items[i].time; frag->time = index->items[j].time;
index->current_item = i + 1; index->current_item = j + 1;
found = 1; found = 1;
break;
} }
} }
if (!found) { if (found)
av_log(c->fc, AV_LOG_WARNING, "track %u has a fragment index " break;
"but it doesn't have an (in-order) entry for moof_offset " }
}
if (index && !found) {
av_log(c->fc, AV_LOG_DEBUG, "track %u has a fragment index but "
"it doesn't have an (in-order) entry for moof_offset "
"%"PRId64"\n", frag->track_id, frag->implicit_offset); "%"PRId64"\n", frag->track_id, frag->implicit_offset);
} }
}
av_log(c->fc, AV_LOG_TRACE, "frag flags 0x%x\n", frag->flags); av_log(c->fc, AV_LOG_TRACE, "frag flags 0x%x\n", frag->flags);
return 0; return 0;
} }
@ -3541,7 +3541,106 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return AVERROR_EOF; return AVERROR_EOF;
frag->implicit_offset = offset; frag->implicit_offset = offset;
st->duration = sc->track_end = dts + sc->time_offset;
sc->track_end = dts + sc->time_offset;
if (st->duration < sc->track_end)
st->duration = sc->track_end;
return 0;
}
static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
int64_t offset = avio_tell(pb) + atom.size, pts;
uint8_t version;
unsigned i, track_id;
AVStream *st = NULL;
MOVStreamContext *sc;
MOVFragmentIndex *index = NULL;
MOVFragmentIndex **tmp;
AVRational timescale;
version = avio_r8(pb);
if (version > 1) {
avpriv_request_sample(c->fc, "sidx version %u", version);
return AVERROR_PATCHWELCOME;
}
avio_rb24(pb); // flags
track_id = avio_rb32(pb); // Reference ID
for (i = 0; i < c->fc->nb_streams; i++) {
if (c->fc->streams[i]->id == track_id) {
st = c->fc->streams[i];
break;
}
}
if (!st) {
av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %d\n", track_id);
return AVERROR_INVALIDDATA;
}
sc = st->priv_data;
timescale = av_make_q(1, avio_rb32(pb));
if (version == 0) {
pts = avio_rb32(pb);
offset += avio_rb32(pb);
} else {
pts = avio_rb64(pb);
offset += avio_rb64(pb);
}
avio_rb16(pb); // reserved
index = av_mallocz(sizeof(MOVFragmentIndex));
if (!index)
return AVERROR(ENOMEM);
index->track_id = track_id;
index->item_count = avio_rb16(pb);
index->items = av_mallocz_array(index->item_count, sizeof(MOVFragmentIndexItem));
if (!index->items) {
av_freep(&index);
return AVERROR(ENOMEM);
}
for (i = 0; i < index->item_count; i++) {
uint32_t size = avio_rb32(pb);
uint32_t duration = avio_rb32(pb);
if (size & 0x80000000) {
avpriv_request_sample(c->fc, "sidx reference_type 1");
av_freep(&index->items);
av_freep(&index);
return AVERROR_PATCHWELCOME;
}
avio_rb32(pb); // sap_flags
index->items[i].moof_offset = offset;
index->items[i].time = av_rescale_q(pts, st->time_base, timescale);
offset += size;
pts += duration;
}
st->duration = sc->track_end = pts;
tmp = av_realloc_array(c->fragment_index_data,
c->fragment_index_count + 1,
sizeof(MOVFragmentIndex*));
if (!tmp) {
av_freep(&index->items);
av_freep(&index);
return AVERROR(ENOMEM);
}
c->fragment_index_data = tmp;
c->fragment_index_data[c->fragment_index_count++] = index;
if (offset == avio_size(pb))
c->fragment_index_complete = 1;
return 0; return 0;
} }
@ -3799,6 +3898,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('a','l','a','c'), mov_read_alac }, /* alac specific atom */ { MKTAG('a','l','a','c'), mov_read_alac }, /* alac specific atom */
{ MKTAG('a','v','c','C'), mov_read_glbl }, { MKTAG('a','v','c','C'), mov_read_glbl },
{ MKTAG('p','a','s','p'), mov_read_pasp }, { MKTAG('p','a','s','p'), mov_read_pasp },
{ MKTAG('s','i','d','x'), mov_read_sidx },
{ MKTAG('s','t','b','l'), mov_read_default }, { MKTAG('s','t','b','l'), mov_read_default },
{ MKTAG('s','t','c','o'), mov_read_stco }, { MKTAG('s','t','c','o'), mov_read_stco },
{ MKTAG('s','t','p','s'), mov_read_stps }, { MKTAG('s','t','p','s'), mov_read_stps },
@ -3922,9 +4022,9 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return err; return err;
} }
if (c->found_moov && c->found_mdat && if (c->found_moov && c->found_mdat &&
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) || ((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX || c->fragment_index_complete) ||
start_pos + a.size == avio_size(pb))) { start_pos + a.size == avio_size(pb))) {
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX || c->fragment_index_complete)
c->next_root_atom = start_pos + a.size; c->next_root_atom = start_pos + a.size;
c->atom_depth --; c->atom_depth --;
return 0; return 0;
@ -4529,6 +4629,52 @@ static int should_retry(AVIOContext *pb, int error_code) {
return 1; return 1;
} }
static int mov_switch_root(AVFormatContext *s, int64_t target)
{
MOVContext *mov = s->priv_data;
int i, j;
int already_read = 0;
if (avio_seek(s->pb, target, SEEK_SET) != target) {
av_log(mov->fc, AV_LOG_ERROR, "root atom offset 0x%"PRIx64": partial file\n", target);
return AVERROR_INVALIDDATA;
}
mov->next_root_atom = 0;
for (i = 0; i < mov->fragment_index_count; i++) {
MOVFragmentIndex *index = mov->fragment_index_data[i];
int found = 0;
for (j = 0; j < index->item_count; j++) {
MOVFragmentIndexItem *item = &index->items[j];
if (found) {
mov->next_root_atom = item->moof_offset;
break; // Advance to next index in outer loop
} else if (item->moof_offset == target) {
index->current_item = FFMIN(j, index->current_item);
if (item->headers_read)
already_read = 1;
item->headers_read = 1;
found = 1;
}
}
if (!found)
index->current_item = 0;
}
if (already_read)
return 0;
mov->found_mdat = 0;
if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
avio_feof(s->pb))
return AVERROR_EOF;
av_log(s, AV_LOG_TRACE, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
return 1;
}
static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
{ {
MOVContext *mov = s->priv_data; MOVContext *mov = s->priv_data;
@ -4539,19 +4685,11 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
mov->fc = s; mov->fc = s;
retry: retry:
sample = mov_find_next_sample(s, &st); sample = mov_find_next_sample(s, &st);
if (!sample) { if (!sample || (mov->next_root_atom && sample->pos > mov->next_root_atom)) {
mov->found_mdat = 0;
if (!mov->next_root_atom) if (!mov->next_root_atom)
return AVERROR_EOF; return AVERROR_EOF;
if (avio_seek(s->pb, mov->next_root_atom, SEEK_SET) != mov->next_root_atom) { if ((ret = mov_switch_root(s, mov->next_root_atom)) < 0)
av_log(mov->fc, AV_LOG_ERROR, "next root atom offset 0x%"PRIx64": partial file\n", mov->next_root_atom); return ret;
return AVERROR_INVALIDDATA;
}
mov->next_root_atom = 0;
if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
avio_feof(s->pb))
return AVERROR_EOF;
av_log(s, AV_LOG_TRACE, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
goto retry; goto retry;
} }
sc = st->priv_data; sc = st->priv_data;
@ -4629,12 +4767,41 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
return 0; return 0;
} }
static int mov_seek_fragment(AVFormatContext *s, AVStream *st, int64_t timestamp)
{
MOVContext *mov = s->priv_data;
int i, j;
if (!mov->fragment_index_complete)
return 0;
for (i = 0; i < mov->fragment_index_count; i++) {
if (mov->fragment_index_data[i]->track_id == st->id) {
MOVFragmentIndex *index = index = mov->fragment_index_data[i];
for (j = index->item_count - 1; j >= 0; j--) {
if (index->items[j].time <= timestamp) {
if (index->items[j].headers_read)
return 0;
return mov_switch_root(s, index->items[j].moof_offset);
}
}
}
}
return 0;
}
static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, int flags) static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, int flags)
{ {
MOVStreamContext *sc = st->priv_data; MOVStreamContext *sc = st->priv_data;
int sample, time_sample; int sample, time_sample;
int i; int i;
int ret = mov_seek_fragment(s, st, timestamp);
if (ret < 0)
return ret;
sample = av_index_search_timestamp(st, timestamp, flags); sample = av_index_search_timestamp(st, timestamp, flags);
av_log(s, AV_LOG_TRACE, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample); av_log(s, AV_LOG_TRACE, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp) if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)

View File

@ -42,6 +42,9 @@
#define XING_TOC_COUNT 100 #define XING_TOC_COUNT 100
#define SAME_HEADER_MASK \
(0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19))
typedef struct { typedef struct {
AVClass *class; AVClass *class;
int64_t filesize; int64_t filesize;
@ -54,7 +57,7 @@ typedef struct {
int is_cbr; int is_cbr;
} MP3DecContext; } MP3DecContext;
static int check(AVIOContext *pb, int64_t pos); static int check(AVIOContext *pb, int64_t pos, uint32_t *header);
/* mp3 read */ /* mp3 read */
@ -374,13 +377,22 @@ static int mp3_read_header(AVFormatContext *s)
off = avio_tell(s->pb); off = avio_tell(s->pb);
for (i = 0; i < 64 * 1024; i++) { for (i = 0; i < 64 * 1024; i++) {
uint32_t header, header2;
int frame_size;
if (!(i&1023)) if (!(i&1023))
ffio_ensure_seekback(s->pb, i + 1024 + 4); ffio_ensure_seekback(s->pb, i + 1024 + 4);
if (check(s->pb, off + i) >= 0) { frame_size = check(s->pb, off + i, &header);
if (frame_size > 0) {
avio_seek(s->pb, off, SEEK_SET);
ffio_ensure_seekback(s->pb, i + 1024 + frame_size + 4);
if (check(s->pb, off + i + frame_size, &header2) >= 0 &&
(header & SAME_HEADER_MASK) == (header2 & SAME_HEADER_MASK))
{
av_log(s, AV_LOG_INFO, "Skipping %d bytes of junk at %"PRId64".\n", i, off); av_log(s, AV_LOG_INFO, "Skipping %d bytes of junk at %"PRId64".\n", i, off);
avio_seek(s->pb, off + i, SEEK_SET); avio_seek(s->pb, off + i, SEEK_SET);
break; break;
} }
}
avio_seek(s->pb, off, SEEK_SET); avio_seek(s->pb, off, SEEK_SET);
} }
@ -420,7 +432,7 @@ static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
#define SEEK_WINDOW 4096 #define SEEK_WINDOW 4096
static int check(AVIOContext *pb, int64_t pos) static int check(AVIOContext *pb, int64_t pos, uint32_t *ret_header)
{ {
int64_t ret = avio_seek(pb, pos, SEEK_SET); int64_t ret = avio_seek(pb, pos, SEEK_SET);
unsigned header; unsigned header;
@ -434,6 +446,8 @@ static int check(AVIOContext *pb, int64_t pos)
if (avpriv_mpegaudio_decode_header(&sd, header) == 1) if (avpriv_mpegaudio_decode_header(&sd, header) == 1)
return -1; return -1;
if (ret_header)
*ret_header = header;
return sd.frame_size; return sd.frame_size;
} }
@ -461,7 +475,7 @@ static int64_t mp3_sync(AVFormatContext *s, int64_t target_pos, int flags)
continue; continue;
for(j=0; j<MIN_VALID; j++) { for(j=0; j<MIN_VALID; j++) {
ret = check(s->pb, pos); ret = check(s->pb, pos, NULL);
if(ret < 0) if(ret < 0)
break; break;
if ((target_pos - pos)*dir <= 0 && abs(MIN_VALID/2-j) < score) { if ((target_pos - pos)*dir <= 0 && abs(MIN_VALID/2-j) < score) {

View File

@ -939,7 +939,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
total_read += pkt_size; total_read += pkt_size;
/* the current chunk doesn't match the stream index (unlikely) */ /* the current chunk doesn't match the stream index (unlikely) */
if ((startcode & 0x1f) != idx_pkt.stream_index) if ((startcode & 0x1f) != s->streams[idx_pkt.stream_index]->id)
break; break;
ret = av_grow_packet(pkt, to_read); ret = av_grow_packet(pkt, to_read);

View File

@ -841,6 +841,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
if ((st->codec->codec_id == AV_CODEC_ID_NONE || if ((st->codec->codec_id == AV_CODEC_ID_NONE ||
(st->request_probe > 0 && st->request_probe < AVPROBE_SCORE_STREAM_RETRY / 5)) && (st->request_probe > 0 && st->request_probe < AVPROBE_SCORE_STREAM_RETRY / 5)) &&
!avcodec_is_open(st->codec) && !avcodec_is_open(st->codec) &&
st->probe_packets > 0 &&
stream_type == STREAM_TYPE_PRIVATE_DATA) { stream_type == STREAM_TYPE_PRIVATE_DATA) {
st->codec->codec_type = AVMEDIA_TYPE_DATA; st->codec->codec_type = AVMEDIA_TYPE_DATA;
st->codec->codec_id = AV_CODEC_ID_BIN_DATA; st->codec->codec_id = AV_CODEC_ID_BIN_DATA;

View File

@ -18,6 +18,9 @@
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* signal_standard, color_siting, store_user_comments and klv_fill_key version
* fixes sponsored by NOA GmbH
*/ */
/* /*
@ -319,6 +322,7 @@ typedef struct MXFContext {
int signal_standard; int signal_standard;
uint32_t tagged_value_count; uint32_t tagged_value_count;
AVRational audio_edit_rate; AVRational audio_edit_rate;
int store_user_comments;
} MXFContext; } MXFContext;
static const uint8_t uuid_base[] = { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd }; static const uint8_t uuid_base[] = { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd };
@ -376,7 +380,6 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
{ 0x4404, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x05,0x00,0x00}}, /* Package Modified Date */ { 0x4404, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x05,0x00,0x00}}, /* Package Modified Date */
{ 0x4402, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x03,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Package Name */ { 0x4402, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x03,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Package Name */
{ 0x4403, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x05,0x00,0x00}}, /* Tracks Strong reference array */ { 0x4403, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x05,0x00,0x00}}, /* Tracks Strong reference array */
{ 0x4406, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x0C,0x00,0x00,0x00}}, /* User Comments */
{ 0x4701, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x03,0x00,0x00}}, /* Descriptor */ { 0x4701, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x03,0x00,0x00}}, /* Descriptor */
// Track // Track
{ 0x4801, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x07,0x01,0x01,0x00,0x00,0x00,0x00}}, /* Track ID */ { 0x4801, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x07,0x01,0x01,0x00,0x00,0x00,0x00}}, /* Track ID */
@ -396,9 +399,6 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
{ 0x1501, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x03,0x01,0x05,0x00,0x00}}, /* Start Time Code */ { 0x1501, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x03,0x01,0x05,0x00,0x00}}, /* Start Time Code */
{ 0x1502, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x04,0x01,0x01,0x02,0x06,0x00,0x00}}, /* Rounded Time Code Base */ { 0x1502, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x04,0x01,0x01,0x02,0x06,0x00,0x00}}, /* Rounded Time Code Base */
{ 0x1503, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x04,0x01,0x01,0x05,0x00,0x00,0x00}}, /* Drop Frame */ { 0x1503, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x04,0x01,0x01,0x05,0x00,0x00,0x00}}, /* Drop Frame */
// Tagged Value
{ 0x5001, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x09,0x01,0x00,0x00}}, /* Name */
{ 0x5003, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x0A,0x01,0x00,0x00}}, /* Value */
// File Descriptor // File Descriptor
{ 0x3F01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x04,0x06,0x0B,0x00,0x00}}, /* Sub Descriptors reference array */ { 0x3F01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x06,0x01,0x01,0x04,0x06,0x0B,0x00,0x00}}, /* Sub Descriptors reference array */
{ 0x3006, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x06,0x01,0x01,0x03,0x05,0x00,0x00,0x00}}, /* Linked Track ID */ { 0x3006, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x06,0x01,0x01,0x03,0x05,0x00,0x00,0x00}}, /* Linked Track ID */
@ -444,6 +444,12 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
{ 0x3D0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Block Align */ { 0x3D0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Block Align */
}; };
static const MXFLocalTagPair mxf_user_comments_local_tag[] = {
{ 0x4406, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x0C,0x00,0x00,0x00}}, /* User Comments */
{ 0x5001, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x09,0x01,0x00,0x00}}, /* Name */
{ 0x5003, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x0A,0x01,0x00,0x00}}, /* Value */
};
static void mxf_write_uuid(AVIOContext *pb, enum MXFMetadataSetType type, int value) static void mxf_write_uuid(AVIOContext *pb, enum MXFMetadataSetType type, int value)
{ {
avio_write(pb, uuid_base, 12); avio_write(pb, uuid_base, 12);
@ -521,10 +527,12 @@ static int mxf_get_essence_container_ul_index(enum AVCodecID id)
static void mxf_write_primer_pack(AVFormatContext *s) static void mxf_write_primer_pack(AVFormatContext *s)
{ {
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
int local_tag_number, i = 0; int local_tag_number, i = 0;
local_tag_number = FF_ARRAY_ELEMS(mxf_local_tag_batch); local_tag_number = FF_ARRAY_ELEMS(mxf_local_tag_batch);
local_tag_number += mxf->store_user_comments * FF_ARRAY_ELEMS(mxf_user_comments_local_tag);
avio_write(pb, primer_pack_key, 16); avio_write(pb, primer_pack_key, 16);
klv_encode_ber_length(pb, local_tag_number * 18 + 8); klv_encode_ber_length(pb, local_tag_number * 18 + 8);
@ -532,10 +540,15 @@ static void mxf_write_primer_pack(AVFormatContext *s)
avio_wb32(pb, local_tag_number); // local_tag num avio_wb32(pb, local_tag_number); // local_tag num
avio_wb32(pb, 18); // item size, always 18 according to the specs avio_wb32(pb, 18); // item size, always 18 according to the specs
for (i = 0; i < local_tag_number; i++) { for (i = 0; i < FF_ARRAY_ELEMS(mxf_local_tag_batch); i++) {
avio_wb16(pb, mxf_local_tag_batch[i].local_tag); avio_wb16(pb, mxf_local_tag_batch[i].local_tag);
avio_write(pb, mxf_local_tag_batch[i].uid, 16); avio_write(pb, mxf_local_tag_batch[i].uid, 16);
} }
if (mxf->store_user_comments)
for (i = 0; i < FF_ARRAY_ELEMS(mxf_user_comments_local_tag); i++) {
avio_wb16(pb, mxf_user_comments_local_tag[i].local_tag);
avio_write(pb, mxf_user_comments_local_tag[i].uid, 16);
}
} }
static void mxf_write_local_tag(AVIOContext *pb, int size, int tag) static void mxf_write_local_tag(AVIOContext *pb, int size, int tag)
@ -1249,14 +1262,15 @@ static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type,
int user_comment_count = 0; int user_comment_count = 0;
if (type == MaterialPackage) { if (type == MaterialPackage) {
if (mxf->store_user_comments)
user_comment_count = mxf_write_user_comments(s, s->metadata); user_comment_count = mxf_write_user_comments(s, s->metadata);
mxf_write_metadata_key(pb, 0x013600); mxf_write_metadata_key(pb, 0x013600);
PRINT_KEY(s, "Material Package key", pb->buf_ptr - 16); PRINT_KEY(s, "Material Package key", pb->buf_ptr - 16);
klv_encode_ber_length(pb, 104 + name_size + (16*track_count) + (16*user_comment_count)); klv_encode_ber_length(pb, 92 + name_size + (16*track_count) + (16*user_comment_count) + 12*mxf->store_user_comments);
} else { } else {
mxf_write_metadata_key(pb, 0x013700); mxf_write_metadata_key(pb, 0x013700);
PRINT_KEY(s, "Source Package key", pb->buf_ptr - 16); PRINT_KEY(s, "Source Package key", pb->buf_ptr - 16);
klv_encode_ber_length(pb, 124 + name_size + (16*track_count)); // 20 bytes length for descriptor reference klv_encode_ber_length(pb, 112 + name_size + (16*track_count) + 12*mxf->store_user_comments); // 20 bytes length for descriptor reference
} }
// write uid // write uid
@ -1291,10 +1305,12 @@ static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type,
mxf_write_uuid(pb, type == MaterialPackage ? Track : Track + TypeBottom, i); mxf_write_uuid(pb, type == MaterialPackage ? Track : Track + TypeBottom, i);
// write user comment refs // write user comment refs
if (mxf->store_user_comments) {
mxf_write_local_tag(pb, user_comment_count*16 + 8, 0x4406); mxf_write_local_tag(pb, user_comment_count*16 + 8, 0x4406);
mxf_write_refs_count(pb, user_comment_count); mxf_write_refs_count(pb, user_comment_count);
for (i = 0; i < user_comment_count; i++) for (i = 0; i < user_comment_count; i++)
mxf_write_uuid(pb, TaggedValue, mxf->tagged_value_count - user_comment_count + i); mxf_write_uuid(pb, TaggedValue, mxf->tagged_value_count - user_comment_count + i);
}
// write multiple descriptor reference // write multiple descriptor reference
if (type == SourcePackage) { if (type == SourcePackage) {
@ -2034,6 +2050,9 @@ static int mxf_write_header(AVFormatContext *s)
return -1; return -1;
} }
if (!av_dict_get(s->metadata, "comment_", NULL, AV_DICT_IGNORE_SUFFIX))
mxf->store_user_comments = 0;
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
MXFStreamContext *sc = av_mallocz(sizeof(*sc)); MXFStreamContext *sc = av_mallocz(sizeof(*sc));
@ -2652,6 +2671,8 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int
static const AVOption mxf_options[] = { static const AVOption mxf_options[] = {
MXF_COMMON_OPTIONS MXF_COMMON_OPTIONS
{ "store_user_comments", "",
offsetof(MXFContext, store_user_comments), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL }, { NULL },
}; };
@ -2666,6 +2687,8 @@ static const AVOption d10_options[] = {
{ "d10_channelcount", "Force/set channelcount in generic sound essence descriptor", { "d10_channelcount", "Force/set channelcount in generic sound essence descriptor",
offsetof(MXFContext, channel_count), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 8, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MXFContext, channel_count), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 8, AV_OPT_FLAG_ENCODING_PARAM},
MXF_COMMON_OPTIONS MXF_COMMON_OPTIONS
{ "store_user_comments", "",
offsetof(MXFContext, store_user_comments), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL }, { NULL },
}; };

View File

@ -1136,7 +1136,6 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
unsigned char ch; unsigned char ch;
const char *p; const char *p;
int ret, content_length, line_count = 0, request = 0; int ret, content_length, line_count = 0, request = 0;
int first_line = 1;
unsigned char *content = NULL; unsigned char *content = NULL;
start: start:
@ -1156,7 +1155,7 @@ start:
return AVERROR_EOF; return AVERROR_EOF;
if (ch == '\n') if (ch == '\n')
break; break;
if (ch == '$' && first_line && q == buf) { if (ch == '$' && q == buf) {
if (return_on_interleaved_data) { if (return_on_interleaved_data) {
return 1; return 1;
} else } else
@ -1167,7 +1166,6 @@ start:
} }
} }
*q = '\0'; *q = '\0';
first_line = 0;
av_log(s, AV_LOG_TRACE, "line='%s'\n", buf); av_log(s, AV_LOG_TRACE, "line='%s'\n", buf);

View File

@ -41,15 +41,17 @@ static int srt_probe(AVProbeData *p)
ff_text_r8(&tr); ff_text_r8(&tr);
/* Check if the first non-empty line is a number. We do not check what the /* Check if the first non-empty line is a number. We do not check what the
* number is because in practice it can be anything. */ * number is because in practice it can be anything.
* Also, that number can be followed by random garbage, so we can not
* unfortunately check that we only have a number. */
if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0 || if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0 ||
strtol(buf, &pbuf, 10) < 0 || *pbuf) strtol(buf, &pbuf, 10) < 0 || pbuf == buf)
return 0; return 0;
/* Check if the next line matches a SRT timestamp */ /* Check if the next line matches a SRT timestamp */
if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0) if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
return 0; return 0;
if (buf[0] >= '0' && buf[1] <= '9' && strstr(buf, " --> ") if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
&& sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1) && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;

View File

@ -46,8 +46,14 @@ static void webvtt_write_time(AVIOContext *pb, int64_t millisec)
static int webvtt_write_header(AVFormatContext *ctx) static int webvtt_write_header(AVFormatContext *ctx)
{ {
AVStream *s = ctx->streams[0]; AVStream *s = ctx->streams[0];
AVCodecContext *avctx = ctx->streams[0]->codec;
AVIOContext *pb = ctx->pb; AVIOContext *pb = ctx->pb;
if (ctx->nb_streams != 1 || avctx->codec_id != AV_CODEC_ID_WEBVTT) {
av_log(ctx, AV_LOG_ERROR, "Exactly one WebVTT stream is needed.\n");
return AVERROR(EINVAL);
}
avpriv_set_pts_info(s, 64, 1, 1000); avpriv_set_pts_info(s, 64, 1, 1000);
avio_printf(pb, "WEBVTT\n"); avio_printf(pb, "WEBVTT\n");

View File

@ -549,17 +549,18 @@ static int xmv_read_packet(AVFormatContext *s,
/* Fetch a video frame */ /* Fetch a video frame */
result = xmv_fetch_video_packet(s, pkt); result = xmv_fetch_video_packet(s, pkt);
if (result)
return result;
} else { } else {
/* Fetch an audio frame */ /* Fetch an audio frame */
result = xmv_fetch_audio_packet(s, pkt, xmv->current_stream - 1); result = xmv_fetch_audio_packet(s, pkt, xmv->current_stream - 1);
if (result) }
if (result) {
xmv->current_stream = 0;
xmv->video.current_frame = xmv->video.frame_count;
return result; return result;
} }
/* Increase our counters */ /* Increase our counters */
if (++xmv->current_stream >= xmv->stream_count) { if (++xmv->current_stream >= xmv->stream_count) {
xmv->current_stream = 0; xmv->current_stream = 0;

View File

@ -27,15 +27,6 @@
#include "mem.h" #include "mem.h"
#include "blowfish.h" #include "blowfish.h"
#if !FF_API_CRYPTO_CONTEXT
#define AV_BF_ROUNDS 16
struct AVBlowfish {
uint32_t p[AV_BF_ROUNDS + 2];
uint32_t s[4][256];
};
#endif
static const uint32_t orig_p[AV_BF_ROUNDS + 2] = { static const uint32_t orig_p[AV_BF_ROUNDS + 2] = {
0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,

View File

@ -31,16 +31,12 @@
* @{ * @{
*/ */
#if FF_API_CRYPTO_CONTEXT
#define AV_BF_ROUNDS 16 #define AV_BF_ROUNDS 16
typedef struct AVBlowfish { typedef struct AVBlowfish {
uint32_t p[AV_BF_ROUNDS + 2]; uint32_t p[AV_BF_ROUNDS + 2];
uint32_t s[4][256]; uint32_t s[4][256];
} AVBlowfish; } AVBlowfish;
#else
typedef struct AVBlowfish AVBlowfish;
#endif
/** /**
* Allocate an AVBlowfish context. * Allocate an AVBlowfish context.

View File

@ -126,6 +126,8 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
strlen(channel_names[i].name) == name_len && strlen(channel_names[i].name) == name_len &&
!memcmp(channel_names[i].name, name, name_len)) !memcmp(channel_names[i].name, name, name_len))
return (int64_t)1 << i; return (int64_t)1 << i;
errno = 0;
i = strtol(name, &end, 10); i = strtol(name, &end, 10);
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
@ -144,14 +146,15 @@ static uint64_t get_channel_layout_single(const char *name, int name_len)
} }
} else { } else {
#endif #endif
if ((end + 1 - name == name_len && *end == 'c')) if (!errno && (end + 1 - name == name_len && *end == 'c'))
return av_get_default_channel_layout(i); return av_get_default_channel_layout(i);
#if FF_API_GET_CHANNEL_LAYOUT_COMPAT #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
} }
#endif #endif
errno = 0;
layout = strtoll(name, &end, 0); layout = strtoll(name, &end, 0);
if (end - name == name_len) if (!errno && end - name == name_len)
return FFMAX(layout, 0); return FFMAX(layout, 0);
return 0; return 0;
} }

View File

@ -76,6 +76,17 @@
*/ */
#define FFNABS(a) ((a) <= 0 ? (a) : (-(a))) #define FFNABS(a) ((a) <= 0 ? (a) : (-(a)))
/**
* Comparator.
* For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0
* if x == y. This is useful for instance in a qsort comparator callback.
* Furthermore, compilers are able to optimize this to branchless code, and
* there is no risk of overflow with signed types.
* As with many macros, this evaluates its argument multiple times, it thus
* must not have a side-effect.
*/
#define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c) #define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) #define FFMIN(a,b) ((a) > (b) ? (b) : (a))

View File

@ -25,13 +25,6 @@
#include "mem.h" #include "mem.h"
#include "des.h" #include "des.h"
#if !FF_API_CRYPTO_CONTEXT
struct AVDES {
uint64_t round_keys[3][16];
int triple_des;
};
#endif
#define T(a, b, c, d, e, f, g, h) 64-a,64-b,64-c,64-d,64-e,64-f,64-g,64-h #define T(a, b, c, d, e, f, g, h) 64-a,64-b,64-c,64-d,64-e,64-f,64-g,64-h
static const uint8_t IP_shuffle[] = { static const uint8_t IP_shuffle[] = {
T(58, 50, 42, 34, 26, 18, 10, 2), T(58, 50, 42, 34, 26, 18, 10, 2),

View File

@ -30,14 +30,10 @@
* @{ * @{
*/ */
#if FF_API_CRYPTO_CONTEXT
typedef struct AVDES { typedef struct AVDES {
uint64_t round_keys[3][16]; uint64_t round_keys[3][16];
int triple_des; int triple_des;
} AVDES; } AVDES;
#else
typedef struct AVDES AVDES;
#endif
/** /**
* Allocate an AVDES context. * Allocate an AVDES context.

View File

@ -77,6 +77,9 @@ int avpriv_open(const char *filename, int flags, ...)
#ifdef O_CLOEXEC #ifdef O_CLOEXEC
flags |= O_CLOEXEC; flags |= O_CLOEXEC;
#endif #endif
#ifdef O_NOINHERIT
flags |= O_NOINHERIT;
#endif
fd = open(filename, flags, mode); fd = open(filename, flags, mode);
#if HAVE_FCNTL #if HAVE_FCNTL

View File

@ -343,7 +343,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
#if CONFIG_VALGRIND_BACKTRACE #if CONFIG_VALGRIND_BACKTRACE
if (level <= BACKTRACE_LOGLEVEL) if (level <= BACKTRACE_LOGLEVEL)
VALGRIND_PRINTF_BACKTRACE(""); VALGRIND_PRINTF_BACKTRACE("%s", "");
#endif #endif
end: end:
av_bprint_finalize(part+3, NULL); av_bprint_finalize(part+3, NULL);

View File

@ -25,13 +25,6 @@
#include "mem.h" #include "mem.h"
#include "rc4.h" #include "rc4.h"
#if !FF_API_CRYPTO_CONTEXT
struct AVRC4 {
uint8_t state[256];
int x, y;
};
#endif
AVRC4 *av_rc4_alloc(void) AVRC4 *av_rc4_alloc(void)
{ {
return av_mallocz(sizeof(struct AVRC4)); return av_mallocz(sizeof(struct AVRC4));

View File

@ -30,14 +30,10 @@
* @{ * @{
*/ */
#if FF_API_CRYPTO_CONTEXT
typedef struct AVRC4 { typedef struct AVRC4 {
uint8_t state[256]; uint8_t state[256];
int x, y; int x, y;
} AVRC4; } AVRC4;
#else
typedef struct AVRC4 AVRC4;
#endif
/** /**
* Allocate an AVRC4 context. * Allocate an AVRC4 context.

View File

@ -97,6 +97,48 @@ int main(void){
sf1 = av_int2sf(0xE0000001, 0); sf1 = av_int2sf(0xE0000001, 0);
printf("test4 softfloat: %.10lf (0x%08x %d)\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp); printf("test4 softfloat: %.10lf (0x%08x %d)\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp);
sf1 = (SoftFloat){ 0x20000000, MIN_EXP };
sf1 = av_mul_sf(sf1, sf1);
printf("test5 softfloat: %.10lf (0x%08x %d)\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp);
sf1 = (SoftFloat){ 0x20000000, MIN_EXP };
sf2 = (SoftFloat){ 0x20000000, MAX_EXP };
i = av_cmp_sf(sf1, sf2);
j = av_cmp_sf(sf2, sf1);
sf1 = av_div_sf(sf1, sf2);
printf("test6 softfloat: %.10lf (0x%08x %d) %d %d\n", (double)av_sf2double(sf1), sf1.mant, sf1.exp, i, j);
for(i= -50; i<50; i++) {
sf1= av_int2sf(i, 0);
for(j= -50; j<50; j++) {
int c;
sf2= av_int2sf(j, 0);
c = av_cmp_sf(sf1, sf2);
if (FFDIFFSIGN(i,j) != c && (FFDIFFSIGN(i,j)^c)<0) {
printf("av_cmp_sf failed at %d %d as %X\n", i, j, c);
}
c = av_gt_sf(sf1, sf2);
if ((i>j) != c) {
printf("av_gt_sf failed at %d %d as %X\n", i, j, c);
}
}
sf1 = av_int2sf(1, i);
for(j = -50; j < 50; j++) {
int c;
sf2 = av_int2sf(1, j);
c = av_cmp_sf(sf2, sf1);
if (FFDIFFSIGN(i,j) != c && (FFDIFFSIGN(i,j)^c) < 0) {
printf("av_cmp_sf failed2 at %d %d as %X\n", i, j, c);
}
c = av_gt_sf(sf1, sf2);
if ((i<j) != c) {
printf("av_gt_sf failed2 at %d %d as %X\n", i, j, c);
}
}
}
for(i= 0; i<4*36; i++){ for(i= 0; i<4*36; i++){
int s, c; int s, c;
double errs, errc; double errs, errc;

View File

@ -36,7 +36,7 @@ typedef struct SoftFloat{
int32_t exp; int32_t exp;
}SoftFloat; }SoftFloat;
static const SoftFloat FLOAT_0 = { 0, 0}; static const SoftFloat FLOAT_0 = { 0, MIN_EXP};
static const SoftFloat FLOAT_05 = { 0x20000000, 0}; static const SoftFloat FLOAT_05 = { 0x20000000, 0};
static const SoftFloat FLOAT_1 = { 0x20000000, 1}; static const SoftFloat FLOAT_1 = { 0x20000000, 1};
static const SoftFloat FLOAT_EPSILON = { 0x29F16B12, -16}; static const SoftFloat FLOAT_EPSILON = { 0x29F16B12, -16};
@ -90,7 +90,7 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){
} }
/** /**
* @return Will not be more denormalized than a+b. So if either input is * @return Will not be more denormalized than a*b. So if either input is
* normalized, then the output will not be worse then the other input. * normalized, then the output will not be worse then the other input.
* If both are normalized, then the output will be normalized. * If both are normalized, then the output will be normalized.
*/ */
@ -98,7 +98,10 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){
a.exp += b.exp; a.exp += b.exp;
av_assert2((int32_t)((a.mant * (int64_t)b.mant) >> ONE_BITS) == (a.mant * (int64_t)b.mant) >> ONE_BITS); av_assert2((int32_t)((a.mant * (int64_t)b.mant) >> ONE_BITS) == (a.mant * (int64_t)b.mant) >> ONE_BITS);
a.mant = (a.mant * (int64_t)b.mant) >> ONE_BITS; a.mant = (a.mant * (int64_t)b.mant) >> ONE_BITS;
return av_normalize1_sf((SoftFloat){a.mant, a.exp - 1}); a = av_normalize1_sf((SoftFloat){a.mant, a.exp - 1});
if (!a.mant || a.exp < MIN_EXP)
return FLOAT_0;
return a;
} }
/** /**
@ -108,20 +111,27 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){
static inline av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){ static inline av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){
a.exp -= b.exp; a.exp -= b.exp;
a.mant = ((int64_t)a.mant<<(ONE_BITS+1)) / b.mant; a.mant = ((int64_t)a.mant<<(ONE_BITS+1)) / b.mant;
return av_normalize1_sf(a); a = av_normalize1_sf(a);
if (!a.mant || a.exp < MIN_EXP)
return FLOAT_0;
return a;
} }
static inline av_const int av_cmp_sf(SoftFloat a, SoftFloat b){ static inline av_const int av_cmp_sf(SoftFloat a, SoftFloat b){
int t= a.exp - b.exp; int t= a.exp - b.exp;
if(t<0) return (a.mant >> (-t)) - b.mant ; if (t <-31) return - b.mant ;
else return a.mant - (b.mant >> t); else if (t < 0) return (a.mant >> (-t)) - b.mant ;
else if (t < 32) return a.mant - (b.mant >> t);
else return a.mant ;
} }
static inline av_const int av_gt_sf(SoftFloat a, SoftFloat b) static inline av_const int av_gt_sf(SoftFloat a, SoftFloat b)
{ {
int t= a.exp - b.exp; int t= a.exp - b.exp;
if(t<0) return (a.mant >> (-t)) > b.mant ; if (t <-31) return 0 > b.mant ;
else return a.mant > (b.mant >> t); else if (t < 0) return (a.mant >> (-t)) > b.mant ;
else if (t < 32) return a.mant > (b.mant >> t);
else return a.mant > 0 ;
} }
static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){ static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){
@ -143,7 +153,12 @@ static inline av_const SoftFloat av_sub_sf(SoftFloat a, SoftFloat b){
* @returns a SoftFloat with value v * 2^frac_bits * @returns a SoftFloat with value v * 2^frac_bits
*/ */
static inline av_const SoftFloat av_int2sf(int v, int frac_bits){ static inline av_const SoftFloat av_int2sf(int v, int frac_bits){
return av_normalize_sf((SoftFloat){v, ONE_BITS + 1 - frac_bits}); int exp_offset = 0;
if(v == INT_MIN){
exp_offset = 1;
v>>=1;
}
return av_normalize_sf(av_normalize1_sf((SoftFloat){v, ONE_BITS + 1 - frac_bits + exp_offset}));
} }
/** /**
@ -163,7 +178,7 @@ static av_always_inline SoftFloat av_sqrt_sf(SoftFloat val)
int tabIndex, rem; int tabIndex, rem;
if (val.mant == 0) if (val.mant == 0)
val.exp = 0; val.exp = MIN_EXP;
else else
{ {
tabIndex = (val.mant - 0x20000000) >> 20; tabIndex = (val.mant - 0x20000000) >> 20;

View File

@ -129,9 +129,6 @@
#ifndef FF_API_HMAC #ifndef FF_API_HMAC
#define FF_API_HMAC (LIBAVUTIL_VERSION_MAJOR < 55) #define FF_API_HMAC (LIBAVUTIL_VERSION_MAJOR < 55)
#endif #endif
#ifndef FF_API_CRYPTO_CONTEXT
#define FF_API_CRYPTO_CONTEXT (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_VAAPI #ifndef FF_API_VAAPI
#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 56) #define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 56)
#endif #endif

View File

@ -34,12 +34,6 @@
#include "mem.h" #include "mem.h"
#include "xtea.h" #include "xtea.h"
#if !FF_API_CRYPTO_CONTEXT
struct AVXTEA {
uint32_t key[16];
};
#endif
AVXTEA *av_xtea_alloc(void) AVXTEA *av_xtea_alloc(void)
{ {
return av_mallocz(sizeof(struct AVXTEA)); return av_mallocz(sizeof(struct AVXTEA));

View File

@ -33,13 +33,9 @@
* @{ * @{
*/ */
#if FF_API_CRYPTO_CONTEXT
typedef struct AVXTEA { typedef struct AVXTEA {
uint32_t key[16]; uint32_t key[16];
} AVXTEA; } AVXTEA;
#else
typedef struct AVXTEA AVXTEA;
#endif
/** /**
* Allocate an AVXTEA context. * Allocate an AVXTEA context.

View File

@ -231,6 +231,10 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
c->compensation_distance= 0; c->compensation_distance= 0;
if(!av_reduce(&c->src_incr, &c->dst_incr, out_rate, in_rate * (int64_t)phase_count, INT32_MAX/2)) if(!av_reduce(&c->src_incr, &c->dst_incr, out_rate, in_rate * (int64_t)phase_count, INT32_MAX/2))
goto error; goto error;
while (c->dst_incr < (1<<20) && c->src_incr < (1<<20)) {
c->dst_incr *= 2;
c->src_incr *= 2;
}
c->ideal_dst_incr = c->dst_incr; c->ideal_dst_incr = c->dst_incr;
c->dst_incr_div = c->dst_incr / c->src_incr; c->dst_incr_div = c->dst_incr / c->src_incr;
c->dst_incr_mod = c->dst_incr % c->src_incr; c->dst_incr_mod = c->dst_incr % c->src_incr;

View File

@ -144,7 +144,7 @@ int ff_rotate_slice(SwsSlice *s, int lum, int chr)
return 0; return 0;
} }
int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH) int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH, int relative)
{ {
int i = 0; int i = 0;
@ -158,30 +158,32 @@ int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int src
chrY + chrH, chrY + chrH,
lumY + lumH}; lumY + lumH};
const uint8_t *src_[4] = {src[0] + (relative ? 0 : start[0]) * stride[0],
src[1] + (relative ? 0 : start[1]) * stride[0],
src[2] + (relative ? 0 : start[2]) * stride[0],
src[3] + (relative ? 0 : start[3]) * stride[0]};
s->width = srcW; s->width = srcW;
for (i = 0; i < 4; ++i) { for (i = 0; i < 4; ++i) {
int j; int j;
int lines = end[i]; int first = s->plane[i].sliceY;
lines = s->plane[i].available_lines < lines ? s->plane[i].available_lines : lines; int n = s->plane[i].available_lines;
int lines = end[i] - start[i];
int tot_lines = end[i] - first;
if (end[i] > s->plane[i].sliceY+s->plane[i].sliceH) { if (start[i] >= first && n >= tot_lines) {
if (start[i] <= s->plane[i].sliceY+1) s->plane[i].sliceH = FFMAX(tot_lines, s->plane[i].sliceH);
s->plane[i].sliceY = FFMIN(start[i], s->plane[i].sliceY); for (j = 0; j < lines; j+= 1)
else s->plane[i].line[start[i] - first + j] = src_[i] + j * stride[i];
s->plane[i].sliceY = start[i];
s->plane[i].sliceH = end[i] - s->plane[i].sliceY;
} else { } else {
if (end[i] >= s->plane[i].sliceY)
s->plane[i].sliceH = s->plane[i].sliceY + s->plane[i].sliceH - start[i];
else
s->plane[i].sliceH = end[i] - start[i];
s->plane[i].sliceY = start[i]; s->plane[i].sliceY = start[i];
lines = lines > n ? n : lines;
s->plane[i].sliceH = lines;
for (j = 0; j < lines; j+= 1)
s->plane[i].line[j] = src_[i] + j * stride[i];
} }
for (j = start[i]; j < lines; j+= 1)
s->plane[i].line[j] = src[i] + (start[i] + j) * stride[i];
} }
return 0; return 0;

View File

@ -359,6 +359,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
#ifndef NEW_FILTER #ifndef NEW_FILTER
uint8_t *formatConvBuffer = c->formatConvBuffer; uint8_t *formatConvBuffer = c->formatConvBuffer;
uint32_t *pal = c->pal_yuv; uint32_t *pal = c->pal_yuv;
int perform_gamma = c->is_internal_gamma;
#endif #endif
yuv2planar1_fn yuv2plane1 = c->yuv2plane1; yuv2planar1_fn yuv2plane1 = c->yuv2plane1;
yuv2planarX_fn yuv2planeX = c->yuv2planeX; yuv2planarX_fn yuv2planeX = c->yuv2planeX;
@ -379,7 +380,6 @@ static int swscale(SwsContext *c, const uint8_t *src[],
int chrBufIndex = c->chrBufIndex; int chrBufIndex = c->chrBufIndex;
int lastInLumBuf = c->lastInLumBuf; int lastInLumBuf = c->lastInLumBuf;
int lastInChrBuf = c->lastInChrBuf; int lastInChrBuf = c->lastInChrBuf;
int perform_gamma = c->is_internal_gamma;
#ifdef NEW_FILTER #ifdef NEW_FILTER
int lumStart = 0; int lumStart = 0;
@ -471,12 +471,12 @@ static int swscale(SwsContext *c, const uint8_t *src[],
yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, c->use_mmx_vfilter); yuv2packed1, yuv2packed2, yuv2packedX, yuv2anyX, c->use_mmx_vfilter);
ff_init_slice_from_src(src_slice, (uint8_t**)src, srcStride, c->srcW, ff_init_slice_from_src(src_slice, (uint8_t**)src, srcStride, c->srcW,
srcSliceY, srcSliceH, chrSrcSliceY, chrSrcSliceH); srcSliceY, srcSliceH, chrSrcSliceY, chrSrcSliceH, 1);
ff_init_slice_from_src(vout_slice, (uint8_t**)dst, dstStride, c->dstW, ff_init_slice_from_src(vout_slice, (uint8_t**)dst, dstStride, c->dstW,
dstY, dstH, dstY >> c->chrDstVSubSample, dstY, dstH, dstY >> c->chrDstVSubSample,
FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample)); FF_CEIL_RSHIFT(dstH, c->chrDstVSubSample), 0);
if (srcSliceY == 0) {
hout_slice->plane[0].sliceY = lastInLumBuf + 1; hout_slice->plane[0].sliceY = lastInLumBuf + 1;
hout_slice->plane[1].sliceY = lastInChrBuf + 1; hout_slice->plane[1].sliceY = lastInChrBuf + 1;
hout_slice->plane[2].sliceY = lastInChrBuf + 1; hout_slice->plane[2].sliceY = lastInChrBuf + 1;
@ -487,6 +487,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
hout_slice->plane[2].sliceH = hout_slice->plane[2].sliceH =
hout_slice->plane[3].sliceH = 0; hout_slice->plane[3].sliceH = 0;
hout_slice->width = dstW; hout_slice->width = dstW;
}
#endif #endif
for (; dstY < dstH; dstY++) { for (; dstY < dstH; dstY++) {
@ -522,8 +523,8 @@ static int swscale(SwsContext *c, const uint8_t *src[],
#ifdef NEW_FILTER #ifdef NEW_FILTER
hasLumHoles = lastInLumBuf != firstLumSrcY - 1; hasLumHoles = lastInLumBuf != firstLumSrcY - 1;
if (hasLumHoles) { if (hasLumHoles) {
hout_slice->plane[0].sliceY = lastInLumBuf + 1; hout_slice->plane[0].sliceY = firstLumSrcY;
hout_slice->plane[3].sliceY = lastInLumBuf + 1; hout_slice->plane[3].sliceY = firstLumSrcY;
hout_slice->plane[0].sliceH = hout_slice->plane[0].sliceH =
hout_slice->plane[3].sliceH = 0; hout_slice->plane[3].sliceH = 0;
} }
@ -534,8 +535,8 @@ static int swscale(SwsContext *c, const uint8_t *src[],
#ifdef NEW_FILTER #ifdef NEW_FILTER
hasChrHoles = lastInChrBuf != firstChrSrcY - 1; hasChrHoles = lastInChrBuf != firstChrSrcY - 1;
if (hasChrHoles) { if (hasChrHoles) {
hout_slice->plane[1].sliceY = lastInChrBuf + 1; hout_slice->plane[1].sliceY = firstChrSrcY;
hout_slice->plane[2].sliceY = lastInChrBuf + 1; hout_slice->plane[2].sliceY = firstChrSrcY;
hout_slice->plane[1].sliceH = hout_slice->plane[1].sliceH =
hout_slice->plane[2].sliceH = 0; hout_slice->plane[2].sliceH = 0;
} }

View File

@ -1012,7 +1012,8 @@ typedef struct VScalerContext
} VScalerContext; } VScalerContext;
// warp input lines in the form (src + width*i + j) to slice format (line[i][j]) // warp input lines in the form (src + width*i + j) to slice format (line[i][j])
int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH); // relative=true means first line src[x][0] otherwise first line is src[x][lum/crh Y]
int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH, int relative);
// Initialize scaler filter descriptor chain // Initialize scaler filter descriptor chain
int ff_init_filters(SwsContext *c); int ff_init_filters(SwsContext *c);

View File

@ -148,7 +148,7 @@ fate-aac-aref-encode: REF = ./tests/data/asynth-44100-2.wav
fate-aac-aref-encode: CMP_SHIFT = -4096 fate-aac-aref-encode: CMP_SHIFT = -4096
fate-aac-aref-encode: CMP_TARGET = 594 fate-aac-aref-encode: CMP_TARGET = 594
fate-aac-aref-encode: SIZE_TOLERANCE = 2464 fate-aac-aref-encode: SIZE_TOLERANCE = 2464
fate-aac-aref-encode: FUZZ = 5 fate-aac-aref-encode: FUZZ = 6
FATE_AAC_ENCODE += fate-aac-ln-encode FATE_AAC_ENCODE += fate-aac-ln-encode
fate-aac-ln-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -c:a aac -aac_is 0 -aac_pns 0 -b:a 512k fate-aac-ln-encode: CMD = enc_dec_pcm adts wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -strict -2 -c:a aac -aac_is 0 -aac_pns 0 -b:a 512k

View File

@ -61,6 +61,7 @@ FATE_LAVF += $(FATE_LAVF_PIXFMT-yes)
$(FATE_LAVF): $(AREF) $(VREF) $(FATE_LAVF): $(AREF) $(VREF)
$(FATE_LAVF): CMD = lavftest $(FATE_LAVF): CMD = lavftest
$(FATE_LAVF): CMP =
FATE_AVCONV += $(FATE_LAVF) FATE_AVCONV += $(FATE_LAVF)
fate-lavf: $(FATE_LAVF) fate-lavf: $(FATE_LAVF)

View File

@ -366,16 +366,16 @@ fate-swr-resample_async-$(3)-$(1)-$(2): FUZZ = 0.1
fate-swr-resample_async-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav fate-swr-resample_async-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav
endef endef
fate-swr-resample_async-fltp-44100-8000: CMP_TARGET = 4031.48 fate-swr-resample_async-fltp-44100-8000: CMP_TARGET = 4020.62
fate-swr-resample_async-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20310 fate-swr-resample_async-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20310
fate-swr-resample_async-fltp-8000-44100: CMP_TARGET = 11185.34 fate-swr-resample_async-fltp-8000-44100: CMP_TARGET = 11186.69
fate-swr-resample_async-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20344 fate-swr-resample_async-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20344
fate-swr-resample_async-s16p-44100-8000: CMP_TARGET = 4031.59 fate-swr-resample_async-s16p-44100-8000: CMP_TARGET = 4020.73
fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20310 fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20310
fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11185.65 fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11187.01
fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20344 fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20344
$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s16p,s16le,s16) $(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s16p,s16le,s16)

Some files were not shown because too many files have changed in this diff Show More