1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-18 03:19:31 +02:00
Commit Graph

109462 Commits

Author SHA1 Message Date
Hubert Mazur
9ccf8c5bfc sw_scale: Add specializations for hscale 16 to 15
Add arm64 neon implementations for hscale 16 to 15 with filter
sizes 4, 8 and X4.

The tests and benchmarks run on AWS Graviton 2 instances.
The results from a checkasm tool are shown below.

hscale_16_to_15__fs_4_dstW_512_c: 6703.5
hscale_16_to_15__fs_4_dstW_512_neon: 2298.0
hscale_16_to_15__fs_8_dstW_512_c: 10983.0
hscale_16_to_15__fs_8_dstW_512_neon: 3216.5
hscale_16_to_15__fs_12_dstW_512_c: 15526.0
hscale_16_to_15__fs_12_dstW_512_neon: 3993.0
hscale_16_to_15__fs_16_dstW_512_c: 20183.5
hscale_16_to_15__fs_16_dstW_512_neon: 5369.7
hscale_16_to_15__fs_32_dstW_512_c: 39315.2
hscale_16_to_15__fs_32_dstW_512_neon: 9511.2
hscale_16_to_15__fs_40_dstW_512_c: 48995.7
hscale_16_to_15__fs_40_dstW_512_neon: 11570.0

(Note, the checkasm tests for these functions haven't been
merged since they fail on x86.)

Signed-off-by: Hubert Mazur <hum@semihalf.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-11-01 15:24:53 +02:00
Hubert Mazur
1e9cfa5bb0 sw_scale: Add specializations for hscale 8 to 19
Add arm64 neon implementations for hscale 8 to 19 with filter
sizes 4, 4X and 8. Both implementations are based on very similar ones
dedicated to hscale 8 to 15. The major changes refer to saving
the data - instead of writing the result as int16_t it is done
with int32_t.

These functions are heavily inspired on patches provided by J. Swinney
and M. Storsjö for hscale8to15 which were slightly adapted for
hscale8to19.

The tests and benchmarks run on AWS Graviton 2 instances. The results
from a checkasm tool shown below.

hscale_8_to_19__fs_4_dstW_512_c: 5663.2
hscale_8_to_19__fs_4_dstW_512_neon: 1259.7
hscale_8_to_19__fs_8_dstW_512_c: 9306.0
hscale_8_to_19__fs_8_dstW_512_neon: 2020.2
hscale_8_to_19__fs_12_dstW_512_c: 12932.7
hscale_8_to_19__fs_12_dstW_512_neon: 2462.5
hscale_8_to_19__fs_16_dstW_512_c: 16844.2
hscale_8_to_19__fs_16_dstW_512_neon: 4671.2
hscale_8_to_19__fs_32_dstW_512_c: 32803.7
hscale_8_to_19__fs_32_dstW_512_neon: 5474.2
hscale_8_to_19__fs_40_dstW_512_c: 40948.0
hscale_8_to_19__fs_40_dstW_512_neon: 6669.7

Signed-off-by: Hubert Mazur <hum@semihalf.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-11-01 15:24:43 +02:00
Peter Ross
16af424bf9 avcodec/svq1dec: detect buggy FFmpeg encoder and apply correction to interframe mean symbols
The FFmpeg encoder does not increment the temporal reference field, so use
that knowledge plus the extradata field to detect buggy versions of the encoder.
2022-11-01 10:14:31 +11:00
Peter Ross
6fe8556a19 avcodec/svq1: fix interframe mean VLC symbols
Fixes ticket #128.

The SVQ1 interframe mean VLC symbols -128 and 128 are incorrectly swapped
in our SVQ1 implementation, resulting in visible artifacts for some videos.
This patch unswaps the order of these two symbols.

The most noticable example of the artiacts caused by this error can be observed in
https://trac.ffmpeg.org/attachment/ticket/128/svq1_set.7z '352_288_k_50.mov'.
The artifacts are not observed when using the reference decoder
(QuickTime 7.7.9 x86 binary).

As a result of this patch, the reference data for the fate-svq1 test
($SAMPLES/svq1/marymary-shackles.mov) must be modified. For this file, our
decoder output is now bitwise identical to the reference decoder. I have
tested patch with various other samples and they are all now bitwise identical.
2022-11-01 09:24:29 +11:00
Peter Ross
b0c1f248d9 avcodec/svq1enc: output ident string in extradata field
This will enable the acurate identification of FFmpeg produced
SVQ1 streams, should there be new bugs found in the encoder.
2022-11-01 09:24:29 +11:00
Peter Ross
e1dd4a27ca avcodec/svq1enc: do not use ambiguous interframe mean symbols
Don't emit interframe mean symbols -128 and 128.
2022-11-01 09:24:29 +11:00
Peter Ross
db77483363 avcodec/mss2: initialise wmv9_mask variable
initialised to -1 which indicates wmv9 mask not present
2022-11-01 09:16:48 +11:00
Timo Rothenpieler
d772419237 configure: add pkg-config check for OpenAL 2022-10-31 18:42:12 +01:00
James Zern
fff4dbd90b avcodec/libaomdec: fix pix_fmt w/AVCOL_SPC_RGB
Signed-off-by: James Zern <jzern@google.com>
Reviewed-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2022-10-31 10:06:55 -07:00
Andreas Rheinhardt
539777f008 avcodec/rv34: Remove always-true/false checks
low_delay is always zero for rv34.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-31 12:01:33 +01:00
Andreas Rheinhardt
1916ead811 avcodec/flvdec, intelh263dec: Remove redundant assignments
ff_mpeg1_dc_scale_table is the default value for
[yc]_dc_scale_table (as set by ff_mpv_common_defaults()).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-31 12:01:33 +01:00
Andreas Rheinhardt
700a39e63c avcodec/mpegvideodata: Mark tables as hidden
This e.g. allows compilers to bake the offset implied
by using ff_mpeg12_dc_scale_table[3] (as the SpeedHQ encoder
does) into the general offset; for certain arches this is
also necessary in order to avoid building suboptimal code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-31 12:01:33 +01:00
Andreas Rheinhardt
908b7fcfb2 avcodec/mpegvideodata: Join mpeg1/2 dc scale tables
Avoids relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-31 12:01:33 +01:00
Andreas Rheinhardt
920ce150c6 avcodec/mpegvideodata: Make DC scale tables smaller
These tables are only accessed in ff_set_qscale()
which only accesses values 1..31 as well as in
encode_picture() in mpegvideo_enc.c, accessing
the value with index 8. So make these tables smaller.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-31 12:01:33 +01:00
Andreas Rheinhardt
ed5a438f05 avcodec/mpegvideo_enc: Initialize dct_unquantize_int(ra|er) only once
For encoders, mpeg_quant is an option of the MPEG-4 encoder
and therefore constant. This implies that one can set
the dct_unquantize_(intra|inter) function pointers during init.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-30 23:52:24 +01:00
James Almer
5d5b87f688 avformat/mov_chan: use the cube layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-10-30 16:46:48 -03:00
James Almer
83e918de71 avutil/channel_layout: add a cube channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
2022-10-30 16:18:30 -03:00
Brendan Hack
01b9abd771 avfilter/vf_frei0r: set align to 1 for frei0r frames
The frei0r API requires linesize to be width * 4.
Since the align property of ff_default_get_video_buffer2
specifies line alignment, not buffer alignment, the
previous value of 16 breaks this requirement for frames
whose width is a multiple of 8, but not a multiple of 16
as it adds extra padding to ensure line aligment.

Fix Trac ticket #9873
2022-10-29 17:11:14 +02:00
Andreas Rheinhardt
17987b371b avcodec/mpegvideo: Remove incorrect comment
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-29 13:37:41 +02:00
Andreas Rheinhardt
7e93fba51f avcodec/mpegvideo: Remove always-false check
This basically reverts cc0380222a.
At the time of said commit, cleanup on init failure was very
buggy. For codecs with the INIT_CLEANUP cap, the close function
could be called on error even before the private data has been
allocated; and when using frame threading the same could also
happen even without said flag. Some mpegvideo decoders were
affected by the latter.

Yet both of these issues have been fixed long ago, the latter
in commit e9b6617579. Therefore
the workaround in ff_mpv_common_end() can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-29 13:37:41 +02:00
Andreas Rheinhardt
ca96456c0e avcodec/msmpeg4dec: Move setting decode_mb for WMV2 to wmv2dec.c
It avoids checks and allows to make ff_wmv2_decode_mb() static;
furthermore, it allows to avoid a config_components.h inclusion.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-29 13:37:41 +02:00
Andreas Rheinhardt
4200ed2e91 avcodec/mpegvideo: Allocate map and score_map buffers jointly
Reduces the amounts of allocs, frees and allocation checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-29 13:37:41 +02:00
Andreas Rheinhardt
20ee12c677 avcodec/mpegvideo: Don't overallocate buffer
Only encoders need two sets of int16_t [12][64]
(one to save the current best state and one for the current
working state); decoders need only one. This saves 1.5KiB
per slice context for a decoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-29 13:37:41 +02:00
Jun Zhao
307326b36d doc/protocols: update rtsp options
Split the rtsp options to muxer/demuxer, and update the options.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-10-29 12:26:42 +08:00
Jun Zhao
3497362be1 doc/examples/muxing: Remove unnecessary ret
Remove unnecessary ret and make the code more compact

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-10-29 12:26:30 +08:00
Andreas Rheinhardt
79508ee523 avcodec/metasound_data: Include data into metasound.c directly
It is only used by metasound.c, so this allows to make
the data static.

To do this, remove metasound_data.h, rename metasound_data.c
into metasound_data.h (and add inclusion guards, remove ff_
prefixes etc.).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:38:45 +02:00
Andreas Rheinhardt
6856cabd13 avcodec/metasound_data: Move data shared with twinvq into a new file
Namely into a header metasound_twinvq_data.h included
in twinvq.c (the common file of MetaSound and TwinVQ).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:38:45 +02:00
Andreas Rheinhardt
f8efd890bf avutil/tx_template: Move function pointers to const memory
This can be achieved by moving the AVOnce out of the structure
containing the function pointers; the latter can then be made
const.
This also has the advantage of eliminating padding in the structure
(sizeof(AVOnce) is four here) and allowing the AVOnces to be put
into .bss (dependening upon the implementation).

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:30:10 +02:00
Andreas Rheinhardt
188216581b avutil/tx_template: Avoid code duplication
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:30:10 +02:00
Andreas Rheinhardt
2af5f55b2e avutil/tx_template: Don't waste space for inexistent factors
It is possible to avoid the factors array for the power-of-two
tables for which said array is unused by using a different
structure for initialization for power-of-two tables than for
non-power-of-two-tables. This saves 3*15*16B from .data.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:29:41 +02:00
Andreas Rheinhardt
b71e2e42ef avcodec/aaccoder: Mark function pointer arrays as const
Forgotten in 57d305207a.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:08:11 +02:00
Andreas Rheinhardt
cdd50223a6 avformat/argo_cvg: Mark overrides as const
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-28 09:08:00 +02:00
Martin Storsjö
cb803a0072 swscale: aarch64: Fix yuv2rgb with negative strides
Treat the 32 bit stride registers as signed.

Alternatively, we could make the stride arguments ptrdiff_t instead
of int, and changing all of the assembly to operate on these
registers with their full 64 bit width, but that's a much larger
and more intrusive change (and risks missing some operation, which
would clamp the intermediates to 32 bit still).

Fixes: https://trac.ffmpeg.org/ticket/9985

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-10-27 21:49:26 +03:00
Martin Storsjö
2eb601e865 configure: Remove a leftover comment about MSVC C99 support
Support for building with older versions of MSVC (with the
c99wrap/c99conv frontend) was removed in
ce943dd6ac.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-10-27 21:49:26 +03:00
Andreas Rheinhardt
22fc0375e8 configure: Remove unnecessary mpeg[12]video_enc->h263dsp dependencies
This effectively reverts 9b78abae19.
The underlying issue has been fixed properly in commit
cff480e49d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 19:39:07 +02:00
Andreas Rheinhardt
938c62b368 avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily
It is only used by the decoders' lowres code, so only initialize
it for decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 19:37:44 +02:00
Andreas Rheinhardt
e59e14eee1 avcodec/speedhq: Remove unused ff_rl_speedhq
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
4190019ff4 avcodec/speedhqenc: Don't initialize unused parts of RLTable
ff_rl_init() initializes RLTable.(max_level|max_run|index_run);
max_run is unused by the SpeedHQ encoder (as well as MPEG-1/2).
Furthermore, it initializes these things twice (for two passes),
but the second half of this is never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
92b81a7c99 avcodec/mpeg12data: Remove ff_rl_mpeg1
No longer used anywhere.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
a89b9d155b avcodec/mpeg12enc: Don't initialize unused parts of RLTable
ff_rl_init() initializes RLTable.(max_level|max_run|index_run);
max_run is unused by the MPEG-1/2 encoders (as well as SpeedHQ).
Furthermore, it initializes these things twice (for two passes),
but the second half of this is never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
0486f0f5d2 avcodec/rl: Add analogue for ff_rl_init() without RLTable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
65beba7889 avcodec/speedhqdec: Use ff_rl_speedhq.table_(run|level) directly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
a12abf59a9 avcodec/mpeg12: Use ff_rl_mpeg1.table_(run|level) directly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
6bb0760a91 avcodec/mpeg12data: Remove unused ff_rl_mpeg2
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
4a8fe21ab4 avcodec/mpeg12: Pass parameters explicitly in ff_init_2d_vlc_rl()
This allows to exploit that ff_rl_mpeg1 and ff_rl_mpeg2
only differ in their VLC table.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
06fafbe01e avcodec/mpeg12enc: Don't initialize ff_rl_mpeg2 unnecessarily
ff_rl_mpeg1 and ff_rl_mpeg2 differ only in RLTable.table_vlc,
which ff_rl_init() does not use to initialize RLTable.max_level,
RLTable.max_run and RLTable.index_run. This implies
that these tables agree for ff_rl_mpeg1 and ff_rl_mpeg2;
hence one can just use one of them and avoid calling ff_rl_init()
ff_rl_mpeg2 alltogether.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
178dcbb96f avcodec/mpeg12enc: Pass tables explicitly in ff_mpeg1_init_uni_ac_vlc
This will allow to remove ff_rl_mpeg2 soon and remove
all uses of RLTable in MPEG-1/2/SpeedHQ later.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
18412c76e6 avcodec/speedhqenc: Avoid unnecessary indirection
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
19ede649a0 avcodec/mpeg12enc: Avoid unnecessary indirection
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:38 +02:00
Andreas Rheinhardt
11dfa4d159 avcodec/mpeg12: Avoid indirection when accessing rl_vlc tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-27 15:44:36 +02:00