summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* avutil/channel_layout: add 22.2 layoutJan Ekström2020-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requires some extraneous top side and bottom front channels to be defined. According to STD-B59v2, the defined channel layout is: - FL - FR - FC - LFE1 - BL - BR - FLc - FRc - BC - LFE2 - SiL - SiR - TpFL - TpFR - TpFC - TpC - TpBL - TpBR - TpSiL - TpSiR - TpBC - BtFC - BtFL - BtFR
* hwcontext_vulkan: remove plane size alignment checks when host importingLynne2020-08-02
| | | | | | | The process space is guaranteed to be aligned to the page size, hence we're never going to map outside of our address space. There are more optimizations to do with respect to chroma plane alignment and buffer offsets, but that can be done later.
* tests/imgutils: test the output of av_image_fill_* functionsJames Almer2020-07-30
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/mips/generic_macros_msa: Fix prob that 'ulw' and 'uld' unsupported by ↵Shiyou Yin2020-07-30
| | | | | | | | | clang. GCC support these two synthesized instruction, but clang does not yet. Use machine instruction instead to adapt clang compiler. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vaapi: remove duplicate formats from sw_format listHaihao Xiang2020-07-27
| | | | | | | | | | | | | | | | | | | | | | hwcontext_vaapi maps different VA fourcc to the same pix_fmt for U/V plane swap cases, however duplicate formats are not expected in sw_format list when merging formats. For example: ffmpeg -loglevel debug -init_hw_device vaapi -filter_hw_device vaapi0 \ -f lavfi -i smptebars -vf \ "hwupload=derive_device=vaapi,scale_vaapi,hwdownload,format=yuv420p" \ -vframes 1 -f null - Without this fix, an auto scaler is required for the above command Duplicate formats in ff_merge_formats detected [auto_scaler_0 @ 0x560df58f4550] Setting 'flags' to value 'bicubic' [auto_scaler_0 @ 0x560df58f4550] w:iw h:ih flags:'bicubic' interl:0 [Parsed_hwupload_0 @ 0x560df58f0ec0] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_hwupload_0' Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* hwcontext_vaapi: avoid fd leak in vaapi_device_deriveHaihao Xiang2020-07-27
|
* avutil/imgutils: always zero data pointers in av_image_fill_pointers()James Almer2020-07-26
| | | | | | | This restores the relevant behavior of the function as it was before 3a8e927176. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/imgutils: don't fill data pointers for missing planesJames Almer2020-07-26
| | | | | | | | | | | The size for a previous plane doesn't signal the presence of another after it. If the plane is present, av_image_fill_plane_sizes() will have returned a size for it. Fixes a regression since 3a8e927176. Reported-by: Imad R. Faiad <irfaiad@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: bump version after addition of MIPS cpu flagsJames Almer2020-07-23
| | | | | | And add the missing doc/APIchanges entry. Signed-off-by: James Almer <jamrial@gmail.com>
* libavutil: Detect MMI and MSA flags for MIPSJiaxun Yang2020-07-23
| | | | | | | | | | | | | | | Add MMI & MSA runtime detection for MIPS. Basically there are two code pathes. For systems that natively support CPUCFG instruction or kernel emulated that instruction, we'll sense this feature from HWCAP and report the flags according to values grab from CPUCFG. For systems that have no CPUCFG (or not export it in HWCAP), we'll parse /proc/cpuinfo instead. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavutils: Add parse_r helper for MIPSJiaxun Yang2020-07-23
| | | | | | | | | | That helper grab from kernel code can allow us to inline newer instructions (not implemented by the assembler) in a elegant manner. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavutil/frame: avoid UB when getting plane sizesBrian Kim2020-07-22
| | | | | | | | This uses av_image_fill_plane_sizes instead of av_image_fill_pointers when we are getting plane sizes to avoid UB from adding offsets to NULL. Signed-off-by: Brian Kim <bkkim@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/imgutils: add utility to get plane sizesBrian Kim2020-07-22
| | | | | | | | | This utility helps avoid undefined behavior when doing things like checking how much memory we need to allocate for an image before we have allocated a buffer. Signed-off-by: Brian Kim <bkkim@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/timecode: add description for SMPTE binary formatLimin Wang2020-07-15
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/hwcontext_vdpau: Correctly initialise pixfmtsPhilip Langdale2020-07-12
| | | | | | The number of declared vdpau formats can vary depending on which version of libvdpau we build against, so the number of pix fmts can vary too. Let's make sure we keep those numbers in sync.
* avutil/x86inc: fix warnings when assembling with Nasm 2.15Henrik Gramner2020-07-12
| | | | | | | | | Some new warnings regarding use of empty macro parameters has been added, so adjust some x86inc code to silence those. Fixes part of ticket #8771 Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevcdec: Add VDPAU to list of supported formatsManojGuptaBonda2020-07-09
| | | | | | | | | | | | | | Added VDPAU to list of supported formats for HEVC10 and 12 bit formats also added 42010 bit to surface_parameters and new VDP chroma formats to VDPAUPixFmtMaps Add HEVC 420 10/12 Bit and 444 10/12 Bit support for VDPAU YUV444P10 is defined as the 444 surface with 10bit valid data in LSBs but H/w returns Data in MSBs Hence if we map output as YUV444p16 it is filtering out the LSB to convert to p10 format. Signed-off-by: Philip Langdale <philipl@overt.org>
* avutil/opt: check return value of av_bprint_finalize()Limin Wang2020-07-02
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/avsscanf: Add () to avoid integer overflow in scanexp()Michael Niedermayer2020-07-01
| | | | | | | | Fixes: signed integer overflow: 2147483610 + 52 cannot be represented in type 'int' Fixes: 23260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-5187871274434560 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Fix integer overflow in av_ceil_log2_c()Michael Niedermayer2020-06-30
| | | | | | | | Fixes: left shift of 1913647649 by 1 places cannot be represented in type 'int' Fixes: 23572/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5082619795734528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/timecode: add function av_timecode_get_smpte()Limin Wang2020-06-28
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/internal: Fix comment for avpriv_dict_set_timestampJun Zhao2020-06-14
| | | | | | Fix comment for avpriv_dict_set_timestamp from b72a7b96f84 Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/internal: remove FF_ALLOCx{_ARRAY}_OR_GOTO macrosLimin Wang2020-06-13
| | | | | | | | | | | | | | | | | These functions have a terrible design, let us fix them before extending them. First design mistake: no error code. A helper function for testing memory allocation failure where AVERROR(ENOMEM) does not appear is absurd. Second design mistake: printing a message. Return the error code, let the caller print the error message. Third design mistake: hard-coded use of goto. http://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/262544.html Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264dec: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos lableLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/hwcontext_vaapi: add vaapi_format_map support for x2rgb10Fei Wang2020-06-12
| | | | Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* lavu/pix_fmt: add new pixel format x2rgb10Fei Wang2020-06-12
| | | | | | | The format is packed RGB with each channel 10 bits available and include 2 bits unused. Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* avutil: add AV_FRAME_DATA_SEI_UNREGISTERED side data typeLimin Wang2020-06-11
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/opt: add a more general child class iteration APIAnton Khirnov2020-06-10
| | | | | | | Use opaque iteration state instead of the previous child class. This mirrors similar changes done in lavf/lavc. Deprecate the av_opt_child_class_next() API.
* Bump minor versions after branching 4.3Michael Niedermayer2020-06-08
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump minor versions to separate 4.3 from masterMichael Niedermayer2020-06-08
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/dict: av_realloc -> av_realloc_array()Limin Wang2020-06-06
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/mathematics: Fix overflow with NaN in av_add_stable()Dale Curtis2020-06-06
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/buffer: separate public and internal flags inside AVBuffersJames Almer2020-06-05
| | | | | | | It's better to not mix user provided flags and internal flags set by AVBufferRef helper functions. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: avutil/buffer: add a mention that some arguments from ↵James Almer2020-06-05
| | | | | | av_buffer_pool_init2() may be NULL Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: use the default allocator if none is provided to ↵James Almer2020-06-05
| | | | | | av_buffer_pool_init2() Signed-off-by: James Almer <jamrial@gmail.com>
* hwcontext_vulkan: fix make checkheaders failJun Zhao2020-06-04
| | | | | | | | | | | | make checkheaders will get error as follow: CC libavutil/hwcontext_vulkan.h.o In file included from libavutil/hwcontext_vulkan.h.c:1: ./libavutil/hwcontext_vulkan.h:130:23: error: ‘AV_NUM_DATA_POINTERS’ undeclared here (not in a function) 130 | void *alloc_pnext[AV_NUM_DATA_POINTERS]; | ^~~~~~~~~~~~~~~~~~~~ ./libavutil/hwcontext_vulkan.h:199:43: warning: ‘enum AVPixelFormat’ declared inside parameter list will not be visible outside of this definition or declaration Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/attributes: Fix too many warning: false is not defined [-Wundef]Limin Wang2020-05-30
| | | | | | Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* Use gcc/clang builtins for av_sat_(add|sub)_64_c if available.Dale Curtis2020-05-27
| | | | | Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vulkan: fix uploading and downloading from/to flipped imagesLynne2020-05-26
| | | | | | We want to copy the lowest amount of bytes per line, but while the buffer stride is sanitized, the src/dst stride can be negative, and negative numbers of bytes do not make a lot of sense.
* hwcontext_vulkan: check for dedicated allocation when mapping from drm/vaapiLynne2020-05-26
| | | | | Some vendors (AMD) require dedicated allocation to be used for all imported images.
* hwcontext_vulkan: initialize the frames context when derivingLynne2020-05-26
| | | | | | Otherwise, the frames context is considered to be ready to handle mapping, and it doesn't get initialized the normal way through .frames_init.
* hwcontext_vulkan: use dedicated allocation for buffers when necessaryLynne2020-05-26
|
* hwcontext_vulkan: use host mapped buffers when uploading and downloadingLynne2020-05-26
| | | | Speeds up both use cases by 30%.
* avutil/mem: Use max_alloc_size as-isAndreas Rheinhardt2020-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The size of a single allocation performed by av_malloc() or av_realloc() is supposed to be bounded by max_alloc_size, which defaults to INT_MAX and can be set by the user; yet currently this is not completely honoured: The actual value used is max_alloc_size - 32. How this came to be can only be understood historically: a) 0ecca7a49f8e254c12a3a1de048d738bfbb614c6 disallowed allocations > INT_MAX. At that time the size parameter of av_malloc() was an unsigned and the commentary added ("lets disallow possible ambiguous cases") indicates that this was done as a precaution against calling the functions with negative int values. Genuinely limiting the size of allocations to INT_MAX doesn't seem to have been the intention given that at this time the memalign hack introduced in commit da9b170c6f06184a5114dc66afb8385cd0ffff83 (which when enabled increased the size of allocations slightly so that one can return a correctly aligned pointer that actually does not point to the beginning of the allocated buffer) was already present. b) Said memalign hack allocated 17 bytes more than actually desired, yet allocating 16 bytes more is actually enough and so this was changed in a9493601638b048c44751956d2360f215918800c; this commit also replaced INT_MAX by INT_MAX - 16 (and made the limit therefore a limit on the size of the allocated buffer), but kept the comment, although there is nothing ambiguous about allocating (INT_MAX - 16)..INT_MAX. c) 13dfce3d44f99a2d7df71aba8ae003d58db726f7 then increased 16 to 32 for AVX, 6b4c0be5586acad3bbafd7d2dd02a8328a5ab632 replaced INT_MAX by MAX_MALLOC_SIZE (which was of course defined to be INT_MAX) and 5a8e994287d8ef181c0a5eac537547d7059b4524 added max_alloc_size and made it user-selectable. d) 4fb311c804098d78e5ce5f527f9a9c37536d3a08 then dropped the memalign hack, yet it kept the -32 (probably because the comment about ambiguous cases was still present?), although it is no longer needed at all after this commit. Therefore this commit removes it and uses max_alloc_size directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* h264dec: support exporting QP tables through the AVVideoEncParams APIAnton Khirnov2020-05-25
|
* hwcontext_vulkan: move physical device feature discovery to device_initLynne2020-05-23
| | | | Otherwise custom vulkan device contexts won't work.
* hwcontext_vulkan: split uploading and downloading contextsLynne2020-05-23
| | | | This allows us to speed up only-uploading or only-downloading use cases.
* hwcontext_vulkan: set usage for DRM imports to the frames context usageLynne2020-05-23
| | | | | They're nothing special, and there's no reason they should always use the default flags.
* hwcontext_vulkan: do not OR the user-specified usage with our default flagsLynne2020-05-23
| | | | | Some users may need special formats that aren't available when the STORAGE flag bit is set, which would result in allocations failing.
* hwcontext_vulkan: actually use the frames exec context for prep/import/exportLynne2020-05-23
| | | | | | | | This was never actually used, likely due to confusion, as the device context also had one used for uploads and downloads. Also, since we're only using it for very quick image barriers (which are practically free on all hardware), use the compute queue instead of the transfer queue.