summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* avutil/mips: optimize UNPCK&SAD macros with MSA2.0 instruction.Shiyou Yin2019-07-10
| | | | | | | 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-07
| | | | | 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-29
| | | | | 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-16
| | | | | | | | | | 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-02
| | | | | | | 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-02
| | | | | | | | 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-02
| | | | | | | 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-02
| | | | | | | | | | | | 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-02
| | | | 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-01
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avutil/tx: should check against (*ctx)Ruiling Song2019-05-16
| | | | | | 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-16
| | | | | 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-16
|
* libavutil: add an FFT & MDCT implementationLynne2019-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-12
| | | | | | | | | | | | | 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-05
| | | | | | | | | | 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.
* Merge commit 'c4642788e83b0858bca449f9b6e71ddb015dfa5d'James Almer2019-05-02
|\ | | | | | | | | | | | | * commit 'c4642788e83b0858bca449f9b6e71ddb015dfa5d': time_internal: Prefix fallback versions of gmtime_r/localtime_r with ff_ Merged-by: James Almer <jamrial@gmail.com>
| * time_internal: Prefix fallback versions of gmtime_r/localtime_r with ff_Martin Storsjö2019-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a macro to redirect calling code from the official name to the ff_ prefixed one. Detecting these functions in configure can be tricky (on mingw, they are conditionally available depending on posix feature defines). If configure didn't detect them, but they still are visible at compile time (due to an unrelated header defining the posix feature defines), providing the local fallback versions with a prefixed name is safer. Signed-off-by: Martin Storsjö <martin@martin.st>
| * time_internal: Do not attempt to override *time_r() macrosMichael Niedermayer2019-04-16
| | | | | | | | | | | | | | In case these already are defined as macros, we shouldn't try to redefine them. Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavu/hwcontext_qsv: Fix the realign check for hwuploadLinjie Fu2019-04-30
| | | | | | | | | | | | | | | | | | | | Fix the aligned check in hwupload, input surface should be 16 aligned too. Partly fix #7830. Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
* | avutil/avstring: Fix bug and undefined behavior in av_strncasecmp()Michael Niedermayer2019-04-24
| | | | | | | | | | | | | | | | | | The function in case of n=0 would read more bytes than 0. The end pointer could be beyond the allocated space, which is undefined. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavu/hwcontext_d3d: Cast src pointers calling av_image_copy*().Carl Eugen Hoyos2019-04-19
| | | | | | | | | | | | | | | | Silences several warnings: libavutil/hwcontext_d3d11va.c:413:49: warning: passing argument 3 of ‘av_image_copy’ from incompatible pointer type libavutil/hwcontext_d3d11va.c:425:47: warning: passing argument 3 of ‘av_image_copy’ from incompatible pointer type libavutil/hwcontext_dxva2.c:351:45: warning: passing argument 3 of ‘av_image_copy’ from incompatible pointer type libavutil/hwcontext_dxva2.c:382:52: warning: passing argument 3 of ‘av_image_copy_uc_from’ from incompatible pointer type
* | avutil/colorspace: add macros for RGB->YUV BT.709Gyan Doshi2019-04-19
| |
* | lavu/hwcontext_qsv: Mark a pointer as const.Carl Eugen Hoyos2019-04-16
| | | | | | | | | | Silences a warning: libavutil/hwcontext_qsv.c:912:15: warning: assignment discards 'const' qualifier from pointer target type
* | avcodec/videotoolbox: add support for 10bit pixel formatfumoboy0072019-04-16
| | | | | | | | | | this patch was originally posted on issue #7704 and was slightly adjusted to check for the availability of the pixel format.
* | libavutil/hwcontext_opencl: Fix channel order in format support checkJarek Samic2019-04-09
| | | | | | | | | | | | | | | | | | | | | | | | | | The `opencl_get_plane_format` function was incorrectly determining the value used to set the image channel order. This resulted in all RGB pixel formats being set to the `CL_RGBA` pixel format, regardless of whether or not they actually *were* RGBA. This patch fixes the issue by using the `offset` and depth of components rather than the loop index to determine the value of `order`. Signed-off-by: Jarek Samic <cldfire3@gmail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* | avutil/hcontext_cuda: Remove unnecessary stream synchronisationPhilip Langdale2019-03-30
| | | | | | | | | | | | | | Similarly to the previous changes, we don't need to synchronise after a memcpy to device memory. On the other hand, we need to keep synchronising after a copy to host memory, otherwise there's no guarantee that subsequent host reads will return valid data.
* | lavu/opencl: replace va_ext.h with standard nameRuiling Song2019-03-22
| | | | | | | | | | | | | | | | | | Khronos OpenCL header (https://github.com/KhronosGroup/OpenCL-Headers) uses cl_va_api_media_sharing_intel.h. And Intel's official OpenCL driver for Intel GPU (https://github.com/intel/compute-runtime) was compiled against Khronos OpenCL header. So it's better to align with Khronos. Signed-off-by: Ruiling Song <ruiling.song@intel.com>
* | lavu/qsv: allow surface size larger than requirementZhong Li2019-03-18
| | | | | | | | | | | | | | Just like commit 6829a079444e10818a847e153121fb458cc5c0a8, surface size larger than requirement should not be treated as error. Signed-off-by: Zhong Li <zhong.li@intel.com>
* | avcodec/mips: [loongson] mmi optimizations for VP9 put and avg functionsgxw2019-02-27
| | | | | | | | | | | | | | VP9 decoding speed improved about 60.5%(from 38fps to 61fps, tested on loongson 3A3000). Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/cuda_check: Fix non-dynamic-loader implementationPhilip Langdale2019-02-24
| | | | | | | | | | | | | | | | | | The function typedefs we were using are only present when using the dynamic loader, which means compilation breaks for code directly using the cuda SDK. To fix this, let's just duplicate the function typedefs locally. These are not going to change.
* | Merge commit '41cf3e3b1ca375962951fde1b90a03b16197d205'James Almer2019-02-20
|\| | | | | | | | | | | | | * commit '41cf3e3b1ca375962951fde1b90a03b16197d205': arm: Create proper .rdata sections for COFF Merged-by: James Almer <jamrial@gmail.com>
| * arm: Create proper .rdata sections for COFFMartin Storsjö2019-01-25
| | | | | | | | | | | | | | | | | | | | | | | | As .rodata isn't one of the default created sections for COFF, it was created as a read-write data section. By using the default .rdata section name for COFF, it automatically becomes a read-only data section. The existing ".section .rodata" works as intended for ELF though. This is based on an original patch and diagnose by Tom Tan <Tom.Tan@microsoft.com>. Signed-off-by: Martin Storsjö <martin@martin.st>
| * pixfmt: Add GRAY10Carl Eugen Hoyos2018-11-06
| | | | | | | | | | | | Based on 7471352f by Luca Barbato. Signed-off-by: James Almer <jamrial@gmail.com>
| * libavutil: Undeprecate the AVFrame reordered_opaque fieldMartin Storsjö2018-11-05
| | | | | | | | | | | | | | | | This was marked as deprecated (but only in the doxygen, not with an actual deprecation attribute) in 81c623fae05 in 2011, but was undeprecated in ad1ee5fa7. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '5584abf69d83169a010aca404cd1cf95c23ad9ef'James Almer2019-02-20
|\| | | | | | | | | | | | | * commit '5584abf69d83169a010aca404cd1cf95c23ad9ef': arm: Emit .thumb_func directives Merged-by: James Almer <jamrial@gmail.com>
| * arm: Emit .thumb_func directivesMartin Storsjö2018-10-12
| | | | | | | | | | | | | | | | | | | | | | Prior to Xcode 9.3, the clang built-in assembler didn't support altmacro, and gas-preprocessor was used for assembling for arm/darwin. For thumb functions, gas-preprocessor took care of adding the .thumb_func directives, but when now being able to assemble without gas-preprocessor, we need to add these directives ourselves. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avutil/cuda_check: avoid pointlessly exporting same symbol from two librariesTimo Rothenpieler2019-02-14
| |
* | lavu/parseutils: Allow to parse >= 100 hours.Carl Eugen Hoyos2019-02-09
| | | | | | | | | | Reported and tested by gamnark. Fixes ticket #7721.
* | avutil/ppc/cpu: Fix power8 linux detectionLauri Kasanen2019-02-05
| | | | | | | | | | The existing code was in no released kernel that I can see. The corrected code was added in 3.9.
* | lavu/imgutils: Use FFABS() instead of abs() for ptrdiff_t.Carl Eugen Hoyos2019-02-01
| | | | | | | | | | | | | | Fixes a warning with clang: libavutil/imgutils.c:314:16: warning: absolute value function 'abs' given an argument of type 'ptrdiff_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value
* | avcodec/mips: [loongson] optimize put_hevc_qpel_hv_8 with mmi.Shiyou Yin2019-01-22
| | | | | | | | | | | | | | Optimize put_hevc_qpel_hv_8 with mmi in the case width=4/8/12/16/24/32/48/64. This optimization improved HEVC decoding performance 11%(1.81x to 2.01x, tested on loongson 3A3000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()Michael Niedermayer2019-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | This is strongly based on code by Marton Balint, and depends on the previous commit Fixes: Timeout Fixes: 11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in 11209 ms After: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in 4104 ms Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/mem: Optimize fill32() by unrolling and using 64bitMichael Niedermayer2019-01-20
| | | | | | | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavu/frame: Fix typo.Carl Eugen Hoyos2019-01-18
| |
* | avutil: add ROI (Region Of Interest) data struct and bump versionGuo, Yejun2019-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The encoders such as libx264 support different QPs offset for different MBs, it makes possible for ROI-based encoding. It makes sense to add support within ffmpeg to generate/accept ROI infos and pass into encoders. Typical usage: After AVFrame is decoded, a ffmpeg filter or user's code generates ROI info for that frame, and the encoder finally does the ROI-based encoding. The ROI info is maintained as side data of AVFrame. Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | intreadwrite: add AV_RL64A, AV_WL64APeter Ross2019-01-11
| | | | | | | | | | | | | | | | macros for reading and writing 64-bit aligned little-endian values. these macros are used by the DST decoder and give a performance boost on platforms that where the compiler must guard against unaligned memory access.
* | Add HDR dynamic metadata struct (for SMPTE 2094-40) to libavutilMohammad Izadi2018-12-21
| | | | | | | | | | | | | | | | The dynamic metadata contains data for color volume transform - application 4 of SMPTE 2094-40:2016 standard. The data comes from HEVC in the SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavu/internal: Replace an empty loop with "do {}".Carl Eugen Hoyos2018-12-19
| | | | | | | | | | | | | | Silences a clang warning when not compiling for x86: libswscale/utils.c:345:13: warning: while loop has empty body Suggested-by: Nicolas George
* | avutil/tests/random_seed: seeds[] is uint32_t, therefore use PRIX32 macroPeter Ross2018-12-16
| | | | | | | | squelch format type warning