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

46876 Commits

Author SHA1 Message Date
Andreas Rheinhardt
56973eb687 avcodec/nvdec: Use av_buffer_replace() where appropriate
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:42:28 +02:00
Andreas Rheinhardt
d3730acca3 avcodec/nvdec: Check av_buffer_ref()
It (unfortunately) involves an allocation and can therefore fail.

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:41:52 +02:00
Andreas Rheinhardt
eb608fd0b0 avcodec/libspeexdec: Fix use of uninitialized value
Regression since 97d9a32938.
Fixes Coverity issue #1503072.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:37:14 +02:00
Andreas Rheinhardt
0d408f4013 avcodec/cbs_h2645: Remove always-false check
The functions to replace parameter sets are only called
after the respective parameter set has just been read or
has just been written; all of these functions check
that the id field is within the appropriate range.
So the checks in the replace-functions can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:34 +02:00
Andreas Rheinhardt
2ba04bafb4 avcodec/cbs: Remove ff_cbs_alloc_unit_content
It is no longer used.
Also rename ff_cbs_alloc_unit_content2 to ff_cbs_alloc_unit_content.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
2d722b6638 avcodec/cbs_jpeg: Use table-based alloc/free
cbs_jpeg was the last user of CBS that didn't use
CodedBitstreamUnitTypeDescriptors.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
9638f5b1a2 avcodec/cbs_internal: Use unions to shrink size of descriptors
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
b37805ddbd avcodec/cbs_internal, cbs_h2645: Add and use new descriptor macros
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
715d3286bc avcodec/cbs: Use smaller scope for variables, add const
And also avoid an unnecessary indirection for src_buf.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
e35b8b848c avcodec/cbs: Remove redundant assignment
The code just creates new references without allocating
new buffers for the subobjects; therefore the actual data pointer
stays valid and need not be updated.

Also remove an assert that ensured that the calculation
for updating the pointer makes sense.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
33f33beead avcodec/cbs: Avoid code duplication for making unit refcounted/writable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
9d0c71a81c avcodec/error_resilience: Avoid overhead of AVBuffer API
These buffers are not shared in any way.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
caleb
6a0cec5315 avcodec/jpeg2000: Fast fail if HTJ2K codeblocks are present.
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-08-07 22:01:21 +02:00
James Almer
f8c62e32b2 avformat/riff: map AYUV fourcc to RAWVIDEO decoder
There's no need to keep using a custom decoder for this pixel format.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 09:33:16 -03:00
Peter Ross
23758380d0 avcodec: WBMP (Wireless Application Protocol Bitmap) image format
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2022-08-07 19:18:18 +10:00
Timo Rothenpieler
b710698790 avcodec/nvenc: hardcode color characteristics for internal RGB2YUV conversion
nvenc does not appear to use these values as inputs for its built in RGB
to YUV conversion, but instead sets them on the output as-is.

Testing indicates the input is expected to be sRGB, with the output
ending up as limited range bt.470.
2022-08-06 22:23:33 +02:00
Andreas Rheinhardt
5e7eaabb42 avcodec/nvdec_hevc: Fix off-by-one error
Fixes Coverity issues #1442912, #1442913, #1442916 and #1442917.

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-06 17:59:05 +02:00
Andreas Rheinhardt
2345b4eb9c avcodec/acelp_*: Remove unnecessary headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
0661472fa8 avcodec/avcodec: Remove legacy cruft
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
57d305207a avcodec/aacenc_quantization: Deduplicate quantization functions
Up until now, there were four copies of
quantize_and_encode_band_cost_(ZERO|[SU]QUAD|[SU]PAIR|ESC|NONE|NOISE|STEREO)
(namely in aaccoder.o, aacenc_is.o, aacenc_ltp.o, aacenc_pred.o).
As 43b378a0d3 says, this is meant to
enable more optimizations.

Yet neither GCC nor Clang performed such optimizations: The functions
in the aforementioned files are not optimized according to
the specifics of the calls in the respective file. Therefore
duplicating them is a waste of space; this commit therefore stops doing
so. The remaining copy is placed into aaccoder.c (which is the only
place where the "round to zero" variant of quantize_and_encode_band()
is used, so that this can be completely internal to aaccoder.c).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
e081358e8d avcodec/aacenc_tns: Remove unused header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
386990a955 avcodec/aacenc_quantization: Remove always-zero function parameter
rtz is only ever nonzero for quantize_and_encode_band().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
d23cb45c1c avcodec/sbrdsp: Remove unnecessary headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
c488ee6182 avcodec/aacenc: Move aac_pce_configs to its only user
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
bcb0faeaba avcodec/internal: Move ff_thread_can_start_frame() to threadframe.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
6c4595190e avcodec/flacdsp: Split encoder-only parts into a ctx of its own
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
3a869cd5cd avcodec/flacdsp: Remove unused function parameter
Forgotten in e609cfd697.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Andreas Rheinhardt
5828e8209f avcodec: Constify frame->data pointers for encoders where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:21:41 +02:00
Andreas Rheinhardt
cee40a945a avcodec/mpegvideo_motion: Constify ff_mpv_motion
Also constify the corresponding code in mpegvideo.c that handles
lowres.
(Unfortunately, not everything that is const could be constified:
ref_picture could be made const uint8_t* const* if C allowed the
safe automatic conversion from uint8_t**; and pix_op, qpix_op
could be made to point to const function pointers, but C's handling
of const in pointers to arrays is broken.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:04:05 +02:00
Andreas Rheinhardt
7e8c8cc04b avcodec/hevcdec: Constify src pointers of HEVC DSP functions
This is possible now that the HEVC DSP API treats them as const.
Also constify the AVFrames whose data is used as source in such
cases.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:02:34 +02:00
Andreas Rheinhardt
333b32af8e avcodec/h264chroma: Constify src in h264_chroma_mc_func
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:02:13 +02:00
Andreas Rheinhardt
2c8dc7e953 avcodec/loongarch/h264chroma, vc1dsp_lasx: Add wrapper for __lasx_xvldx
__lasx_xvldx does not accept a pointer to const (in fact,
no function in lasxintrin.h does so), although it is not allowed
to modify the pointed-to buffer. Therefore this commit adds a wrapper
for it in order to constify the H264Chroma API in a later commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 02:59:58 +02:00
Andreas Rheinhardt
b3bbbb14d0 avcodec/hevcdsp: Constify src pointers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 02:54:04 +02:00
Andreas Rheinhardt
6c9a60ada4 avcodec/loongarch: Add wrapper for __lsx_vldx
__lsx_vldx does not accept a pointer to const (in fact,
no function in lsxintrin.h does so), although it is not allowed
to modify the pointed-to buffer. Therefore this commit adds a wrapper
for it in order to constify the HEVC DSP functions in a later commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 02:53:35 +02:00
Jun Zhao
33afa2167e lavc/Makefile: fix make checkheaders fail
Fix the build break when used make checkheaders

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-08-05 00:55:53 +08:00
Philip Langdale
d3f48e68b3 lavc/vaapi: Declare support for decoding 8bit 4:4:4 content
Now that we have a combination of capable hardware (new enough Intel)
and a mutually understood format ("AYUV"), we can declare support for
decoding 8bit 4:4:4 content via VAAPI.

This requires listing AYUV as a supported format, and then adding VAAPI
as a supported hwaccel for the relevant codecs (HEVC and VP9). I also
had to add VP9Profile1 to the set of supported profiles for VAAPI as it
was never relevant before.
2022-08-03 14:10:55 -07:00
Andreas Rheinhardt
900ce6f8c3 avcodec/intrax8: Avoid indirection when accessing VLC table
To do so, store the pointer to the VLC table and not to the VLC.
This is possible, because all the VLCs of the same type use
the same number of bits.
Also use a const VLCElem*, because the target is static and must
therefore not be modified after its initialization.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:23:35 +02:00
Andreas Rheinhardt
b0e38c7d1e configure: Add msmpeg4(dec|enc) subsystems
The msmpeg4 decoders/encoders share a common set of prerequisites,
ergo it makes sense to use common subsystems for them. This also
allows to remove the CONFIG_MSMPEG4_DECODER/ENCODER ad-hoc defines
(which violated the CONFIG_ namespace).

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:18:25 +02:00
Andreas Rheinhardt
b10e218df1 configure, avcodec/Makefile: Make IntraX8 select WMV2DSP, fix MIPS build
IntraX8 uses WMV2DSP directly, so it should have a direct dependency
on it. Also remove the indirect Makefile dependency of the VC-1 decoder
on wmv2dsp.o. Notice that since the addition of the MIPS WMV2DSP
implementation building only the VC-1 decoder would fail, because
no Makefile dependency VC1->wmv2dsp_init_mips.o has been added.
This is of course fixed by this commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:17:56 +02:00
Andreas Rheinhardt
eb5c5ae658 avcodec/intrax8: Remove unused IDCTDSPContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:10:00 +02:00
James Almer
b0cd979a0b avcodec/libaomenc: support AV_CODEC_CAP_ENCODER_RECON_FRAME
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-02 09:56:27 -03:00
Anton Khirnov
c6f22940e4 lavc/libx264: support AV_CODEC_CAP_ENCODER_RECON_FRAME
Bump the version requirement to 122, which introduced b_full_recon.
2022-08-02 10:52:15 +02:00
Anton Khirnov
e3838b856f lavc: add API for exporting reconstructed frames from encoders 2022-08-02 10:46:11 +02:00
Andreas Rheinhardt
771d8937af avcodec/alpha/me_cmp_alpha: Remove commented-out function
This function is bitrotten: It uses different parameters
than the corresponding ASM functions which replaced it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-02 08:40:58 +02:00
Andreas Rheinhardt
088382a434 avcodec/alpha/me_cmp_alpha: Use proper me_cmp_func type
ea41e6d637 forgot
the int->ptrdiff_t switch for the stride. Libav didn't
do it because Libav had already dropped support for Alpha
at that point.
Only compilation has been tested for this commit.

(It might be that the ASM-versions of me_cmp_func functions
need to be updated as well.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-02 08:40:58 +02:00
James Almer
db9fd78bd7 avcodec/aacdec_fixed: also clip samples on the second channel for stereo HE-AAC
Fixes outputting silence on the second channel when decoding Parametic Stereo
HE-AAC.

Closes ticekt #3361.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-01 20:25:09 -03:00
James Almer
9fb80bf760 avcodec/aacdec_fixed: add missing priv_class
This enables the same input options as the float decoder.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-01 20:25:09 -03:00
Andreas Rheinhardt
1368b5a725 avcodec/ttmlenc: Use string literal macro for default namespacing
Fixes -Werror=format-security build failures when building with
disabled optimizations and (according to fate.ffmpeg.org also with
several other old GCC versions).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-31 04:57:23 +02:00
Andreas Rheinhardt
e725c5e24e avcodec/exr: Constify slice threads' ptr to main context
Modifying the main context from a slice thread is (usually)
a data race, so it must not happen. So only use a pointer to const
to access the main context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-31 04:38:55 +02:00
Andreas Rheinhardt
9ea03f5678 avcodec/diracdec: Constify slice threads' ptr to main context
Modifying the main context from a slice thread is (usually)
a data race, so it must not happen. So only use a pointer to const
to access the main context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-31 04:38:37 +02:00