Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-06avfilter/vf_scale: overwrite the width and height expressions with the ↵James Almer
original values Instead of the potentially adjusted ones. Otherwise, if config_props() is called again and if using force_original_aspect_ratio, the already adjusted values could be altered again. Example command line scale=size=1920x1000:force_original_aspect_ratio=decrease:force_divisible_by=2 user value 1920x1000 -> 1920x798 on init_dict() -> 1918x798 on frame change when eval_mode == EVAL_MODE_INIT, which after e645a1ddb9 could be at the very first frame. Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-06avcodec/decode: remove superfluous initial channels fieldsJames Almer
They are internal, so there's no need to keep them around as they are just duplicate functionality. Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-06lavc/pthread_frame: avoid leaving stale hwaccel state in worker threadsAnton Khirnov
This state is not refcounted, so make sure it always has a well-defined owner. Remove the block added in 091341f2ab5bd35ca1a2aae90503adc74f8d3523, as this commit also solves that issue in a more general way.
2022-09-06lavc: fix and extend AVCodecContext.hwaccel_context doxyAnton Khirnov
Mention: - that it is legacy and optional (every hwaccel that uses it can also work with hwcontext, though some optional information can only be signalled throught hwaccel_context) - that it can be used for encoders (only qsvenc currently) - ownership and lifetime
2022-09-06aarch64/tx_float: fix compilationLynne
Forgot to add the new function arguments.
2022-09-06checkasm/tx: add checkasm support for the iMDCTLynne
2022-09-06x86/tx_float: implement inverse MDCT AVX2 assemblyLynne
This commit implements an iMDCT in pure assembly. This is capable of processing any mod-8 transforms, rather than just power of two, but since power of two is all we have assembly for currently, that's what's supported. It would really benefit if we could somehow use the C code to decide which function to jump into, but exposing function labels from assebly into C is anything but easy. The post-transform loop could probably be improved. This was somewhat annoying to write, as we must support arbitrary strides during runtime. There's a fast branch for stride == 4 bytes and a slower one which uses vgatherdps. Zen 3 benchmarks for stride == 4 for old (av_imdct_half) vs new (av_tx): 128pt: 2811 decicycles in av_tx (imdct),16775916 runs, 1300 skips 3082 decicycles in av_imdct_half,16776751 runs, 465 skips 256pt: 4920 decicycles in av_tx (imdct),16775820 runs, 1396 skips 5378 decicycles in av_imdct_half,16776411 runs, 805 skips 512pt: 9668 decicycles in av_tx (imdct),16775774 runs, 1442 skips 10626 decicycles in av_imdct_half,16775647 runs, 1569 skips 1024pt: 19812 decicycles in av_tx (imdct),16777144 runs, 72 skips 23036 decicycles in av_imdct_half,16777167 runs, 49 skips
2022-09-06x86/tx_float: add support for calling assembly functions from assemblyLynne
Needed for the next patch. We get this for the extremely small cost of a branch on _ns functions, which wouldn't be used anyway with assembly.
2022-09-06tools/.gitignore: Add missing toolsAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-06avcodec/libtheoraenc: Do not use invalid error codeAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-06ref/fate/ffprobe_xsd: Change ref fileAndreas Rheinhardt
Forgotten in 5c16df1b92c519238e10664eeab3adb3b9016edd, because neither I nor patchwork ran fate with xmllint. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/x86/flacdsp_init: Remove double ';'Andreas Rheinhardt
Inside a function, the second ';' in ";;" is just a null statement, but it is actually illegal outside of functions. Compilers nevertheless accept it without warning, except when in -pedantic mode when e.g. Clang emits a -Wextra-semi warning. Therefore remove the unnecessary ';'. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Write CodecDelay for codecs != OpusAndreas Rheinhardt
The field is not specific to Opus. The mp2fixed encoder signals initial_padding and is used by both the matroska-encoding-delay test as well as the lavf-mkv tests which necessitated several FATE ref changes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Use custom min timestampAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/mux: Allow muxers to set custom min timestampAndreas Rheinhardt
Matroska requires pts to be >= 0 with a slight exception: It has a mechanism to deal with codec delay, i.e. with the data added at the beginning that does not correspond to actual input data and should be discarded by the player. Only the audio actually intended to be output needs to have a timestamp >= 0. In order to avoid unnecessary timestamp shifting, this patch allows muxers to inform the shifting code about this so that it can take it into account. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Actually apply timestamp offset for OpusAndreas Rheinhardt
Matroska generally requires timestamps to be nonnegative, but there is an exception: Data that corresponds to encoder delay and is not supposed to be output anyway can have a negative timestamp. This is achieved by using the CodecDelay header field: The demuxer has to subtract this value from the raw (nonnegative) timestamps of the corresponding track. Therefore the muxer has to add this value first to write this raw timestamp. Support for writing CodecDelay has been added in FFmpeg commit d92b1b1babe69268971863649c225e1747358a74 and in Libav commit a1aa37dd0b96710d4a17718198a3f56aea2040c1. The former simply wrote the header field and did not apply any timestamp offsets, leading to desynchronisation (if one uses multiple tracks). The latter applied it at two places, but not at the one where it actually matters, namely in mkv_write_block(), leading to the same desynchronisation as with the former commit. It furthermore used the wrong stream timebase to convert the delay to the stream's timebase, as the conversion used the timebase from before avpriv_set_pts_info(). When the latter was merged in 82e4f39883932c1b1e5c7792a1be12dec6ab603d, it was only done in a deactivated state that still did not offset the timestamps when muxing due to "assertion failures and av sync errors". a1aa37dd0b96710d4a17718198a3f56aea2040c1 made it definitely more likely to run into assertion failures (namely if the relative block timestamp doesn't fit into an int16_t). Yet all of the above issues have been fixed (in commits 962d63157322466a9a82f9f9d84c1b6f1b582f65, 5d3953a5dcfd5f71391b7f34908517eb6f7e5146 and 4ebeab15b037a21f195696cef1f7522daf42f3ee. This commit therefore enables applying CodecDelay, fixing ticket #7182. There is just one slight regression from this: If one has input with encoder delay where the first timestamp is negative, but the pts of the part of the data that is actually intended to be output is nonnegative, then the timestamps will currently by default be shifted to make them nonnegative before they reach the muxer; the muxer will then ensure that the shifted timestamps are retained. Before this commit, the muxer did not ensure this; instead the timestamps that the demuxer will output were shifted and if the first timestamp of the actually intended output was zero before shifting, then this unintentional shift just cancels the shift performed before the packet reached the muxer. (But notice that this only applies if all the tracks use the same CodecDelay, or the relative sync between tracks will be impaired.) This happens in the matroska-opus-remux and matroska-ogg-opus-remux FATE tests. Future commits will forward the information that the Matroska muxer has a limited capability to handle negative timestamps so that the shifting in libavformat can take advantage of it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Don't override samplerate for CodecDelayAndreas Rheinhardt
Opus can be decoded to multiple samplerates (namely 48kHz, 24KHz, 16Khz, 12 KHz and 8Khz); libopus as well as our encoder wrapper support these sample rates. The OpusHead contains a field for this original samplerate. Yet the pre-skip (and the granule-position in the Ogg-Opus mapping in general) are always in the 48KHz clock, irrespective of the original sample rate. Before commit c3c22bee6362737cf290929b7f31df9fb88da983, our libopus encoder was buggy: It did not account for the fact that the pre-skip field is always according to a 48kHz clock and wrote a too small value in case one uses the encoder with a sample rate other than 48kHz; this discrepancy between CodecDelay and OpusHead led to Firefox rejecting such streams. In order to account for that, said commit made the muxer always use 48kHz instead of the actual sample rate to convert the initial_padding (in samples in the stream's sample rate) to ns. This meant that both fields are now off by the same factor, so Firefox was happy. Then commit f4bdeddc3cab807e43e0450744dfe9a45661e1d7 fixed the issue in libopusenc; so the OpusHead is correct, but the CodecDelay is still off*. This commit fixes this by effectively reverting c3c22bee6362737cf290929b7f31df9fb88da983. *: Firefox seems to no longer abort when CodecDelay and OpusHead are off. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avformat/matroskaenc: Only write DiscardPadding if nonzeroAndreas Rheinhardt
It is possible for the trailing padding to be zero, namely e.g. if the AV_PKT_DATA_SKIP_SAMPLES side data is used for leading padding. Matroska supports this (use a negative DiscardPadding), but players do not; at least Firefox refuses to play such a file. So for now only write DiscardPadding if it is trailing padding and nonzero. The fate-matroska-ogg-opus-remux was affected by this. (I wish CodecDelay would not exist and DiscardPadding would be used to instead trim the codec delay away (with the Block timestamp corresponding to the time at which the actually output audio is output).) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05fate/matroska: Add tests for muxing with initial_paddingAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05fftools/ffprobe: Report initial and trailing paddingAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/cfhddata: Reduce stack usageAndreas Rheinhardt
Creating CFHD RL VLC tables works by first extending the codes by the sign, followed by creating a VLC, followed by deriving the RL VLC from this VLC (which is then discarded). Extending the codes uses stack arrays. The tables used to initialize the VLC are already sorted from left-to-right in the tree. This means that the corresponding VLC entries are generally also ascending, but not always: Entries from subtables always follow the corresponding main table although it is possible for the right-most node to fit into the main table. This suggests that one can try to use the final destination buffer as scratch buffer for the tables with sign included. Unfortunately it works for neither of the tables if one uses the right-most part of the RL VLC buffer as scratch buffer; using the left-most part of the RL VLC buffer as scratch buffer might work if one traverses the VLC entries from end to start. But it works only for the little RL VLC (table 9), not for table 18. Therefore this patch uses the RL VLC buffer for table 9 as scratch buffer for creating the bigger table 18. Afterwards the left part of the buffer for table 9 is used as scratch buffer to create table 9. This fixes the cfhd part of ticket #9399 (if it is not already fixed). Notice that I do not consider the previous stack usage excessive. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/cfhd, cfhddata: Free VLC as soon as it is not neededAndreas Rheinhardt
The VLC is only used to initialize RL VLC. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/cfhddata: Avoid code duplication when creating codebooksAndreas Rheinhardt
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/cfhddata: Avoid code tablesAndreas Rheinhardt
cfhddata.c initializes a RL VLC table via code tables and corresponding tables for length, run and level. code and length tables are used to initialize a VLC, no symbol table is used. Afterwards the symbols of said VLC are just the indices of the corresponding entries in the code and length table that were used for initialization; they can therefore be used to get the matching level and run entry and they are not used for anything else. Therefore one can just permute these tables without changing the resulting RL VLC tables. This commit does just this. It permutes these tables so that the code tables are ordered from left to right in the resulting tree and then switches to ff_init_vlc_from_lengths(), which allows to remove the codes table altogether. Given that these tables are constructed on the stack, this also reduces stack usage, potentially fixing part of #9399. (The size of the tables on the stack decreases from 4752 to 2640.) Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/cfhd, cfhddata: Simplify check for escapeAndreas Rheinhardt
cfhd.c checked for level being equal to a certain codebook- dependent constant and to run being two. The first check is actually redundant, as all codebooks contain only one (real) entry with run == 2 (as is usual with VLCs, this one real entry has several corresponding entries in the table). But given that no entry has a run of zero (except incomplete entries which just signal that one needs to do another round of parsing), one can actually use that as sentinel. This patch does so. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/flac: smallest frame is 10 bytesPaul B Mahol
Fixes #9270
2022-09-05avcodec/x86/flacdsp: fix bug in decorrelationPaul B Mahol
Fixes #9297
2022-09-05lavu/fifo: clarify interaction of AV_FIFO_FLAG_AUTO_GROW with av_fifo_write()Anton Khirnov
2022-09-05lavu/fifo: clarify interaction of AV_FIFO_FLAG_AUTO_GROW with ↵Anton Khirnov
av_fifo_can_write()
2022-09-05lavu/fifo: add the header to its own doxy groupAnton Khirnov
Also, drop mentions of it being a circular buffer, as this is an internal implementation detail that should be invisible to the caller.
2022-09-05lavf/mov: avoid leaks with multiple dv-audio streamsAnton Khirnov
2022-09-05lavf/dv: do not update AVCodecParameters.sample_rate while demuxingAnton Khirnov
Demuxers are not allowed to do this and few callers, if any, will handle this correctly. Send the AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE side data instead.
2022-09-05lavf/dv: set audio bitrate only at stream creationAnton Khirnov
Demuxers are not supposed to update AVCodecParameters after the stream was seen by the caller. This value is not important enough to support dynamic updates for.
2022-09-05lavf/dv: set non-changing AVStream fields only onceAnton Khirnov
2022-09-05lavf/dv: forward errors from avformat_new_stream()Anton Khirnov
2022-09-05lavf/dv: return a meaningful error code from avpriv_dv_produce_packet()Anton Khirnov
2022-09-05lavf/dv: make returning the video packet optionalAnton Khirnov
The mov demuxer only returns DV audio, video packets are discarded. It first reads the data to be parsed into a packet. Then both this packet and the pointer to its data are passed together to avpriv_dv_produce_packet(), which parses the data and partially overwrites the packet. This is confusing and potentially dangerous, so just pass NULL and avoid pointless packet modification.
2022-09-05lavc/dv: rename constants to follow our naming conventionsAnton Khirnov
CamelCase for enum tags, ALL_CAPS for enum values.
2022-09-05lavc/dv.h: move encoder/decoder-specific code to a new headerAnton Khirnov
dv.h is also used by libavformat, so avoid exposing encoder/decoder code to it.
2022-09-05lavc/dvenc: stop using DVVideoContextAnton Khirnov
Move the parts of it used by the encoder into a new DVEncContext and remove DVVideoContext.
2022-09-05lavc/dvdec: stop using DVVideoContextAnton Khirnov
The struct is quite small and the decoder and the encoder use different fields from it, so benefits from reusing it are small. This allows making the buf field const.
2022-09-05lavc/dv: do not pass DVVideoContext to dv_calculate_mb_xy()Anton Khirnov
Pass the two variables needed from it directly. This is done in preparation to splitting DVVideoContext.
2022-09-05lavc/dv: do not pass DVVideoContext to ff_dv_init_dynamic_tables()Anton Khirnov
It only needs work_chunks from it, so pass that directly. This is done in preparation to splitting DVVideoContext.
2022-09-05lavc/dv: remove ff_dvvideo_init()Anton Khirnov
The function contains only two assignments, setting DVVideoContext.avctx and AVCodecContext.chroma_sample_location. However, the decoder does not use the former, and the encoder should not be setting the latter. Therefore move the first assignment to dvenc and the second to dvdec. Make the encoder warn if the user-signalled chroma sample location does not match the supported one, and return an error on higher compliance levels.
2022-09-05lavc/dvdec: drop the only use of DVVideoContext.avctxAnton Khirnov
The function gets the codec context parameter directly.
2022-09-05lavf/dv: always provide avpriv_dv_* symbolsAnton Khirnov
They are used from libavdevice.
2022-09-05lavf/dv: remove DVMuxContext declaration from dv.hAnton Khirnov
DVMuxContext is only used inside dvenc.c, there is no reason for it to be visible outside of that file.
2022-09-05avutil/tests/.gitignore: Add channel_layout testtoolAndreas Rheinhardt
Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-05avcodec/speedhq: Check widthMichael Niedermayer
Fixes: out of array access Fixes: 50014/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEDHQ_fuzzer-4748914632294400 Alternatively the buffer size can be increased Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-04avformat/avisynth: reindentStephen Hutchinson
Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>