summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avutil: [loongarch] Add support for loongarch SIMD.Shiyou Yin2021-12-15
| | | | | | | | | | | LSX and LASX is loongarch SIMD extention. They are enabled by default if compiler support it, and can be disabled with '--disable-lsx' '--disable-lasx'. Change-Id: Ie2608ea61dbd9b7fffadbf0ec2348bad6c124476 Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Reviewed-by: guxiwei <guxiwei-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_astats: improve options descriptionsLimin Wang2021-12-14
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtpdec_rfc4175: cosmetic changesLimin Wang2021-12-14
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: deprecate hls_ts_options optionSteven Liu2021-12-13
| | | | | | | Because the hls_ts_options will be misunderstand by user, and then user can use hls_segment_options instead of hls_ts_options. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/hlsenc: add hls_segment_options correct the segment options nameSteven Liu2021-12-13
| | | | | | | Because the hls_ts_options will be misunderstand by user that only can be used in mpegts segments option. So add this option for segments. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avcodec/mmaldec: Deduplicate AVClassesAndreas Rheinhardt2021-12-12
| | | | | | | Possible now that the child_class_next API is gone. Tested-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mmaldec: Avoid creating unnecessary reference, simplify codeAndreas Rheinhardt2021-12-12
| | | | | | | | | | ffmal_add_packet() basically duplicated the logic in av_packet_make_refcounted() with the added twist that it always created a reference even if one is already available. This commit stops doing this. Tested-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mmaldec: fix pointer type warningHo Ming Shun2021-12-12
| | | | | Tested-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Ho Ming Shun <cyph1984@gmail.com>
* avcodec/mmaldec: re-use AVPacket for extra_dataHo Ming Shun2021-12-12
| | | | | | | | | | | | extra_data and normal packets (from ff_decode_get_packet) processing do not overlap, thus we can re-use the spare AVPacket to send to ffmmal_add_packet. Furthermore, this removes allocation of AVPacket on the stack and stops using deprecated av_init_packet. Tested-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Ho Ming Shun <cyph1984@gmail.com>
* avcodec/mmaldec: use decoupled dataflowHo Ming Shun2021-12-12
| | | | | | | | | | | | | | | | | | MMAL is an fundamentally an asynchronous decoder, which was a bad fit for the legacy dataflow API. Often multiple packets are enqueued before a flood of frames are returned from MMAL. The previous lockstep dataflow meant that any delay in returning packets from the VPU would cause ctx->queue_decoded_frames to grow with no way of draining the queue. Testing this with mpv streaming from a live RTSP source visibly reduced latency introduced by frames waiting in queue_decoded_frames from roughly 2s to 0. Tested-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Ho Ming Shun <cyph1984@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: add audio dynamic equalizer filterPaul B Mahol2021-12-12
|
* avformat/img2enc: do not ignore IO errorsMarton Balint2021-12-12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: introduce AVFormatContext io_close2 which returns an intMarton Balint2021-12-12
| | | | | | | | | | | | | | | | | Otherwise there is no way to detect an error returned by avio_close() because ff_format_io_close cannot get the return value. Checking the return value of the close function is important in order to check if all data was successfully written and the underlying close() operation was successful. It can also be useful even for read mode because it can return any pending AVIOContext error, so the user don't have to manually check AVIOContext->error. In order to still support if the user overrides io_close, the generic code only uses io_close2 if io_close is either NULL or the default io_close callback. Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffmpeg: close output files before cleanupMarton Balint2021-12-12
| | | | | | This allows us to check the return value of avio_closep(). Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: return stored AVIO context error on avio_closeMarton Balint2021-12-12
| | | | | | Otherwise IO errors at avio_flush() before closing may be lost. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/file: use proper return value in file_closeMarton Balint2021-12-12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/movtextenc: Check for existence of font name before using itCharlie Monroe2021-12-11
| | | | | | | | Fixes crashes if the font name is NULL (which it is if a \fn tag is not followed by a font name). Signed-off-by: Charlie Monroe <charlie@charliemonroe.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Fix wrong error codeAndreas Rheinhardt2021-12-11
| | | | | Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Switch to pointer comparisons and bytestream APIAndreas Rheinhardt2021-12-11
| | | | | | | | Improves readability and avoids a redundant index variable that was mistakenly called "tracksize". Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Redo TextSampleModifierBox size checksAndreas Rheinhardt2021-12-11
| | | | | | | | | | | | The current checks just check whether the boxes fit into the remaining size of the packet instead of whether they actually fit into the box size. This has been changed; part of this change is to pass the size of the box (minus the box header) as parameter instead of a pointer to the AVPacket by which the box parsing function is supposed to recalculate whether enough data is available. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Use const where appropriateAndreas Rheinhardt2021-12-11
| | | | | Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Improve size checkAndreas Rheinhardt2021-12-11
| | | | | Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Switch to smaller typeAndreas Rheinhardt2021-12-11
| | | | | | | | | | The base size of a box refers to the size the box has in a file, not in memory; so size_t is not their natural type. Therefore use a plain unsigned which is smaller on 64bit systems and still big enough to represent any conceivable base size. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_transpose_vulkan: simplify config_props_output functionWu Jianhua2021-12-10
| | | | | | | It's no need to assign outlink here, which has been done in ff_vk_filter_config_output already. Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avfilter/vf_transpose_vulkan: add clock and cclock optionWu Jianhua2021-12-10
| | | | | | | | | | | | | | | | | | | | | | The following command is on how to apply cclock option: ffmpeg -init_hw_device vulkan -i input.264 -vf \ hwupload=extra_hw_frames=16,transpose_vulkan=dir=cclock,hwdownload,format=yuv420p \ output.264 The following command is on how to apply clock_flip option: ffmpeg -init_hw_device vulkan -i input.264 -vf \ hwupload=extra_hw_frames=16,transpose_vulkan=dir=clock_flip,hwdownload,format=yuv420p \ output.264 The following command is on how to apply clock option: ffmpeg -init_hw_device vulkan -i input.264 -vf \ hwupload=extra_hw_frames=16,transpose_vulkan=dir=clock,hwdownload,format=yuv420p \ output.264 Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* hwcontext_vulkan: wait on semaphores when exporting to DRMLynne2021-12-10
| | | | There is no synchronization method for DRM yet.
* lavu: bump minor version and add doc/APIchanges entry for Vulkan changesLynne2021-12-10
|
* hwcontext_vulkan: stricter semaphore number requirementsLynne2021-12-10
| | | | | | Always require one semaphore per sw_format plane. This is what the implementation uses and relies upon throughout. This was a leftover from an earlier revision that was never needed.
* hwcontext_vulkan: support creating DRM-tiled images and autodetecting modifiersWenbin Chen2021-12-10
| | | | | | | | | | | | | | | When vulkan image exports to drm, the tilling need to be VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT. Now add code to create vulkan image using this format. Now the following command line works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format \ vaapi -i input_1080p.264 -vf "hwmap=derive_device=vulkan,format=vulkan, \ scale_vulkan=1920:1080,hwmap=derive_device=vaapi,format=vaapi" -c:v h264_vaapi output.264 Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Further-modifications-by: Lynne <dev@lynne.ee>
* hwcontext_vulkan: add support for mapping frames with planes in a single ↵Wenbin Chen2021-12-10
| | | | | | | | | | VkDeviceMemory Add support to map vulkan frames to software frames when using contiguous_planes flag. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Further-modifications-by: Lynne <dev@lynne.ee>
* hwcontext_vulkan: add support for allocating all planes in a single allocationWenbin Chen2021-12-10
| | | | | | | | | | | | | | VAAPI on Intel can import external frame, but the planes of the external frames should be in the same drm object. A new option "contiguous_planes" is added to device. This flag tells device to allocate places in one memory. When device is derived from vaapi this flag will be enabled. A new flag frame_flag is also added to AVVulkanFramesContext. User can use this flag to force enable or disable this behaviour. A new variable "offset "is added to AVVKFrame. It describe describe the offset from the memory currently bound to the VkImage. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Further-modifications-by: Lynne <dev@lynne.ee>
* libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frameWenbin Chen2021-12-10
| | | | | | | Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* hwcontext_vaapi: Use PRIME_2 memory type for modifiers.Bas Nieuwenhuizen2021-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier if all the buffer-passing has used explicit modifier. All these issues should be resolved by passing in the modifier, and for that we switch to using the PRIME_2 memory type. Tested with experimental radeonsi patches for modifiers and kmsgrab. Also tested with radeonsi without the patches to double-check it works without PRIME_2 support. v2: Cache PRIME_2 support to avoid doing two calls every time on libva drivers that do not support it. v3: Remove prime2_vas usage. Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
* avfilter: add a transpose_vulkan filterWu Jianhua2021-12-10
| | | | | | | | The following command is on how to apply transpose_vulkan filter: ffmpeg -init_hw_device vulkan -i input.264 -vf \ hwupload=extra_hw_frames=16,transpose_vulkan,hwdownload,format=yuv420p output.264 Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avfilter/vf_transpose: fix un-checked potential memory allocation failureWu Jianhua2021-12-10
| | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avformat/mxfdec: Check for duplicate mxf_read_index_entry_array()Michael Niedermayer2021-12-09
| | | | | | | | | Fixes: memleak Fixes: 41596/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6439060204290048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apedec: Change avg to uint32_tMichael Niedermayer2021-12-09
| | | | | | | | | Fixes: Integer overflow Fixes: 40973/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6739312704618496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Suggested-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/targa: Do not return images when there is no image in the tgaMichael Niedermayer2021-12-09
| | | | | | | | Fixes: Timeout Fixes: 35877/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TARGA_fuzzer-5407292819374080 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: Check component_depth in mxf_get_color_range()Michael Niedermayer2021-12-09
| | | | | | | | | Fixes: shift exponent 4294967163 is too large for 32-bit type 'int' Fixes: 41449/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6183636217495552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswresample/swresamplec: Err num(negative-size) was used as a function ↵Yu Yang2021-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parameter If memory allocation fails, ERROR(ENOMEM) '-12' will be returned. When resample() is done first, the negative size param would cause buffer-overflow and SEGV in swri_rematrix(). When swri_rematrix() is run first, resample() would not cause an error but Err num as a wrong parameter passing. Err num should be returned immediately. And remove an unneeded term from an assert. coredump info: #0 0x499517 in posix_memalign (/home/r1/ffmpeg/ffmpeg_4.4.1+0x499517) #1 0x6c1f0b4 in av_malloc /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavutil/mem.c:86:9 #2 0x6c208fe in av_mallocz /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavutil/mem.c:239:17 #3 0x6c207ad in av_mallocz_array /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavutil/mem.c:195:12 #4 0x654b2e5 in swri_realloc_audio /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libswresample/swresample.c:418:14 #5 0x654f9a1 in swr_convert_internal /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libswresample/swresample.c:601:17 #6 0x654d2c0 in swr_convert /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libswresample/swresample.c:766:19 #7 0x186cf56 in flush_frame /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/af_aresample.c:251:13 #8 0x186a454 in request_frame /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/af_aresample.c:288:20 #9 0x787d9c in ff_request_frame_to_filter /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/avfilter.c:459:15 #10 0x7877f1 in forward_status_change /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/avfilter.c:1257:19 #11 0x77ed7e in ff_filter_activate_default /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/avfilter.c:1288:20 #12 0x77e4e1 in ff_filter_activate /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/avfilter.c:1441:11 #13 0x793b3f in ff_filter_graph_run_once /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/avfiltergraph.c:1403:12 #14 0x7a7bee in get_frame_internal /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/buffersink.c:131:19 #15 0x7a7287 in av_buffersink_get_frame_flags /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/buffersink.c:142:12 #16 0x792888 in avfilter_graph_request_oldest /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/libavfilter/avfiltergraph.c:1356:17 #17 0x5d07df in transcode_from_filter /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/fftools/ffmpeg.c:4639:11 #18 0x59e557 in transcode_step /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/fftools/ffmpeg.c:4729:20 #19 0x593970 in transcode /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/fftools/ffmpeg.c:4805:15 #20 0x58f7a4 in main /home/r1/ffmpeg/ffmpeg-4.4.1/build/src/fftools/ffmpeg.c:5010:9 #21 0x7f6fd2dee0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 SUMMARY: AddressSanitizer: negative-size-param (/home/r1/ffmpeg/ffmpeg_4.4.1+0x497e67) in __asan_memcpy Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Add const where appropriateAndreas Rheinhardt2021-12-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Fix wrong indentationAndreas Rheinhardt2021-12-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/bitpacked_enc: suppport for frame thread encodeLimin Wang2021-12-09
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/bitpacked_dec: support for frame thread decodeLimin Wang2021-12-09
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/bitpacked_dec: setting pict_type and key_frame after decode()Limin Wang2021-12-09
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/bitpacked_dec: remove AV_CODEC_CAP_EXPERIMENTAL capabilitiesLimin Wang2021-12-09
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/movtextdec: Sanitize style entriesAndreas Rheinhardt2021-12-08
| | | | | | | | | | | | | | | | | | | | | There are three types of style entries which are redundant: a) Entries with length zero. They are already discarded. b) Entries that are equivalent to the default style: They can be safely discarded. c) Entries that are equivalent to the immediately preceding style if the start of the current style coincides with the end of the preceding style. In this case the styles can be merged. This commit implements discarding/merging in cases b) and c). This fixes ticket #9548. In said ticket each packet contained exactly one style entry that covered the complete packet with the exception of the last character (probably created by a tool that didn't know that the style's end is exclusive). Said style coincided with the default style, leading to a superfluous reset, which is now gone. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Perform RGB->BGR color conversion earlyAndreas Rheinhardt2021-12-08
| | | | | | | Reduces the amount of conversions. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Deduplicate parsing of StyleRecordsAndreas Rheinhardt2021-12-08
| | | | | | | | | Both TextSampleEntry and TextSample can contain StyleRecords; yet both the code as well as the structures for them were duplicated. This commit changes this. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/movtextdec: Rename several structure elementsAndreas Rheinhardt2021-12-08
| | | | | | | | | Giving elements of a structure called StyleBox names like "style_start" or "style_end" is redundant, especially given that the relevant variables are also called style. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>