Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-07libavcodec/qsvenc: Add skip_frame support to qsvencWenbin Chen
Add skip_frame support to qsvenc. Use per-frame metadata "qsv_skip_frame" to control it. skip_frame option defines the behavior of qsv_skip_frame. no_skip: Frame skipping is disabled. insert_dummy: Encoder inserts into bitstream frame where all macroblocks are encoded as skipped. insert_nothing: Similar to insert_dummy, but encoder inserts nothing. The skipped frames are still used in brc. For example, gop still include skipped frames, and the frames after skipped frames will be larger in size. brc_only: skip_frame metadata indicates the number of missed frames before the current frame. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-11-07libavcodec/qsvenc_hevc: add tier optionnyanmisaka
Without this change, MSDK/VPL always defaults the HEVC tier to MAIN if the -level is specified. Also, according to the HEVC specs, only level >= 4 can support High Tier. Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2022-10-25lavc/qsvenc_hevc: accept HDR metadata if haveHaihao Xiang
The SDK may accept HDR metadata via mfxEncodeCtrl::ExtParam Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-10-10lavc/qsvenc_hevc: use open GOP by defaultHaihao Xiang
HEVC spec has CRA frame which allows random access with open GOP, hence it can achieve higher compression efficiency. Removing the entry was suggested by Andreas Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-10-10lavc/qsv: add support for decoding & encoding 12bit contentFei Wang
AV_PIX_FMT_P012, AV_PIX_FMT_Y212 and AV_PIX_FMT_XV36 are used in FFmpeg and MFX_FOURCC_P016, MFX_FOURCC_Y216, and MFX_FOURCC_Y416 are used in the SDK Signed-off-by: Fei Wang <fei.w.wang@intel.com> Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-10-10lavc/qsv: add support for decoding & encoding 10bit 4:4:4 contentHaihao Xiang
AV_PIX_FMT_XV30 is used in FFmpeg and MFX_FOURCC_Y410 is used in the SDK. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-09-30libavcodec/qsvenc: Let runtime to set default parameter.Wenbin Chen
Unset qsv_h264 and qsv_hevc's default settings. Let runtime to decide these parameters, so that it can choose the best parameter and ffmpeg-qsv can keep up with runtime's update. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-09-09libavcodec/qsvenc: Add "slice" intra refresh type to qsvencWenbin Chen
Add "slice" intra refresh type to h264_qsv and hevc_qsv. This type means horizontal refresh by slices without overlapping. Also update the doc. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-09-07lavc/qsv: Add support for decoding & encoding 8bit 4:4:4 contentHaihao Xiang
AV_PIX_FMT_VUYX is used in FFmpeg and MFX_FOURCC_AYUV is used in the SDK Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-09-07lavc/qsvenc: use VBR if maxrate is not specified on WindowsHaihao Xiang
Currently AVBR is disabled and VBR is the default method if maxrate is not specified on Linux, but AVBR is the default one if maxrate is not specified on Windows. In order to make user experience better accross Linux and Windows, use VBR by default on Windows if maxrate is not specified. User need to set both avbr_accuracy and avbr_convergence to non-zero explicitly and not to specify maxrate if AVBR is expected. In addition, AVBR works for H264 and HEVC only in the SDK. $ ffmpeg.exe -v verbose -f lavfi -i yuvtestsrc -vf "format=nv12" -c:v vp9_qsv -f null -
2022-09-03avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt
It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-23qsvenc_{hevc,h264}: add scenario optionHaihao Xiang
User may get better experience after providing corresponding senario hint to encoder for the encoding session. See [1] for scenario support in the SDK [1]https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#scenarioinfo
2022-08-23libavcodec/qsvenc: Add adaptive_i/b to hevc_qsvWenbin Chen
Add adaptive_i/b feature to hevc_qsv. Adaptive_i allows changing of frame type from P and B to I. Adaptive_b allows changing of frame type frome B to P. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-08-12lavc/qsv: create mfx session using oneVPL for decoding/encodingHaihao Xiang
If qsv hwdevice is available, use the mfxLoader handle in qsv hwdevice to create mfx session. Otherwise create mfx session with a new mfxLoader handle. This is in preparation for oneVPL support
2022-08-12qsv: remove mfx/ prefix from mfx headersHaihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to CFLAGS when running 'configure --enable-libmfx' for old versions of libmfx, if so, mfx headers without mfx/ prefix can be included too. If libmfx comes without pkg-config support, we may do a small change to the settings of the environment(e.g. set -I/opt/intel/mediasdk/include/mfx instead of -I/opt/intel/mediasdk/include to CFLAGS), then the build can find the mfx headers without mfx/ prefix After applying this change, we won't need to change #include for mfx headers when mfx headers are installed under a new directory. This is in preparation for oneVPL support (mfx headers in oneVPL are installed under vpl directory)
2022-07-18avcodec: Add FF_CODEC_CAP_NOT_INIT_THREADSAFEAndreas Rheinhardt
This is in preparation of switching the default init-thread-safety to a codec being init-thread-safe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-27libavcodec/qsvenc_hevc: Use default value from MSDK to set bf.Wenbin Chen
Change the default value of "bf" for hevc_qsv to -1. 8 isn't the best choice so let MSDK to decide the number of b frames. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-06-06libavcodec/qsvenc: Add min/max QP control options for I/P/B frameYue Heng
To do more accurate QP control, add min/max QP control on I/P/B frame separately to qsv encoder. qmax and qmin still work but newly-added options have higher priority. Signed-off-by: Yue Heng <yue.heng@intel.com> Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-05-25qsv: add requirement for the mininal version of libmfxHaihao Xiang
libmfx 1.28 was released 3 years ago, it is easy to get a greater version than 1.28. We may remove lots of compile-time checks if adding the requirement for the minimal version in the configure script. Reviewed-by: softworkz <softworkz@hotmail.com> Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-05-25libavcodec/qsvenc: expose only supported optionsDmitry Rogozhkin
vp9, hevc, avc, mpeg2 QSV encoders inherit common list of options (QSV_COMMON_OPTS) while bunch of options is not actually supported by current qsv code. The only codec which supportes everything is avc, followed by hevc, while vp9 and mpeg2 significantly fall behind. This creates difficulties for the users to use qsv encoders. This patch fixes options list for encoders leaving only those which are actually supported. Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-04-06libavcodec/qsvenc: Add more pixel format support to qsvencWenbin Chen
Qsv encoder only support input P010 and nv12 format directly from system memory. For other format, we need to upload frame to device memory and input qsv format to encoder. Now add other system memory format support to qsv encoder. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-04-05avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt
This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefaultAndreas Rheinhardt
This structure is no longer declared in a public header, so using an FF-prefix is more appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt
Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt
Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-22libavcodec/qsvenc_hevc: encode RGB format rawvideoWenbin Chen
Add support for hevc_qsv to input RGB format frame. It will transform frame to yuv inside MediaSDK instead of using auto scale. Now hevc_qsv supports directly encoding BGRA and X2RGB10 format. The X2RGB10 correspond to the A2RGB20 format and BGRA correspond to RGB4 format in MediaSDK. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-27libavcodec/qsvenc: Add intra refresh to hevc_qsv and add new intra refresh ↵Wenbin Chen
parameter Add intra refresh support to hevc_qsv as well. Add an new intra refresh type: "horizontal", and an new param ref_cycle_dist. This param specify the distance between the beginnings of the intra-refresh cycles in frames. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-21libavcodec/qsvenc: Add transform skip to hevc_qsvWenbin Chen
Add transform_skip option to hevc_qsv. By enabling this option, the transform_skip_enabled_flag in PPS will be set to 1. This option is supported on the platform equal or newer than ICL. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-18lavc/qsvenc_hevc: add -pic_timing_sei optionHaihao Xiang
The SDK may insert picture timing SEI for hevc and the code to set mfx parameter has been added in qsvenc, however the corresponding option is missing in the hevc option array Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-18lavc/qsvenc: add encode support for screen content coding extensionHaihao Xiang
Enables HEVC Screen Content Coding extension support on ICL+ platform Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-27avcodec/qsvenc_hevc: use AV_OPT_TYPE_BOOL for aud optionLimin Wang
Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-23lavc/qsvenc: enable lookahead for hevc encodingZhong Li
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-07-02qsvenc_hevc: allow user set more coding optionsHaihao Xiang
The SDK supports NalHrdConformance, RecoveryPointSEI and AUDelimiter for hevc encoder, so we may allow user to set these coding options like as what we did for h264_qsv encoder. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com> Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-04-27avcodec: Constify AVCodecsAndreas Rheinhardt
Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27avcodec: Remove private options from AVCodecContextAndreas Rheinhardt
Several options that were too codec-specific were deprecated between 0e6c8532215790bbe560a9eea4f3cc82bb55cf92 and 0e9c4fe254073b209970df3e3cb84531bc388e99. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-05lavc/qsvenc_hevc: add qmax/qmin support for HEVC encodingLinjie Fu
Add qmax/qmin support for HEVC software bitrate control(SWBRC). Limitations: - RateControlMethod != MFX_RATECONTROL_CQP - with EXTBRC ON Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhongli_dev@126.com>
2020-05-18lavc/qsvenc: add encode support for HEVC 4:2:2 8-bit and 10-bitLinjie Fu
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>
2020-04-26lavc/qsvenc: Add hardware config metadataMark Thompson
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.
2019-12-12lavc/qsvenc: add Tiles encode support for HEVCLinjie Fu
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>
2019-04-03lavc/qsvenc: enable hevc gpb optionZhong Li
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>
2019-04-01lavc/qsvenc: get vps extradata from MSDKZhong Li
Signed-off-by: Zhong Li <zhong.li@intel.com> Reviewed-by: Mark Thompson <sw@jkqxz.net>
2019-03-29lavc/qsvenc: fix hevc vps extradata issuesZhong Li
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>
2019-03-28lavc/qsvenc: use the common option "trellis" of AVCodecContextZhong Li
Signed-off-by: Zhong Li <zhong.li@intel.com>
2018-12-18lavc/qsv_hevc: correct QSV HEVC default plugin on WindowsZhong Li
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>
2017-12-14avcodec: add metadata to identify wrappers and hardware decoderswm4
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 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.
2017-11-11Merge commit '077011b5af2b3150efc52a9b58f5ef9bb0235087'James Almer
* commit '077011b5af2b3150efc52a9b58f5ef9bb0235087': qsv: Expose idr_interval for hevc as well Also includes 98afe3fb71afd4a18009924aaba56bc577bbd400. Merged-by: James Almer <jamrial@gmail.com>
2017-11-11Merge commit 'b05128f3c953bd66483e697d60a2e7e45ee9cfa0'James Almer
* commit 'b05128f3c953bd66483e697d60a2e7e45ee9cfa0': qsv: Load the hw hevc plugin by default on Linux Merged-by: James Almer <jamrial@gmail.com>
2017-11-04h2645_parse: Allocate a single buffer per packetKieran Kunhya
Drastically reduces memory usage on pathological streams. Fixes ticket #6789
2017-10-14qsv: Expose idr_interval for hevc as wellLuca Barbato
2017-09-26Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'James Almer
* commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3': Mark some arrays that never change as const. Merged-by: James Almer <jamrial@gmail.com>