summaryrefslogtreecommitdiffstats
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
* Switch FFmpeg to use raw monotonic timestampsTimothy Pearson2019-11-161-0/+4
| | | | Use ALSA high resolution hardware timestamps if available
* avutil/frame: fix remove_side_dataZhao Zhili2019-11-112-3/+2
| | | | | | | | remove_side_data is supposed to remove a single instance by design. Since new_side_data() doesn't forbid add multiple instances of the same type, remove_side_data should deal with that. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/lfg: Document the AVLFG structMichael Niedermayer2019-11-091-0/+6
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: msa optimizations for vc1dspgxw2019-10-301-0/+3
| | | | | | | Performance of WMV3 decoding has speed up from 3.66x to 5.23x tested on 3A4000. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: print runtime flag tooPaul B Mahol2019-10-141-0/+1
|
* avutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flagPaul B Mahol2019-10-142-1/+2
|
* avutil/eval: add sgn()Paul B Mahol2019-10-121-0/+4
|
* avutil/avstring: support input path as a null pointer or empty stringLimin Wang2019-10-082-8/+17
| | | | | | | | | | | | | | | Linux and OSX systems support basename and dirname via <libgen.h>, I plan to make the wrapper interface conform to the standard interface first. If it is feasible, I will continue to modify it to call the system interface if there is already a system call interface. You can get more description about the system interface by below command: "man 3 basename" Reviewed-by: Marton Balint <cus@passwd.hu> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avutil/common: Fix underflow for ROUNDED_DIV with unsigned integerMengye Lv2019-10-061-1/+1
| | | | | | | | | | | | When used ROUNDED_DIV(a,b), if a is unsigned integer zero, it's will lead to an underflow issue(it called unsigned integer wrapping). Fixes #8062 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Mengye Lv <mengyelv@tencent.com> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavu/qsv: remove redundant version queryZhong Li2019-09-271-5/+0
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* avutil/opt: Fix type specifierAndreas Rheinhardt2019-09-221-1/+1
| | | | | | | | This bug has been introduced in 9e0a071e. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/encryption_info: Don't pass NULL to memcpyAndreas Rheinhardt2019-09-201-2/+4
| | | | | | | | | | | | | | | The pointer arguments to memcpy (and several other functions of the C standard library) are not allowed to be NULL, not even when the number of bytes to copy is zero. An AVEncryptionInitInfo's data pointer is explicitly allowed to be NULL and yet av_encryption_init_info_add_side_data unconditionally used it as a source pointer to copy from. This commit changes this so that copying is only done if the number of bytes to copy is > 0. Fixes ticket #8141 as well as a part of ticket #8150. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: Print out numeric values of option constantsSoft Works2019-09-201-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's often not obvious how option constants relate to numerical values. Defaults are sometimes printed as numbers and from/to are always printed as numbers. Printing the numeric values of options constants avoids this confusion. It also allows to see which constants are equivalent. Before this patch: -segment_list_type <int> E........ set the segment list type (from -1 to 4) (default -1) flat E........ flat format csv E........ csv format ext E........ extended format ffconcat E........ ffconcat format m3u8 E........ M3U8 format hls E........ Apple HTTP Live Streaming compatible Afterwards: -segment_list_type <int> E........ set the segment list type (from -1 to 4) (default -1) flat 0 E........ flat format csv 1 E........ csv format ext 3 E........ extended format ffconcat 4 E........ ffconcat format m3u8 2 E........ M3U8 format hls 2 E........ Apple HTTP Live Streaming compatible Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/opt: Fix printing integer option defaultsSoft Works2019-09-201-1/+18
| | | | | | | | | | | | | Integer values should not be printed using format specifier '%g' which leads to inexact display in case of higher values. Before this patch: -trans_color <int> .D.V..... color value [...] (default 1.67772e+07) Afterwards: -trans_color <int> .D.V..... color value [...] (default 16777215) Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Fix undefined shiftAndreas Rheinhardt2019-09-181-1/+1
| | | | | | | | | av_mod_uintp2_c uses a bitwise AND with (1 << p) - 1 to clear the high bits of an unsigned int. But this is undefined if p == 31, because 1 is an int and 2^31 is not representable in an int. So make 1 unsigned. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mips: refactor msa SLDI_Bn_0 and SLDI_Bn macros.gxw2019-09-161-49/+31
| | | | | | | | | | | | Changing details as following: 1. The previous order of parameters are irregular and difficult to understand. Adjust the order of the parameters according to the rule: (RTYPE, input registers, input mask/input index/..., output registers). Most of the existing msa macros follow the rule. 2. Remove the redundant macro SLDI_Bn_0 and use SLDI_Bn instead. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/version: bump for hwcontext_videotoolbox api changeAman Gupta2019-09-041-1/+1
| | | | | | | av_map_videotoolbox_format_from_pixfmt2() added in previous commit to support full-range pixel formats. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolbox: add support for full range pixel formatsAkemi2019-09-042-6/+20
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* avutil/pixfmt: Add EBU Tech. 3213-E AVColorPrimaries valueRaphaël Zumer2019-09-013-3/+4
| | | | | | | | | | This is an alias for JEDEC P22. The name associated with the value is also changed from jedec-p22 to ebu3213 to match ITU-T H.273. Signed-off-by: Raphaël Zumer <rzumer@tebako.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/mathematics: Fix 2 overflows in av_add_stable()Michael Niedermayer2019-08-311-1/+5
| | | | | | | | Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long' Fixes: 16022/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5759796759756800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/file: add more check befor destory the bufferJun Zhao2019-08-301-1/+1
| | | | | | | add more check befor destory the buffer Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/file: always set *size to zero if *bufptr is NULLJun Zhao2019-08-301-0/+5
| | | | | | | | | Always set *size to zero if *bufptr is NULL, it's more make sence. fix #8095 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/imgutils: remove dead assignmentMarton Balint2019-08-221-1/+0
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* Add assembly support for -fsanitize=hwaddress tagged globals.Peter Collingbourne2019-08-221-0/+8
| | | | | | | | | | | | | | | | | As of LLVM r368102, Clang will set a pointer tag in bits 56-63 of the address of a global when compiling with -fsanitize=hwaddress. This requires an adjustment to assembly code that takes the address of such globals: the code cannot use the regular R_AARCH64_ADR_PREL_PG_HI21 relocation to refer to the global, since the tag would take the address out of range. Instead, the code must use the non-checking (_NC) variant of the relocation (the link-time check is substituted by a runtime check). This change makes the necessary adjustment in the movrel macro, where it is needed when compiling with -fsanitize=hwaddress. Signed-off-by: Peter Collingbourne <pcc@google.com> Reviewed-by: Martin Storsjö Reviewed-by: Janne Grunau
* avutil/mips: remove redundant code in TRANSPOSE16x8_UB_UB.Shiyou Yin2019-08-151-2/+0
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mips: refine msa macros CLIP_*.gxw2019-08-131-70/+49
| | | | | | | | | | | | | | | Changing details as following: 1. Remove the local variable 'out_m' in 'CLIP_SH' and store the result in source vector. 2. Refine the implementation of macro 'CLIP_SH_0_255' and 'CLIP_SW_0_255'. Performance of VP8 decoding has speed up about 1.1%(from 7.03x to 7.11x). Performance of H264 decoding has speed up about 0.5%(from 4.35x to 4.37x). Performance of Theora decoding has speed up about 0.7%(from 5.79x to 5.83x). 3. Remove redundant macro 'CLIP_SH/Wn_0_255_MAX_SATU' and use 'CLIP_SH/Wn_0_255' instead, because there are no difference in the effect of this two macros. Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mips: Avoid instruction exception caused by gssqc1/gslqc1.Shiyou Yin2019-08-021-1/+1
| | | | Ensure the address accesed by gssqc1/gslqc1 are 16-byte aligned.
* lavu/tx: add support for double precision FFT and MDCTLynne2019-08-028-677/+822
| | | | | | | Simply moves and templates the actual transforms to support an additional data type. Unlike the float version, which is equal or better than libfftw3f, double precision output is bit identical with libfftw3.
* lavu/hwcontext_qsv: fix the memory leakLinjie Fu2019-07-301-0/+2
| | | | | | | av_dict_free child_device_opts to fix the memory leak. Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
* Bump minor versions again on master to keep 4.2 versions separate from masterMichael Niedermayer2019-07-211-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump minor versions to separate 4.2 from masterMichael Niedermayer2019-07-211-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/softfloat_ieee754: Fix odd bit position for exponent and sign in ↵Michael Niedermayer2019-07-211-1/+1
| | | | | | av_bits2sf_ieee754() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mips: refactor msa load and store macros.Shiyou Yin2019-07-191-198/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace STnxm_UB and LDnxm_SH with new macros ST_{H/W/D}{1/2/4/8}. The old macros are difficult to use because they don't follow the same parameter passing rules. Changing details as following: 1. remove LD4x4_SH. 2. replace ST2x4_UB with ST_H4. 3. replace ST4x2_UB with ST_W2. 4. replace ST4x4_UB with ST_W4. 5. replace ST4x8_UB with ST_W8. 6. replace ST6x4_UB with ST_W2 and ST_H2. 7. replace ST8x1_UB with ST_D1. 8. replace ST8x2_UB with ST_D2. 9. replace ST8x4_UB with ST_D4. 10. replace ST8x8_UB with ST_D8. 11. replace ST12x4_UB with ST_D4 and ST_W4. Examples of new macro: ST_H4(in, idx0, idx1, idx2, idx3, pdst, stride) ST_H4 store four half-word elements in vector 'in' to pdst with stride. About the macro name: 1) 'ST' means store operation. 2) 'H/W/D' means type of vector element is 'half-word/word/double-word'. 3) Number '1/2/4/8' means how many elements will be stored. About the macro parameter: 1) 'in0, in1...' 128-bits vector. 2) 'idx0, idx1...' elements index. 3) 'pdst' destination pointer to store to 4) 'stride' stride of each store operation. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/hwcontext_vaapi: move kernel_driver into CONFIG_LIBDRMSteven Liu2019-07-111-1/+3
| | | | | Reviewed-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Steven Liu <lq@onvideo.cn>
* avutil/mips: optimize UNPCK&SAD macros with MSA2.0 instruction.Shiyou Yin2019-07-101-3/+39
| | | | | | | Loongson 3A4000 and 2k1000 has supported MSA2.0. This patch optimized SAD_UB2_UH,UNPCK_R_SH_SW,UNPCK_SB_SH and UNPCK_SH_SW with MSA2.0 instruction. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/frame: Improve ROI documentationMark Thompson2019-07-071-16/+43
| | | | | Clarify and add examples for the behaviour of the quantisation offset, and define how multiple ranges should be handled.
* avutil: add FF_DECODE_ERROR_DECODE_SLICES for AVFrame.decode_error_flagsAmir Pauker2019-06-292-1/+2
| | | | | Signed-off-by: Amir Pauker <amir@livelyvideo.tv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: add FF_DECODE_ERROR_CONCEALMENT_ACTIVE flag for ↵Amir Pauker2019-06-162-1/+2
| | | | | | | | | | AVFrame.decode_error_flags FF_DECODE_ERROR_CONCEALMENT_ACTIVE is set when the decoded frame has error(s) but the returned value from avcodec_receive_frame is zero i.e. concealed errors Signed-off-by: Amir Pauker <amir@livelyvideo.tv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_qsv: Try to select a matching VAAPI device by defaultMark Thompson2019-06-021-3/+12
| | | | | | | Tries to find a device backed by the i915 kernel driver and loads the iHD VAAPI driver to use with it. This reduces confusion on machines with multiple DRM devices and removes the surprising requirement to set the LIBVA_DRIVER_NAME environment variable to use libmfx at all.
* hwcontext_vaapi: Try to create devices via DRM before X11Mark Thompson2019-06-021-21/+21
| | | | | | | | Opening the device via X11 (DRI2/DRI3) rather than opening a DRM render node directly is only useful if you intend to use the legacy X11 interop functions. That's never true for the ffmpeg utility, and a library user who does want this will likely provide their own display instance rather than making a new one here.
* hwcontext_vaapi: Add option to set driver nameMark Thompson2019-06-021-0/+17
| | | | | | | For example: -init_hw_device vaapi:/dev/dri/renderD128,driver=foo This may be more convenient that using the environment variable, and allows loading different drivers for different devices in the same process.
* hwcontext_vaapi: Make default DRM device selection more helpfulMark Thompson2019-06-021-16/+60
| | | | | | | | | | | | Iterate over available render devices and pick the first one which looks usable. Adds an option to specify the name of the kernel driver associated with the desired device, so that it is possible to select a specific type of device in a multiple-device system without knowing the card numbering. For example: -init_hw_device vaapi:,kernel_driver=amdgpu will select only devices using the "amdgpu" driver (as used with recent AMD graphics cards). Kernel driver selection requires libdrm to work.
* hwcontext_vaapi: Add option to specify connection typeMark Thompson2019-06-021-4/+28
| | | | Can be set to "drm" or "x11" to force a specific connection type.
* avutil/dynarry.h: fix comment grammar mistakes of FF_DYNARRAY_ADDSteven Liu2019-06-011-1/+1
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avutil/tx: should check against (*ctx)Ruiling Song2019-05-161-1/+1
| | | | | | ctx is a pointer to pointer here. Signed-off-by: Ruiling Song <ruiling.song@intel.com>
* avutil/tx: fix forward compound non-mod-15 based MDCTsLynne2019-05-161-1/+1
| | | | | There was a hardcoded value left. Wasn't caught earlier as no code uses compound forward mod-3/5 MDCTs yet.
* lavu: bump minor and update APIchanges for the new transform APILynne2019-05-161-1/+1
|
* libavutil: add an FFT & MDCT implementationLynne2019-05-153-0/+886
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new API to libavutil to allow for arbitrary transformations on various types of data. This is a partly new implementation, with the power of two transforms taken from libavcodec/fft_template, the 5 and 15-point FFT taken from mdct15, while the 3-point FFT was written from scratch. The (i)mdct folding code is taken from mdct15 as well, as the mdct_template code was somewhat old, messy and not easy to separate. A notable feature of this implementation is that it allows for 3xM and 5xM based transforms, where M is a power of two, e.g. 384, 640, 768, 1280, etc. AC-4 uses 3xM transforms while Siren uses 5xM transforms, so the code will allow for decoding of such streams. A non-exaustive list of supported sizes: 4, 8, 12, 16, 20, 24, 32, 40, 48, 60, 64, 80, 96, 120, 128, 160, 192, 240, 256, 320, 384, 480, 512, 640, 768, 960, 1024, 1280, 1536, 1920, 2048, 2560... The API was designed such that it allows for not only 1D transforms but also 2D transforms of certain block sizes. This was partly on accident as the stride argument is required for Opus MDCTs, but can be used in the context of a 2D transform as well. Also, various data types would be implemented eventually as well, such as "double" and "int32_t". Some performance comparisons with libfftw3f (SIMD disabled for both): 120: 22353 decicycles in fftwf_execute, 1024 runs, 0 skips 21836 decicycles in compound_fft_15x8, 1024 runs, 0 skips 128: 22003 decicycles in fftwf_execute, 1024 runs, 0 skips 23132 decicycles in monolithic_fft_ptwo, 1024 runs, 0 skips 384: 75939 decicycles in fftwf_execute, 1024 runs, 0 skips 73973 decicycles in compound_fft_3x128, 1024 runs, 0 skips 640: 104354 decicycles in fftwf_execute, 1024 runs, 0 skips 149518 decicycles in compound_fft_5x128, 1024 runs, 0 skips 768: 109323 decicycles in fftwf_execute, 1024 runs, 0 skips 164096 decicycles in compound_fft_3x256, 1024 runs, 0 skips 960: 186210 decicycles in fftwf_execute, 1024 runs, 0 skips 215256 decicycles in compound_fft_15x64, 1024 runs, 0 skips 1024: 163464 decicycles in fftwf_execute, 1024 runs, 0 skips 199686 decicycles in monolithic_fft_ptwo, 1024 runs, 0 skips With SIMD we should be faster than fftw for 15xM transforms as our fft15 SIMD is around 2x faster than theirs, even if our ptwo SIMD is slightly slower. The goal is to remove the libavcodec/mdct15 code and deprecate the libavcodec/avfft interface once aarch64 and x86 SIMD code has been ported. New code throughout the project should use this API. The implementation passes fate when used in Opus, AAC and Vorbis, and the output is identical with ATRAC9 as well.
* avutil: Add NV24 and NV42 pixel formatsPhilip Langdale2019-05-124-2/+30
| | | | | | | | | | | | | These are the 4:4:4 variants of the semi-planar NV12/NV21 formats. These formats are not used much, so we've never had a reason to add them until now. VDPAU recently added support HEVC 4:4:4 content and when you use the OpenGL interop, the returned surfaces are in NV24 format, so we need the pixel format for media players, even if there's no direct use within ffmpeg. Separately, there are apparently webcams that use NV24, but I've never seen one.
* avutil/hwcontext_vdpau: Map 444 pix fmts to new VdpYCbCr typesManojGuptaBonda2019-05-052-5/+15
| | | | | | | | | | New VdpYCbCr Formats VDP_YCBCR_FORMAT_Y_U_V_444 and, VDP_YCBCR_FORMAT_Y_UV_444 have been added in VDPAU with libvdpau-1.2 to be used in get/putbits for YUV 4:4:4 surfaces. Earlier mapping of AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_YV12 is not valid. Hence this Change maps AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_Y_U_V_444 to access the YUV 4:4:4 surface via read-back API's of VDPAU.
OpenPOWER on IntegriCloud