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

69746 Commits

Author SHA1 Message Date
Mickaël Raulet
bcb0925115 x86/hevc: use CLIPW macro when possible
Conflicts:
	libavcodec/x86/hevc_mc.asm

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 17:38:47 +01:00
Christophe Gisquet
5eedd36df1 x86: hevc_mc: use epel_hv 16-wide function
The epel_hv functions were still relying on only epel_hv 8-wide
being the maximum width instanciated.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 17:37:56 +01:00
Pierre Edouard Lepere
a0d1300f71 x86: hevc_mc: add AVX2 optimizations
before
33304 decicycles in luma_bi_1, 523066 runs, 1222 skips
38138 decicycles in luma_bi_2, 523427 runs, 861 skips
13490 decicycles in luma_uni, 516138 runs, 8150 skips
after
20185 decicycles in luma_bi_1, 519970 runs, 4318 skips
24620 decicycles in luma_bi_2, 521024 runs, 3264 skips
10397 decicycles in luma_uni, 515715 runs, 8573 skips

Conflicts:
	libavcodec/x86/hevc_mc.asm
	libavcodec/x86/hevcdsp_init.c

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 17:20:47 +01:00
Paul B Mahol
f968166439 avformat/rpl: check av_get_packet() for failure
Also make ret signed as it should be from start.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-06 16:07:16 +00:00
Michael Niedermayer
6fafc62b0b avcodec/h264: Be more strict on rejecting pps/sps changes
Fixes race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 15:22:51 +01:00
Michael Niedermayer
31cc9c04ca avcodec/h264: Be more strict on rejecting pps_id changes
Fixes race condition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 15:22:51 +01:00
Paul B Mahol
dc3c3758ce avformat/thp: check av_get_packet() for failure
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-06 09:42:53 +00:00
Michael Niedermayer
69aa79365c avcodec/h264_ps: More completely check the bit depths
Fixes out of array read
Fixes: asan_static-oob_30328b6_719_cov_3325483287_H264_artifacts_motion.h264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 04:32:14 +01:00
James Almer
15a88468ae avformat/tta: only check for header and seek table crc if requested
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-05 23:20:40 -03:00
Michael Niedermayer
a6c2c8fe3f Revert "avcodec/x86/lossless_audiodsp: Make scalarproduct_and_madd_int16 prototypes more similar"
This reverts commit 3b4ffba3af.

Unbreaks the SSSE3 code on mingw32

Conflicts:

	libavcodec/x86/lossless_audiodsp.asm

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 02:31:45 +01:00
Michael Niedermayer
f1214763af avcodec/x86/lossless_audiodsp: Move order&8 fallback into C code
This is simpler and more robust, and fixes mismatching XMM save restore
mismatches

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 02:18:54 +01:00
Michael Niedermayer
d41b66a1a2 avcodec/vp3: pass correct context to av_log()
Fixes null pointer dereference
Fixes: signal_sigsegv_000_3694_cov_1050071691_theora.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 00:34:09 +01:00
Michael Niedermayer
3b4ffba3af avcodec/x86/lossless_audiodsp: Make scalarproduct_and_madd_int16 prototypes more similar
This is needed as the mmx code is used as fallback from the ssse3 code

Suggested-by: jamrial
Tested-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 00:20:59 +01:00
Michael Niedermayer
43b1fd5bb4 avcodec/hevc: drop redundant ifs()
Found-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 22:29:55 +01:00
Seppo Tomperi
0c494114cc hevcdsp: ARM NEON optimized deblocking filter
cherry picked from commit 1b9ee47d2f43b0a029a9468233626102eb1473b8

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 22:01:52 +01:00
Christophe Gisquet
9a2f5d825a hevc: free sao buffers when receiving a new SPS
The buffer pointers would be otherwise overwritten, causing a
leak on e.g. PERSIST_RPARAM_A_RExt_Sony_1.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 21:50:35 +01:00
wm4
a83b6b077c vp9: assign PTS to visible instead of invisible frames
All the webm/vp9 files I have seen so far can have packets that contain
1 invisible and 1 visible frame. The vp9 parser separates them. Since
the invisible frame is always (?) the first sub-packet, the new packet
is assigned the PTS of the original packet, while the packet containing
the visible frame has no PTS.

This patch essentially reassigns the PTS from the invisible to the
visible frame.

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 21:16:26 +01:00
James Almer
15574c505b x86/hevcdsp: add ff_hevc_sao_edge_filter_{10,12}_{sse2,avx2}
Original x86 intrinsics code by Pierre-Edouard Lepere.
Yasm port, refactoring and optimizations by James Almer.

Benchmarks of BQTerrace_1920x1080_60_qp22.bin with an Intel Core i5-4200U

Width 32
342694 decicycles in sao_edge_filter_10, 16384 runs, 0 skips
29476 decicycles in ff_hevc_sao_edge_filter_32_10_ssse3, 16384 runs, 0 skips
13996 decicycles in ff_hevc_sao_edge_filter_32_10_avx2, 16381 runs, 3 skips

Width 64
581163 decicycles in sao_edge_filter_10, 8192 runs, 0 skips
59774 decicycles in ff_hevc_sao_edge_filter_64_10_ssse3, 8192 runs, 0 skips
28383 decicycles in ff_hevc_sao_edge_filter_64_10_avx2, 8191 runs, 1 skips

Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-05 15:02:33 -03:00
James Almer
042c1159fc x86/hevcdsp: add ff_hevc_sao_edge_filter_8_{ssse3,avx2}
Original x86 intrinsics code and initial yasm port by Pierre-Edouard Lepere.
Refactoring and optimizations by James Almer.

Benchmarks of BQTerrace_1920x1080_60_qp22.bin with an Intel Core i5-4200U

Width 32
158583 decicycles in edge, sao_edge_filter_8 runs, 0 skips
5205 decicycles in ff_hevc_sao_edge_filter_32_8_ssse3, 32767 runs, 1 skips
2942 decicycles in ff_hevc_sao_edge_filter_32_8_avx2, 32767 runs, 1 skips

Width 64
705639 decicycles in sao_edge_filter_8, 262144 runs, 0 skips
19224 decicycles in ff_hevc_sao_edge_filter_64_8_ssse3, 262111 runs, 33 skips
10433 decicycles in ff_hevc_sao_edge_filter_64_8_avx2, 262115 runs, 29 skips

Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-05 15:02:27 -03:00
James Almer
1f1c7c8a57 hevcdsp: remove compilation-time-fixed parameter from sao_edge_filter
The stride_src parameter is always 2 * MAX_PB_SIZE + FF_INPUT_BUFFER_PADDING_SIZE.

Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-05 15:02:22 -03:00
Michael Niedermayer
e09ad5bd0d avcodec/h264_refs: set last_pic_for_ec only if it has not been set previously
This ensures we do not loose the frame in case or multiple clears
Fixes out of array read
Fixes: asan_heap-oob_2fa47ea_2100_cov_1278768963_ff_add_pixels_clamped_mmx.m2ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 14:57:42 +01:00
Michael Niedermayer
7dad2f7bb9 Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  Fix compilation with --disable-protocol=udp

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 13:26:07 +01:00
Paul B Mahol
dccd648f9f avcodec/alsdec: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-05 09:48:54 +00:00
Paul B Mahol
57bca64b3f avcodec/cllc: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-05 09:48:54 +00:00
Carl Eugen Hoyos
afada9ac67 Fix compilation with --disable-protocol=udp 2015-02-05 10:07:03 +01:00
Michael Niedermayer
7801a54ec3 avfilter/vf_fps: update frame drop comment
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 06:03:11 +01:00
Michael Niedermayer
f2579dbb4b avformat/thp: Check av_get_packet() for failure not only for partial output
Fixes null pointer dereference
Fixes: signal_sigsegv_db2c1f_3108_cov_163322880_pikmin2_opening1_partial.thp

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 04:14:42 +01:00
Lukasz Marek
21051af218 lavf/avc: add buffer padding to extradata allocation
ff_avc_write_annexb_extradata() allocates extradata, but don't add
FF_INPUT_BUFFER_PADDING_SIZE value

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2015-02-05 03:27:55 +01:00
Philip Langdale
d20df2601f avcodec/nvenc: De-compensate aspect ratio compensation of DVD-like content.
For reasons we are not privy to, nvidia decided that the nvenc encoder
should apply aspect ratio compensation to 'DVD like' content, assuming that
the content is not bt.601 compliant, but needs to be bt.601 compliant. In
this context, that means that they make the following, questionable,
assumptions:

1) If the input dimensions are 720x480 or 720x576, assume the content has
an active area of 704x480 or 704x576.

2) Assume that whatever the input sample aspect ratio is, it does not account
for the difference between 'physical' and 'active' dimensions.

From, these assumptions, they then conclude that they can 'help', by adjusting
the sample aspect ratio by a factor of 45/44. And indeed, if you wanted to
display only the 704 wide active area with the same aspect ratio as the full
720 wide image - this would be the correct adjustment factor, but what if you
don't? And more importantly, what if you're used to ffmpeg not making this kind
of adjustment at encode time - because none of the other encoders do this!

And, what if you had already accounted for bt.601 and your input had the
correct attributes? Well, it's going to apply the compensation anyway!
So, if you take some content, and feed it through nvenc repeatedly, it
will keep scaling the aspect ratio every time, stretching your video out
more and more and more.

So, clearly, regardless of whether you want to apply bt.601 aspect ratio
adjustments or not, this is not the way to do it. With any other ffmpeg
encoder, you would do it as part of defining your input paramters or
do the adjustment at playback time, and there's no reason by nvenc
should be any different.

This change adds some logic to undo the compensation that nvenc would
otherwise do.

nvidia engineers have told us that they will work to make this
compensation mechanism optional in a future release of the nvenc
SDK. At that point, we can adapt accordingly.

Signed-off-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 02:32:33 +01:00
Michael Niedermayer
692b22626e swscale/utils: Limit filter shifting so as not to read from prior the array
Fixes out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 00:33:50 +01:00
Michael Niedermayer
fd52d2d3d1 avcodec/mpegvideo_motion: Fix gmc chroma dimensions
Fixes integer overflow and out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 00:33:50 +01:00
James Almer
7457afc64d hevcdsp: replace the SAOParams struct parameter from sao_edge_filter
As with sao_band_filter, pass instead the two variables from the struct needed in the function.
This simplifies writing asm optimized versions.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-04 17:53:04 -03:00
James Almer
121ccc3365 hevcdsp: further simplify sao_edge_filter
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-04 17:52:59 -03:00
Seppo Tomperi
4386e1fd94 hevcdsp: simplified sao_edge_filter
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
2015-02-04 17:52:54 -03:00
Seppo Tomperi
74d7faf400 hevcdsp: separated sao edge filter and pixel restore funcs
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
2015-02-04 17:52:49 -03:00
Michael Niedermayer
fabbfaa095 avcodec/mjpegdec: Check number of components for JPEG-LS
Fixes out of array accesses
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 20:49:12 +01:00
Michael Niedermayer
afa92907f3 avcodec/mjpegdec: Check escape sequence validity
Fixes assertion failure
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 20:14:18 +01:00
Michael Niedermayer
7f02fcd917 avfilter/vf_fps: Do not drop a random subset of frames
This also avoids droping the frame which is closest to the target timestamp

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 18:52:14 +01:00
Hendrik Leppkes
b11994593a dxva2_hevc: properly fill the scaling list structure
The scaling list can be specified in either the SPS or PPS.
Additionally, compensate for the diagonal scan permutation applied in the decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 16:31:49 +01:00
Michael Niedermayer
05e1619529 avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 14:55:42 +01:00
Paul B Mahol
9f1a5dbc26 avcodec/cdxl: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-04 13:40:04 +00:00
Michael Niedermayer
85a8069d23 Merge commit '8c1ce7787ad7af8fc321b4a145e9dc965f6d0e86'
* commit '8c1ce7787ad7af8fc321b4a145e9dc965f6d0e86':
  aacsbr: silence message for SBR extension "padding".

See: 1ac606bae6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 14:20:32 +01:00
Paul B Mahol
469a170135 avformat/siff: fix if_( style
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-04 13:10:53 +00:00
Michael Niedermayer
ba4fba8f48 Merge commit 'd615187f74ddf3413778a8b5b7ae17255b0df88e'
* commit 'd615187f74ddf3413778a8b5b7ae17255b0df88e':
  aacdec: Support for ER AAC ELD 480.

Conflicts:
	libavcodec/aacdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 13:49:17 +01:00
Michael Niedermayer
dd72e26d0c Merge commit '7640c4a371a97899dfb443d980fd0bf8ac587754'
* commit '7640c4a371a97899dfb443d980fd0bf8ac587754':
  aacdec: Tables for length 480 AAC ELD.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 13:40:23 +01:00
Michael Niedermayer
f53aa3f4f3 Merge commit '0ee2573347ecdb9cb5656001f7201d819eec16d8'
* commit '0ee2573347ecdb9cb5656001f7201d819eec16d8':
  aacdec: Support for ER AAC in LATM

Conflicts:
	libavcodec/aacdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 13:31:24 +01:00
Michael Niedermayer
5348d7b605 Merge commit 'edd9ea3ffba1d5873dead1c57c74b1e3cc912167'
* commit 'edd9ea3ffba1d5873dead1c57c74b1e3cc912167':
  aacdec: Refactor aac_er_decode_frame.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 13:18:51 +01:00
Stefano Sabatini
fd242b468d lavf/utils: fix if_( style 2015-02-04 13:17:30 +01:00
Liviu Oniciuc
d2330e5844 doc/muxers/image2: remove the non-negative number requirement for start_number
Update after b37858eae1.
2015-02-04 13:17:30 +01:00
Michael Niedermayer
0afc26d330 Merge commit '82bd8a57692d8f3643ad0903c97e4a0f84393f53'
* commit '82bd8a57692d8f3643ad0903c97e4a0f84393f53':
  aacdec: Refactor decode_ics_info.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-04 13:09:52 +01:00