1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

113785 Commits

Author SHA1 Message Date
Zhao Zhili
4ea2b271eb avformat/libsrt: Remove manually free AV_OPT_TYPE_STRING
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-02-22 19:13:36 +08:00
Zhao Zhili
80cd6e655b avcodec/audiotoolboxenc: Ensure frame_size isn't zero
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-02-22 19:13:13 +08:00
Zhao Zhili
338e33b084 avcodec/audiotoolboxenc: remove CAP_VARIABLE_FRAME_SIZE from alac
AV_CODEC_CAP_VARIABLE_FRAME_SIZE has been set for alac_at encoder,
which means avctx->frame_size should be zero. However, alac_at
encoder also set avctx->frame_size. This leading to assert failure
in ffmpeg_sched.c
	av_assert0(enc->sq_idx[0] >= 0);

Actually, the implementation of audiotoolboxenc.c doesn't support
frame_size been zero.

Fix #10720.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-02-22 19:13:02 +08:00
James Almer
76b2bb96b4 avutil/tx: print debug log at trace level
The output of TX is extremely verbose and makes it harder to find other debug
log messages, so print most of it at trace level.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-22 00:29:59 -03:00
Andreas Rheinhardt
4179c121c3 avcodec/movtextenc: Don't copy data around unnecessarily
Using av_bprint_init_for_buffer() avoids copying data
into the internal AVBPrint buffer (or worse: to allocate
a temporary buffer in case the internal buffer does not
suffice).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:45:31 +01:00
Andreas Rheinhardt
e9a587af25 avcodec/srtenc, webvttenc: Use av_printf_format
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:45:31 +01:00
Andreas Rheinhardt
ed9de6d2d8 avcodec/ttmlenc: Remove always-true check
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:45:31 +01:00
Andreas Rheinhardt
253a8340f5 avcodec/ttmlenc: Don't copy data around unnecessarily
Using av_bprint_init_for_buffer() avoids copying data
into the internal AVBPrint buffer (or worse: to allocate
a temporary buffer in case the internal buffer does not
suffice).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:45:31 +01:00
Andreas Rheinhardt
abea3749b3 avcodec/webvttenc: Don't copy data around unnecessarily
Using av_bprint_init_for_buffer() avoids copying data
into the internal AVBPrint buffer (or worse: to allocate
a temporary buffer in case the internal buffer does not
suffice). It also ensures that the data is always
0-terminated.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:45:31 +01:00
Andreas Rheinhardt
686af4578c avcodec/srtenc: Don't copy data around unnecessarily
Using av_bprint_init_for_buffer() avoids copying data
into the internal AVBPrint buffer (or worse: to allocate
a temporary buffer in case the internal buffer does not
suffice). It also ensures that the data is always
0-terminated, whereas the current code never does this
and returns success in case the length of the
string to write and the size of the buffer coincide.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:45:31 +01:00
Andreas Rheinhardt
b8a00a1f73 avcodec/assenc: Use size_t for length of string
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:45:31 +01:00
Andreas Rheinhardt
fe08058f24 avcodec/cbs_vp8: Don't leave out ... in calls to variadic macros
It is undefined behaviour (see C11, 6.10.3 (4); see also
14dd0a9057).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:42:28 +01:00
Andreas Rheinhardt
76b4151175 avcodec/h264dec: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:42:28 +01:00
Andreas Rheinhardt
b550dd670a avcodec/h264dec: Return early in ff_h264_draw_horiz_band()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-22 01:42:28 +01:00
Martin Storsjö
1f1abb27f1 configure: Fix a typo
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-02-21 23:28:21 +02:00
Martin Storsjö
8a9b02389d checkasm: Add a "run-checkasm" make target
Contrary to the existing "fate-checkasm", this always prints the
tool output, and runs all tests at once instead of splitting it up
per target group. This is more useful when the user expects to
look directly at the tool output, instead of being part of a full
fate run.

(On failure with the regular "make fate-checkasm" targets, none of
the tool output is printed, but stored in files. If run with reporting
set up to the FATE website, the individual failures are uploaded there,
but if it is run in some sort of other CI setup, the intermediate files
might not be available afterwards for inspection.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-02-21 23:27:28 +02:00
James Almer
d06cc1cb47 fate/mov: rename a test group to better reflect what it requires
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-21 18:03:06 -03:00
James Almer
ebed8be508 fate/mov: add missing samples dependency to avif/heic tests
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-21 17:56:41 -03:00
James Almer
733d641211 fate/mov: add missing ffprobe dependency to mov-write-amve
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-21 17:46:54 -03:00
Andreas Rheinhardt
4d86e64d33 avcodec/cbs_vp8: Remove empty flush callback
This callback is optional and should therefore only be set
if it actually does something.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 19:24:19 +01:00
Andreas Rheinhardt
e2f56f2bac fate/image: Enable fate-webp-rgb-lossless-palette-predictor test
Postponed in 9f4708c22d
because the sample had not been uploaded at that time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 19:24:19 +01:00
sunyuechi
9cb8f262f2 lavc/me_cmp: R-V V sse
C908:
sse_0_c: 614.7
sse_0_rvv_i32: 138.2
sse_1_c: 302.7
sse_1_rvv_i32: 107.2
sse_2_c: 175.7
sse_2_rvv_i32: 104.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-21 20:08:55 +02:00
sunyuechi
37463d7979 lavc/me_cmp: R-V V pix_abs_y2
C908:
pix_abs_0_2_c: 904.0
pix_abs_0_2_rvv_i32: 172.2
pix_abs_1_2_c: 460.0
pix_abs_1_2_rvv_i32: 168.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-21 20:08:25 +02:00
sunyuechi
f1ec475f66 lavc/me_cmp: R-V V pix_abs_x2
C908:
pix_abs_0_1_c: 767.0
pix_abs_0_1_rvv_i32: 196.2
pix_abs_1_1_c: 388.0
pix_abs_1_1_rvv_i32: 185.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-21 20:08:25 +02:00
sunyuechi
b41e115dde lavc/me_cmp: R-V V pix_abs
C908:
pix_abs_0_0_c: 534.0
pix_abs_0_0_rvv_i32: 136.2
pix_abs_1_0_c: 287.7
pix_abs_1_0_rvv_i32: 125.2
sad_0_c: 534.0
sad_0_rvv_i32: 136.2
sad_1_c: 287.7
sad_1_rvv_i32: 125.2

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2024-02-21 20:08:25 +02:00
Michael Niedermayer
e9cc9e492f
libswscale/utils: Fix bayer to yuvj
Fixes: out of array access.

Earlier code assumes that a unscaled bayer to yuvj420 converter exists
but the later code then skips yuvj420

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-02-21 18:24:17 +01:00
Michael Niedermayer
f9906911f0
Revert "swscale: fix sws_setColorspaceDetails after sws_init_context"
Suggested by: Niklas Haas in Ticket10824

Fixes: Assertion failure
Fixes: Ticket10824

This reverts commit cedf589c09.
2024-02-21 18:24:17 +01:00
Michael Niedermayer
8caa84cec7
tools: Add target_sws_fuzzer.c
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-02-21 18:24:17 +01:00
Michael Niedermayer
64098d0cd8
swscale/swscale: Check srcSliceH for bayer
Fixes: Assertion srcSliceH > 1 failed at libswscale/swscale_unscaled.c:1359
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-02-21 18:24:16 +01:00
Michael Niedermayer
18f26f8a2f
swscale/utils: Allocate more dithererror
Fixes: out of array read
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-02-21 18:24:16 +01:00
Dale Curtis
6ef32ea574
Avoid OOM for invalid STCO / CO64 constructions.
The `entries` value is read directly from the stream and used to
allocate memory. This change clamps `entries` to however many are
possible in the remaining atom or file size (whichever is smallest).

Fixes https://crbug.com/1429357

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-02-21 18:23:41 +01:00
Anton Khirnov
a3f69cdec7 fftools/ffmpeg: cosmetics, vertically align structs 2024-02-21 10:33:20 +01:00
Anton Khirnov
6b6815b1c8 fftools/ffmpeg: move subtitle helpers to ffmpeg_dec, their only user 2024-02-21 10:31:27 +01:00
Anton Khirnov
826cfd9997 fftools/ffmpeg_filter: pass framerate through InputFilterOptions
Rather than read it directly from InputStream.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
fef3052df3 fftools/ffmpeg_filter: pass autorotate/reinit flags through InputFilterOptions
Rather than read them directly from InputStream.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
6315f78e0c fftools/ffmpeg_filter: pass sub2video canvas size through InputFilterOptions
Rather than read them directly from InputStream.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
bd3c1c194b fftools/ffmpeg_filter: accept a name from its upstream input
Do not construct the name manually from input file/stream indices.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
8f592eb35f fftools/ffmpeg_filter: compute input trim start/end in demuxer
The computation is based on demuxer properties, so that is the more
appropriate place for it. Filter code just receives the desired
start time/duration.
2024-02-21 10:27:20 +01:00
Anton Khirnov
09438d6529 fftools/ffmpeg_filter: stop taking display matrix from global side data
It should never be necessary now that decoders propagate global side
data to frames.
2024-02-21 10:27:20 +01:00
Andreas Rheinhardt
cb9f1f59a1 avutil/version: Remove outdated checks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 01:07:03 +01:00
Andreas Rheinhardt
39b4b5aad7 avcodec: Remove superfluous ';' outside of functions
Inside a function an extra ';' is a null statement;
but outside of it it simply must not happen.
So remove them.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 01:06:29 +01:00
Andreas Rheinhardt
48612de63c avcodec/vvc/vvcdsp: Remove pointless wrappers
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 01:06:22 +01:00
Andreas Rheinhardt
ef04737e18 avcodec/vvc/vvc_ps: Use union for luts to avoid unaligned accesses
These arrays are currently accessed via uint16_t* pointers
although nothing guarantees their alignment. Furthermore,
this is problematic wrt the effective-type rules.
Fix this by using a union of arrays of uint8_t and uint16_t.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 01:06:10 +01:00
Andreas Rheinhardt
1eafbc27e2 avcodec/vvc/vvc_ps: Check before access
max_bin_idx can be at most LMCS_MAX_BIN_SIZE - 1 here,
so pivot[LCMS_MAX_BIN_SIZE + 1] may be accessed,
but pivot has only LCMS_MAX_BIN_SIZE + 1 elements
(unless the values of pivot were so that it is always
assured that pivot[LCMS_MAX_BIN_SIZE] is always < sample
(which it is iff it is always < 2^bit_depth - 1)).
So reorder the checks.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 01:04:28 +01:00
Andreas Rheinhardt
1d66a122df avcodec/avcodec: Deprecate AV_INPUT_BUFFER_MIN_SIZE
It used to be used with preallocated packet buffers with
the old encode API, but said API is no more and therefore
there is no reason for this to be public any more.
So deprecate it and use an internal replacement
for the encoders using it as an upper bound for the
size of their headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 00:24:44 +01:00
Andreas Rheinhardt
b6b33f7edd avutil/common: Move includes to the beginning of the file
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 00:23:39 +01:00
Andreas Rheinhardt
27cd7011bc avutil/tests/pixelutils: Remove dead code
Forgotten in e6b125e3be.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-21 00:23:20 +01:00
Jan Ekström
37936b09ce avcodec/av1dec: fix matrix coefficients exposed by codec context
`colorspace` in avcodec terms means `matrix coefficients`.

Reviewed-by: James Almer <jamrial@gmail.com>
2024-02-20 20:54:17 +02:00
Andreas Rheinhardt
870d9730d6 avutil/hwcontext_vaapi: Allocate pub and priv frames hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to VAAPIFramesContext as one no longer has to
go through AVHWFramesInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-20 19:08:23 +01:00
Andreas Rheinhardt
520c1b0a7c avutil/hwcontext_vaapi: Allocate public and priv device hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to VAAPIDeviceContext as one no longer has to
go through AVHWDeviceInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-20 19:08:14 +01:00