summaryrefslogtreecommitdiffstats
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/apedec: Fix integer overflows in predictor_update_3930()Michael Niedermayer2022-01-131-8/+8
| | | | | | | | | | Fixes: signed integer overflow: 1074134419 - -1075212485 cannot be represented in type 'int' Fixes: 43273/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4706880883130368 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 0c9c9bbd01bd82c35b6a908592d9dd6d9f4bd4a0) Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/libdav1d: explicitly set Dav1dSettings.apply_grainJames Almer2022-01-101-2/+2
| | | | | | | Don't depend on its default value being 1, as that could change anytime. Signed-off-by: James Almer <[email protected]> (cherry picked from commit 6c4074e4234edacfb3f37184fd68771df3cb2b7f)
* avcodec/nvenc: zero-initialize NV_ENC_REGISTER_RESOURCE structTimo Rothenpieler2022-01-101-1/+1
|
* avcodec/v4l2_context: send start decode command after dynamic resolution ↵Ming Qian2022-01-091-0/+18
| | | | | | | | | | | | | | | | | | | change event Fixes decoding of sample https://streams.videolan.org/ffmpeg/incoming/720p60.mp4 on RPi4 after kernel driver commit: staging: bcm2835-codec: Format changed should trigger drain Reference: linux/Documentation/userspace-api/media/v4l/dev-decoder.rst "A source change triggers an implicit decoder drain, similar to the explicit Drain sequence. The decoder is stopped after it completes. The decoding process must be resumed with either a pair of calls to VIDIOC_STREAMOFF and VIDIOC_STREAMON on the CAPTURE queue, or a call to VIDIOC_DECODER_CMD with the V4L2_DEC_CMD_START command." Reviewed-by: Andriy Gelman <[email protected]> Signed-off-by: Ming Qian <[email protected]>
* avcodec/v4l2_context: don't reinit output queue on dynamic resolution change ↵Ming Qian2022-01-091-25/+2
| | | | | | | | | | | | | | | | | event Reference: linux/Documentation/userspace-api/media/v4l/dev-decoder.rst "During the resolution change sequence, the OUTPUT queue must remain streaming. Calling VIDIOC_STREAMOFF() on the OUTPUT queue would abort the sequence and initiate a seek. In principle, the OUTPUT queue operates separately from the CAPTURE queue and this remains true for the duration of the entire resolution change sequence as well." Reviewed-by: Andriy Gelman <[email protected]> Signed-off-by: Ming Qian <[email protected]>
* lavc/av1dec: use frame split bsfFei Wang2022-01-081-0/+1
| | | | | | | | | | Split packed data in case of its contains multiple show frame in some non-standard bitstream. This can benefit decoder which can decode continuously instead of interrupt with unexpected error. Signed-off-by: Fei Wang <[email protected]> Signed-off-by: Haihao Xiang <[email protected]> (cherry picked from commit 7787cca18016c1f8100ab158f3479ba4b7e70467)
* aarch64: Disable ff_hevc_sao_band_filter_8x8_8_neon out of precautionMartin Storsjö2022-01-071-1/+5
| | | | | | | | | | | While this function on its own passes all of fate-hevc, there's indications that the function might need to handle widths that aren't a multiple of 8 (noted in commit f63f9be37c799ddc835af358034630d31fb7db02, which later was reverted). Signed-off-by: Martin Storsjö <[email protected]> (cherry picked from commit 24b93022fee322c7a17e326e2d162a1fbc3698ee)
* avcodec/libdav1d: honor the requested strict_std_compliance level on ↵James Almer2022-01-061-0/+3
| | | | | | | supported builds Signed-off-by: James Almer <[email protected]> (cherry picked from commit 3e17e0e5eff896f43654635bd3219da56f807f11)
* avcodec/Makefile: Add missing entry for ADPCM_IMA_AMV_ENCODERAndreas Rheinhardt2022-01-061-0/+1
| | | | | | | | Forgotten in 555f5c1fc5ae0c4e7b0431dc3166c3fcf3f4e979. Reviewed-by: Zane van Iperen <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> (cherry picked from commit df4cb384fb68454e23f8cc2b369e344c1bd8be7d)
* avcodec/Makefile: Only compile nvenc.o if neededAndreas Rheinhardt2022-01-051-3/+2
| | | | | | | | | | | | This fixes compilation errors in case nvenc is enabled (e.g. autodected) with both nvenc-based encoders disabled because nvenc uses ff_alloc_a53_sei(), yet only the nvenc-based encoders require atsc_a53. (This error does not manifest itself in case of static linking (nothing pulls in nvenc.o), but it exists with shared builds.) Signed-off-by: Andreas Rheinhardt <[email protected]> Signed-off-by: Timo Rothenpieler <[email protected]>
* avcodec/Makefile: Add missing HEVC decoder->h274.o dependencyAndreas Rheinhardt2022-01-051-1/+2
| | | | | | | Forgotten in 3cc3f5de2afda5b8f880c0817e9d67c2dafbfe1e. Signed-off-by: Andreas Rheinhardt <[email protected]> (cherry picked from commit aa8bb05d29599fb5372a715d30c290c7b723c24b)
* avcodec/Makefile: Add missing mpegaudiodata.o dependency to MPEGAUDIOAndreas Rheinhardt2022-01-051-1/+2
| | | | | | | | | | | | | | | mpegaudiodec_template.c uses stuff from mpegaudiodata directly, yet this dependency was only indirectly fulfilled via mpegaudio-headers before 33e6d57f01dd4742a2e25ac5fa072b487d9d02ce. Since this commit, the latter only needs (and therefore provides) mpegaudiotabs, leading to compilation failures. This commit adds this missing direct dependency directly. (Sorry for not having checked indirect dependencies.) Found-by: Zane van Iperen <[email protected]> Reviewed-by: Zane van Iperen <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> (cherry picked from commit 07fd34aca744d6ae64cd4756943ce508ee0f9973)
* avcodec/videotoolbox: Fix undefined symbol with minimal configurationLimin Wang2022-01-051-0/+2
| | | | | | | | | | | | | | | | | Please reproduced with the following minimal configure command: ./configure --enable-shared --disable-all --enable-avcodec --enable-decoder=h264 --enable-hwaccel=h264_videotoolbox You'll get below error: Undefined symbols for architecture x86_64: "_ff_videotoolbox_vpcc_extradata_create", referenced from: _videotoolbox_start in videotoolbox.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Reported-by: Cameron Gutman <[email protected]> Tested-by: Cameron Gutman <[email protected]> Signed-off-by: Limin Wang <[email protected]>
* lib*/version.h: Bump Versions before release/5.0 branchAndreas Rheinhardt2022-01-041-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/packet_internal: Add proper PacketList structAndreas Rheinhardt2022-01-042-34/+27
| | | | | | | | | | | | | | | Up until now, we had a PacketList structure which is actually a PacketListEntry; a proper PacketList did not exist and all the related functions just passed pointers to pointers to the head and tail elements around. All these pointers were actually consecutive elements of their containing structs, i.e. the users already treated them as if they were a struct. So add a proper PacketList struct and rename the current PacketList to PacketListEntry; also make the functions use this structure instead of the pair of pointers. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/utils: Unavpriv avpriv_toupper4()Andreas Rheinhardt2022-01-047-12/+66
| | | | | | | | | | | | | | | | This function is quite small (96B with GCC 11.2 on x64 Ubuntu 21.10 at -O3), making it more economical to duplicate it into libavformat instead of exporting it as avpriv: Doing so saves 2x24B in .dynsim, 2x16B in .dynstr, 2x2B .gnu.version, 24B in .rela.plt, 16B in .plt, 16B in .plt.sec (if enabled), 4B .gnu.hash; besides the actual duplicated code this also adds 2x8B .eh_frame_hdr and 24B .eh_frame. In other words: Duplicating is neutral size-wise (it is also presumed neutral for other systems). Given that it avoids the runtime overhead of dynamic symbols, it is advantageouos to duplicate the function. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/internal: Remove unused av_export_avcodecAndreas Rheinhardt2022-01-041-6/+0
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegaudiodata: Unavpriv mpa_bitrate and mpa_frequency tabsAndreas Rheinhardt2022-01-048-32/+82
| | | | | | | | | | | These arrays have a size of 180 resp. six bytes. This does not make it worthwhile to export them due to the overhead this occurs; for x64 Elf/Linux/GNU: 2x2B version, 2x24B .dynsym, 24B .rela.dyn, 8B .got, 4B hash + twice the size of the name (here 20+23B). Therefore these symbols are unavprived and duplicated for shared builds. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg4audio: Unavpriv and deduplicate mpeg4audio_sample_ratesAndreas Rheinhardt2022-01-048-27/+67
| | | | | | | | | | | | | | | | | | | | | avpriv_mpeg4audio_sample_rates has a size of 64B and it is currently avpriv; a clone of it exists in aacenctab.h and from there it is inlined in aacenc.c (which also uses the avpriv version) and in the FLV muxer. This means that despite it being avpriv both libavformat as well as libavcodec have copies already. This situation is clearly suboptimal. Given the overhead of exporting symbols (for x64 Elf/Linux/GNU: 2x2B version, 2x24B .dynsym, 24B .rela.dyn, 8B .got, 4B hash + twice the size of the name (here 31B)) the object is unavprived, i.e. duplicated into libavformat when creating a shared build; but the duplicates in the AAC encoder and FLV muxer are removed. This involves splitting of the sample rate table into a file of its own; this allowed to break some spurious dependencies (e.g. both the AAC encoder as well as the Matroska demuxer actually don't need the mpeg4audio_get_config stuff). Signed-off-by: Andreas Rheinhardt <[email protected]>
* configure, avcodec/Makefile: Add new mpeg4audio CONFIG_EXTRA groupAndreas Rheinhardt2022-01-041-14/+9
| | | | | | | | | | | | | | | This group is mainly for the users of *_mpeg4audio_get_config2(); it is not for those who only use avpriv_mpeg4audio_sample_rates. This is in preparation for splitting the latter into a file of its own; if there were no CONFIG_EXTRA group for *_mpeg4audio_get_config2() users, one would have to add a dependency to the new file for all these users on top of the existing dependency on mpeg4audio.o. Adding a new CONFIG_EXTRA group only takes effect after a reconfigure; so in order to force a reconfigure some unnecessary headers from libavdevice/alldevices.c have been removed. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/jpegtables: Unavpriv MJPEG-tablesAndreas Rheinhardt2022-01-0412-134/+161
| | | | | | | | | | | | | | | | There are seven MJPEG-tables, five small (1x12, 4x17) and two not small (2x162). These are all avpriv, despite this not being worthwhile due to the overhead of exporting a symbol: The total overhead for each symbol consists of two entries in .dynsym (24B each), one entry in the importing library's .rela.dyn (24B) and one in .got (8B) as well as 2x2B for symbol versions and 4B for symbol hashes in the exporting library; in addition to that, the name of the symbol is included in both exporting and importing libraries, using 2x210 bytes in this case. (The above numbers are for a x64 Elf/Linux/GNU system. Other platforms will give different numbers.) Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/dca: Unavpriv dca_sample_ratesAndreas Rheinhardt2022-01-047-14/+67
| | | | | | | | | | | | | | | Said table is 64 bytes long and exported so that it can be used both in libavcodec and libavformat. This commit stops doing so and instead duplicates it for shared builds, because the overhead of exporting the symbol is bigger than 64 bytes. It consists of the length of the name of the symbol (2x24 bytes), two entries in .dynsym (2x24 bytes), two entries for symbol version (2x2 bytes), one hash value in the exporting library (4 bytes) in addition to one entry in the importing library's .got and .rela.dyn (8 + 24 bytes). (The above numbers are for a Linux/GNU/Elf system; the numbers for other platforms may be different.) Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ac3tab: Unavpriv ac3_channel_layout_tabAndreas Rheinhardt2022-01-049-24/+78
| | | | | | | | | | | | | | | | | It is small (16 B) and therefore the overhead of exporting it more than outweighs the size savings from not having duplicated symbols: When the symbol is no longer avpriv, one saves twice the size of the string containing the symbols name (2x30 byte), two entries in .dynsym (24 bytes each on x64), one entry in the importing libraries .got and .rela.dyn (8 + 24 bytes on x64) and two entries for the symbol version (2 bytes each) and one hash value in the exporting library (4 bytes). (The exact numbers are of course different for other platforms (e.g. when using dlls), but given that the strings saved alone more than outweigh the array size it can be presumed that this is beneficial for all platforms.) Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/raw: Reduce number of avpriv symbolsAndreas Rheinhardt2022-01-044-26/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libavcodec currently exports four avpriv symbols that deal with PixelFormatTags: avpriv_get_raw_pix_fmt_tags, avpriv_find_pix_fmt, avpriv_pix_fmt_bps_avi and avpriv_pix_fmt_bps_mov. The latter two are lists of PixelFormatTags, the former returns such a list and the second searches a list for a pixel format that matches a given fourcc; only one of the aforementioned three lists is ever searched. Yet for avpriv_pix_fmt_bps_avi, avpriv_pix_fmt_bps_mov and avpriv_find_pix_fmt the overhead of exporting these functions actually exceeds the size of said objects (at least for ELF; the following numbers are for x64 Ubuntu 20.10): The code size of avpriv_find_pix_fmt is small (GCC 10.2 37B, Clang 11 41B), yet exporting it adds a 20B string for the name alone to the exporting as well as to each importing library; there is more: Four bytes in the exporting libraries .gnu.hash; two bytes each for the exporting as well as each importing libraries .gnu.version; 24B in the exporting as well as each importing libraries .dynsym; 16B+24B for an entry in .plt as well as the accompanying relocation entry in .rela.plt for each importing library. The overhead for the lists is similar: The strings are 23B and the .plt+.rela.plt pair is replaced by 8B+24B for an entry in .got and a relocation entry in .rela.dyn. These lists have a size of 80 resp. 72 bytes. Yet for ff_raw_pix_fmt_tags, exporting it is advantageous compared to duplicating it into libavformat and potentially libavdevice. Therefore this commit replaces all library uses of the four symbols with a single function that is exported for shared builds. It has an enum parameter to choose the desired list besides the parameter for the fourcc. New lists can be supported with new enum values. Unfortunately, avpriv_get_raw_pix_fmt_tags could not be removed, as the fourcc2pixfmt tool uses the table of raw pix fmts. No other user of this function remains. Signed-off-by: Andreas Rheinhardt <[email protected]>
* lavc/hevcdec: Parse DOVI RPU NALsNiklas Haas2022-01-042-8/+31
| | | | | | | | | | | | | | | | And expose the parsed values as frame side data. Update FATE results to match. It's worth documenting that this relies on the dovi configuration record being present on the first AVPacket fed to the decoder, which in practice is the case if if the API user has called something like av_format_inject_global_side_data, which is unfortunately not the default. This commit is not the time and place to change that behavior, though. Signed-off-by: Niklas Haas <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* lavc: Implement Dolby Vision RPU parsingNiklas Haas2022-01-043-0/+537
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on a mixture of guesswork, partial documentation in patents, and reverse engineering of real-world samples. Confirmed working for all the samples I've thrown at it. Contains some annoying machinery to persist these values in between frames, which is needed in theory even though I've never actually seen a sample that relies on it in practice. May or may not work. Since the distinction matters greatly for parsing the color matrix values, this includes a small helper function to guess the right profile from the RPU itself in case the user has forgotten to forward the dovi configuration record to the decoder. (Which in practice, only ffmpeg.c and ffplay do..) Notable omissions / deviations: - CRC32 verification. This is based on the MPEG2 CRC32 type, which is similar to IEEE CRC32 but apparently different in subtle enough ways that I could not get it to pass verification no matter what parameters I fed to av_crc. It's possible the code needs some changes. - Linear interpolation support. Nothing documents this (beyond its existence) and no samples use it, so impossible to implement. - All of the extension metadata blocks, but these contain values that seem largely congruent with ST2094, HDR10, or other existing forms of side data, so I will defer parsing/attaching them to a future commit. - The patent describes a mechanism for predicting coefficients from previous RPUs, but the bit for the flag whether to use the prediction deltas or signal entirely new coefficients does not seem to be present in actual RPUs, so we ignore this subsystem entirely. - In the patent's spec, the NLQ subsystem also loops over num_nlq_pivots, but even in the patent the number is hard-coded to one iteration rather than signalled. So we only store one set of coefs. Heavily influenced by https://github.com/quietvoid/dovi_tool Documentation drawn from US Patent 10,701,399 B2 and ETSI GS CCM 001 Signed-off-by: Niklas Haas <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* Makefile: Redo duplicating object files in shared buildsAndreas Rheinhardt2022-01-041-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of shared builds, some object files containing tables are currently duplicated into other libraries: log2_tab.c, golomb.c, reverse.c. The check for whether this is duplicated is simply whether CONFIG_SHARED is true. Yet this is crude: E.g. libavdevice includes reverse.c for shared builds, but only needs it for the decklink input device, which given that decklink is not enabled by default will be unused in most libavdevice.so. This commit changes this by making it more explicit about what to duplicate from other libraries. To do this, two new Makefile variables were added: SHLIBOBJS and STLIBOBJS. SHLIBOBJS contains the objects that are duplicated from other libraries in case of shared builds; STLIBOBJS contains stuff that a library has to provide for other libraries in case of static builds. These new variables provide a way to enable/disable with a finer granularity than just whether shared builds are enabled or not. E.g. lavd's Makefile now contains: SHLIBOBJS-$(CONFIG_DECKLINK_INDEV) += reverse.o Another example is provided by the golomb tables. These are provided by lavc for static builds, even if one uses a build configuration that makes only lavf use them. Therefore lavc's Makefile contains STLIBOBJS-$(CONFIG_MXF_MUXER) += golomb.o, whereas lavf's Makefile has a corresponding SHLIBOBJS-$(CONFIG_MXF_MUXER) += golomb_tab.o. E.g. in case the MXF muxer is the only component needing these tables only libavformat.so will contain them for shared builds; currently libavcodec.so does so, too. (There is currently a CONFIG_EXTRA group for golomb. But actually one would need two groups (golomb_avcodec and golomb_avformat) in order to know when and where to include these tables. Therefore this commit uses a Makefile-based approach for this and stops using these groups for the users in libavformat.) Signed-off-by: Andreas Rheinhardt <[email protected]>
* lib*/version.h: Bump Versions after release/5.0 branchMichael Niedermayer2022-01-031-1/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* lib*/version.h: Bump Versions before release/5.0 branchMichael Niedermayer2022-01-031-2/+2
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* libavcodec/pthread_frame: remove duplicate pointersYu Yang2022-01-031-7/+6
| | | | | | | '*src' and '*avctx' point to the same memory. It is enough to keep one of them. Signed-off-by: Yu Yang <[email protected]> Signed-off-by: Anton Khirnov <[email protected]>
* avcodec/speexdec: Consider mode in frame size checkMichael Niedermayer2022-01-011-1/+1
| | | | | | | | | | | | | | No speex samples with non default frame sizes are known (to me) the official speexenc seems to only generate the 3 default ones. Thus it may be that the fuzzer samples where the first non default values encountered by the decoder. Possibly the "<" should be "!=" Fixes: out of array access Fixes: 42821/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-5640695772217344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
* lavc/{av1, h264, h265}_metadata_bsf: fix description of tick_rateZhao Zhili2022-01-013-3/+3
| | | | | | | | Users may take the description literally which leads to inverted results. Signed-off-by: Zhao Zhili <[email protected]> Reviewed-by: Jun Zhao <[email protected]
* avcodec/apedec: fix integer overflow in 8bit samplesMichael Niedermayer2021-12-301-1/+1
| | | | | | | | Fixes: signed integer overflow: 2147483542 + 128 cannot be represented in type 'int' Fixes: 42812/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6344057861832704 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/targa: Check input size for uncompressed TGA before allocationMichael Niedermayer2021-12-301-1/+10
| | | | | | | | Fixes: Timeout Fixes: 42667/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TARGA_fuzzer-5619236075077632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/tiff: Remove messing with jpeg contextMichael Niedermayer2021-12-301-22/+2
| | | | | | | | | | | | | | | | The whole concept is just not correct, also as it seems not to be needed at all, all dng files i have decode without this. Fixes: various crashes Fixes: 42937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4625073334517760 Fixes: 42938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4643368217477120 Fixes: 42939/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925325908246528 Fixes: 42940/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925378806808576 Fixes: 42941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6202009265504256 Fixes: 42944/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6076860998483968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
* lavc/mediacodecdec: set codec profile and level from extradata for H264+HEVCsfan52021-12-301-0/+6
| | | | | | This value is later passed to MediaCodec and checked at decoder init. Notably decoding of 10-bit streams before this commit would "work" without returning errors but only return garbage output (on most Android devices).
* avcodec/v4l2_m2m_dec: dequeue frame if input isn't readyCameron Gutman2021-12-281-2/+6
| | | | | | | | | | | The V4L2M2M API operates asynchronously, so multiple packets can be enqueued before getting a batch of frames back. Since it was only possible to receive a frame by submitting another packet, there wasn't a way to drain those excess output frames from when avcodec_receive_frame() returned AVERROR(EAGAIN). Reviewed-by: Andriy Gelman <[email protected]> Signed-off-by: Cameron Gutman <[email protected]>
* avcodec/libx26[45]: reindent after last commitLimin Wang2021-12-282-46/+46
| | | | Signed-off-by: Limin Wang <[email protected]>
* avcodec/libx26[45]: add udu_sei option to import user data unregistered SEIsLimin Wang2021-12-283-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Most of user data unregistered SEIs are privated data which defined by user/ encoder. currently, the user data unregistered SEIs found in input are forwarded as side-data to encoders directly, it'll cause the reencoded output including some useless UDU SEIs. I prefer to add one option to enable/disable it and default is off after I saw the patch by Andreas Rheinhardt: https://patchwork.ffmpeg.org/project/ffmpeg/patch/AM7PR03MB66607C2DB65E1AD49D975CF18F7B9@AM7PR03MB6660.eurprd03.prod.outlook.com/ How to test by cli: ffmpeg -y -f lavfi -i testsrc -c:v libx264 -frames:v 1 a.ts ffmpeg -y -i a.ts -c:v libx264 -udu_sei 1 b.ts ffmpeg -y -i a.ts -c:v libx264 -udu_sei 0 c.ts # check the user data unregistered SEIs, you'll see two UDU SEIs for b.ts. # and mediainfo will show with wrong encoding setting info ffmpeg -i b.ts -vf showinfo -f null - ffmpeg -i c.ts -vf showinfo -f null - This fixes tickets #9500 and #9557. Reviewed-by: "zhilizhao(赵志立)" <[email protected]> Signed-off-by: Limin Wang <[email protected]>
* avcodec/qsvenc_h264: use AV_OPT_TYPE_BOOL for aud, a53cc, cavlc, look_ahead, ↵Limin Wang2021-12-271-6/+6
| | | | | | | pic_timing_sei options Signed-off-by: Limin Wang <[email protected]> Signed-off-by: Haihao Xiang <[email protected]>
* avcodec/qsvenc_hevc: use AV_OPT_TYPE_BOOL for aud optionLimin Wang2021-12-271-1/+1
| | | | | Signed-off-by: Limin Wang <[email protected]> Signed-off-by: Haihao Xiang <[email protected]>
* avcodec/vaapi_encode_vp9: fix > 4k encode fail issueZhang yuankun2021-12-271-0/+8
| | | | | | | | | | | | This patch will fix following command: ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i input.264 \ -vf 'scale_vaapi=w=7680:h=4096' -c:v vp9_vaapi output.ivf Max width of a vp9 tile is 4096. If the source frame > 4096, we need split to multiple tiles. Reviewed-by: Limin Wang <[email protected]> Signed-off-by: Zhang yuankun <[email protected]> Signed-off-by: Haihao Xiang <[email protected]>
* avcodec/nvenc: add udu_sei option to import user data unregistered SEIsLimin Wang2021-12-255-1/+9
| | | | | Signed-off-by: Limin Wang <[email protected]> Signed-off-by: Timo Rothenpieler <[email protected]>
* avcodec/cdgraphics: avoid signed overflow in alphaMichael Niedermayer2021-12-251-1/+1
| | | | | | | | | Fixes: left shift of 255 by 24 places cannot be represented in type 'int' Fixes: 42766/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-5142826105569280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/h2645: Fix SEI->display matrix transformationAndreas Rheinhardt2021-12-233-3/+31
| | | | | | | | | | | The earlier code did not account for the fact that av_display_rotation_set() wants the angle in the anticlockwise direction (despite what its documentation stated for a long time); furthermore, the H.2645 spec wants the flips applied first, whereas our code did it the other way around. This can be fixed by negating the angle once for every flip. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegdec: Fix exif rotation->displaymatrix conversionAndreas Rheinhardt2021-12-231-2/+2
| | | | | | | The cases in which there was flipping together with a rotation that is not a multiple of the identity were wrong. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/tiff: Use ff_set_dimensions() for setting up mjpeg context dimensionsMichael Niedermayer2021-12-231-7/+8
| | | | | | | | | | | sets coded_width / coded_height too to keep them consistent with width / height Fixes: OOM Fixes: 42263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5653333619113984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/tiff: Pass max_pixels to mjpeg contextMichael Niedermayer2021-12-231-0/+1
| | | | Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec/vqavideo: reset accounting on errorMichael Niedermayer2021-12-231-3/+4
| | | | | | | | Fixes: Timeout (same growing chunk is decoded to failure repeatedly) Fixes: 42582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6531195591065600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
* avcodec: [loongarch] Optimize vc1dsp with LASX.Hao Chen2021-12-236-0/+1156
| | | | | | | | | ./ffmpeg -i 11_wmv3_720p_24fps_7Mbps.wmv -f rawvideo -y /dev/null -an before:131fps after :229fps Reviewed-by: Shiyou Yin <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>