Commit Graph

107467 Commits

Author SHA1 Message Date
Andreas Rheinhardt 538cbaf18e fate/pcm: Add pcm_dvd transcode tests
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-10 16:58:58 +02:00
Andreas Rheinhardt d0b050562a avcodec/pcm-dvdenc: Fix encoding 24bit samples
The earlier code ignored the lower 16 bits and instead used
the highest 8 bits twice.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-10 16:58:43 +02:00
Andreas Rheinhardt 7259eef711 avcodec/pcm-dvdenc: Remove unused extra_sample(s|_count)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-10 16:58:07 +02:00
dvhh c6fdbe26ef configure: fix SDL2 version check for pkg_config fallback
pkg_config fallback for SDL2 use 2.1.0 as max (excluded) version
where the pkg_config specify 3.0.0
Correcting fallback version to be in line with the pkg_config version

Signed-off-by: dvhh <dvhh@yahoo.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-09 21:33:38 +02:00
Wenbin Chen bd7dae7daf avcodec/mpegvideo_enc: Unify the code style
Change whitespace and add newline to unify the code style.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-09 21:05:02 +02:00
Wenbin Chen 76b33704b6 avcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb()
For 422 frames we should not use hard coded 8 to calculate mb size for
uv plane. Chroma shift should be taken into consideration to be
compatiple with different sampling format.

The error is reported by fate test when av_cpu_max_align() return 64
on the platform supporting AVX512. This is a hidden error and it is
exposed after commit 17a59a634c.

mpeg2enc has a mechanism to reuse frames. When it computes SSE (sum of
squared error) on current mb, reconstructed mb will be wrote to the
previous mb space, so that the memory can be saved. However if the align
is 64, the frame is shared in somewhere else, so the frame cannot be
reused and a new frame to store reconstrued data is created. Because the
height of mb is wrong when compute sse on 422 frame, starting from the
second line of macro block, changed data is read when frame is reused
(we need to read row 16 rather than row 8 if frame is 422), and unchanged
data is read when frame is not reused (a new frame is created so the
original frame will not be changed).

That is why commit 17a59a634c exposes this
issue, because it add av_cpu_max_align() and this function return 64 on
platform supporting AVX512 which lead to creating a frame in mpeg2enc,
and this lead to the different outputs.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-09 21:05:02 +02:00
Andreas Rheinhardt 8393c0721a avcodec/hevc_cabac: Don't cast const away unnecessarily
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:29:26 +02:00
Andreas Rheinhardt c34e3920f2 avcodec/hevc_refs: Constify ff_hevc_get_ref_list()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:28:02 +02:00
Andreas Rheinhardt 5f176bbc9a fate/h264: Add Active Format Descriptor test
Some samples contain Active Format Descriptors, yet the output
of no test depends upon them, so that they are de-facto untested.
So add a dedicated test for them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:24:31 +02:00
Andreas Rheinhardt c6134ce65f fftools/ffprobe: Improve description of AFD side data
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:21:31 +02:00
Andreas Rheinhardt aba0cc4465 avcodec/hevc_sei: Use proper type for NALU type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:19:29 +02:00
Andreas Rheinhardt 6f5e0a7294 avformat/flvenc: Add deinit function
Fixes memleaks when the trailer is never written or when shift_data()
fails when writing the trailer.

Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:16:39 +02:00
Andreas Rheinhardt 75a2d25a6f avcodec/h26[45]_metadata_bsf: Fix range of chroma_sample_loc_type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:10:21 +02:00
Andreas Rheinhardt 12392ffee5 avcodec/hevc_ps: Fix wrong copyright years
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:10:11 +02:00
Andreas Rheinhardt 3524e82a08 avcodec/dv: Remove unnecessary header
Forgotten in 6d484671ec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:06:47 +02:00
Andreas Rheinhardt ad5040a442 avcodec/cbs: Mark init and close functions as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:05:14 +02:00
Andreas Rheinhardt e4f7a2b003 avcodec/encode: Avoid check whose result is known in advance
encode_send_frame_internal() is always only called if
the buffer packet is empty and except when we are dealing
with an audio codec that does not allow variable frame size
it stays that way until a call to av_frame_ref() at the end
of encode_send_frame_internal(). In case we are dealing
with the small last frame of an audio encoder requiring
constant frame size the frame will be allocated by pad_last_frame()
and this the only case where this is so. So by returning directly
after pad_last_frame(), we can avoid having to recheck
whether the frame is still empty before av_frame_ref().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 20:03:37 +02:00
Andreas Rheinhardt a256426411 avformat/movenc: Ensure packet is writable before modifying it
Fixes e.g.

ffmpeg -i fate-suite/h264/bbc2.sample.h264 -c:v rawvideo -map 0:v -frames:v 10 -pix_fmt gray8 -f tee "first.mov|second.mov"

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:53 +02:00
Andreas Rheinhardt dc977f94d5 fftools/ffprobe: Add const to AVPacket data pointers
These packets need not be writable (and are not modified by us),
so it is best to access them via const uint8_t*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:53 +02:00
Andreas Rheinhardt 4ad686269d avcodec: Add const to decoder packet data pointers
The packets given to decoder need not be writable,
so it is best to access them via const uint8_t*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:53 +02:00
Andreas Rheinhardt d5a0eba8a2 av(format|device): Add const to muxer packet data pointers
The packets given to muxers need not be writable,
so it is best to access them via const uint8_t*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:53 +02:00
Andreas Rheinhardt 417554bdd6 avformat/apngenc: Add const where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:53 +02:00
Andreas Rheinhardt 05e96e6933 avformat/apngenc: Don't modify input packet
It might not be writable at this point.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:53 +02:00
Andreas Rheinhardt f89446eaff avformat/apngenc: Check fcTL size
The remaining code relies on it having the value it should have.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:53 +02:00
Andreas Rheinhardt 3204572a1a avformat/apngenc: Check for incomplete chunks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:52 +02:00
Andreas Rheinhardt e4a10dd637 avcodec/apng: Add APNG_FCTL_CHUNK_SIZE define
Also use it where appropriate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09 19:37:52 +02:00
Brion Vibber 66a251e836 Support for 16:9 DV in QuickTime
Some files I have from circa year 2000 are 16:9 NTSC DV video
encoded as QuickTime with Radius SoftDV. This marked 4:3 videos
with the box 'dvc ' for NTSC or 'dvcp' for PAL, which are already
supported, but 16:9 videos as 'dvl ' or 'dvlp', which were not.

Adding these to the list for DV codec processing gives the
expected metadata and playback.

I have not tested PAL as I have no sample data, only NTSC.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-09 19:03:28 +02:00
Paul B Mahol fc1ca18fcf avfilter/vf_xfade: add two more transitions 2022-07-09 16:55:50 +02:00
James Almer f9785a78da avcodec/aacdec: fix parsing of dual mono files
Dual mono files report a channel count of 2 with each individual channel in its
own SCE, instead of both in a single CPE as is the case with standard stereo.
This commit handles this non default channel configuration scenario.

Fixes ticket #1614

Signed-off-by: James Almer <jamrial@gmail.com>
2022-07-08 10:05:24 -03:00
Nicolas Gaullier d3cf7be5a4 fftools: Fix preset search pathes
regression since 13350e81fd

Fix looking for .ffmpeg subfolder in FFMPEG_DATADIR and inversely not in HOME.
Fix search order (documentation).

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2022-07-08 13:58:49 +02:00
Andreas Schneider 59018254c7 avcodec/openh264: return (DE|EN)CODER_NOT_FOUND if version check fails
A cosmetic change only, it basically just changes the user facing error message
to clients that interpret the errors to something that makes sense.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-08 00:49:37 +02:00
Michael Niedermayer c9a2996544 avformat/sctp: close socket on errors
This is untested as i have no testcase

Fixes: CID1302709

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer b418ad75c2 avcodec/flashsv: Clear pointers
Fixes: Use after free
Fixes: 47399/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLASHSV2_fuzzer-5718646686613504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer 4ff654e030 tools/target_dec_fuzzer: Adjust threshold for SIMBIOSIS_IMX
Fixes: Timeout
Fixes: 47892/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIMBIOSIS_IMX_fuzzer-5160609278197760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer 884a108121 avformat/cinedec: Check size and pos more
Fixes: signed integer overflow: 9223372036848019263 + 134232320 cannot be represented in type 'long'
Fixes: 48155/clusterfuzz-testcase-minimized-ffmpeg_dem_CINE_fuzzer-5751429207293952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer 9f77af177a tools/target_dec_fuzzer: Adjust threshold for ARGO
Fixes: Timeout
Fixes: 48002/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-6187041768996864

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer af2ed09220 avcodec/aasc: Fix indention
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer 8f6432cd77 avcodec/flashsv: Check inflate() for failure
Fixes: CID1047223

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer 7796d740bd avcodec/smacker: fix indention after previous commit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer 08e82e5b57 avcodec/smacker: Optimize constant 16bit audio output
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Michael Niedermayer 5c2fa59f32 tools/target_dec_fuzzer: Adjust threshold for smacker audio
Fixes: Timeout
Fixes: 47043/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-4824799337119744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-07 21:52:52 +02:00
Marton Balint b54f3e32fa avformat/img2enc: use unmatched filename for an invalid or missing sequence pattern
Also warn the user that for single images -update should be used, for sequences
a proper pattern should be specified.

Fixes ticket #9748.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-07 20:23:06 +02:00
Marton Balint 3f2de562c3 avformat/img2enc: fix first image check
Start image number was hardcoded to 1 for the first image check.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-07 20:23:06 +02:00
Paul B Mahol 6ed9eaf664 avfilter: add remap opencl filter 2022-07-07 17:52:32 +02:00
Marton Balint 03d81a044a avformat/mov: disallow a zero sample size in trun atoms
In order to not generate 0 sized packets or create a huge index table
needlessly.

Fixes: Timeout
Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304
Fixes: 45738/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6142535657979904

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-07-06 23:37:29 +02:00
Marton Balint 7acc124121 Revert "avformat/demux: Make read_frame_internal() return AVERREOR(EAGAIN) on stuck empty input parser"
Hides the underlying real problem with a demuxer returning 0 sized packets.

This reverts commit 02699490c1.
2022-07-06 23:37:29 +02:00
Marton Balint dbc3b5a902 Revert "avformat/demux: Count EAGAIN as 100 bytes in relation to read limit in avformat_find_stream_info()"
Modifying avformat_find_stream_info() behaviour based on the number of EAGAINs
it encounters is a hack which usually only hides the real issue if such thing
happen.

This reverts commit b0cac7082d.
2022-07-06 23:37:29 +02:00
Andreas Rheinhardt aca09ed7d4 avutil/mem: Handle fast allocations near UINT_MAX properly
av_fast_realloc and av_fast_mallocz? store the size of
the objects they allocate in an unsigned. Yet they overallocate
and currently they can allocate more than UINT_MAX bytes
in case a user has requested a size of about UINT_MAX * 16 / 17
or more if SIZE_MAX > UINT_MAX (and if the user increased
max_alloc_size via av_max_alloc). In this case it is impossible
to store the true size of the buffer via the unsigned*;
future requests are likely to use the (re)allocation codepath
even if the buffer is actually large enough because of
the incorrect size.

Fix this by ensuring that the actually allocated size
always fits into an unsigned. (This entails erroring out
in case the user requested more than UINT_MAX.)

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-06 22:53:15 +02:00
Paul B Mahol 42518d8dd0 avcodec/exrenc: add av_cold to some functions 2022-07-06 19:41:44 +02:00
Timo Rothenpieler 85bc6b5abf avcodec/nvenc: add support for additional (10 bit) RGB pixel formats 2022-07-05 18:27:37 +02:00