1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

109025 Commits

Author SHA1 Message Date
Andreas Rheinhardt
d7c3e52fbf avutil/integer: Use '|' instead of '+' where it is more natural
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 20:11:20 +02:00
Andreas Rheinhardt
9a6cdd1ba3 avutil/integer: Fix undefined left shifts of negative numbers
Affected the integers FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 18:04:24 +02:00
Andreas Rheinhardt
f49375f28f avutil/aes: Don't use out-of-bounds index
Up until now, av_aes_init() uses a->round_key[0].u8 + t
as dst of memcpy where it is intended for t to greater
than 16 (u8 is an uint8_t[16]); given that round_key itself
is an array, it is actually intended for the dst to be
in a latter round_key member. To do this properly,
just cast a->round_key to unsigned char*.

This fixes the srtp, aes, aes_ctr, mov-3elist-encrypted,
mov-frag-encrypted and mov-tenc-only-encrypted
FATE-tests with (Clang-)UBSan.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 16:28:14 +02:00
Andreas Rheinhardt
73930e4f93 avutil/aes: Don't use misaligned pointers
The AES code uses av_aes_block, a union consisting of
uint64_t[2], uint32_t[4], uint8_t[4][4] and uint8_t[16].
subshift() performs byte-wise manipulations of two av_aes_blocks,
but when encrypting, it does so with a shift of two bytes;
more precisely, it uses
"av_aes_block *s1 = (av_aes_block *) (s0[0].u8 - s)"
and lateron uses the uint8_t[16] member to access s0.
Yet av_aes_block requires to be suitably aligned for
the uint64_t[2] member, which s0[0].u8 - 2 is certainly
not. This is in violation of 6.3.2.3 (7) of C11. UBSan
reports this in the aes_ctr, mov-3elist-encrypted,
mov-frag-encrypted, mov-tenc-only-encrypted and srtp
tests.
Furthermore, there is another issue here: The pointer points
outside of s0; this works, because all the accesses lateron
use an index >= 3. (Clang-)UBSan reports this as
"runtime error: index -2 out of bounds for type 'uint8_t[16]'".

This commit fixes both of these issues: The latter issue
is fixed by applying an offset of "+ 3" during the cast
and subtracting this from the indices used lateron.
The former issue is solved by not casting to av_aes_block*
at all; instead simply cast to unsigned char*.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 16:28:14 +02:00
Andreas Rheinhardt
7c5d256c9c avcodec/motion_est_template: Avoid using last + 1 element of array
For an int array[8][2] using &array[8][0] (which is an int*
pointing to the element beyond the last element of array)
triggers a "runtime error: index 8 out of bounds for type 'int[8][2]'"
from (Clang-)UBSan in the fate-vsynth(1|2|_lena)-snow tests.

I don't know whether this is really undefined behaviour or does not
actually fall under the "pointer arithmetic with the element beyond
the last element of the array is allowed as long as it is not
accessed" exception". All I know is that the code itself does not
read from beyond the last element of the array.

Nevertheless rewrite the code to a form that UBSan does not complain
about.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 16:28:14 +02:00
Andreas Rheinhardt
c76155236f avcodec/snow_dwt: Fix left shifts of negative numbers
Affected the vsynth(1|2|_lena)-snow(|-hpel) tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 16:28:14 +02:00
Wenbin Chen
d79c240196 doc/encoders: Add doc for av1_qsv
Add doc for av1_qsv.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-10-24 13:30:22 +08:00
Wenbin Chen
dc9e4789a3 libavcodec/qsvenc_av1: add av1_qsv encoder
It is available only when libvpl is enabled. MSDK doesn't support av1
encoding.

sample command:
ffmpeg -f rawvideo -pix_fmt nv12 -s 1920x1080 -i input.yuv \
-c:v av1_qsv output.ivf

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-10-24 13:30:22 +08:00
Anton Khirnov
874a6f2090 fftools/ffmpeg: set thread names 2022-10-24 02:00:31 +02:00
Anton Khirnov
a2f5913857 lavf: set internal thread names 2022-10-24 02:00:31 +02:00
Anton Khirnov
5f82447dfc lavc/pthread_frame: set worker thread names 2022-10-24 02:00:31 +02:00
Anton Khirnov
f66e794672 lavu/thread: add an internal function for setting thread name
Linux-only for now.
2022-10-24 02:00:31 +02:00
Andreas Rheinhardt
5ec9d26b2b avcodec/mpegvideo: Don't use ScanTable where unnecessary
For the intra_[hv]_scantables, only ScanTable.permutated
is used, so one only needs to keep that.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 01:23:59 +02:00
Andreas Rheinhardt
33b838aad6 avcodec/mpegvideo: Move ASM-offset warning to its proper place
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:16 +02:00
Andreas Rheinhardt
b76f07b8c3 avcodec/eatgq: Move transient GetByteContext from context to stack
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:15 +02:00
Andreas Rheinhardt
7f45691769 avcodec/idctdsp: Move ScanTable to mpegvideo
Only used there.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:14 +02:00
Andreas Rheinhardt
de133d22da avcodec/wmv2dec: Remove unnecessary ScanTables
Only ScanTable.scantable is used for the abt_scantables.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:13 +02:00
Andreas Rheinhardt
da93e4fb27 avcodec/speedhqdec: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:12 +02:00
Andreas Rheinhardt
69f46ff586 avcodec/mjpegenc_common: Only pass what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:11 +02:00
Andreas Rheinhardt
3cdfb146b2 avcodec/mjpegdec: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:10 +02:00
Andreas Rheinhardt
5975bb7f81 avcodec/mimic: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:09 +02:00
Andreas Rheinhardt
60c3516941 avcodec/mdec: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:08 +02:00
Andreas Rheinhardt
ec2b07db79 avcodec/intrax8: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:07 +02:00
Andreas Rheinhardt
9f64b06758 avcodec/g2meet: Pre-permute quantization tables
Allows to avoid a permutation lateron.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:06 +02:00
Andreas Rheinhardt
f1a7bf0227 avcodec/g2meet: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:05 +02:00
Andreas Rheinhardt
250d556343 avcodec/cavs: Only keep what is needed from IDCTDSP-API
Namely ScanTable.permutated. The rest of the IDCTDSP-API
is unused as cavs has its own idct.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:03 +02:00
Andreas Rheinhardt
b1bcff3ac0 avcodec/dnxhddec: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:02 +02:00
Andreas Rheinhardt
1da5da19b1 avcodec/asvdec: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:01 +02:00
Andreas Rheinhardt
0702fefd88 avcodec/agm: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:00 +02:00
Andreas Rheinhardt
ee0e03fe77 avcodec/idctdsp: Add function to apply permutation to array
It is the part of ff_init_scantable() that is used
by all users of said function.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:46:59 +02:00
Andreas Rheinhardt
0d53d92e3a avcodec/imm4: Remove useless ScanTable
Also rename the scantable variable to idct_permutation
to better reflect what it actually is.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:46:58 +02:00
Andreas Rheinhardt
4c9dee6e8d avcodec/aic: Remove useless ScanTable
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:46:56 +02:00
Andreas Rheinhardt
3cabe958a7 avcodec/eatqi: Don't use IDCTDSP-API unnecessarily
The eatqi decoder uses a custom IDCT and actually does not
use the IDCTDSP API at all. Somehow it was nevertheless
used to simply apply the identity permutation on ff_zigzag_direct.
This commit stops doing so.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:46:53 +02:00
Andreas Rheinhardt
a8f34f0877 avcodec/eatgq: Don't use IDCTDSP-API unnecessarily
The eatgq decoder uses a custom IDCT and actually does not
use the IDCTDSP API at all. Somehow it was nevertheless
used to simply apply the identity permutation on ff_zigzag_direct.
This commit stops doing so. It also renames perm to scantable,
because it is only the scantable as given by the spec without
any further permutation performed by us.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:46:49 +02:00
Andreas Rheinhardt
c262245fd3 avcodec/eamad: Don't use IDCTDSP-API unnecessarily
The eamad decoder uses a custom IDCT and actually does not
use the IDCTDSP API at all. Somehow it was nevertheless
used to simply apply the identity permutation on ff_zigzag_direct.
This commit stops doing so.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:46:39 +02:00
Andreas Rheinhardt
ba85e0ce41 configure: Add idctdsp dependency to codecs that need it
Currently masked by faan.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:15:03 +02:00
Andreas Rheinhardt
a14c5af58d avcodec/snowenc: Fix invalid left shift of negative numbers
Affected the vsynth(1|2|_lena)-snow(|-hpel) tests.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-23 23:42:17 +02:00
Carl Eugen Hoyos
882a17068f lavu/hwcontext_vaapi: Fix type specifier for uintptr_t
Fixes a format specifier warning on x86_32 Linux.
Fixes part of ticket #9986.
2022-10-23 20:51:42 +02:00
Carl Eugen Hoyos
fc410ce572 lavf/hevc: Fix type specifiers, missed in 8b5d1553
Fixes several warnings with msvc:
warning: format specifies type 'unsigned char' but the argument has type 'unsigned int'
2022-10-23 20:45:25 +02:00
Takeshi (Kesh) Ikuma
65f96a965a avfilter/vf_curves: add PCHIP interpolator and interp option
summary: This patch modifies the `curves` filter with new `interp` option
         to let user pick the existing natural cubic spline interpolation
         and the new PCHIP interapolation.

reason:  The natural cubic spline does not impose monotonicity between
         the keypoints. As such, the fitted curve may vary wildly against
         user's intension. The PCHIP interpolation is not as smooth as
         the natural spline but guarantees the monotonicity. Providing
         both options enhances users experience (e.g., reduces the number
         of keypoints to realize the desired curve). See the related bug
         report for the example of an ill-interpolated curve.

alternate solution:
         Both Photoshop and GIMP appear to use monotonic interpolation in
         their curve tools, which were the models for this filter. As
         such, an alternate solution is to drop the natural spline and
         go without the `interp` option.

related bug report: https://trac.ffmpeg.org/ticket/9947 (filed by myself)

Signed-off-by: Takeshi (Kesh) Ikuma <tikuma@hotmail.com>
2022-10-22 19:35:44 +02:00
Andreas Rheinhardt
993e3a6b54 avocdec/cbs_internal: Rename CBS_MAX_UNIT_TYPES->CBS_MAX_LIST_UNIT_TYPES
This makes it clearer that this limit does not apply to
CBS_UNIT_TYPE_RANGE units.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-22 17:35:56 +02:00
Andreas Rheinhardt
543ef831a8 avcodec/cbs: Remove CBS_CONTENT_TYPE_POD
It is equivalent to CBS_CONTENT_TYPE_INTERNAL_REFS
with nb_offsets equal to zero.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-22 17:28:01 +02:00
Paul B Mahol
ff3c708686 avfilter/vf_fftdnoiz: improve filtering at edges 2022-10-22 12:04:43 +02:00
Andreas Rheinhardt
ff3c4705f6 avcodec/speedhqdec: Remove write-only AVCodecContext*
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00
Andreas Rheinhardt
7894d4c9fa avcodec/metasound: Remove unnecessary headers
They are used in twinvq.c, not in metasound.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00
Andreas Rheinhardt
0d1028f63f avcodec/speedhq: Rename file to speedhqdec.c, move ff_rl_speedhq out
Renaming the decoder to speedhqdec.c makes sense since
we have an encoder in speedhqenc.c. Given that ff_rl_speedhq
is also used by the encoder, it is kept in speedhq.c
and a proper header for it is created to replace the ad-hoc
declaration in speedhqenc.c. This also allows to remove
the check for CONFIG_SPEEDHQ_DECODER, as it is always true
when speedhqdec.c is compiled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00
Andreas Rheinhardt
1490ba6f41 avcodec/metasound: Remove always-false checks
The number of channels that is checked here is automatically
valid because it has just been set by us (based upon an entry
in codec_props).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00
Andreas Rheinhardt
d94a445e3d avcodec/cyuv: Remove useless private context
It just contains duplicates of values from AVCodecContext
as well as an write-only pointer to said AVCodecContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00
Andreas Rheinhardt
20a1296bb4 avcodec/nvdec_mjpeg: Remove always-true #if CONFIG_MJPEG_NVDEC_HWACCEL
This file is built iff said hwaccel is enabled.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00
Andreas Rheinhardt
f18f8a561c avcodec/speedhqenc: Remove always-true #if CONFIG_SPEEDHQ_ENCODER
This file is built iff the SpeedHQ encoder is enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-21 21:12:45 +02:00