1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-04 23:38:20 +02:00
Commit Graph

45632 Commits

Author SHA1 Message Date
Andreas Rheinhardt
5aac4b669a avcodec/j2kenc: Fix AV_OPT_TYPE_CONST offsets
They are supposed to be zero.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:18 +02:00
Andreas Rheinhardt
497c490a4e avcodec/tests/avcodec: Check consistency of function pointers
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:15 +02:00
Andreas Rheinhardt
d77798309f avcodec/tests/avcodec: Test AVCodec and AVCodecDescriptor consistency
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:29:01 +02:00
Andreas Rheinhardt
0d97317429 avcodec/tests/avcodec: Add basic sanity checks for AVCodec properties
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 13:03:56 +02:00
Andreas Rheinhardt
136865413c avcodec/tests/utils: Rename to avcodec
The current name comes from a time in which libavcodec/utils.c
contained the whole core of libavcodec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-26 12:56:08 +02:00
Maryla
9f4708c22d webp: fix transforms after a palette with pixel packing.
When a color indexing transform with 16 or fewer colors is used,
WebP uses "pixel packing", i.e. storing several pixels in one byte,
which virtually reduces the width of the image (see WebPContext's
reduced_width field). This reduced_width should always be used when
reading and applying subsequent transforms.

Updated patch with added fate test.
The source image dual_transform.webp can be downloaded by cloning
https://chromium.googlesource.com/webm/libwebp-test-data/

Fixes: 9368
Signed-off-by: James Zern <jzern@google.com>
2021-09-25 15:31:36 -07:00
Andreas Rheinhardt
9348d06fc6 avcodec/qsvenc: Remove dead code for user-provided buffers
Dead since commit 93016f5d1d
which ensured that the packets received by encoders are always blank.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 22:58:17 +02:00
Andreas Rheinhardt
dd0a7fdfc0 avcodec/qsvenc: Fix memleaks upon allocation errors
Fixes leaks in case the allocation of the H.264-specific stuff fails.
Fixes Coverity issues #1442911 and #1442914.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 22:58:17 +02:00
Zhao Zhili
378ad2f8fd lavc/aarch64: fix relocation out of range error
Use a temporary label instead of global function symbol for b.gt.

Signed-off-by: Martin Storsjö <martin@martin.st>
2021-09-25 21:55:29 +03:00
Limin Wang
0463f5d6d5 avcodec/libsvtav1: Fix value range for rc mode
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:37:01 +08:00
Limin Wang
64e2fb3f9d avcodec/libsvtav1: make coded GOP type configurable
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:35:54 +08:00
Limin Wang
04b89e8ae3 avcodec/libsvtav1: Fix duplicate definition of caps_internal
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-25 21:35:40 +08:00
James Almer
970264a74f avcodec/av1_parser: constify some variables
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-24 00:04:37 -03:00
Andreas Rheinhardt
bb98212930 avcodec/elbg: Mark ELBGContext as being unaliased by using av_restrict
This improves performance: For msvideo1, the performance improved by
4.8% when encoding the sample from the fate-vsynth1-msvideo1 test;
when encoding the sample from fate-vsynth1-cinepak, performance
improved by 2%. The compiler user was GCC 10 and the calls to encode2
have been timed.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:01:49 +02:00
Andreas Rheinhardt
6b2c1d1018 avcodec/elbg: Add flags to avpriv_elbg_do()
This is currently unused and it is only added to enable changes
while maintaining ABI compatibility. The type is uintptr_t in order
to potentially accept a pointer argument.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:01:27 +02:00
Andreas Rheinhardt
73f47846bd avcodec/msvideo1enc: Check all calls to avpriv_elbg_do()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:00:39 +02:00
Andreas Rheinhardt
ad27326e2b avcodec/cinepakenc: Check all calls to avpriv_elbg_do()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-24 00:00:13 +02:00
Andreas Rheinhardt
477a398c3e avcodec/elbg: Also allocate buffers for recursion only once
This is possible because the number of elements needed in each
recursion step decreases geometrically, so the geometric series
provides an upper bound for the sum of number of elements of
the needed buffers.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-23 23:53:38 +02:00
Paul B Mahol
cd7e25b14a avcodec/mlpenc: fix encoding stereo single stream in TrueHD 2021-09-23 23:43:48 +02:00
Paul B Mahol
57f0b36367 avcodec/mlpdec: fix decoding single stereo stream in TrueHD 2021-09-23 23:43:48 +02:00
Nicolas Gaullier
fad459b5a6 avcodec/h264_parser: Set AVCodecContext.framerate
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-23 10:35:08 -03:00
James Almer
6edcdd2520 avcodec/cbs_h265: support general_profile_idc 11
And fix support for general_profile_idc 9 and 10.
Defined in ITU-T H.265 (V6).

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-22 16:31:35 -03:00
Limin Wang
a487635b85 avcodec/dynamic_hdr10_plus: check size before using it
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-22 09:25:25 +08:00
Limin Wang
4c079636ab avcodec/dynamic_hdr10_plus: use AVERROR_INVALIDDATA instead of AVERROR(EINVAL)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-22 09:25:25 +08:00
Limin Wang
45b850f9f5 avcodec/hevc_sei: check size before using it
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-09-22 09:25:25 +08:00
James Almer
9a7fe439d9 avcodec/libdav1d: let libdav1d choose optimal max frame delay
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-21 15:11:20 -03:00
Michael Niedermayer
85413a5ae6 avcodec/cbs_h265_syntax_template: Limit sps_num_palette_predictor_initializer_minus1 to 127
Fixes: index 128 out of bounds for type 'uint16_t [128]'
Fixes: 38651/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6296416058736640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-21 19:20:56 +02:00
James Almer
d873b5fffc avcodec/libdav1d: pass auto threads value to libdav1d
libdav1d 1.0.0 will be the first version supporting Dav1dSettings.n_threads == 0.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-20 22:30:35 -03:00
Andreas Rheinhardt
60ada0f5fa avcodec/elbg: Keep buffers to avoid allocations and frees
Up until now, each call to avpriv_elbg_do() would result
in at least six allocations. And this function is called a lot:
A typical FATE run results in 52213653 calls to av_malloc; of these,
34974671 originate from av_malloc_array and from these 34783679
originate from avpriv_elbg_do; the msvideo1 encoder tests are behind
most of these.

This commit changes this by keeping the buffers and only reallocating
them when needed. E.g. for the encoding part of fate-vsynth1-msvideo1
total heap usage went down from 11,407,939 allocs and frees with
468,106,207 bytes allocated to 3,149 allocs and frees with 13,181,847
bytes allocated. The time for one encode2-call went down by 69%.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 05:40:51 +02:00
Andreas Rheinhardt
5e01527330 avcodec/elbg: Move arguments to the context early if possible
This affects all the arguments that don't change during a call
to avpriv_elbg_do(); doing so makes it easily recognizable which
arguments change upon recursive calls.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 05:09:59 +02:00
Andreas Rheinhardt
896c11687e avcodec/elbg: Add persistent ELBGContext
It will be used in future commits to avoid having to allocate and free
all the buffers used.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:38:45 +02:00
Andreas Rheinhardt
9e11debb5d avcodec/elbg: Rename elbg_data to ELBGContext
It is in line with our naming conventions for types.
Also change numCB to num_cb for the same reason.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:38:25 +02:00
Andreas Rheinhardt
05ccfcb7b0 avcodec/elbg: Merge avpriv_init_elbg() into avpriv_do_elbg()
These functions are always called directly after another with
the exact same arguments. This avoids exporting a symbol;
it also avoids having to perform two calls for every caller.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:09:22 +02:00
Andreas Rheinhardt
d046e76515 avcodec/elbg: Move avpriv_init_elbg() down
It will avoid a forward declaration later.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 04:08:54 +02:00
Andreas Rheinhardt
1ea3650823 Replace all occurences of av_mallocz_array() by av_calloc()
They do the same.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:52 +02:00
Andreas Rheinhardt
4b15474316 avcodec/opus_silk: Remove wrong size information in function declaration
silk_lsp2poly()'s declaration contained arrays with array sizes;
yet these array sizes exceeded the number of actually accessed array
elements (which is related to another parameter) and this leads to
-Wstringop-overflow= warnings from GCC 11, because the arrays provided
by callers are only large enough for the actually used elements.

So replace the incorrect array sizes with comments containing
the correct array sizes. Given that these sizes are not compile-time
constants, they can only be communicated via a comment.

Reported by Paul B Mahol.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:51 +02:00
Andreas Rheinhardt
176b8d785b avcodec/avcodec, options_table: Deprecate sub_text_format
Unused since 1f63665ca5.

Found-by: Soft Works <softworkz@hotmail.com>
Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:48 +02:00
Andreas Rheinhardt
8edf6c3bf1 avcodec/(h263|mpeg4?video)_parser: Make *_find_frame_end() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 00:20:15 +02:00
Anton Khirnov
dd846bc4a9 lavc: deprecate AV_CODEC_(FLAG|CAP)_TRUNCATED
It is supported only by a few decoders (h263, h263p, mpeg(1|2|)video
and mpeg4) and is entirely redundant with parsers. Furthermore, using
it leads to missing frames, as flushing the decoder at the end does not
work properly.

Co-authored-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 00:20:13 +02:00
Andreas Rheinhardt
9c489a0f3a avcodec/mpegvideo: Move startcodes to mpeg12.h
And remove the MPEG-4-specific SLICE_START_CODE, which duplicates
SLICE_STARTCODE.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 00:10:35 +02:00
Michael Niedermayer
0faf04e807 avcodec/snowdec: Maintain avmv buffer
This avoids reallocating per frame

Fixes: Assertion failure
Fixes: 36359/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6733238591684608
Fixes: 38623/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6098656512573440

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-19 22:36:23 +02:00
Michael Niedermayer
db18f29b33 avcodec/siren: Check index for catergory5
Fixes: out of array access
Fixes: 38603/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSNSIREN_fuzzer-5741847809490944.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-19 20:12:32 +02:00
Michael Niedermayer
5a95abcce4 avcodec/mpeg12dec: Do not put mpeg_f_code into an invalid state on error return
Fixes: invalid shift
Fixes: 37018/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-5290280902328320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-17 19:56:05 +02:00
Michael Niedermayer
245017ec8a avcodec/mpegvideo_enc: Limit bitrate tolerance to the representable
Fixes: error: 1.66789e+11 is outside the range of representable values of type 'int'
Fixes: Ticket8201

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-17 19:23:03 +02:00
Michael Niedermayer
48bbeac259 avcodec/wmaprodec: Check that the EOF frame was allocated before decoding into it
Fixes: NULL pointer dereference
Fixes: 38125/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5151909422432256

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>
2021-09-17 19:23:03 +02:00
Andreas Rheinhardt
a6760bb92b avcodec/elbg: Remove avoidable buffer
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-17 15:13:04 +02:00
Michael Niedermayer
90da43557f avcodec/apedec: Fix integer overflow in intermediate
Fixes: signed integer overflow: 559334865 * 4 cannot be represented in type 'int'
Fixes: 37929/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6751932295806976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-16 18:41:10 +02:00
James Almer
e93c998602 avcodec/mjpegdec: export display matrix frame side data when available
Finishes fixing ticket #6945.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-16 12:57:10 -03:00
Michael Niedermayer
c1a49a1264 avcodec/elbg: Increase some fields to 64bit
Fixes: Ticket8312
Fixes: Ticket8321

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-15 19:55:17 +02:00
Tong Wu
f31033c6ca avcodec/dxva2_av1: fix superres_denom parameter
Defined in spec 5.9.8. When superres is enabled, SuperresDenom equals
"coded_denom + SUPERRES_DENOM_MIN" instead of coded_denom.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2021-09-14 23:44:42 +02:00
James Almer
5d5ab3b4e6 avcodec/h264_picture: wait for the second slice to apply film grain on interlaced content
Fixes: Assertion failure
Fixes: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6581961297100800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-14 13:55:49 -03:00
Michael Niedermayer
e67deaf86c avcodec/exr: Fix undefined integer multiplication
Fixes: signed integer overflow: 7020950083487072256 * 2 cannot be represented in type 'long long'
Fixes: 37523/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5133634955771904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-14 17:34:33 +02:00
Michael Niedermayer
7dfa8040d6 avcodec/jpeg2000_parser: Check state!=0
Fixes: out of array read
Fixes: 37664/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5893420460146688

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>
2021-09-14 17:34:33 +02:00
Andreas Rheinhardt
bbc24363f1 avcodec/bsf: Unref the packet when flushing
The documentation does not require the packet to be blank in this case
(i.e. it can now contain opaque_ref), but it does contain that the
contents will be reset upon success.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:41:34 +02:00
Andreas Rheinhardt
b99fb4df42 avcodec/bsf: Use null-bsf for passthrough when available
When an empty list bsf is used for passthrough, there is a check
for every packet in bsf_list_filter() before ff_bsf_get_packet_ref()
is called. Directly using the null bsf avoids that.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:41:26 +02:00
bnnm
19802d170a avcodec/wmadec: fix WMA gapless playback
Fixes trac issue #7473.

Removes encoder delay (skip samples) and writes remaining frame samples after EOF to get correct sample count.

Output is now accurate vs players that use Microsoft's codecs (Windows Media Format Runtime).

Tested vs encode>decode WMAv2 with MS's codecs and most sample rate/bit rate/channel/mode combinations in ASF/XWMA.
WMAv1 appears to use the same delay, from FFmpeg samples.

Signed-off-by: bnnm <bananaman255@gmail.com>
2021-09-12 22:23:35 +02:00
Niklas Haas
a543d075cd avcodec/h274: trim unnecessarily large array
We only ever read to idx+3, so 256 values are overkill.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-12 11:07:40 -03:00
Niklas Haas
52c35d648c avcodec/h274: don't read from uninitialized array members
This bug flew under the radar because, in practice, these values are
0-initialized for the first invocation. But for subsequent invocations
(with different h/v values), reading from the uninitialized parts of
`out` is undefined behavior.

Avoid this by simply adjusting the iteration range of the following
loops. Has the added benefit of being a minor speedup.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-12 11:07:40 -03:00
Xu Guangxin
3bbe0c210b avcodec/qsv_enc: do not reuse enc_ctrl from previous frames
fixes #8857

If we do not clear the enc_ctrl, we will reuse previous frames' data like FrameType.

Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-09 12:53:25 -03:00
Andreas Rheinhardt
bb9141cc13 avcodec/mlpenc: Fix mixed declarations and code warning
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-09 12:07:06 +02:00
Peter Ross
20f9cfb3e3 avcodec/siren: decode_vector: remove unused parameter
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-09 18:38:16 +10:00
Peter Ross
e8aec714d3 avcodec/siren: replace magic numbers with macro value
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-09 18:38:16 +10:00
Adam Chelminski
715f63232f avcodec/libvpxenc: Apply codec options to alpha codec context
When encoding yuva420 (alpha) frames, the vpx encoder uses a second
vpx_codec_ctx to encode the alpha stream. However, codec options were
only being applied to the primary encoder. This patch updates
codecctl_int and codecctl_intp to also apply codec options to the alpha
codec context when encoding frames with alpha.

This is necessary to take advantage of libvpx speed optimizations
such as 'row-mt' and 'cpu-used' when encoding videos with alpha.
Without this patch, the speed optimizations are only applied to the
primary stream encoding, and the overall encoding is just as slow
as it would be without the options specified.

Signed-off-by: Adam Chelminski <chelminski.adam@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2021-09-08 18:48:00 -07:00
Andreas Rheinhardt
41751e4aef avcodec/iirfilter: Make ff_iir_filter_flt() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
854f7bab5a avcodec/snow_dwt: Make ff_snow_(horizont|vertic)al_compose97i static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
faa62773cb avcodec/jpeg2000: Make ff_tag_tree_size() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
fc9cb7d51a avcodec/mqcenc: Make ff_mqc_flush() static
Only used as an auxiliary function for ff_mqc_flush_to() since
4624656797.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
25394eb72e avcodec/qsv: Make ff_qsv_map_error() static
It is only an auxiliary function to ff_qsv_print_(error|warning)().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
029bfc3501 avcodec/h263dec: Make ff_h263_hw_config_list static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
fd43b868e1 avcodec/cbs: Make ff_cbs_alloc_unit_data() static
Forgotten in 7c92eaace2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
97bc4695fb avcodec/bsf: ff_list_bsf static
It is a special BSF that is only available via the av_bsf_list-API;
it is not part of the list generated from the declarations in
bitstream_filters.c and therefore needn't have external linkage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Artem Galin
776d5a7472 libavcodec/qsv: enabling d3d11va support, added mfxhdlpair
Adding DX11 relevant device type checks and adjusting callbacks with
proper MediaSDK pair type support.

Extending structure for proper MediaSDK pair type support.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:42:52 -03:00
Michael Niedermayer
2d36d2fbd7 avcodec/h264_parser: Fix nalsize check
Fixes: Assertion failure
Fixes: 37463/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4914693494931456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-08 20:14:00 +02:00
Paul B Mahol
9e33572b3d avcodec/mlpenc: simplify some complicated expressions more 2021-09-07 18:16:13 +02:00
Paul B Mahol
1cbd4b00b1 avcodec/mlpenc: simplify strange pointer initializations 2021-09-07 18:16:13 +02:00
Paul B Mahol
5d92b73c64 avcodec/mlpdec: fix integer sanitizer warning under clang
Fixes:
libavcodec/mlpdec.c:1108:37: runtime error: negation of 1 cannot be represented in type 'unsigned int'
2021-09-07 18:16:13 +02:00
Peter Ross
c655a734b1 avcodec/siren: MSN Siren decoder
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-07 18:07:11 +10:00
Paul B Mahol
b9426f371a avcodec/mlpenc: remove convoluted incomplete multiple substreams support code
It is very hard to follow data structures indirections in current code,
so just remove it for now.
2021-09-07 00:18:33 +02:00
Paul B Mahol
e811b0080e avcodec/mlpenc: use variables local to for loops 2021-09-07 00:18:33 +02:00
Limin Wang
75001ae844 avcodec/nvenc: add constrainedFrame encoding support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:25:26 +02:00
Limin Wang
3756525a59 avcodec/nvenc: add single slice intra refresh support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:13:00 +02:00
Limin Wang
e6bd5171ac avcodec/nvenc: add intra refresh support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:12:57 +02:00
Limin Wang
85489e0308 avcodec/nvenc: make number of slices per frame configurable
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 13:33:53 +02:00
Michael Niedermayer
3c659f8618 avcodec/jpeg2000dec: Check that atom header is within bytsetream
Fixes: Infinite loop
Fixes: 36666/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5912760671141888

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>
2021-09-05 22:22:27 +02:00
Michael Niedermayer
33feb527ff avcodec/apedec: Fix 2 integer overflows in filter_3800()
Fixes: signed integer overflow: 1683879955 - -466265224 cannot be represented in type 'int'
Fixes: 37419/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6074294407921664

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>
2021-09-05 22:22:27 +02:00
Michael Niedermayer
e58692837c avcodec/xpmdec: Move allocations down after more error checks
Fixes: Timeout
Fixes: 37035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XPM_fuzzer-5142718576721920

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>
2021-09-05 22:22:05 +02:00
Michael Niedermayer
26659fe53e avcodec/argo: Move U, fix shift
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 37249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5754862984888320

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>
2021-09-05 22:22:05 +02:00
Paul B Mahol
0c87b43c6c avcodec/mlp: move sync defines to common header 2021-09-05 18:12:56 +02:00
Paul B Mahol
3ea0171ea3 avcodec/mlpenc: remove frame_size array from private context
It is supposed to be used with different bit depth and/or sample rates
per each substream, but such currently not implemented feature is not
important and current state causes problems when implementing variable
restart interval to fix decoding with sample rates not multiple of 40.
2021-09-05 16:08:19 +02:00
Paul B Mahol
5852bb6b4b avcodec/mlpenc: stop using hardcoded value 2021-09-05 15:02:39 +02:00
Paul B Mahol
ac29cec312 avcodec/mlpenc: use av_shrink_packet() 2021-09-05 14:09:50 +02:00
Paul B Mahol
cfc491bf44 avcodec/mlpenc: remove no more needed goto 2021-09-05 14:09:50 +02:00
Paul B Mahol
4ca9877b91 avcodec/mlpenc: fix removal of packet timestamp/size from queue 2021-09-05 12:15:34 +02:00
Paul B Mahol
d8863013a8 avcodec/mlpenc: remove not needed buf_size checks 2021-09-05 11:44:50 +02:00
Paul B Mahol
85b9b96957 avcodec/mlpenc: fix indentation 2021-09-05 11:44:50 +02:00
Paul B Mahol
036d94da43 avcodec/mlpenc: stop returning packets with no data 2021-09-05 11:44:50 +02:00
Paul B Mahol
589cd58c85 avcodec/mlpenc: simplify compare_best_offset() 2021-09-05 00:28:40 +02:00
Paul B Mahol
5b28a5db03 avcodec/mlpenc: use ff_ctz() 2021-09-05 00:11:40 +02:00
Paul B Mahol
d18b445689 avcodec/mlpenc: remove unused item 2021-09-05 00:09:55 +02:00
Paul B Mahol
19b52a7cc4 avcodec/mlpenc: remove log messages when allocation fails at init 2021-09-04 14:46:40 +02:00