Commit Graph

31081 Commits

Author SHA1 Message Date
James Almer
92d903afaa x86/vp9dsp: fix clobbering of xmm6 on IDCT sse2 functions
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-08 00:50:39 -03:00
Michael Niedermayer
7c148f30f3 Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  Support decoding yuv dpx images.
  Do not use -mdynamic-no-pic on OSX x86_64.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-08 02:36:23 +01:00
Michael Niedermayer
2048126ea7 avcodec/utils: Assert that dst->progress is clear before ff_thread_ref_frame()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-08 02:27:27 +01:00
Michael Niedermayer
de6df46120 avcodec/h264: Setup decoder to have matching reference to the EC code
Also move EC ref initialization to where the EC code is called.
Fixes out of array read
Fixes: asan_heap-uaf_143f420_142_20110805_112659_ch0.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-08 02:27:27 +01:00
Michael Niedermayer
ecfd48dc06 avcodec/h264: Move COPY_PICTURE() to h264.h so it can be used from other parts of the h264 decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-08 02:27:27 +01:00
Carl Eugen Hoyos
2efaaf9476 Support decoding yuv dpx images. 2015-02-08 00:12:46 +01:00
Christophe Gisquet
626d6184ce x86: lavc/hevc_mc: fix comments
The width parameter is now completely at the back, and actually
never used. This helps understanding the actual parameter list.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 20:52:03 +01:00
Paul B Mahol
134e8c73ea avcodec/faxcompr: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-07 17:16:14 +00:00
Christophe Gisquet
97996eff4f hevc/sao: do in-place band filtering when possible
The copies are only needed when data must be restored, so skip them
when it must not be.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 18:04:25 +01:00
Christophe Gisquet
ed450d4acf x86: lavc: share more constant through defines
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 17:48:14 +01:00
Paul B Mahol
ec8ec999f4 avcodec/twinvqdec: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-02-07 15:19:03 +00:00
Christophe Gisquet
691b7f5e9e lavc/lossless_audiodsp: revert various commits
Their intent was to make the DSP work with wmalossless pro.
The later was fixed to work with the DSP.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 15:15:19 +01:00
Christophe Gisquet
46e2afa4dc wmalossless: reset lms_update
It may contain garbage at the end, and zeroing allows using DSP
with longer loops.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 15:14:32 +01:00
Anshul Maheshwari
f05efd42af avcodec/ccaption_dec: Added Debug logs
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 06:01:31 +01:00
Anshul Maheshwari
5647286e67 avcodec/ccaption_dec: handle error from ass_sub api
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 05:51:17 +01:00
Anshul Maheshwari
bf30161a8d avcodec/ccaption_dec: Added Roll up functionality
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 05:51:10 +01:00
Michael Niedermayer
2fd9ce92af avcodec/h264_slice: assert that reinit does not occur after the first slice
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 03:59:45 +01:00
Michael Niedermayer
38d5241b7f avcodec/h264_slice: ignore SAR changes in slices after the first
Fixes race condition and null pointer dereference
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-07 03:59:45 +01:00
Michael Niedermayer
f111831ed6 avcodec/h264_slice: Check picture structure before setting the related fields
This might fix a hypothetical race condition

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-07 03:59:45 +01:00
Michael Niedermayer
f906982c94 avcodec/h264_slice: Do not change frame_num after the first slice
Fixes potential 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-07 02:20:14 +01:00
Christophe Gisquet
9dc45d1f42 x86: lavc: share more constants
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 23:35:02 +01:00
Michael Niedermayer
bfb988b1fa Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  lavc/tscc: Make 32bit output opaque.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 22:31:32 +01:00
Mickaël Raulet
6ecc3fd612 x86/hevc_mc: use aligned loads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 21:38:00 +01:00
James Almer
383fddeec6 x86/lossless_audiodsp: fix compilation with --disable-yasm
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-06 17:30:17 -03:00
Carl Eugen Hoyos
d45fadb6df lavc/tscc: Make 32bit output opaque.
Found-by: wm4
2015-02-06 21:02:08 +01:00
Michael Niedermayer
9bc7ee8a98 avcodec/avfft: Add simple self test
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 19:07:29 +01:00
Timothy Gu
5081012eb8 audioconvert: Add missing include for FF_API_AUDIO_CONVERT
Fixes warning in `make checkheaders`.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-06 19:07:29 +01:00
James Almer
aea29a891f x86/hevc_sao: fix loading of RIP address
pb_eo must be handled as a rip relative address for MSVC64, so an
intermediate register is needed. Should fix link failures.

Suggested by Hendrik Leppkes and Christophe Gisquet.

Tested-By: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-06 15:06:15 -03:00
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
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
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
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
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
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
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