summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
* avutil/pixdesc: add missing FF_API_PSEUDOPAL checkJames Almer2020-10-021-0/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/buffer: add a convenience function for replacing buffersAnton Khirnov2020-09-283-1/+43
| | | | | | | A common pattern e.g. in libavcodec is replacing/updating buffer references: unref old one, ref new one. This function allows simplifying such code and avoiding unnecessary refs+unrefs if the references are already equivalent.
* avutil/pixfmt: improve definition of AVColorRangeJan Ekström2020-09-231-3/+51
| | | | | | | | | | | | As it was brought up that the current documentation leaves things as specific to YCbCr only, ICtCp and RGB are now mentioned. Additionally, the specifications on which these definitions of narrow and full range are defined are mentioned. This way, the documentation of AVColorRange should now match how most people seem to read interpret it at this point, and thus flagging RGB AVFrames as full range is valid not only according to common sense, but also the enum definition.
* avutil/fixed_dsp: Fix integer overflows in butterflies_fixed_c()Michael Niedermayer2020-09-191-1/+2
| | | | | | | | Fixes: signed integer overflow: 0 - -2147483648 cannot be represented in type 'int' Fixes: 23646/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5480991098667008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/cuda_check: add missing dynlink_loader.h includeJames Almer2020-09-151-0/+2
| | | | | | Fixes make checkheaders Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/timecode: add av_timecode_make_smpte_tc_string2Marton Balint2020-09-133-2/+36
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/timecode: do not trash bits on invalid av_timecode_get_smpte argumentsMarton Balint2020-09-131-0/+5
| | | | | | The function has no way to return error, so let's clip or calculate modulo. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/timecode: cosmetics on av_timecode_get_smpteMarton Balint2020-09-131-7/+4
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fpsMarton Balint2020-09-132-18/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SMPTE 12M timecode can only count frames up to 39, because the tens-of-frames value is stored in 2 bit. In order to resolve this 50/60 fps SMPTE timecode is using the field bit (which is the same bit as the phase correction bit) to signal the least significant bit of a 50/60 fps timecode. See SMPTE ST 12-1:2014 section 12.1. Therefore we slightly change the format of the return value of av_timecode_get_smpte_from_framenum and AV_FRAME_DATA_S12M_TIMECODE and start using the previously unused Phase Correction bit as Field bit. (As the SMPTE standard suggests) We add 50/60 fps support to av_timecode_get_smpte_from_framenum by calling the recently added av_timecode_get_smpte function in it which already handles this properly. This change affects the decklink indev and the DV and MXF muxers. MXF has no fate test for 50/60fps content, DV does, therefore the changes. MediaInfo (a recent version) confirms that half-frame timecode must be inserted to DV. MXFInspect confirms valid timecode insertion to the System Item of MXF files. For MXF, also see EBU R122. Note that for DV the field flag is not used because in the HDV specs (SMPTE 370M) it is still defined as biphase mark polarity correction flag. So it should not matter that the DV muxer overrides the field bit. Signed-off-by: Marton Balint <cus@passwd.hu>
* hwcontext_vaapi: Don't require a render node when deriving from DRMMark Thompson2020-08-311-12/+16
| | | | | | | | | | | | | The V4L2 driver does not actually have an associated DRM device at all, so users work around the requirement by giving libva an unrelated display-only device instead (which is fine, because it doesn't actually do anything with that device). This was broken by bc9b6358fb7315c0173de322472641766f6289da forcing a render node, because the display-only device did not have an associated render node to use. Fix that by just passing through the original non-render DRM fd if we can't find a render node. Reported-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Tested-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
* lavu/buffer: forward av_buffer_realloc() error code.Nicolas George2020-08-211-3/+4
| | | | Fix CID 1457235.
* lavu/avstring: deprecate av_d2str().Nicolas George2020-08-214-0/+14
| | | | | It is no longer used in our code base and does not seem to be used much in other projects.
* avutil/video_enc_params: fix code commentleozhang2020-08-201-1/+1
| | | | | Reviewed-by: Zhao Zhili <zhilizhao@tencent.com> Signed-off-by: leozhang <leozhang@qiyi.com>
* avutil/channel_layout: add 22.2 layoutJan Ekström2020-08-043-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-021-4/+4
| | | | | | | 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-301-0/+38
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/mips/generic_macros_msa: Fix prob that 'ulw' and 'uld' unsupported by ↵Shiyou Yin2020-07-301-6/+8
| | | | | | | | | 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-271-5/+25
| | | | | | | | | | | | | | | | | | | | | | 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-271-1/+6
|
* avutil/imgutils: always zero data pointers in av_image_fill_pointers()James Almer2020-07-261-2/+2
| | | | | | | 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-261-1/+1
| | | | | | | | | | | 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-231-1/+1
| | | | | | 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-237-1/+181
| | | | | | | | | | | | | | | 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-231-0/+42
| | | | | | | | | | 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-221-4/+16
| | | | | | | | 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-223-24/+90
| | | | | | | | | 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-152-2/+15
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/hwcontext_vdpau: Correctly initialise pixfmtsPhilip Langdale2020-07-121-21/+21
| | | | | | 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-121-16/+30
| | | | | | | | | 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-091-2/+19
| | | | | | | | | | | | | | 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-021-1/+3
| | | | | 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-011-2/+2
| | | | | | | | 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-301-1/+1
| | | | | | | | 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-282-0/+45
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/internal: Fix comment for avpriv_dict_set_timestampJun Zhao2020-06-141-1/+2
| | | | | | 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-131-36/+0
| | | | | | | | | | | | | | | | | 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-131-0/+3
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/hwcontext_vaapi: add vaapi_format_map support for x2rgb10Fei Wang2020-06-121-0/+3
| | | | Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* lavu/pix_fmt: add new pixel format x2rgb10Fei Wang2020-06-123-1/+28
| | | | | | | 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-113-1/+10
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/opt: add a more general child class iteration APIAnton Khirnov2020-06-104-12/+67
| | | | | | | 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.3n4.4-devMichael Niedermayer2020-06-081-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump minor versions to separate 4.3 from masterMichael Niedermayer2020-06-081-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/dict: av_realloc -> av_realloc_array()Limin Wang2020-06-061-2/+2
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/mathematics: Fix overflow with NaN in av_add_stable()Dale Curtis2020-06-061-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/buffer: separate public and internal flags inside AVBuffersJames Almer2020-06-052-10/+10
| | | | | | | 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-051-2/+3
| | | | | | 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-052-1/+4
| | | | | | av_buffer_pool_init2() Signed-off-by: James Almer <jamrial@gmail.com>
* hwcontext_vulkan: fix make checkheaders failJun Zhao2020-06-041-0/+3
| | | | | | | | | | | | 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-301-1/+1
| | | | | | Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>