1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00
Commit Graph

109663 Commits

Author SHA1 Message Date
Paul B Mahol
2c3107c3e9 avformat/bonk: remove unused variable 2023-01-25 18:49:09 +01:00
Leo Izen
6f79f0971e
avcodec/png: support cICP chunks
This commit adds both decode and encode support for cICP chunks, which
allow a PNG image's pixel data to be tagged by any of the enum values in
H.273, without an ICC profile.

Upon decode, if a cICP chunk is present, the PNG decoder will tag output
AVFrames with the resulting enum color, and ignore iCCP, sRGB, gAMA, and
cHRM chunks, as per the spec.

Upon encode, if the color space is known and specified, and it is not sRGB,
the PNG encoder will output a cICP chunk containing the color space. If the
color space is sRGB, then it will output an sRGB chunk instead of a cICP
chunk. If the color space of the input is not unspecified, it will not output
a cICP chunk tagging the PNG as unspecified.

In either the sRGB case or the non-SRGB case, gAMA and cHRM are still written
as fallbacks provided the info is known.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-01-25 08:09:24 -05:00
Leo Izen
f7bab37c8e
avcodec/pngdec: support decoding sRGB chunks
If an sRGB chunk is present in the PNG file, this commit will cause the
png decoder to ignore the cHRM and gAMA chunks and tag the resulting AVFrames
with BT.709 primaries, and ISO/IEC 61966-2-1 transfer. If these tags are
present in the AVFrame, pngenc.c already writes this chunk, so no change was
needed on the encode-side.

The PNG spec does not define what happens if sRGB and iCCP are present at
the same time, it just recommends that this not happen. As of this patch,
the decoder will have the ICC profile take precedence, and it will not tag
the pixel data as sRGB.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-01-25 08:09:20 -05:00
Leo Izen
2548c32cc1
avcodec/png: use libavutil/csp.h for cHRM chunks
The cHRM chunk is descriptive. That is, it describes the primaries that should
be used to interpret the pixel data in the PNG file. This is notably different
from Mastering Display Metadata, which describes which subset of the presented
gamut is relevant. MDM describes a gamut and says colors outside the gamut are
not required to be preserved, but it does not actually describe the gamut that
the pixel data from the frame resides in. Thus, to decode a cHRM chunk present
in a PNG file to Mastering Display Metadata is incorrect.

This commit changes this behavior so the cHRM chunk, if present, is decoded to
color metadata. For example, if the cHRM chunk describes BT.709 primaries, the
resulting AVFrame will be tagged with AVCOL_PRI_BT709, as a description of its
pixel data. To do this, it utilizes libavutil/csp.h, which exposes a funcction
av_csp_primaries_id_from_desc, to detect which enum value accurately describes
the white point and primaries represented by the cHRM chunk.

This commit also changes pngenc.c to utilize the libavuitl/csp.h API, since it
previously duplicated code contained in that API. Instead, taking advantage of
the API that exists makes more sense. pngenc.c does properly utilize the color
tags rather than incorrectly using MDM, so that required no change.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-01-25 08:09:16 -05:00
Stefano Sabatini
843a446713 ffprobe: fix data hash rendering
Print data hash before side data list, fix wrong nesting level of data hash
element.

In particular, fix trac issue:
http://trac.ffmpeg.org/ticket/7217
2023-01-24 23:58:00 +01:00
Stefano Sabatini
b6219c9114 ffprobe: use pkt->dts to compute interval ts when pts is missing
For some samples the pkt->pts is always missing, use the pkt->dts
instead.

Fix trac issue:
http://trac.ffmpeg.org/ticket/4427
2023-01-24 23:58:00 +01:00
Mark Thompson
aaa49a7a42 cbs_av1: Remove constraint on MDCV luminance values
While desiring min to be less than max feels entirely sensible,
unfortunately the standard does not actually have this requirement.
2023-01-24 21:41:55 +00:00
Paul B Mahol
20b96494de avfilter/vf_scdet: fix introduced discrepancy with latest change 2023-01-24 22:02:45 +01:00
Ashyni
69c060bea2 avfilter/vf_cropdetect: add ability to change limit at runtime
Fixes: https://trac.ffmpeg.org/ticket/9851

Signed-off-by: Ashyni <jeffrey.c@tuta.io>
2023-01-24 21:53:53 +01:00
Paul B Mahol
3110e28456 avcodec/dpcm: add .flush
Otherwise after seek, DC offset for audio samples might be big.
2023-01-24 16:58:01 +01:00
Paul B Mahol
b8640bfc99 avformat: add WADY demuxer 2023-01-24 16:58:01 +01:00
Paul B Mahol
c5a545cff8 avcodec: add WADY DPCM decoder 2023-01-24 16:58:01 +01:00
Leo Izen
9d5e66942c avcodec/libjxldec: fix gamma22 and gamma28 recognition
Gamma 2.2 and Gamma 2.8 are tagged in the file as 0.45455 and 0.35714,
respectively (i.e. 1/2.2 and 1/2.8). Trying to identify them as 2.2 and
2.8 instead of these values will cause the transfer function to not
properly be recognized. This patch fixes this.
2023-01-22 17:00:57 +02:00
Paul B Mahol
ab8cde6efa avfilter/vf_dblur: also filter last scanline 2023-01-19 12:33:55 +01:00
Paul B Mahol
31c15a0880 avfilter/vf_dblur: allow radius < 1.0 2023-01-19 12:33:55 +01:00
Anton Khirnov
ba36e6ed52 lavc/tests/bitstream: test bits_*_signed_nz and bits_peek_signed* 2023-01-18 09:41:32 +01:00
Anton Khirnov
0b33310cd0 lavc/bitstream: avoid UB in bits_{read,peek}_signed(0)
bits_*_signed(0) will currently invoke an undefined shift by
8 * sizeof(int).

Add bits_*_signed_nz() that only works for n>0, analogous to
bits_read_nz(). Add an explicit check for n=0 in bits_*_signed().

Found-by: James Almer
2023-01-18 09:41:32 +01:00
Paul B Mahol
bf23d530d2 avfilter/vf_histogram: call av_frame_copy_props() 2023-01-17 23:20:00 +01:00
OvchinnikovDmitrii
c13d959343 lavc/libvpx: increase thread limit to 64
This change improves the performance and multicore scalability of the vp9
codec for streaming single-pass encoded videos by taking advantage of up
to 64 cores in the system. The current thread limit for ffmpeg codecs is 16
(MAX_AUTO_THREADS in pthread_internal.h) due to a limitation in H.264 codec
that prevents more than 16 threads being used.

Experiments show that increasing the thread limit to 64 for vp9 improves
the performance for encoding 4K raw videos for streaming by up to 47%
compared to 16 threads, and from 20-30% for 32 threads, with the same quality
as measured by the VMAF score.

Rationale for this change:
Vp9 uses tiling to split the video frame into multiple columns; tiles must
be at least 256 pixels wide, so there is a limit to how many tiles can be
used. The tiles can be processed in parallel, and more tiles mean more CPU
threads can be used. 4K videos can make use of 16 threads, and 8K videos
can use 32. Row-mt can double the number of threads so 64 threads can be used.

Signed-off-by: James Zern <jzern@google.com>
2023-01-17 14:02:55 -08:00
Paul B Mahol
6ce51e5ee1 avfilter/vf_lagfun: call av_frame_copy_props() 2023-01-17 22:55:14 +01:00
Paul B Mahol
3cc08688e3 avfilter/vf_elbg: call av_frame_copy_props() 2023-01-17 22:43:39 +01:00
Paul B Mahol
ceb52d47a3 avfilter/avf_showvolume: set output video frame duration 2023-01-17 19:02:35 +01:00
Paul B Mahol
04bbf5f70d avfilter/vsrc_gradients: set output video frame duration 2023-01-17 18:49:31 +01:00
Paul B Mahol
a13931843e avfilter/avf_abitscope: set output time_base and output frame duration 2023-01-17 18:36:37 +01:00
Paul B Mahol
2c3f211b6d avfilter/af_virtualbass: call av_frame_copy_props() 2023-01-17 18:36:37 +01:00
Paul B Mahol
07485a6975 avfilter/vf_scdet: change threshold checking
Also allow score to match threshold thus allowing ==0.0 scores.
2023-01-17 18:03:14 +01:00
Paul B Mahol
11b02fc675 avfilter/af_arnndn: unbreak filtering 2023-01-17 17:46:58 +01:00
Paul B Mahol
180a7d2d6c avfilter/af_arnndn: call av_frame_copy_props() 2023-01-17 17:46:58 +01:00
Paul B Mahol
697e0fc062 avfilter/af_afftfilt: call av_frame_copy_props() 2023-01-17 17:46:58 +01:00
Paul B Mahol
5625f0542d avfilter/af_afftdn: call av_frame_copy_props() 2023-01-17 17:46:58 +01:00
Paul B Mahol
6d2b57fd31 avfilter/vsrc_cellauto: set video frame duration 2023-01-17 17:46:58 +01:00
Paul B Mahol
e845c3e00a avfilter/vsrc_life: set video frame duration 2023-01-17 17:46:58 +01:00
Paul B Mahol
45910b2504 avfilter/vsrc_mandelbrot: set video frame duration 2023-01-17 17:46:58 +01:00
Paul B Mahol
96d4f74548 avfilter/vsrc_mptestsrc: set video frame duration 2023-01-17 17:46:58 +01:00
Paul B Mahol
218278b11d avfilter/vsrc_testsrc: set video frame duration 2023-01-17 17:46:57 +01:00
Paul B Mahol
aa24719843 avfilter/vsrc_sierpinski: set video frame duration 2023-01-17 17:46:57 +01:00
Paul B Mahol
d590fbf306 avfilter/vf_ciescope: fix black-point position 2023-01-17 17:46:57 +01:00
Paul B Mahol
e6b9191e92 avfilter/vf_ciescope: switch to anti-aliased lines 2023-01-17 17:46:57 +01:00
Paul B Mahol
6b8adbfe03 avfilter/avf_a3dscope,avf_showcwt: set video frame duration 2023-01-17 14:50:08 +01:00
Paul B Mahol
2cee62295f avfilter/af_dialoguenhance: call av_frame_copy_props() 2023-01-17 14:50:08 +01:00
Paul B Mahol
8885d5dc7a avfilter/af_surround: call av_frame_copy_props() 2023-01-17 14:50:08 +01:00
Paul B Mahol
6a205d244a avfilter/af_afir: call av_frame_copy_props() 2023-01-17 14:50:08 +01:00
Michael Niedermayer
cc7e984a05
avcodec/scpr3: Check bx
Fixes: Out of array access
Fixes: 55102/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-4877396618903552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-17 12:54:54 +01:00
Michael Niedermayer
4d42d82563
avcodec/012v: Order operations for odd size handling
Fixes: out of array access
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZERO12V_fuzzer-6714182078955520.fuzz
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZERO12V_fuzzer-6698145212137472.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-01-17 12:54:29 +01:00
Haihao Xiang
faf0afb5d9 lavfi/overlay_vaapi: remove unnecessary code
VA-API filter is not required.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08:00
Haihao Xiang
f1a8d3b0b6 lavfi/vaapi: remove duplicated code
Add a ff_ function to handle mulitple pipeline parameters. No functional
changes.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08:00
Aman Karmani
f5f1c1fd6b avcodec/vaapi_encode_h26x: passthrough A53 CC data as H264/HEVC SEI
Signed-off-by: Aman Karmani <aman@tmm1.net>
2023-01-17 10:10:52 +08:00
Haihao Xiang
7491545320 lavfi/qsv: use QSVVPPContext as base context in vf_vpp_qsv/vf_overlay_qsv
The same members between QSVVPPContext and VPPContext are removed from
VPPContext, and async_depth is moved from QSVVPPParam to QSVVPPContext
so that all QSV filters using QSVVPPContext may support async depth.

In addition, we may use QSVVPPContext as base context in other QSV
filters in the future so that we may re-use functions defined in
qsvvpp.c for other QSV filters.

This commit shouldn't change the functionality of vpp_qsv / overlay_qsv.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08:00
Haihao Xiang
3763635ef4 lavfi/qsvvpp: set output frame durations
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08:00
Haihao Xiang
6ce23ebaac lavfi/vf_vpp_qsv: check output format string against NULL pointer
This is in preparation for reusing the code for other QSV filters. E.g.
deinterlacing_qsv may have an option array without format option

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08:00