Commit Graph

111401 Commits

Author SHA1 Message Date
Anton Khirnov
551a9af5a1 lavu/tests/cpu: stop processing the thread count
Just print it as it is.

Needed by the following commit.
2023-07-11 19:15:04 +02:00
Anton Khirnov
bbff143b07 lavfi/src_movie: stop using AV_CODEC_FLAG_COPY_OPAQUE
That feature is overkill for a constant pointer to AVFilterLink which
can be stored in AVCodecContext.opaque (indirectly, because the link is
not allocated yet at the time the codec is opened).

This also avoids leaking non-NULL AVFrame.opaque to callers.
2023-07-11 19:14:23 +02:00
Leo Izen
75b1a555a7
avcodec/libjxldec: build against libjxl 0.9
Git master libjxl changed several function signatures, so this commit
adds some #ifdefs to handle the new signatures without breaking old
releases. Do note that old git master development versions of libjxl
will be broken, but no releases will be.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-07-10 16:26:40 -04:00
Paul B Mahol
f3896a148e avfilter/avf_showcwt: fix frame slide output 2023-07-10 18:57:14 +02:00
Paul B Mahol
1324698ff3 avfilter/avf_showcwt: simplify EOF checking 2023-07-10 18:57:13 +02:00
Paul B Mahol
2f2f76def7 avfilter/avf_showcwt: optimize multiplication with kernel 2023-07-10 18:57:12 +02:00
Paul B Mahol
587189cdb9 avfilter/avf_showcwt: simplify cache handling 2023-07-10 18:57:10 +02:00
Paul B Mahol
2c4fa968b6 avfilter/avf_showcwt: use av_rescale() 2023-07-10 18:57:08 +02:00
Andreas Rheinhardt
a92dbeb9ae avcodec/decode: Return EAGAIN instead of discarding unused packet
Should fix #10457, a regression caused by
69516ab3e9.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-10 16:25:46 +02:00
Andreas Rheinhardt
f6dc85ae16 avcodec/hevc_ps: Improve PPS SCC extension bit depth check
From the spec: "It is a requirement of bitstream conformance that
the value of luma_bit_depth_entry_minus8 shall be equal to
the value of bit_depth_luma_minus8"; similarly for chroma.

Also fixes Coverity ticket #1529226 (complaining about the fact
that chroma_bit_depth_entry is checked twice).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-10 12:31:06 +02:00
Philip Langdale
1c61c24f5f vulkan/hevc: handle missing active PPS
I don't pretend to understand how we get into this situation, but there
are files out there where we can end up with the active PPS not being
identified when we call vk_hevc_end_frame. In these situations today,
we will segfault. So, before we give up, see if we can get the active
PPS id from the slice header, and use that if possible.

If that still doesn't work, return an error instead of segfaulting.
2023-07-10 16:49:32 +08:00
Dai, Jianhui J
3b358f151d avformat/ivfenc: Set the "number of frames" in IVF header
Should set "number of frames" to bytes 24-27 of IVF header, not
duration.
It is described by [1], and confirmed by parsing all IVF files in [2].

This commit also updates the md5sum of refs to pass fate-cbs.

[1] Duck IVF - MultimediaWiki
https://wiki.multimedia.cx/index.php/Duck_IVF

[2] webm/vp8-test-vectors
https://chromium.googlesource.com/webm/vp8-test-vectors

Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2023-07-09 16:56:58 -04:00
Paul B Mahol
fcbee7efdf avfilter/avf_showcwt: add qdrt frequency scale 2023-07-09 20:53:55 +02:00
Paul B Mahol
aee8689ba5 avfilter/avf_showcwt: add cbrt frequency scale 2023-07-09 20:53:54 +02:00
Paul B Mahol
7f23b72dde avfilter/avf_showcwt: add sqrt frequency scale 2023-07-09 20:53:52 +02:00
Marton Balint
7357012bb5 fftools/ffmpeg: fix negative timestamps at the beginning of the encoding
Also fix a couple of possible overflows while at it.

Fixes the negative initial timestamps in ticket #10358.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-09 19:50:15 +02:00
Marton Balint
f607e8517d avdevice/decklink_enc: use 64bit format string for BMD timebase instead of long long
BMDTimeValue is defined as LONGLONG on Windows, but int64_t on Linux/Mac.

Fixes format string warnings:

libavdevice/decklink_enc.cpp: In function ‘void construct_cc(AVFormatContext*, decklink_ctx*, AVPacket*, klvanc_line_set_s*)’:
libavdevice/decklink_enc.cpp:424:48: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘BMDTimeValue {aka long int}’ [-Wformat=]
                ctx->bmd_tb_num, ctx->bmd_tb_den);
                ~~~~~~~~~~~~~~~                 ^
libavdevice/decklink_enc.cpp:424:48: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘BMDTimeValue {aka long int}’ [-Wformat=]

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-09 19:50:15 +02:00
Paul B Mahol
20b8688092 avfilter/adynamicequalizer_template: fix peak filter 2023-07-09 11:58:22 +02:00
Paul B Mahol
889c2529cc avfilter/af_adynamicequalizer: simplify calculations 2023-07-09 11:58:03 +02:00
Andreas Rheinhardt
e52676e20b avformat/evc: Don't cast const away, avoid loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-09 03:05:00 +02:00
Andreas Rheinhardt
e5ab2dab2c avformat/evcdec: Check that enough data has been read
Fixes potential use of uninitialized values
in evc_read_nal_unit_length().

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-09 02:40:14 +02:00
Pavel Koshevoy
0056d9f176 avutil: fix build failure on osx 10.4
libavutil/random_seed.c calls arc4random_buf which is
not available on OSX 10.4 Tiger, but the configuration
script tests for arc4random which is available.

Fix the configuration test to match the actual API used.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-08 14:51:15 -03:00
Niklas Haas
13e9899014 lavfi/vf_libplacebo: add contrast recovery options
New upstream option. Enabled by default in the high-quality preset
upstream, so enable it by default here.
2023-07-08 12:54:49 +02:00
Niklas Haas
2e83ba001d lavfi/vf_libplacebo: deprecate hybrid_mix option
Deprecated upstream in libplacebo v6.292.
2023-07-08 12:41:45 +02:00
James Almer
13ef5025e3 fate/cbs: add more VVC tests
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-07 11:56:37 -03:00
James Almer
3a30abd8ae avcodec/cbs_h266: use exp_tile_height when checking the allowed range for pps_num_exp_tile_rows_minus1
Fixes warnings about variable set but not used.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-07 11:56:37 -03:00
James Almer
0f008a0ffa avcodec/cbs_h266: fix use of uninitialized value
And fix the allowed range for ph_log2_diff_max_bt_min_qt_intra_slice_luma while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-07 11:56:37 -03:00
Zhao Zhili
7eeef72c67 avcodec/nvenc: set idrPeriod to gopLength unconditionally
When intra_refresh is enabled, gopLength is equal to
NVENC_INFINITE_GOPLENGTH. gopLength should be 1 at least.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-07-07 13:39:26 +02:00
Zhao Zhili
0d0c39832f avcodec/nvenc: fix intraRefreshPeriod setting
Regression since 99dfdb45. intraRefreshPeriod access cc->gopLength,
which has been overwritten to NVENC_INFINITE_GOPLENGTH before.

Fixes #10445.
2023-07-07 13:39:26 +02:00
Anton Khirnov
ac616afa62 lavf/dv: stop setting a random video bitrate
A real value is determined from the bytestream.
2023-07-07 12:13:05 +02:00
Anton Khirnov
9b625ab679 lavc/dvdec: export bitrate
Changes the result of fate-mxf-probe-dv25, where the bitrate is now
exported.

Also changes the result of fate-bsf-dv-error-marker, where the exported
bitrate is now different. Note that the codec layer bitrate does not
match the container bitrate, because container timing is 25fps, while
the DV profile is 50.
2023-07-07 12:12:52 +02:00
Anton Khirnov
b54603a26a lavc/decode: do not perform decoding when sending draining packets
This way decoding errors will not be returned when the user starts
draining the decoder, avoiding confusion over whether draining did or
did not start.

Fixes failures of fate-h264-attachment-631 for certain numbers of frame
threads (e.g. 5).
2023-07-07 12:07:24 +02:00
Anton Khirnov
69516ab3e9 lavc/decode: move submitting input packets to bitstream filters
Do it from ff_decode_get_packet() rather than from
avcodec_send_packet(). This way all nontrivial stages of the decoding
pipeline (i.e. other than just placing a packet at its entrance) are
pull-based rather than a mix of push an pull.
2023-07-07 12:07:24 +02:00
Anton Khirnov
0f957cfba2 lavc/bsf: move IS_EMPTY() to packet_internal()
It will be useful in other places.
2023-07-07 12:07:24 +02:00
Anton Khirnov
c4332dfda9 lavc/decode: track whether the caller started draining with a separate flag
Decoding pipeline has multiple stages, some of which may have their own
delay (e.g. bitstream filters). The code currently uses
AVCodecInternal.draining to track all of them, but they do not have to
all be in sync.
2023-07-07 12:07:24 +02:00
Anton Khirnov
fd915dc1da lavc: move AVCodecInternal.last_audio_frame to EncodeContext
It does not need to be visible outside of encode.c.
2023-07-07 12:07:24 +02:00
Anton Khirnov
232700154c lavc: add generic-encode-layer private data
Move AVCodecInternal.intra_only_flag to it, should should not be visible
outside of encode.c.
2023-07-07 12:07:23 +02:00
Anton Khirnov
f2fb882b3f lavc: add generic-decode-layer private data
Move AVCodecInternal.nb_draining_errors to it, should should not be
visible outside of decode.c.
2023-07-07 12:07:23 +02:00
Anton Khirnov
21de4db402 lavc: reindent after previous commit 2023-07-07 12:07:23 +02:00
Anton Khirnov
6ff27024b8 lavc/avcodec: split flushing into decode- and encode-specific functions
Will allow making some state private to encoding/decoding in the future.
2023-07-07 12:07:23 +02:00
Anton Khirnov
5e7b5b0090 lavc: add a header for internal generic-layer APIs
The goal is to distinguish between APIs provided by the generic layer to
individual codecs and APIs internal to the generic layer.

Start by moving ff_{decode,encode}_receive_frame() and
ff_{decode,encode}_preinit() into this new header, as those functions
are called from generic code and should not be visible to individual
codecs.
2023-07-07 12:07:23 +02:00
Andreas Rheinhardt
83c0f7b046 avformat/evcdec: Avoid nonsense casts
For uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE], &buf still points
to the beginning of buf, but it is of type "pointer to array of
EVC_NALU_LENGTH_PREFIX_SIZE uint8_t" (i.e. pointer arithmetic
would operate on blocks of size EVC_NALU_LENGTH_PREFIX_SIZE).
This is of course a different type than uint8_t*, which is why
there have been casts in evc_read_packet(). But these are unnecessary
if one justs removes the unnecessary address-of operator.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-07 03:47:29 +02:00
QiTong Li
79f41a0760 fftools/ffplay: fix typo in frame_queue_destory
Not sure if the function naming frame_queue_destory is intended because
"destory" is not really a word. Changing it to "destroy" makes more sense.

Signed-off-by: QiTong Li <liqitong@163.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-06 21:24:47 +02:00
Marton Balint
4e27b485d7 avcodec/mpeg12dec: ignore picture start code in extradata for AVID mpeg2 files
AVID IMX MPEG2 files in MOV seems to have extradata like this:

00000000: 0000 0018 4143 4c52 4143 4c52 3030 3031  ....ACLRACLR0001
00000010: 0000 0001 0000 0000                      ........

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-06 21:08:57 +02:00
James Almer
b7f4d5fa7e avutil/random_seed: add support for gcrypt and OpenSSL as source of randomness
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-06 15:30:27 -03:00
James Almer
68e9d2835f avcodec/cbs_h266: add support for Adaptation parameter set NALU type
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-06 11:43:13 -03:00
Frank Plowman
4b19690ff4 cbs_h266: add range extension support
example clips:
  * 12b444vvc1_E_Sony_2
  * 12b444Ietsrc_A_Kwai_2
  * 10b444P16_D_Sony_2
  * 12b444Iepp_A_Sharp_2
  * 12b444SPetsrc_B_Kwai_2

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-06 09:05:13 -03:00
John Cox
f00222e81f avfilter/vf_bwdif: Add neon for filter_line3
Signed-off-by: John Cox <jc@kynesim.co.uk>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-07-06 00:21:05 +03:00
John Cox
697533e76d avfilter/vf_bwdif: Add a filter_line3 method for optimisation
Add an optional filter_line3 to the available optimisations.

filter_line3 is equivalent to filter_line, memcpy, filter_line

filter_line shares quite a number of loads and some calculations in
common with its next iteration and testing shows that using aarch64
neon filter_line3s performance is 30% better than two filter_lines
and a memcpy.

Adds a test for vf_bwdif filter_line3 to checkasm

Rounds job start lines down to a multiple of 4. This means that if
filter_line3 exists then filter_line will not sometimes be called
once at the end of a slice depending on thread count. The final slice
may do up to 3 extra lines but filter_edge is faster than filter_line
so it is unlikely to create any noticable thread load variation.

Signed-off-by: John Cox <jc@kynesim.co.uk>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-07-06 00:21:05 +03:00
John Cox
94cb94a2c0 avfilter/vf_bwdif: Add neon for filter_line
Exports C filter_line needed for tail fixup of neon code
Adds neon for filter_line

Signed-off-by: John Cox <jc@kynesim.co.uk>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-07-06 00:21:05 +03:00