summaryrefslogtreecommitdiff
path: root/libavcodec/qsvenc_h264.c
Commit message (Collapse)AuthorAge
* libavcodec/qsvenc: Add min/max QP control options for I/P/B frameYue Heng2022-06-06
| | | | | | | | | 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>
* qsv: add requirement for the mininal version of libmfxHaihao Xiang2022-05-25
| | | | | | | | | | 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>
* libavcodec/qsvenc: expose only supported optionsDmitry Rogozhkin2022-05-25
| | | | | | | | | | | | | | 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>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | 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>
* avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefaultAndreas Rheinhardt2022-03-21
| | | | | | | 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>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | 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>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | 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>
* libavcodec/qsvenc: Add intra refresh to hevc_qsv and add new intra refresh ↵Wenbin Chen2022-01-27
| | | | | | | | | | | | 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>
* avcodec/qsvenc_h264: use AV_OPT_TYPE_BOOL for aud, a53cc, cavlc, look_ahead, ↵Limin Wang2021-12-27
| | | | | | | pic_timing_sei options Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | 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>
* avcodec: Remove private options from AVCodecContextAndreas Rheinhardt2021-04-27
| | | | | | | | | 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>
* avcodec: Remove deprecated coder type optionsAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in be00ec832c519427cd92218abac77dafdc1d5487. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/qsvenc_h264: add missing atsc_a53.h includeJames Almer2020-08-15
| | | | | | Regression since 0de01da1d2 Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/qsvenc: Add hardware config metadataMark Thompson2020-04-26
| | | | | | 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.
* lavc/qsvenc: expose low_power as a common option for QSV encoderLinjie Fu2019-04-01
| | | | | | | | Always exposes low_power option for all qsv encoder, and reports a warning if VDENC is not supported in current version of MSDK. Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsvenc_h264: remove the privite option trellisZhong Li2019-03-28
| | | | | | | | | | | | | | | | | | There are many problems of current qsv trellis option: 1. Duplicated with AVCodecContext definition 2. MFX_TRELLIS_XXX is introduced by MSDK API 1.17 Currently Without MSDK API checking thus may cause compilation issue. 3. user is inclined to enable trellis when set "-trellis 1", but actually it is to disable since MFX_TRELLIS_OFF is equal to 1. 4. It is too complex for user to enable trellis for every frame(I/P/B). Just simply remove the private option, and switch to the AVCodecContext definition. Compatibility should not a big problem (except can't exact map) since the option name is same as AVCodecContext. Signed-off-by: Zhong Li <zhong.li@intel.com> Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
* lavc/qsvenc: use the common option "trellis" of AVCodecContextZhong Li2019-03-28
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsvenc: add VDENC support for H264Linjie Fu2019-01-10
| | | | | | | | | | | | | | | Add VDENC(lowpower mode) support for QSV H264 It's an experimental function(like lowpower in vaapi) with some limitations: - CBR/VBR require HuC which should be explicitly loaded via i915 module parameter(i915.enable_guc=2 for linux kernel version >= 4.16) Use option "-low_power 1" to enable VDENC. Add in dump_video_param() to show the status of VDENC in runtime log. Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsvenc: add an option to set h264 pps for every frameZhong Li2018-12-07
| | | | | | | | | RepeatPPS is enabled by default in mfx. It is not necessary mostly and wasting encoding bits. Add an option to control it and disable it by default. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Zhong Li <zhong.li@intel.com>
* Fix typosMichael Bunk2018-09-14
|
* Merge commit 'e16b20782a597e36a9c7488487c3179375a25b97'James Almer2018-09-11
|\ | | | | | | | | | | | | * commit 'e16b20782a597e36a9c7488487c3179375a25b97': lavc/qsvenc: allow to set qp range for h264 BRC Merged-by: James Almer <jamrial@gmail.com>
| * lavc/qsvenc: allow to set qp range for h264 BRCZhong Li2018-09-02
| | | | | | | | | | Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
* | Merge commit '4ce701b4e640d4723a4005d664f31f8342fac40e'James Almer2018-09-02
|\| | | | | | | | | | | | | * commit '4ce701b4e640d4723a4005d664f31f8342fac40e': qsvenc: remove vcm option on Linux Merged-by: James Almer <jamrial@gmail.com>
| * qsvenc: remove vcm option on LinuxZhong Li2018-06-11
| | | | | | | | | | | | | | | | | | 1. vcm mode is only available for H264. 2. vcm is not supported on Linux, but it is shown when run "./avconv -h encoder=h264_qsv |grep vcm". This shouldn't happen. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
* | Merge commit '35ed7f93dbc72d733e454ae464b1324f38af62a0'James Almer2018-09-02
|\| | | | | | | | | | | | | * commit '35ed7f93dbc72d733e454ae464b1324f38af62a0': qsvenc: Add an option to disable MFE mode Merged-by: James Almer <jamrial@gmail.com>
| * qsvenc: Add an option to disable MFE modeZhong Li2018-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | Provide proper aliases to enable/disable MFE. The numeric values are ambiguous and misleading (e.g: user may misunderstand setting mfmode to 1 is to enable MFE but actually it is to disable MFE, and set it to be 5 or above is meaningless). MFX_MF_MANUAL hasn't been exposed since it is to be implemented. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | lavc/qsvenc: add quality status to side_dataZhong Li2018-08-22
| | | | | | | | | | | | | | | | Add fix a memory leak issue as James's comments. V2: use a local pict_type since coded_frame is deprecated. Signed-off-by: Zhong Li <zhong.li@intel.com>
* | lavc/qsvenc: expose qp of encoded framesZhong Li2018-08-07
| | | | | | | | | | | | | | Requirement from ticket #7254. Currently only H264 supported by MSDK. Signed-off-by: Zhong Li <zhong.li@intel.com>
* | lavc/qsvenc: set corret maximum value of look_ahead_downsamplingZhong Li2018-05-07
| | | | | | | | | | | | | | Option "4x(MFX_LOOKAHEAD_DS_4x)" is provided but can't be set due to wrong maximum value. Signed-off-by: Zhong Li <zhong.li@intel.com>
* | Merge commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42'James Almer2018-04-13
|\| | | | | | | | | | | | | * commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42': qsv: adding Multi Frame Encode support Merged-by: James Almer <jamrial@gmail.com>
| * qsv: adding Multi Frame Encode supportMaxym Dmytrychenko2018-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting from API 1.25 helps to improve performance of the simultaneous encode, 1:N scenario, like: ./avconv -y -hwaccel qsv -c:v h264_qsv -r 30000/1001 -i ~/bbb_sunflower_1080p_60fps_normal.mp4 -vframes 600 -an \ -filter_complex "split=2[s1][s2]; [s1]scale_qsv=1280:720[o1]; [s2]scale_qsv=960:540[o2]" \ -map [o1] -c:v h264_qsv -b:v 3200k -minrate 3200k -maxrate 3200k -f rawvideo /tmp/3200a.264 \ -map [o2] -c:v h264_qsv -b:v 1750k -minrate 1750k -maxrate 1750k -f rawvideo /tmp/1750a.264 Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
* | Merge commit 'deefca02c275ce4bc5ccbee690463ffef81a18b8'James Almer2018-03-29
|\| | | | | | | | | | | | | * commit 'deefca02c275ce4bc5ccbee690463ffef81a18b8': qsvenc: add the Access Unit Delimiter NAL Unit support Merged-by: James Almer <jamrial@gmail.com>
| * qsvenc: add the Access Unit Delimiter NAL Unit supportZhong Li2018-03-16
| | | | | | | | | | Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | lavc/qsvenc: disable h264 look_ahead by defaultZhong Li2018-03-06
| | | | | | | | | | | | | | | | | | | | | | Look_ahead can provide quality improvements, but would better disable it by default due to some reasons: 1. It is only available for some codecs (e.g. HEVC is not supported) on Intel Haswell and plus platforms. Thus means it will be failed on some platforms. 2. It significantly increases encoding latency and memory consumption. 3. It may overwrite some other options such as CBR and CAVLC. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* | Merge commit '508378556631dc18d32247b4a4e35703758e1ca9'James Almer2017-12-14
|\| | | | | | | | | | | | | * commit '508378556631dc18d32247b4a4e35703758e1ca9': qsv: Support explicit lookahead downscaling Merged-by: James Almer <jamrial@gmail.com>
* | avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e'James Almer2017-11-29
|\| | | | | | | | | | | | | * commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e': qsvenc: cavlc option is only available for h264 Merged-by: James Almer <jamrial@gmail.com>
| * qsvenc: cavlc option is only available for h264Li, Zhong2017-11-24
| | | | | | | | | | | | | | | | Moving option definition to h264 implementation and fixing command line defaults in order to properly respect cavlc input value Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
* | Merge commit '37a9015ee84c15fec5247ba8f6577351a25fa8d2'Mark Thompson2017-03-12
|\| | | | | | | | | | | | | * commit '37a9015ee84c15fec5247ba8f6577351a25fa8d2': qsvenc: add support for p010 Merged-by: Mark Thompson <sw@jkqxz.net>
| * qsvenc: add support for p010Anton Khirnov2016-07-22
| |
* | qsv: Merge libav implementationMark Thompson2016-10-31
| | | | | | | | | | | | | | Merged as-at libav 398f015, and therefore includes outstanding skipped merges 04b17ff and 130e1f1. All features not in libav are preserved, and no options change.
* | avcodec/qsvenc_h264: fix segfault when a53 SEI is not availableNablet Developer2016-10-06
| | | | | | | | | | Signed-off-by: Nablet Developer <sdk@nablet.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc: Enable a53cc by default for x264 and qsv_h264.Carl Eugen Hoyos2016-09-14
| |
* | Merge commit 'b24dafe10572254ff0decc18b0d7c3d3707d5a29'James Almer2016-08-01
|\| | | | | | | | | | | | | * commit 'b24dafe10572254ff0decc18b0d7c3d3707d5a29': lavc: drop unnecessary h264dec.h includes Merged-by: James Almer <jamrial@gmail.com>
| * lavc: drop unnecessary h264dec.h includesAnton Khirnov2016-06-21
| |
* | Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'Clément Bœsch2016-07-29
|\| | | | | | | | | | | | | * commit '9df889a5f116c1ee78c2f239e0ba599c492431aa': h264: rename h264.[ch] to h264dec.[ch] Merged-by: Clément Bœsch <u@pkh.me>
| * h264: rename h264.[ch] to h264dec.[ch]Anton Khirnov2016-06-21
| | | | | | | | This is more consistent with the naming of other decoders.
* | avcodec/qsvenc_h264: declare the QSVEncContext variable before using itJames Almer2016-06-19
| | | | | | | | | | | | | | | | Should fix compilation. Regression introduced by commit 63adb3602d3b35c5d1df14cf1e477bc458f96b7b Signed-off-by: James Almer <jamrial@gmail.com>
* | libavcodec: factor out SEI generation for A53 captionsAndrey Turkin2016-06-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>