Commit Graph

105659 Commits

Author SHA1 Message Date
Andreas Rheinhardt 66d7a21132 avcodec/cbs: Make ff_cbs_insert_unit_data() always append the new unit
All split functions (the only users of this function) only
append units.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08 06:02:05 +01:00
Andreas Rheinhardt f183ae787a avcodec/cbs_jpeg: Remove redundant counter
Use -1 as the position in ff_cbs_insert_unit_data()
which implicitly reuses frag->nb_units as the counter.

Also switch to a do-while-loop, as it is more natural
than a for-loop now that the counter is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08 04:30:02 +01:00
Andreas Rheinhardt d64e27f521 avcodec/cbs_mpeg2: Remove redundant counter
Use -1 as the position in ff_cbs_insert_unit_data()
which implicitly reuses frag->nb_units as the counter.

Also switch to a do-while-loop, as it is more natural
than a for-loop now that the counter is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08 04:00:30 +01:00
Aman Karmani 2f299c0b8b avutil: use getauxval(3) for CPU capabilities on linux/android ARM
getauxval is marginally faster, and works even when procfs is not mounted

support on Linux was added in glibc 2.16
support on Android was added in 4.4 (API 20)
fixes #6578

Signed-off-by: Aman Karmani <aman@tmm1.net>
2022-02-07 13:42:40 -08:00
Lynne 04cc7a5548
lavu/tx: wrap missed string in NULL_IF_CONFIG_SMALL
It's the only one that isn't defined through the macros used elsewhere.
2022-02-07 04:23:31 +01:00
Lynne eac4c3574b
lavu/tx: disable debugging information when CONFIG_SMALL 2022-02-07 03:56:47 +01:00
Lynne 3bbe9c5e38
lavu/tx: refactor assembly codelet definition
This commit does some refactoring to make defining assembly codelets
smaller, and fixes compiler redefinition warnings. It also allows
for other assembly versions to reuse the same boilerplate code as
x86.

Finally, it also adds the out_of_place flag to all assembly codelets.
This changes nothing, as out-of-place operation was assumed to be
available anyway, but this makes it more explicit.
2022-02-07 03:56:45 +01:00
Anton Khirnov a10f1aec1f avutil/fifo: Deprecate old FIFO API
Users should switch to the superior AVFifo API.

Unfortunately AVFifoBuffer fields cannot be marked as deprecated because
it would trigger a warning wherever fifo.h is #included, due to
inlined av_fifo_peek2().
2022-02-07 00:31:49 +01:00
Anton Khirnov e6469e68cc ffmpeg: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov bdf9ed41fe ffplay: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov c65c2ed01d lavfi/vf_deshake_opencl: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 85c938fa28 lavfi/qsvvpp: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 90eef1c3de lavu/threadmessage: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov d1bd189c63 lavu/audio_fifo: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 082136209c lavu/audio_fifo: drop an unnecessary include
Nothing in audio_fifo.h uses anything from fifo.h
2022-02-07 00:31:23 +01:00
Anton Khirnov d46fd9640f lavd/jack: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 36117968ad lavf/async: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 70a1774f1a lavf/udp: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 5fe2c37734 lavf/swfenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov ea511196a6 lavf/mpegenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 60414afc9d lavf/dvenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 7e2be84a94 lavf/dvenc: return an error on audio/video desync 2022-02-07 00:31:23 +01:00
Andreas Rheinhardt d3c6156ce3 avcodec/qsvenc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-07 00:31:23 +01:00
Anton Khirnov 35e52d21dc lavc/qsvenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 08181624e0 lavc/qsvdec: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 587545c9e0 lavc/nvenc: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 9ef4b6699b lavc/libvpxenc: remove unneeded context variable
discard_hdr10_plus is 0 IFF hdr10_plus_fifo is non-NULL, so we can test
for the latter and avoid an extra variable.
2022-02-07 00:31:23 +01:00
Anton Khirnov 4b066b53b2 lavc/libvpxenc: switch to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov a718d84e92 lavc/libvorbisenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 6eaf5cd00a lavc/cuviddec: convert to the new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov de40342c04 lavc/cuviddec: do not reallocate the fifo unnecessarily 2022-02-07 00:31:23 +01:00
Anton Khirnov 70611d7f3b lavc/amfenc: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 37e70d4802 lavc/avcodec: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Anton Khirnov 93ed375574 lavu/tests/fifo: switch to the new API 2022-02-07 00:31:23 +01:00
Anton Khirnov 14429f8fec lavu/fifo: add a flag for automatically growing the FIFO as needed
This will not increase the FIFO beyond 1MB, unless the caller explicitly
specifies otherwise.
2022-02-07 00:31:23 +01:00
Anton Khirnov 7329b22c05 lavu/fifo: Add new AVFifo API based upon the notion of element size
Many AVFifoBuffer users operate on fixed-size elements (e.g. pointers),
but the current FIFO API deals exclusively in bytes, requiring extra
complexity in all these callers.

Add a new AVFifo API creating a FIFO with an element size
that may be larger than a byte. All operations on such a FIFO then
operate on complete elements.

This API does not reuse AVFifoBuffer and its API at all, but instead uses
an opaque struct called AVFifo. The AVFifoBuffer API will be deprecated
in a future commit once all of its users have been switched to the new
API.

Not reusing AVFifoBuffer also allowed to use the full range of size_t
from the beginning.
2022-02-07 00:30:22 +01:00
Anton Khirnov 5939c8d361 lavu/fifo: disallow overly large fifo sizes
The API currently allows creating FIFOs up to
- UINT_MAX: av_fifo_alloc(), av_fifo_realloc(), av_fifo_grow()
- SIZE_MAX: av_fifo_alloc_array()
However the usable limit is determined by
- rndx/wndx being uint32_t
- av_fifo_[size,space] returning int
so no FIFO should be larger than the smallest of
- INT_MAX
- UINT32_MAX
- SIZE_MAX
(which should be INT_MAX an all commonly used platforms).
Return an error on trying to allocate FIFOs larger than this limit.
2022-02-07 00:29:05 +01:00
Andreas Rheinhardt 2d71f93c7c avutil/fifo: Use av_fifo_generic_peek_at() for av_fifo_generic_peek()
Avoids code duplication. It furthermore properly checks
for buf_size to be > 0 before doing anything.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-07 00:29:05 +01:00
Zhao Zhili 03afa12762 avformat/rtpproto: set ttl upper bound to 255
Also remove bogus millisecond reference from help text.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-02-06 23:04:59 +01:00
Zhao Zhili 9daac85da8 avformat/udp: set ttl upper bound to 255
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-02-06 22:59:18 +01:00
Paul B Mahol e597ea4c0e avfilter/asrc_sinc: switch to rdft from lavu/tx 2022-02-06 12:45:47 +01:00
Paul B Mahol cfe6df99fa configure: afir filter no longer depends on rdft from avcodec 2022-02-06 11:28:27 +01:00
Zane van Iperen f14dbb4bf5
avformat/mxfdec: add avlanguage dependency
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-02-06 13:20:46 +10:00
Paul B Mahol bedb4bac1c avfilter/vf_cas: unbreak >8 depth support 2022-02-05 20:56:33 +01:00
Jason Jang 306994b887 avfilter/af_apsyclip: increase protection for high frequencies
This reduces sibilance distortion when sibilance and bass are
present at the same time. Bringing the protection of high
frequencies up to about the same level as for low frequencies
should also make the quality less dependent on the frequency
balance of the playback system.

Signed-off-by: Jason Jang <jcj83429@gmail.com>
2022-02-05 14:52:16 +01:00
Jason Jang 18fceb9926 avfilter/af_apsyclip: fix peak overestimation
Ignore more samples that are near the edge of the block. The reason
is that the filtering tends to cause these samples to go above the
window more than the samples near the middle. If these samples are
included in the unwindowed peak estimation, the peak can be
overestimated. Because the block is windowed again before
overlapping, overshoots near the edge of the block are not very
important.

0.1 is the value from the version originally contributed to calf.

Signed-off-by: Jason Jang <jcj83429@gmail.com>
2022-02-05 14:52:16 +01:00
Jason Jang b4ad13420f avfilter/af_apsyclip: fix FFT bin indexing
With a complex FFT instead of real FFT, the negative frequencies
are not dropped from the spectrum output, so they need to be scaled
when the positive frequencies are scaled. The location of the top
bin is also different.

Signed-off-by: Jason Jang <jcj83429@gmail.com>
2022-02-05 14:52:16 +01:00
Zane van Iperen 40766ae1da
avformat/imf: cosmetics
s/++i/i++/g

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-02-05 22:52:46 +10:00
Pierre-Anthony Lemieux bec300f4e1
avformat/tests: add /imf to .gitignore
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-02-05 22:52:39 +10:00
James Almer 0ea87ebc19 avformat/demux: don't truncate the return value of ts_to_samples()
Signed-off-by: James Almer <jamrial@gmail.com>
2022-02-05 09:44:59 -03:00