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

105201 Commits

Author SHA1 Message Date
Wenbin Chen
ed6c5c13b1 libavutil/hwcontext_qsv: clean padding when upload qsv frames
Fix #7830
When we upload a frame that is not padded as MSDK requires, we create a
new AVFrame to copy data. The frame's padding data is uninitialized so
it brings run to run problem. For example, If we run the following
command serveral times we will get different outputs.

ffmpeg -init_hw_device qsv=qsv:hw -qsv_device /dev/dri/renderD128 \
-filter_hw_device qsv -f rawvideo -s 192x200 -pix_fmt p010 \
-i 192x200_P010.yuv -vf "format=nv12,hwupload=extra_hw_frames=16" \
-c:v hevc_qsv output.265

According to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#encoding-procedures
"Note: It is the application's responsibility to fill pixels outside
of crop window when it is smaller than frame to be encoded. Especially
in cases when crops are not aligned to minimum coding block size (16
for AVC, 8 for HEVC and VP9)"

I add a function to fill padding area with border pixel to fix this
run2run problem, and also move the new AVFrame to global structure
to reduce redundant allocation operation to increase preformance.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-23 15:49:07 +08:00
Zhong Li
7e4747ec50 lavc/qsvenc: enable lookahead for hevc encoding
Update version based on the patch:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20211009015949.1510-1-haihao.xiang@intel.com/

Signed-off-by: Daniel Socek <daniel.socek@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-12-23 15:49:07 +08:00
Zhong Li
0598b38e93 lavc/qsvenc: specify codec name when print profile
It is more clear and easily to detect the issues similar to commit
3857ecbe70

Signed-off-by: Zhong Li <zhongli_dev@126.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-23 15:49:07 +08:00
rcombs
3e00b9e395 swscale/x86/init: use isSemiPlanarYUV
Fixes P210/P410 cases introduced (and broken) in 88d804b7ff
2021-12-23 01:41:03 -06:00
Haihao Xiang
ba44843f40 MAINTAINERS: add my gpg fingerprint
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-23 09:25:16 +08:00
rcombs
8e24a8e93a lavfi/metal: fix build with pre-10.11 deployment targets
- Ensure the yadif .metal compiles when targeting any Metal runtime version
- Use some preprocessor awkwardness to ensure Core Video's Metal-specific
  functionality is exposed regardless of our deployment target (this works
  around what seems to be an SDK header bug, filed as FB9816002)
- Ensure all direct references to Metal functions and classes are gated
  behind runtime version checks (this satisfies clang's deployment-target
  violation warnings provided by -Wunguarded-availability).
2021-12-22 18:43:34 -06:00
rcombs
0f77ee9d97 lavfi/metal: fix build on pre-10.15 SDKs 2021-12-22 18:43:34 -06:00
rcombs
62ad427823 configure: test the metal compiler before use
Apparently Metal.framework is included with the command line tools
(and thus may be present without Xcode), but the Metal compiler is only
included as part of Xcode.
2021-12-22 18:43:34 -06:00
rcombs
3767900860 configure: ensure we use the macOS SDK's metal compiler by default
Apparently on some OS and Xcode versions this can select an iOS SDK,
which in turn may fail on the affected versions.
2021-12-22 18:43:34 -06:00
rcombs
2d16182e7d lavfi/metal: don't use braced-include for internal headers 2021-12-22 18:43:34 -06:00
rcombs
bc63ef354a configure: fix .d generation for C++ and Obj-C files 2021-12-22 18:43:34 -06:00
rcombs
942f94e830 configure: fix setting OBJCCFLAGS
We call this OBJCFLAGS in help text, but common.mak looks for OBJCCFLAGS.
2021-12-22 18:43:34 -06:00
rcombs
4778ab2b1f lavc/videotoolboxenc: explicitly set realtime=false
On some encoders, this defaults to true, which can result in encode speed
being _limited_ to only slightly above realtime (as a power-saving measure),
so we need a way to disable it.
2021-12-22 18:43:34 -06:00
rcombs
802c051506 libavcodec/videotoolboxenc: use the correct types for options
These are all set by AV_OPT_TYPE_INT or AV_OPT_TYPE_BOOL; the only reason
they worked before was that this is only used on little-endian.
2021-12-22 18:43:34 -06:00
rcombs
b04601ed6a lavc/videotoolbox: set attachments on decoded buffers
VideoToolbox internally sets all the colorspace parameters to BT709,
regardless of what the bitstream actually indicates, so we need to
replace that with what we've parsed.
2021-12-22 18:43:34 -06:00
rcombs
5afc5661ac lavu/hwcontext_videotoolbox: use OS-provided mapping routines when available 2021-12-22 18:43:34 -06:00
rcombs
b7e1ec7bda lavu/videotoolbox: expose routine to set CVPixelBufferRef metadata 2021-12-22 18:43:17 -06:00
rcombs
69bd95dcd8 lavu/videotoolbox: expose conversion routines for color parameters
Also fixes symbol lookup errors on older macOS when built with a newer SDK,
introduced in 6cab5206b0
2021-12-22 18:42:51 -06:00
rcombs
9a890e49b6 lavc/proresdec: fix threaded hwaccel decode 2021-12-22 18:38:40 -06:00
rcombs
0e7684e554 FATE: always pass -nostdin to ffmpeg
This avoids making terminal config changes that may not be reverted properly
during parallel testing.
2021-12-22 18:38:40 -06:00
rcombs
18192166e7 lavc/videotoolboxenc: add ProRes support 2021-12-22 18:38:40 -06:00
rcombs
88d804b7ff swscale: add P210/P410/P216/P416 output 2021-12-22 18:38:40 -06:00
rcombs
310a1c25e8 lavc/Makefile: fix missing hevc_videotoolbox case 2021-12-22 18:38:40 -06:00
rcombs
2bb5edc38c lavc/videotoolboxenc: add handling for non-NAL-based codecs 2021-12-22 18:38:40 -06:00
rcombs
30539394bb lavc/videotoolboxenc: vastly simplify get_cv_pixel_info
No longer requires per-format switch cases.

The frame==0 path was unused (and would've crashed anyway).
2021-12-22 18:38:40 -06:00
rcombs
c8323350f4 lavc/videotoolboxenc: config-gate ATSC CC support 2021-12-22 18:38:40 -06:00
rcombs
7644c6224f lavc/videotoolboxenc: fix RGB support 2021-12-22 18:38:40 -06:00
rcombs
e55db79612 lavc/videotoolboxenc: detect alpha more generically
Fixes support for alpha in hardware input frames
2021-12-22 18:38:40 -06:00
rcombs
2acb13cb93 lavc/videotoolboxenc: don't access int64_t member as int 2021-12-22 18:38:40 -06:00
rcombs
028a6ed1a1 lavc/videotoolboxenc: use common routine for pixfmt conversion 2021-12-22 18:38:40 -06:00
James Almer
131dbb9a7a ffprobe: add missing separator when printing side data in compact output
Should fix ticket #7153

Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-22 09:41:13 -03:00
Gerard Sole
18ad360648 libavformat: add side_data copy in concat demuxer
Adds support for concat demuxer to copy the side data information
from the input file to the resulting file. It will behave like the
metadata copy, where the metadata of the first file is kept in the
the output file.

Extract the current code that already performs the stream side_data
copy into a separate method and reuse the method in the concat demuxer.

Signed-off-by: Gerard Sole <g.sole.ca@gmail.com>
2021-12-22 12:05:41 +01:00
Limin Wang
2ac8bcec63 avcodec/v210enc: suppport frame thread for v210
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-22 09:27:30 +08:00
Limin Wang
8ecd7cdb46 avcodec/rawenc: suppport frame thread for rawvideo
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-22 09:27:30 +08:00
Limin Wang
0e1f5f8871 fate: use single thread for rawvideo
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-22 09:27:30 +08:00
James Almer
e1d3ef9217 avutil/tests/cpu: add slowgather
Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-21 17:52:09 -03:00
James Almer
e68e379e0c avutil/cpu: add slowgather to av_parse_cpu_caps()
Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-21 17:51:27 -03:00
James Almer
8c2d2fd6cc avutil/cpu: move slow gather checks below in the function
Put them together with other similar slow flag checks.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-21 17:51:17 -03:00
Alan Kelly
eebe406c80 libswscale: Test AV_CPU_FLAG_SLOW_GATHER for hscale functions.
This is instead of EXTERNAL_AVX2_FAST so that the avx2 hscale functions
are only used where they are faster.
2021-12-21 17:44:53 -03:00
Alan Kelly
ffbab99f2c libavutil/cpu: Add AV_CPU_FLAG_SLOW_GATHER.
This flag is set on Haswell and earlier and all AMD cpus.
2021-12-21 17:44:44 -03:00
Lynne
14b6805eb2
configure: improve non-pkgconfig Vulkan version check
Check for the patch version as well as the major+minor version.

The VK_API_VERSION macros are not usable in preprocessor code due
to casts.
The patch (header) version is meant to linearly increment and
not be reset, however it's better to trust, but verify.
2021-12-21 15:28:50 +01:00
Lynne
fa2e460f63
configure: autodetect vulkan 2021-12-21 12:30:10 +01:00
Andreas Rheinhardt
155dcfe2e2 avcodec/libx264: Don't unnecessarily add in-band extradata
The check here is meant to check for whether avcintra-class option
(default value -1) has been set; yet it checks for the x264_param_t
value where 0 is the default value (treated as "no avcintra-mode"
by x264). This meant that in-band extradata has been added unnecessarily
when using global headers; furthermore, the first output packet
had two x264 SEIs.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-21 08:35:05 +01:00
John-Paul Stewart
50bfd5e96e avformat/mvdec: explicitly set duration
Resolves a warning that duration is being innaccurately estimated based
on bitrate.

Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net>
Reviewed-by: Peter Ross <pross@xvid.org>
2021-12-21 12:01:22 +11:00
John-Paul Stewart
3c9ffbd009 avformat/mvdec: read frame rate from data stream
Prior to this patch, for version 2 of the file format the frame rate was
hard-coded at 15 fps.  This uses the 64-bit floating-point value from
the data stream, similar to what is already done for version 3 of the
file format (around line 206).

Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net>
Reviewed-by: Peter Ross <pross@xvid.org>
2021-12-21 12:01:17 +11:00
Henrik Gramner
15cfb4eee3 checkasm: Use the correct AVTXContext in av_tx tests
Keep a reference to the correct associated context of the reference
function and use that context when calling the reference function.
2021-12-20 23:58:05 +01:00
U. Artie Eoff
cde2efb5da MAINTAINERS: Add Haihao Xiang for vaapi
Current listed maintainers for vaapi plugin are
not reponsive and/or currently active in the
ffmpeg community.  Thus, vaapi plugin patches
(and qsv plugin) have generally gone ignored or
lost in the ether for too long.

Remove Gwenole Beauchesne from vaapi maintainer
who has not been active since 2016.

Current alternative maintainer for vaapi is Mark
Thompson whom has not been active since
March/April 2021.

Therefore, add Haihao Xiang to vaapi maintainer
who's primary role is FFmpeg development with a
focus on the vaapi and qsv plugins.  Haihao has
over a decade of media experience and many years
of FFmpeg development experience, amongst other
media frameworks.

The additional patch for adding Haihao as qsv
plugin maintainer has been submitted previously:

https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210608141134.27448-1-zhongli_dev@126.com/

This will help FFmpeg to continue to be the leading
multimedia framework by allowing these plugins to be
actively improved, enhanced, and maintained for existing
and future HW platforms.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2021-12-20 14:31:57 -08:00
Zhao Zhili
278068dc60 avutil/display: fix inverted doc
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-20 21:29:42 +01:00
Zhao Zhili
35420ab7fd build: simplify rules for metal
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-20 12:05:39 -08:00
Zhao Zhili
3c56b9c597 build: add .metal to vpath to fix build error
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-20 12:05:07 -08:00