1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

39880 Commits

Author SHA1 Message Date
Rostislav Pehlivanov
c51301db14 dcaenc: move all tables inside context and fix incorrect coding style
Functionally identical to the old code, with less lines wasted.
Partially fixes the complete disregard for the 80 col/line guide.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-13 18:37:54 +00:00
Daniil Cherednik
ec6e389c75 avcodec/dcaenc: Use ffmpeg mdct instead of own implementation
Signed-off-by: Daniil Cherednik <dan.cherednik@gmail.com>
2018-01-13 18:13:58 +00:00
Rostislav Pehlivanov
56e11ebf55 dcaenc: cleanup on init failure and add a threadsafe init codec cap
The encoder didn't clean up if a malloc failed during init.
It also doesn't need any external tables to be initialized on init.
Finally, it didn't need to check for whether avctx->priv_data exists during
uninit.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-13 18:06:59 +00:00
Daniil Cherednik
c7d726f7f4 opusenc_psy: Typo, use all coeffs in range for band tonality calculation 2018-01-13 17:54:20 +00:00
Rostislav Pehlivanov
fcb681ac3e aacenc: use the fast coder as the default
The twoloop coder sounds decent at low bitrates, however at higher bitrates
it sounds worse than the fast coder (which used to be the old twoloop coder
before October 2015) and needs quite a lot more CPU.
Change the default to fast. It has been well tested and has had little changes
over the years so its been confirmed to be quite stable.
Also change its description (not valid for more than a year) and the
documentation.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-13 12:03:19 +00:00
Rodger Combs
1eb7c1d49d lavc/libx265: support all color parameters that x265 does 2018-01-12 18:33:58 -06:00
Michael Niedermayer
860d991fcd avcodec/utils: Avoid hardcoding duplicated types in sizeof()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-12 22:57:01 +01:00
Michael Niedermayer
2cd718a4c5 avcodec/opus: Add {} over multiline if() body
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-12 22:57:01 +01:00
Michael Niedermayer
7dbbb75ee3 avcodec/arm/sbrdsp_neon: Use a free register instead of putting 2 things in one
Fixes high pitched shriek
Fixes: 25420848_1478428308873746_4255813235963330560_n.mp4

Reported-by: Dale Curtis <dalecurtis@google.com>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-12 22:45:02 +01:00
Jérôme Martinez
58e16a4f4b avcodec/ffv1enc: mark RGB48 support as non-experimental
Resulting bitstream was tested with a conformance checker
using the last draft of FFV1 specifications.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Also the files are already in the wild, and decoder support is
thus needed. And with decoders widely supporting it, there is no
advantage in not allowing it in the encoder.
The exact bitstream format may change in future versions of the
spec, if improvments are found.
2018-01-12 12:31:55 +01:00
James Almer
6e80079a28 avcodec: increase AV_INPUT_BUFFER_PADDING_SIZE to 64
AVX-512 support has been introduced, and even if no functions currently
use zmm registers (able to load as much as 64 bytes of consecutive data
per instruction), they will be added eventually.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-11 23:46:31 -03:00
Michael Niedermayer
d6945aeee4 avcodec/h264addpx_template: Fixes integer overflows
Fixes: signed integer overflow: 512 + 2147483491 cannot be represented in type 'int'
Fixes: 4780/clusterfuzz-testcase-minimized-4709066174627840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-08 21:50:34 +01:00
Michael Niedermayer
0e62a23734 avcodec/dirac_dwt: Fix overflows in COMPOSE_HAARiH0/COMPOSE_HAARiL0
Fixes: 4830/clusterfuzz-testcase-minimized-5255392054476800
Fixes: signed integer overflow: 2147483646 - -7 cannot be represented in type 'int'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-08 21:50:15 +01:00
Michael Niedermayer
eaa9317589 avcodec/diracdec: Fix integer overflow with quant
Fixes: signed integer overflow: 2 + 2147483646 cannot be represented in type 'int'
Fixes: 4792/clusterfuzz-testcase-minimized-6322450775146496

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-08 21:50:12 +01:00
Michael Niedermayer
1bcd7fefcb avcodec/opus_parser: Check payload_len in parse_opus_ts_header()
Fixes: clusterfuzz-testcase-minimized-6134545979277312
Fixes: crbug 797469

Reported-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-08 21:49:53 +01:00
Michael Niedermayer
b3192c64b5 avcodec/jpeg2000dsp: Fix integer overflows in ict_int()
Fixes: signed integer overflow: 46802 * -71230 cannot be represented in type 'int'
Fixes: 4756/clusterfuzz-testcase-minimized-4812495563784192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-08 18:57:22 +01:00
Michael Niedermayer
476665d4de avcodec/h264_slice: Do not attempt to render into frames already output
Fixes: null pointer dereference
Fixes: 4698/clusterfuzz-testcase-minimized-5096956322906112

This testcase does not reproduce the issue before 03b82b3ab9

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-07 04:47:32 +01:00
Matthieu Bouron
e30b46b1ae lavc/mediacodec_wrapper: allocate MediaCodec.BufferInfo once 2018-01-06 22:12:51 +01:00
Matthieu Bouron
d19174c673 lavc/mediacodecdec: remove mediacodec_process_data() indirection 2018-01-06 22:12:51 +01:00
Aman Gupta
9d9835017f lavc/mediacodecdec: switch to new decoding API
Using the new API gives the decoder the ability to produce
N frames per input packet. This is particularly useful with
mpeg2 decoders on some android devices, which automatically
deinterlace video and produce one frame per field.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-01-06 22:12:31 +01:00
LongChair
2ca65fc7b7 avcodec/rkmpp : remove stream start retries before first frame.
those were needed because of some odd mpp behavior that seems to have
been fixed.

Makes the code cleaner.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
2018-01-06 18:08:41 +01:00
LongChair
c6f8410636 avcodec/rkmpp : Fix broken build due to missing control operation
This patch is taking care of https://trac.ffmpeg.org/ticket/6834.
It seems that one of the control operations that was available to get
the free decoders input slots was removed.

There is another control operation to retrieve the used slots. Given
that the input slot count is hardcoded to 4 in mpp at this point,
replacing the old control operation by the other one.

This was tested on Rockchip ROCK64.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
2018-01-06 18:08:13 +01:00
Misty De Meo
94e6b5ac39 adpcm: consume remainder after consuming XA chunks
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-06 03:14:38 +01:00
James Almer
dcbf034a0f avcodec/error_resilience: remove unused header
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-05 14:04:02 -03:00
James Almer
9ed4ebc530 avcodec/util: use a mutex instead of atomics in avcodec_register()
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-05 13:18:34 -03:00
Michael Niedermayer
b2be76c0a4 avcodec/dnxhddec: Check dc vlc
Fixes: signed integer overflow: 1024 + 2147483640 cannot be represented in type 'int'
Fixes: 4671/clusterfuzz-testcase-minimized-6027464343027712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-05 03:35:48 +01:00
James Almer
d36335bda5 avcodec/parser: use a mutex instead of atomics in av_register_codec_parser()
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-04 21:56:49 -03:00
Rostislav Pehlivanov
f141b353e6 opusenc_psy: disable stereo searches for mono streams
Fixes a crash which happened when someone tried to encode mono.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-04 02:52:40 +00:00
Jiejun Zhang
677701c6b3 lavc/audiotoolboxenc: fix noise in encoded audio
This fixes #6940

Although undocumented, AudioToolbox seems to require the data supplied
by the callback (i.e. ffat_encode_callback) being unchanged until the
next time the callback is called. In the old implementation, the
AVBuffer backing the frame is recycled after the frame is freed, and
somebody else (maybe the decoder) will write into the AVBuffer and
change the data. AudioToolbox then encodes some wrong data and noise
is produced. Retaining a frame reference solves this problem.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-03 17:32:55 -03:00
Derek Buitenhuis
500a9bb5ba lavc/options: Remove unneeded header
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2018-01-03 13:00:06 -05:00
Paul B Mahol
57d0c24132 avcodec/utvideoenc: switch to planar RGB formats
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-01-02 13:41:50 +01:00
Paul B Mahol
92b32664cd avcodec/utvideodec: add support for UMH2, UMY2, UMH4, UMY4, UMRA, UMRG
These are new modes which are supposed to be more SIMD friendly.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-01-02 13:41:49 +01:00
Rostislav Pehlivanov
fdbd261967 lavc/Makefile: fix opus_parser dependencies
Fix suggested by RiCON.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-01 19:56:37 +00:00
Michael Niedermayer
903be5e4f6 avcodec/exr: Check buf_size more completely
Fixes: Out of heap array read
Fixes: 4683/clusterfuzz-testcase-minimized-6152313673613312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-30 21:02:49 +01:00
Rostislav Pehlivanov
51027d0b8b opus: merge encoder and decoder bitallocation functions into one
There's no difference apart from which entropy coding functions get called.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-12-30 17:05:23 +00:00
Michael Niedermayer
3d23f7a096 avcodec/flacdec: Fix overflow in multiplication in decode_subframe_fixed()
Fixes: signed integer overflow: 2 * 1629495328 cannot be represented in type 'int'
Fixes: 4716/clusterfuzz-testcase-minimized-5835915940331520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-28 20:13:59 +01:00
Michael Niedermayer
d135f3c514 avcodec/hevcdsp_template: Fix Invalid shifts in put_hevc_qpel_bi_w_h() and put_hevc_qpel_bi_w_w()
Fixes: left shift of negative value -1
Fixes: 4690/clusterfuzz-testcase-minimized-6117482428366848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-28 20:13:59 +01:00
Michael Niedermayer
560daf8891 avcodec/flacdec: avoid undefined shift
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int'
Fixes: 4688/clusterfuzz-testcase-minimized-6572210748653568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-28 20:13:59 +01:00
Carl Eugen Hoyos
658bdc6771 lavc/jpeg2000dec: Support reading 64-bit atom size.
Fixes ticket #6935.
2017-12-28 02:58:56 +01:00
James Almer
2f96190732 Merge commit 'c6558e8840fbb2386bf8742e4d68dd6e067d262e'
* commit 'c6558e8840fbb2386bf8742e4d68dd6e067d262e':
  x264: Support version 153

See
2a111c99a6
7e60c74329

Merged-by: James Almer <jamrial@gmail.com>
2017-12-27 21:11:10 -03:00
Luca Barbato
c6558e8840 x264: Support version 153
It has native simultaneus 8 and 10 bit support.
2017-12-27 15:59:45 +00:00
wm4
8f9024f2ca lavc: remove uneffective attribute_deprecated on enum
Does not work. Even emits a warning with some compilers that the
attribute does not work on enums. It's likely that there is way to make
it work, but not worth the trouble.
2017-12-27 03:47:28 +01:00
James Almer
7e60c74329 avcodec/libx264: set supported pix_fmts at runtime rather than build time
This partially reverts a change in behavior introduced in 2a111c99a6.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-26 19:41:04 -03:00
Mark Thompson
e6a1dfc9ce mpeg4videodec: Fix unused variable warning
video_format is not used.
2017-12-26 17:25:46 +00:00
Michael Niedermayer
0c9ab5ef9c avcodec/hevcdsp_template.c: Fix undefined shift in FUNC(dequant)
Fixes: runtime error: left shift of negative value -180
Fixes: 4626/clusterfuzz-testcase-minimized-5647837887987712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-26 18:05:10 +01:00
Michael Niedermayer
4d70fbeec8 avcodec/dirac_dwt: Fix integer overflow in COMPOSE_DD97iH0() and COMPOSE_DD137iL0()
Fixes: runtime error: signed integer overflow: 2147483646 + 33554433 cannot be represented in type 'int'
Fixes: 4563/clusterfuzz-testcase-minimized-5438979567517696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-26 18:05:10 +01:00
James Almer
2a111c99a6 avcodec/libx264: fix compilation with x264 builds >= 153
x264 now supports multibitdepth builds, with a slightly changed API to
request bitdepth during initialization.

Reviewed-by: Ricardo Constantino <wiiaboo@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-26 11:57:01 -03:00
James Almer
89f704caba avcodec/libx264: use the pixfmt descriptor to check for high bit depths
The x264_bit_depth constant has been removed in newer x264 builds.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-25 23:18:41 -03:00
wm4
cf57cb3ae4 h264: add AVOption to set x264_build default
This provides a generic way to the API user to deal with files that
either lack this SEI, or which have the SEI only in packets not passed
to the decoder (such as the common case of the SEI being in the very
firsat video packet, but decoding is started somewhere in the middle of
the file). Bugs like 840b41b2a6 make this
somewhat of a necessity.

This intentionally uses the version in the SEI instead, if any is found.
2017-12-26 02:56:09 +01:00
wm4
4ed66517c6 lavc: remove complex debug code around avcodec init locking
This is just a lot of complicated and confusing code that had no purpose
anymore.

Also, the functions return values were checked only sometimes. Locking
shouldn't fail anyway, so remove the return values. Barely any other
pthread lock calls check the return value (including more important code
that is more likely to fail horribly if locking fails).

It could be argued that it might be helpful in some debugging
situations, or when the user built FFmpeg without thread support against
all good advice.

But there are dummy atomics too, so the atomic check won't help with
ensuring correctness absolutely. You gain very little.

Also, for debugging, you can just raise the ASSERT_LEVEL, and then
libavutil/thread.h will redefine the locking functions to explicitly
check the return values.
2017-12-26 02:50:00 +01:00