summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec: add QOI decoder and demuxer and parser and encoder and muxerPaul B Mahol2022-06-05
|
* lavc/h264_ps: always include the stop bit in [s|p]ps->datarcombs2022-06-01
| | | | | | | | The VideoToolbox hwaccel needs the entire NAL (including the stop bit), but ff_h2645_packet_split may remove it. Detect this case by looking for bit counts divisible by 8 and insert a stop-bit-only 0x80 byte. Signed-off-by: rcombs <rcombs@rcombs.me>
* lavc/videotoolboxdec: insert emu-prevention bytes for HEVC as wellrcombs2022-06-01
| | | | | | Fixes decoding of files with sync-fooling sequences in their PSs. Signed-off-by: rcombs <rcombs@rcombs.me>
* lavc/videotoolboxdec: fix writing too many 1 bits for the reserved fieldsrcombs2022-06-01
| | | | Signed-off-by: rcombs <rcombs@rcombs.me>
* lavc/videotoolboxdec: fix generating HEVC general_profile_compatibility_flagsrcombs2022-06-01
| | | | | | We store this as an array of bools, not a bitfield. Signed-off-by: rcombs <rcombs@rcombs.me>
* lavc/videotoolboxdec: fix escaping sequential zero sequencesrcombs2022-06-01
| | | | | | | This ensure that e.g. 0000000000 becomes 00000300 000300, rather than 00000300 0000. Signed-off-by: rcombs <rcombs@rcombs.me>
* lavc/videotoolboxdec: warn on nonzero status in the callbackrcombs2022-06-01
| | | | Signed-off-by: rcombs <rcombs@rcombs.me>
* vp9: don't overread by 4 pixels in ff_vp9_avg4_mmxext().Ronald S. Bultje2022-06-01
| | | | | | If the block is at the end of the allocated buffer and there is no padding, this will over-read, which may cause crashes. Reported by Firefox.
* avcodec/libaomenc: Expose the allintra usage modeVignesh Venkatasubramanian2022-05-31
| | | | | | | | | libaom added an usage=allintra mode for doing better with still images. Expose that in the ffmpeg's wrapper. This is especially useful for encoding still AVIF images. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vp9: ipred_hd_16x16_16 avx2 implementationSemen Belozerov2022-05-31
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avcodec/wavpack: Remove redundant av_channel_layout_uninit()Andreas Rheinhardt2022-05-31
| | | | | | | av_channel_layout_copy() will uninit the dst channel layout before copying the new one. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ffv1enc: Fix undefined left shifts of negative numbersAndreas Rheinhardt2022-05-30
| | | | | | | | Maybe this fixes the FPE encountered here: https://fate.ffmpeg.org/report.cgi?slot=alpha-debian-qemu-gcc-4.7&time=20220530144951 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/iff: Remove redundant #ifAndreas Rheinhardt2022-05-30
| | | | | | | | Since ec0275843d8eb933699807da81f6f366291f034a this file is compiled iff the IFF ILBM decoder is enabled. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ffv1enc: Eliminate float/double from find_best_state()Michael Niedermayer2022-05-30
| | | | | | | | | | log2() remains, this can either be replaced by a integer implementation or the table hardcoded if needed Tested-by: Anton Khirnov <anton@khirnov.net> Tested-by: Martin Storsjö <martin@martin.st> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pcm-dvdenc: Mark unreachable defaultsMichael Niedermayer2022-05-30
| | | | | | | Helps: CID1441929 Helps: CID1441931 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mfenc: Use dlopen instead of LoadLibrary for loading mfplat.dllMartin Storsjö2022-05-28
| | | | | | | The dlopen wrapper contains code to make loading libraries safer, to avoid loading a potentially malicious DLL with the same name. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/libaomenc: Add unmet target level warningBohan Li2022-05-27
| | | | | | | | | | | When target levels are set, this patch checks whether they are satisfied by libaom. If not, a warning is shown. Otherwise the output levels are also logged. This patch applies basically the same approach used for libvpx. Signed-off-by: Bohan Li <bohanli@google.com> Signed-off-by: James Zern <jzern@google.com>
* lavc/aarch64: hevc_sao reschedule slightlyJ. Dekker2022-05-26
| | | | Signed-off-by: J. Dekker <jdek@itanimul.li>
* avcodec/mfenc: Dynamically load MFPlat.DLLTrystan Mata2022-05-25
| | | | | | | | | | | | Allows non-UWP builds of FFmpeg with MediaFoundation to work on N editions of Windows which are without MediaFoundation by default. On UWP target, FFmpeg is linked directly against MediaFoundation since LoadLibrary is not available. This commit adresses https://trac.ffmpeg.org/ticket/9788 Signed-off-by: Martin Storsjö <martin@martin.st>
* qsv: add requirement for the mininal version of libmfxHaihao Xiang2022-05-25
| | | | | | | | | | libmfx 1.28 was released 3 years ago, it is easy to get a greater version than 1.28. We may remove lots of compile-time checks if adding the requirement for the minimal version in the configure script. Reviewed-by: softworkz <softworkz@hotmail.com> Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* libavcodec/qsvenc: expose only supported optionsDmitry Rogozhkin2022-05-25
| | | | | | | | | | | | | | vp9, hevc, avc, mpeg2 QSV encoders inherit common list of options (QSV_COMMON_OPTS) while bunch of options is not actually supported by current qsv code. The only codec which supportes everything is avc, followed by hevc, while vp9 and mpeg2 significantly fall behind. This creates difficulties for the users to use qsv encoders. This patch fixes options list for encoders leaving only those which are actually supported. Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/aarch64: add hevc sao edge 8x8J. Dekker2022-05-25
| | | | | | | | | bench on AWS Graviton: hevc_sao_edge_8x8_8_c: 516.0 hevc_sao_edge_8x8_8_neon: 81.0 Signed-off-by: J. Dekker <jdek@itanimul.li>
* lavc/aarch64: add hevc sao edge 16x16J. Dekker2022-05-25
| | | | | | | | | | | | | | | bench on AWS Graviton: hevc_sao_edge_16x16_8_c: 1857.0 hevc_sao_edge_16x16_8_neon: 211.0 hevc_sao_edge_32x32_8_c: 7802.2 hevc_sao_edge_32x32_8_neon: 808.2 hevc_sao_edge_48x48_8_c: 16764.2 hevc_sao_edge_48x48_8_neon: 1796.5 hevc_sao_edge_64x64_8_c: 32647.5 hevc_sao_edge_64x64_8_neon: 3118.5 Signed-off-by: J. Dekker <jdek@itanimul.li>
* lavc/aarch64: fix hevc sao band filterJ. Dekker2022-05-25
| | | | | | | The SAO band filter can be called with non-multiples of 8, we round up to the nearest multiple of 8 to account for this. Signed-off-by: J. Dekker <jdek@itanimul.li>
* avcodec/mjpegenc: Remove ineffective pred optionAndreas Rheinhardt2022-05-24
| | | | | | Never did anything, so it is removed immediately. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideoenc: Remove ineffective optionsAndreas Rheinhardt2022-05-24
| | | | | | | | | | | | | | | | This commit removes the ineffective FF_MPV_DEPRECATED_ options, namely mpeg_quant (this is only an option for MPEG-4), a53cc (this is only an option for MPEG-2), force_duplicated_matrix (applies only to MJPEG) and b_strategy, b_sensitivity and brd_scale (these options only make sense for encoders supporting B-frames, which currently means the MPEG-1/2 and MPEG-4 encoders). Given that these options never changed the outcome of encoding, they are removed at once. Notice that the options for the encoders for which it made sense are not affected by this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegenc: Remove pointless motion-estimation optionsAndreas Rheinhardt2022-05-24
| | | | | | | | (M)JPEG does not use motion estimation/motion vectors at all. These options therefore don't affect the output at all. So remove them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideoenc: Remove ineffective [pb]bias optionsAndreas Rheinhardt2022-05-24
| | | | | | | | | | | The user-provided value is overwritten in ff_mpv_encode_init() without having ever been read. (This has been broken when making these options mpegvideo-specific in commits 910247f1720c6aae422723c05dac6d0b19f20bec and cf7d2f2d2134c0854edf2db91e7436ac2bc9874f. No one has ever complained, so this commit removes these fields.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pthread_frame: Don't update the first thread ctx before freeingAndreas Rheinhardt2022-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, ff_frame_thread_free() uses the last worker thread to updates the first worker thread via update_context_from_thread() immediately before freeing all these worker threads. This is a remnant of the time in which the first worker was special. (E.g. the first worker shared its AVCodecInternal with the public AVCodecContext.) But these times are over (none of the uses of is_copy matter for ff_frame_thread_free()); nowadays the only thing that update_context_from_thread() does is referencing a few buffers/frames and replacing them with other references instead. These new references will then be freed immediately thereafter when the first worker thread is freed. Ensuring that the code is free of double-frees is achieved by using reference-counted structures (or in case of AVChannelLayouts: by giving each worker its own copy). Some archaeology: a) Updating the first worker thread from the last one used has been done since frame-threading was added in 37b00b47cbeecd66bb34c5c7c534d016d6e8da24. b) The precursor to ff_mpv_common_end() checked for is_copy before freeing pictures (i.e. it only freed them for the first worker thread). c) Commits c2dfb1e37cc72bf144545c4410a4621cbff5c4b1 and e33811bd2686411233cb0eb4a4ee45eb99d7e736 modified the update_thread_context function of the H.264 decoder so that it could fail before calling ff_mpeg_update_thread_context(). d) This led to a double free/an assert violation with a H.264 sample for which ff_mpeg_update_thread_context() is not reached for the final update_context_from_thread(). Commit a6e4796fbf0aa9b13451a8ef917ecc4e80d1d272 added code to fix this sample. e) This issue was fixed (even with the last mentioned commit reverted) when the H.264 decoder was deMpegEncContextized in commit b7fe35c9e50e1701274364adf7280bf4a02b092b (merging commit 2c541554076cc8a72e7145d4da30389ca763f32f). f) mpegvideo.c stopped using is_copy when it was switched to refcounted frames in 759001c534287a96dc96d1e274665feb7059145d. g) 1f4cf92cfbd3accbae582ac63126ed5570ddfd37 removed the init_thread_copy callbacks; now no FFCodec.close callback checks for is_copy at all any more. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libdavs2: export has_b_frames infoZhao Zhili2022-05-24
| | | | | | | More precisely, we should use picture_reorder_delay, but it's unavailable yet. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/libuavs3d: use output_reorder_delay as has_b_framesZhao Zhili2022-05-24
| | | | | | | has_b_frames is more than a bool, it's the size of the frame reordering buffer in the decoder. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/avs3_parser: set has_b_frames properlyZhao Zhili2022-05-24
| | | | | | | | | has_b_frames should be output_reorder_delay field in AVS3 sequence header and larger than 1. The parser implementation doesn't parse that field. Decoder can set has_b_frames properly, so use FFMAX here to avoid resetting has_b_frames from output_reorder_delay to 1. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/dvdsubdec: use avpriv_fopen_utf8() instead of plain fopen()softworkz2022-05-24
| | | | | | | | Unify file access operations by replacing usages of direct calls to posix fopen() to prepare for long filename support on Windows. Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/libuavs3d: fix access uninitialized variable when drainingZhao Zhili2022-05-23
| | | | buf_ptr is uninitialized and accessed when function return.
* avcodec/mpegvideo: Move float.h inclusion to mpegvideoenc.hAndreas Rheinhardt2022-05-19
| | | | | | It is only needed for the options in mpegvideoenc.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mss2: Remove write-only QpelDSPContextAndreas Rheinhardt2022-05-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/error_resilience: Only keep what is needed from MECmpContextAndreas Rheinhardt2022-05-19
| | | | | | | | | ERContext currently has an embedded MECmpContext, despite only needing exactly one function from it. This is wasteful because MECmpContext is pretty large (135 pointers, 1080 B for eight byte pointers). So keep only what is needed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dvdsubenc: return error if canvas_size is too small for subtitle renderLimin Wang2022-05-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/wrapped_avframe: Don't attach FrameDecodeData unnecessarilyAndreas Rheinhardt2022-05-15
| | | | | | It is unneeded, as this decoder does not call ff_get_buffer(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3: Move non-(de|en)coder-only parts out of ac3.hAndreas Rheinhardt2022-05-15
| | | | | | | | | | Move AC3HeaderInfo into ac3_parser_internal.h and the rest into a new header ac3defs.h. This also breaks an include cycle of ac3.h and ac3tab.h (the latter now only needs ac3defs.h). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3tab: Move some tables only used by ac3.c to itAndreas Rheinhardt2022-05-15
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3: Remove declaration of inexistent functionAndreas Rheinhardt2022-05-15
| | | | | | Removed in 7b11eead1b4e08728561595e6b610cf8fe2b7122. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libaomenc: Add parameter for avif single image encodingVignesh Venkatasubramanian2022-05-13
| | | | | | | | | | | | | | Add a parameter to libaom-av1 encoder to enforce some of the single image constraints in the AV1 encoder. Setting this flag will limit the encoder to producing exactly one frame and the sequence header that is produced by the encoder will be conformant to the AVIF specification [1]. Part of Fixing Trac ticket #7621 [1] https://aomediacodec.github.io/av1-avif Signed-off-by:: Vignesh Venkatasubramanian <vigneshv@google.com>
* avcodec/vp9: ipred_vl_16x16_16 avx2 implementationSemen Belozerov2022-05-12
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* libavcodec/cinepakenc: Mark no-skip frames as keyframesTomas Härdin2022-05-12
| | | | | Reset curframe whenever we generate a keyframe. Use -g instead of -keyint_min.
* avcodec/internal: Hide stuff only used by the core decode APIAndreas Rheinhardt2022-05-12
| | | | | | | | | | | | | | | | | | | | | | The general decoding API uses bitstream filters and an AVFifo and therefore AVCodecInternal contains pointers to an AVBSFContext and to an AVFifo and lavc/internal.h includes lavc/bsf.h and lavu/fifo.h. Yet actually, only two files are supposed to use these, namely avcodec.c and (mainly) decode.c. For all the other files, it should be an opaque type that they should not touch and that they need not know anything about. This can be achieved by not including these headers and using the structs instead of the corresponding typedefs. This also forces translation units that really use the BSF and the FIFO APIs themselves to include the relevant headers directly instead of relying on indirect inclusions (up until now, even avcodec.c and decode.c relied on fifo.h to be included by internal.h). Of course, it also avoids unnecessary rebuilds when bsf.h or fifo.h change. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/texturedspenc: Fix invalid shiftAndreas Rheinhardt2022-05-12
| | | | | | | | Left shifts of signed types are UB unless the results fit into the type. (Furthermore the value to be shifted need to be nonnegative.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc: drop a confusing message about "thread emulation"Anton Khirnov2022-05-11
| | | | There is no such thing.
* lavc/pthread_frame: do not copy AVCodecInternal contentsAnton Khirnov2022-05-11
| | | | | None of its fields have meaningful values at that point that would need to be copied to frame thread workers.
* lavc/avcodec: only allocate decoding packets for decodersAnton Khirnov2022-05-11
|