1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00
Commit Graph

105513 Commits

Author SHA1 Message Date
Andreas Rheinhardt
67e1013a96 avcodec/cbs_mpeg2: Use smaller scope for variables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08 07:11:14 +01:00
Andreas Rheinhardt
70a90fb73e avcodec/internal.h: Move avpriv_find_start_code() to startcode.h
This is by definition the appropriate place for it.
Remove all the now unnecessary libavcodec/internal.h inclusions;
also remove other unnecessary headers from the affected files.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08 06:22:14 +01:00
Andreas Rheinhardt
27f22f3383 all: Remove unnecessary libavcodec/internal.h inclusions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08 06:16:26 +01:00
Andreas Rheinhardt
115ac90ec9 avcodec/cbs_mpeg2: Simplify splitting fragment
avpriv_find_start_code() supports non-contiguous buffers
by maintaining a state that allows to find start codes
that span across multiple buffers; a consequence thereof
is that avpriv_find_start_code() is given a zero-sized
buffer, it does not modify this state, so that it appears
as if a start code was found if the state contained a start code.

This can e.g. happen with Sequence End units in MPEG-2 and
to counter this, cbs_mpeg2_split_fragment() reset the state
when it has already encountered the end of the fragment
in order to add the last unit (if it is only of the form 00 00 01 xy)
only once; it also used a flag to set whether this is the final unit.

Yet this can be improved by simply resetting state unconditionally
(thereby avoiding a branch); the flag can be removed by just checking
whether we have a valid start code (of the next unit to add)
at the end.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08 06:10:08 +01:00
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