Commit Graph

107834 Commits

Author SHA1 Message Date
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
James Almer 85c59bd6de avutil/test/pixfmt_best: test the VUYA pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 09:33:16 -03:00
James Almer 1974813261 swscale/output: add VUYA output support
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
James Almer d93e29154f avfilter/avfiltergraph: remove unnecessary channel layout copy
It's not modified, so we can simply use a const pointer to it.
Also check the return value of the other copy in the function while at it.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-06 20:32:46 -03: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
Timo Rothenpieler 611f843534 avfilter/vsrc_ddagrab: set sRGB color information on output frames
According to MSDN, all integer pixel formats contains sRGB compliant
pixel data, so set the color information on our output frames
accordingly.
2022-08-06 22:23:07 +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
Timo Rothenpieler 38595ebe3b avfilter/vsrc_ddagrab: make output format user configurable 2022-08-06 15:50:15 +02:00
James Almer f0abd07996 swscale/input: add VUYA input support
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-05 09:39:21 -03:00
Timo Rothenpieler cbb53bfbd8 avfilter/vsrc_ddagrab: move most of init to config_props
Most notably, the input hw_device_ctx is not set at init time, so using it was impossible.
2022-08-05 14:27:55 +02:00
Timo Rothenpieler fbf87a46ab avfilter/vsrc_ddagrab: fix mouse cursor render init 2022-08-05 14:07:47 +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 101e154c28 lavf/hevc: replace the unicode signal quotation with normal quotation
replace the unicode left/right signal quotation mark with normal
signal quotation.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-08-05 00:58:49 +08: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
Philip Langdale 2b720676e0 lavu/hwcontext_vaapi: Map the AYUV format
This is the format used by Intel VAAPI for 8bit 4:4:4 content.
2022-08-03 14:10:12 -07:00
Philip Langdale 6ab8a9d375 lavu/pixfmt: Add packed 4:4:4 format
The "AYUV" format is defined by Microsoft as their preferred format for
4:4:4 content, and so it is the format used by Intel VAAPI and QSV.

As Microsoft like to define their byte ordering in little-endian
fashion, the memory order is reversed, and so our pix_fmt, which
follows memory order, has a reversed name (VUYA).
2022-08-03 14:09:46 -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
Andreas Rheinhardt 8d7d52721a avutil/opt: Combine multiple av_log statements
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:09:24 +02:00
Zhao Zhili f56730fb6f avformat/flvenc: fix shadowed variable ts 2022-08-03 17:52:55 +08:00
Zhao Zhili 988838cf4f avformat/flvdec: make key frame timestamps more accurate
There was an implicit cast from double to int64_t in time unit of
second.
2022-08-03 17:52:50 +08:00
Zhao Zhili 693c5be320 avformat/flvenc: fix timestamp of key frame index
Firstly, the timestamps generated from framerate are inaccurate for
variable framerate mode.

Secondly, the timestamps always start from zero, while pts/dts can
start from nonzero. FLV demuxer rejects such index with message:
"Found invalid index entries, clearing the index".
2022-08-03 17:52:45 +08:00
Zhao Zhili 30aa0c3f48 avdevice/v4l2: fix leak of timefilter
Fixes ticket #9844.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-08-03 17:52:25 +08:00
Haihao Xiang ad67ea9eee ffmpeg_opt: consider HW acceleration method when selecting decoder
Usually a HW decoder is expected when user specifies a HW acceleration
method via -hwaccel option, however the current implementation doesn't
take HW acceleration method into account, it is possible to select a SW
decoder.

For example:
$ ffmpeg -hwaccel vaapi -i av1.mp4 -f null -
$ ffmpeg -hwaccel nvdec -i av1.mp4 -f null -
$ ffmpeg -hwaccel vdpau -i av1.mp4 -f null -
[...]
Stream #0:0 -> #0:0 (av1 (libdav1d) -> wrapped_avframe (native))

libdav1d is selected in this case even if vaapi, nvdec or vdpau is
specified.

After applying this patch, the native av1 decoder (with vaapi, nvdec or
vdpau support) is selected for decoding(libdav1d is still used for
probing format).
$ ffmpeg -hwaccel vaapi -i av1.mp4 -f null -
$ ffmpeg -hwaccel nvdec -i av1.mp4 -f null -
$ ffmpeg -hwaccel vdpau -i av1.mp4 -f null -
[...]
Stream #0:0 -> #0:0 (av1 (native) -> wrapped_avframe (native))

Tested-by: Mario Roy <marioeroy@gmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-08-03 11:10:57 +08:00
Haihao Xiang df5defe15a ffmpeg_opt: select a decoder after getting values for per-stream hwdec options
After applying this patch, the desired HW acceleration method is known
before selecting decoder, so we may take HW acceleration method into
account when selecting decoder for input stream in the next commit

There should be no functional changes in this patch

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-08-03 09:54:20 +08: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
Anton Khirnov eede1d2927 lavu/frame: allow calling av_frame_make_writable() on non-refcounted frames
This is an easy way to make a refcounted frame from a non-refcounted
one.
2022-08-02 10:44:37 +02:00
Andreas Rheinhardt d9cd192ddd fftools/ffmpeg_opt: Fix copyinkf
Broken in 9c2b800203.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-02 09:02:11 +02:00