Commit Graph

106839 Commits

Author SHA1 Message Date
Thilo Borgmann 79286d3eb6 avfilter/vf_blurdetect: fix uninitialized variables and possible div by zero
Found-by: Coverity
2022-04-27 11:41:41 +02:00
Paul B Mahol 39f22df6cd avfilter/vsrc_testsrc: fix typo for yellow patch 2022-04-26 22:04:30 +02:00
Paul B Mahol 944e60f4ae avfilter/vf_blurdetect: remove set but not used variables 2022-04-26 20:15:26 +02:00
Paul B Mahol 452d611fc7 avfilter/vf_lut3d: allow to control when to upload CLUT for haldclut 2022-04-26 20:07:04 +02:00
Thilo Borgmann 1da3394adb avfilter/vf_blurdetect: cleanup headers, remove unused variables, fix type of variable 2022-04-26 12:39:17 +02:00
Andre Kempe 861285c146 arm64: Fix wrong BTI landing pad
This patch fixes a wrong type of BTI landing pad when branching to
functions instantiated via the fft*_neon macro.

Although the previously employed paciasp instruction serves as a landing
pad, for the ways that this function is invoked it is the wrong type, resulting
in an unexpected termination of the running process.

Signed-off-by: André Kempe <andre.kempe@arm.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-04-26 10:26:49 +03:00
Paul B Mahol 08ac8bda38 avfilter/vf_colormap: avoid reallocating memory to build map 2022-04-26 09:21:56 +02:00
Paul B Mahol 494139bcc7 doc/filters: add colorchart to section 2022-04-26 09:21:56 +02:00
Paul B Mahol f908f365f9 avfilter/vf_colormap: change default nb_patches 2022-04-26 09:21:55 +02:00
Jan Ekström ded0334d21 avcodec/libsvtav1: add support for setting chroma sample location
Support for configuring this was added with version 1.0.0.
2022-04-26 09:17:47 +03:00
Christopher Degawa 6fd1533057 avcodec/libsvtav1: pass pict_type to library
match the behavior of SvtAv1EncApp to ensure pic_type is always set
before passing it to the library.

The other options for pic_type aren't currently used inside the library,
so they aren't introduced in this patch.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-04-25 20:35:31 -03:00
Thilo Borgmann b23208826b lavfi: Add blurdetect filter 2022-04-25 20:52:15 +02:00
Thilo Borgmann 22df52c444 lafi/vf_edgedetect: Move some common functions into seperate file 2022-04-25 20:52:15 +02:00
Vignesh Venkatasubramanian f2724d2b69 avformat/mov: Add avif to list of supported extensions
AVIF still and animations are now supported by the MOV parser.
Add the "avif" extension to the list of supported extensions to
AVInputFormat.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2022-04-25 15:42:11 +05:30
Christopher Snowhill 944b8c96c9 avcodec/audiotoolboxdec: Properly fill out_format
Monterey needs mBytesPerFrame and mBytesPerPacket to be set, and I'm
surprised this didn't break any previous system versions.

Fixes bug #9564: Cannot decode xHE-AAC with audiotoolbox (aac_at) on
Mac OS Monterey. Fixes likely bug that none of the AudioToolbox
decoders work on Monterey.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-24 19:11:33 -03:00
Paul B Mahol 058a1ff9b4 avcodec/pcm-blurayenc: set fixed number of samples per packet
Other values are forbidden by specification.
2022-04-24 14:26:47 +02:00
Wu Jianhua 037fa0437d avcodec/x86/hevc_mc: add qpel_h64_8_avx512icl
ff_hevc_put_hevc_qpel_h64_8_sse4       56782981
ff_hevc_put_hevc_qpel_h64_8_avx2       40097816
ff_hevc_put_hevc_qpel_h64_8_avx512icl  25488576

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:47:13 +08:00
Wu Jianhua 68437bf169 avcodec/x86/hevc_mc: add qpel_h32_8_avx512icl
ff_hevc_put_hevc_qpel_h32_8_sse4       14122151
ff_hevc_put_hevc_qpel_h32_8_avx2        9337675
ff_hevc_put_hevc_qpel_h32_8_avx512icl   6424654

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:47:09 +08:00
Wu Jianhua 6fbb8cc8ad avcodec/x86/hevc_mc: add qpel_h4_8_avx512icl
ff_hevc_put_hevc_qpel_h4_8_sse4       993694
ff_hevc_put_hevc_qpel_h4_8_avx512icl  686647

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:47:01 +08:00
Wu Jianhua c1790b60d6 avcodec/x86/hevc_mc: add qpel_h16_8_avx512icl
ff_hevc_put_hevc_qpel_h16_8_sse4       3290870
ff_hevc_put_hevc_qpel_h16_8_avx512icl  1730033

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:46:41 +08:00
Wu Jianhua d4cd8830bd avcodec/x86/hevc_mc: add qpel_h8_8_avx512icl and qpel_hv8_8_avx512icl
This commit uses the instruction `vpdpbusd` introduced by AVX512 VNNI
to calculate the horizontal filter.

ff_hevc_put_hevc_qpel_h8_8_sse4       1039169
ff_hevc_put_hevc_qpel_h8_8_avx512icl   677153
ff_hevc_put_hevc_qpel_hv8_8_sse4      3603511
ff_hevc_put_hevc_qpel_hv8_8_avx512icl 2995354

Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2022-04-24 14:45:59 +08:00
Paul B Mahol fe85afbf8c avfilter/af_afftdn: use better approach for gain smoothing 2022-04-23 23:05:51 +02:00
Jan Ekström eae3b84189 libavfilter/version: bump minor version for icc{gen,detect}
Missed during that patch set's life time.
2022-04-23 23:07:26 +03:00
Leo Izen 58039129e5 avformat/version: bump minor version for Jpeg XL
The version.h bump got missed with the Jpeg XL patchset. This should
bump the minor version in accordance with the contributing guidelines.
2022-04-23 22:57:56 +03:00
Leo Izen cfbde390f3 avcodec/version: bump minor version for Jpeg XL
The version.h bump got missed with the Jpeg XL patchset. This should
bump the minor version in accordance with the contributing guidelines.
2022-04-23 22:57:56 +03:00
Niklas Haas 2cb0cebd11 lavfi: add vf_iccdetect for parsing ICC profiles
This filter is designed to parse embedded ICC profiles and attempt
extracting colorspace tags from them, updating the AVFrame metadata
accordingly.

This is intentionally made a separate filter, rather than being part of
libavcodec itself, so that it's an opt-in behavior for the time being.
This also gives the user more flexibility to e.g. first attach an ICC
profile and then also set the colorspace tags from it.

This makes #9673 possible, though not automatic.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas 5cfeaeef0c lavfi: add vf_iccgen for generating ICC profiles
This filter is designed to specifically cover the task of generating ICC
profiles (and attaching them to output frames) on demand. Other tasks,
such as ICC profile loading/stripping, or ICC profile application, are
better left to separate filters (or included into e.g. vf_setparams).

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas b9a25963f7 lavfi: add ICC profile support via lcms2
This introduces an optional dependency on lcms2 into FFmpeg. lcms2 is a
widely used library for ICC profile handling, which apart from being
used in almost all major image processing programs and video players,
has also been deployed in browsers. As such, it's both widely available
and well-tested.

Add a few helpers to cover our major use cases. This commit merely
introduces the helpers (and configure check), even though nothing uses
them yet.

It's worth pointing out that the reason the cmsToneCurves for each
AVCOL_TRC are cached inside the context, is because constructing a
cmsToneCurve requires evaluating the curve at 4096 (by default) grid
points and constructing a LUT. So, we ideally only want to do this once
per curve. This matters for e.g. ff_icc_profile_detect_transfer, which
essentially compares a profile against all of these generated LUTs.
Re-generating the LUTs for every iteration would be unnecessarily
wasteful.

The same consideration does not apply to e.g. cmsCreate*Profile, which
is a very lightweight operation just involving struct allocation and
setting a few pointers.

The cutoff value of 0.01 was determined by experimentation. The lowest
"false positive" delta I saw in practice was 0.13, and the largest
"false negative" delta was 0.0008. So a value of 0.01 sits comfortaby
almost exactly in the middle.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas 072dd047f0 lavfi: add ff_detect_color_primaries helper
Related to #9673, this helper exists to facilitate "guessing" the right
primary tags from a given set of raw primary coefficients.

The cutoff value of 0.001 was chosen by experimentation. The smallest
"false positive" delta observed in practice was 0.023329, while the
largest "false negative" delta was 0.00016. So, a value of 0.001 sits
comfortably in the middle.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Niklas Haas 6d83036662 lavfi: generalize colorspace coefficent helpers
These are needed beyond just vf_colorspace, so give them a new home in
colorspace.h.

In addition to moving code around, also merge the white point and
primary coefficients into a single struct to slightly increase the
convenience and shrink the size of the new API by avoiding the need
to introduce an extra function just to look up the white point as well.
The only place the distinction matters is in a single enum comparison,
which can just as well be a single memcpy - the difference is
negligible.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-04-23 21:51:55 +02:00
Leo Izen 3ac23440ef avformat/image2: add Jpeg XL as image2 format
This commit adds support to libavformat for muxing
and demuxing Jpeg XL images as image2 streams.
2022-04-23 19:51:46 +02:00
Leo Izen 5f0b4e9c70 avcodec/libjxl: add Jpeg XL encoding via libjxl
This commit adds encoding support to libavcodec
for Jpeg XL images via the external library libjxl.
2022-04-23 19:51:46 +02:00
Leo Izen 458cc7e314 avcodec/libjxl: add Jpeg XL decoding via libjxl
This commit adds decoding support to libavcodec
for Jpeg XL images via the external library libjxl.
2022-04-23 19:51:46 +02:00
Leo Izen 0008c15956 avcodec/jpegxl: add Jpeg XL image codec
This commit adds support to libavcodec to read
encoded Jpeg XL images. Jpeg XL is intended to be an
extended-life replacement to legacy mjpeg.
2022-04-23 19:51:46 +02:00
Paul B Mahol ce23794b91 avfilter/avf_showspectrum: filter support all channel counts 2022-04-23 19:24:43 +02:00
Paul B Mahol a64e250680 avfilter/af_afftdn: add gain_smooth option 2022-04-23 16:25:45 +02:00
Paul B Mahol 16463520d9 avfilter: add colorchart video filter 2022-04-23 11:00:42 +02:00
Paul B Mahol 43ea19fef4 avfilter: add colormap video filter 2022-04-23 10:59:34 +02:00
Paul B Mahol b1b7249606 avfilter/vf_lagfun: small speed-up 2022-04-23 10:58:29 +02:00
Vignesh Venkatasubramanian 499e245b85 avformat/mov: Add support for still image AVIF parsing
This patch supports AVIF still images conforming to the
final specification that have exactly one item (i.e. no alpha channel).
The iloc box is parsed and the mov index populated.

Partially fixes #7621.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2022-04-23 13:26:34 +05:30
Marton Balint 0d666200d3 avutil/timecode: use timecode fps for number of frame digits
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-22 22:54:58 +02:00
Marton Balint 8dd5bb7280 avformat/mov: fix timecode with high frame rate content
60 fps content have "Number of Frames" set to 30 in the tmcd atom, but the
frame duration / timescale reflects the original video frame rate.

Therefore we multiply the frame count with the quotient of the rounded timecode
frame rate and the "Number of Frames" per second to get a frame count in the original
(higher) frame rate.

Note that the frames part in the timecode will be in high frame rate which will
make the timecode different to e.g. MediaInfo which seems to show the 30 fps
timecode even for 120 fps content.

Regression since 428b4aacb1.

Fixes ticket #9710.
Fixes ticket #9492.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-22 22:54:56 +02:00
Marton Balint 58454749a7 avformat/rtmpproto: send proper status for response to play command
This fixes referencing the uninitialized filename variable.

Fixes ticket #9711.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-22 22:06:04 +02:00
Marton Balint 58aa06bea0 avutil/cpu: #define _GNU_SOURCE before including any standard headers
Otherwise its effect might not work causing CPU_COUNT to not get defined.

Fixes cpu count detection to actually use sched_getaffinity if available.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-22 21:58:47 +02:00
Michael Niedermayer fbd22504c4 avfilter/vsrc_mandelbrot: Check for malloc failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-22 12:24:14 +02:00
Martin Storsjö 70db14376c swscale: aarch64: Optimize the final summation in the hscale routine
Before:                     Cortex A53      A72      A73  Graviton 2  Graviton 3
hscale_8_to_15_width8_neon:     8273.0   4602.5   4289.5      2429.7      1629.1
hscale_8_to_15_width16_neon:   12405.7   6803.0   6359.0      3549.0      2378.4
hscale_8_to_15_width32_neon:   21258.7  11491.7  11469.2      5797.2      3919.6
hscale_8_to_15_width40_neon:   25652.0  14173.7  12488.2      6893.5      4810.4

After:
hscale_8_to_15_width8_neon:     7633.0   3981.5   3350.2      1980.7      1261.1
hscale_8_to_15_width16_neon:   11666.7   5951.0   5512.0      3080.7      2131.4
hscale_8_to_15_width32_neon:   20900.7  10733.2   9481.7      5275.2      3862.1
hscale_8_to_15_width40_neon:   24826.0  13536.2  11502.0      6397.2      4731.9

Thus, this gives overall a 8-29% speedup for the smaller filter
sizes, around 1-8% for the larger filter sizes.

Inspired by a patch by Jonathan Swinney <jswinney@amazon.com>.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-04-22 10:49:46 +03:00
Zhao Zhili d1a44f261a examples/decode_video: flush parser to fix missing frame
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-04-22 11:26:51 +08:00
Paul B Mahol 0b6e801d4a avfilter/avf_showfreqs: add option to draw subset of channels 2022-04-22 01:20:21 +02:00
Paul B Mahol fd834924d7 avfilter/avf_showfreqs: filter support all channel counts 2022-04-22 01:20:21 +02:00
Michael Niedermayer d353909e77 avfilter/vf_frei0r: Copy to frame allocated according to frei0r requirements
Fixes: issues with non trivial linesize

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-21 22:42:20 +02:00