Enables HEVC Range Extension encoding support (Linux) for 4:2:2 8/10 bit
on ICL+ (gen11 +) platform.
Restricted to linux only for now.
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
All of these encoders can accept libmfx surfaces directly in a hardware
frames context, or they can accept software frames if a suitable device
is supplied to use.
Add -tile_rows and -tile_cols option to specify the number of tile rows
and columns for ICL+ (gen 11) platform.
A tile must wholly contain all the slices within it. Slices cannot cross
tile boundaries. So the slice number would be implicitly resized to the
max(nSlice, nTile).
Example:
ffmpeg -v verbose -hwaccel qsv -init_hw_device qsv=hw
-filter_hw_device hw -f rawvideo -s:v 1920x1080 -i ./input.nv12 -vf
format=nv12,hwupload=extra_hw_frames=64 -c:v hevc_qsv -tile_rows 2
-tile_cols 2 -slices 4 -y output.h265
Also dump the actual quantity of encoded tiled rows and columns in run
time.
Fix the enhancement #8400.
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
GPB is the default type, just contains forward references but the
slice_type is B slice with higher encoding efficiency than regular P
slice, but lower performance.
Add an option to allow user to set regular P slice.
Fix ticket#6870
Test data on Intel Kabylake (i7-7567U CPU @ 3.50GHz):
1. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough
-vframes 1000 -c:v hevc_qsv -gpb 0 -bf 0 -q 25 test_gpb_off_bf0_kbl.mp4
transcoding fps: 85
encoded file size of test_gpb_off_bf0_kbl.mp4: 21960100 (bytes)
2. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough
-vframes 1000 -c:v hevc_qsv -gpb 1 -bf 0 -q 25 test_gpb_on_bf0_kbl.mp4
transcoding fps: 79
encoded file size oftest_gpb_on_bf0_kbl.mp4: 21211449 (bytes)
In this case, enable gpb can bring about 7% performance drop but 3.4% encoding efficiency improvment.
Signed-off-by: Zhong Li <zhong.li@intel.com>
cbs trace qsv vps header failed due to some reasons:
1. vps_temporal_id_nesting_flag is not set but spec required it must to
be 1 when vps_max_sub_layers_minus1 is equal to 0.
2. vps_num_hrd_parameters is not set and written.
3. other issues in ff_hevc_encode_nal_vps() (fixed in pervious commit_id: 520226b683).
Reproduce: ffmpeg -hwaccel qsv -v verbose -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vframes 1
-c:v hevc_qsv -bsf:v trace_headers -f null -
Signed-off-by: Zhong Li <zhong.li@intel.com>
1. Old logic meaned: everywhere, except Windows, ffmpeg has to use HW
acceleration, but on Windows ffmpeg has to use (unavailable) software
HEVC by default
2. Software HEVC is available only if you provide corresponding
software MediaSDK library, which isn't provided with ffmpeg. More
information could be found in
https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/samples/readme-encode_linux.pdf
3. HW HEVC decoding/encoding are available on Windows in the driver by default
Note: Default case should be the most common case but this change still has potential risk
on windows if HW path is not supported(or doesn't work as expection).
(See the historical disscution: https://lists.libav.org/pipermail/libav-devel/2016-November/080419.html).
In such case, two options suggested:
1. Use the option "-load_plugin hevc_sw" to switch SW path manually.
2. Or report bug to Intel windows driver if your GPU can support HEVC HW codec.
(HEVC decoding is supported since Braswell, and encoding supported since Skylake)
Patch started by Landgraph. Add similar change for hevc decoder and bump a new version.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
Signed-off-by: Landgraph <me@landgraph.ru>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.
Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.
AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.
Based on a patch by Philip Langdale <philipl@overt.org>.
Merges Libav commit 47687a2f8a.
* commit '077011b5af2b3150efc52a9b58f5ef9bb0235087':
qsv: Expose idr_interval for hevc as well
Also includes 98afe3fb71.
Merged-by: James Almer <jamrial@gmail.com>
* commit 'c359d624d3efc3fd1d83210d78c4152bd329b765':
hevcdec: move decoder-independent declarations into a separate header
Merged-by: James Almer <jamrial@gmail.com>
This way they can be reused by other code without including the whole
decoder-specific hevcdec.h
Also, add the HEVC_ prefix to them, since similarly named values exist
for H.264 as well and are sometimes used in the same code.
The parser changes have lost the support for the needed padding, this adds it back
Fixes out of array reads
Fixes: 03ea21d271abc8acf428d42ace51d8b4/asan_heap-oob_3358eef_5692_16f0cc01ab5225e9ce591659e5c20e35.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
The b_frame_strategy option is only used by mpegvideoenc, qsv, x264, and
xavs, while b_sensitivity is only used by mpegvideoenc.
These are very codec-specific options, so deprecate the global variants.
Set proper limits to the maximum allowed values.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* commit 'ecee1148af4989e1f9e16f0cdc9f98ad2045538c':
qsvenc_hevc: use the correct HW plugin UID
Merged-by: Michael Niedermayer <michael@niedermayer.cc>