1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-26 06:01:30 +02:00
Commit Graph

58 Commits

Author SHA1 Message Date
Andreas Rheinhardt
a247ac640d avcodec: Constify AVCodecs
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-27 10:43:15 -03:00
Andreas Rheinhardt
d85c41b572 avcodec: Remove private options from AVCodecContext
Several options that were too codec-specific were deprecated between
0e6c853221 and
0e9c4fe254.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:02 -03:00
Andreas Rheinhardt
78ce00428f avcodec: Remove deprecated coder type options
Deprecated in be00ec832c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:01 -03:00
James Almer
34a385b340 avcodec/qsvenc_h264: add missing atsc_a53.h include
Regression since 0de01da1d2

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-15 14:43:11 -03:00
Mark Thompson
5a1ff44907 lavc/qsvenc: Add hardware config metadata
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.
2020-04-26 18:38:25 +01:00
Linjie Fu
a8355eed36 lavc/qsvenc: expose low_power as a common option for QSV encoder
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>
2019-04-01 19:21:42 +08:00
Zhong Li
391f884675 lavc/qsvenc_h264: remove the privite option trellis
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>
2019-03-28 21:52:51 +08:00
Zhong Li
b9a066ae23 lavc/qsvenc: use the common option "trellis" of AVCodecContext
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-03-28 21:50:01 +08:00
Linjie Fu
e92ce340e6 lavc/qsvenc: add VDENC support for H264
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>
2019-01-10 21:48:07 +08:00
Zhong Li
c9f0cff5ef lavc/qsvenc: add an option to set h264 pps for every frame
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>
2018-12-07 17:13:36 +08:00
Michael Bunk
0d7e0f25ca Fix typos 2018-09-14 21:36:21 +02:00
James Almer
27e30c73d7 Merge commit 'e16b20782a597e36a9c7488487c3179375a25b97'
* commit 'e16b20782a597e36a9c7488487c3179375a25b97':
  lavc/qsvenc: allow to set qp range for h264 BRC

Merged-by: James Almer <jamrial@gmail.com>
2018-09-11 13:57:49 -03:00
James Almer
8e789d244c Merge commit '4ce701b4e640d4723a4005d664f31f8342fac40e'
* commit '4ce701b4e640d4723a4005d664f31f8342fac40e':
  qsvenc: remove vcm option on Linux

Merged-by: James Almer <jamrial@gmail.com>
2018-09-02 19:12:52 -03:00
James Almer
b4ca32414e Merge commit '35ed7f93dbc72d733e454ae464b1324f38af62a0'
* commit '35ed7f93dbc72d733e454ae464b1324f38af62a0':
  qsvenc: Add an option to disable MFE mode

Merged-by: James Almer <jamrial@gmail.com>
2018-09-02 19:10:49 -03:00
Zhong Li
e16b20782a lavc/qsvenc: allow to set qp range for h264 BRC
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2018-09-02 20:01:42 +02:00
Zhong Li
900487043b lavc/qsvenc: add quality status to side_data
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>
2018-08-22 15:26:35 +08:00
Zhong Li
6088b7b037 lavc/qsvenc: expose qp of encoded frames
Requirement from ticket #7254.
Currently only H264 supported by MSDK.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2018-08-07 11:26:37 +08:00
Zhong Li
4ce701b4e6 qsvenc: remove vcm option on Linux
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>
2018-06-11 13:33:52 +02:00
Zhong Li
35ed7f93db qsvenc: Add an option to disable MFE mode
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>
2018-05-24 14:37:23 +02:00
Zhong Li
06344f705e lavc/qsvenc: set corret maximum value of look_ahead_downsampling
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>
2018-05-07 21:32:34 +01:00
James Almer
f790410b6b Merge commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42'
* commit 'cca5e4f040971db6de0bfe6968f00c021d8a9c42':
  qsv: adding Multi Frame Encode support

Merged-by: James Almer <jamrial@gmail.com>
2018-04-13 20:34:23 -03:00
Maxym Dmytrychenko
cca5e4f040 qsv: adding Multi Frame Encode support
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>
2018-04-08 20:47:59 +02:00
James Almer
b065c71e9d Merge commit 'deefca02c275ce4bc5ccbee690463ffef81a18b8'
* commit 'deefca02c275ce4bc5ccbee690463ffef81a18b8':
  qsvenc: add the Access Unit Delimiter NAL Unit support

Merged-by: James Almer <jamrial@gmail.com>
2018-03-29 20:34:43 -03:00
Zhong Li
deefca02c2 qsvenc: add the Access Unit Delimiter NAL Unit support
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-03-16 13:36:30 +01:00
Zhong Li
0645698ecc lavc/qsvenc: disable h264 look_ahead by default
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>
2018-03-06 00:23:16 +00:00
James Almer
374f818bfb Merge commit '508378556631dc18d32247b4a4e35703758e1ca9'
* commit '508378556631dc18d32247b4a4e35703758e1ca9':
  qsv: Support explicit lookahead downscaling

Merged-by: James Almer <jamrial@gmail.com>
2017-12-14 19:05:55 -03:00
wm4
b945fed629 avcodec: add metadata to identify wrappers and hardware decoders
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.
2017-12-14 19:37:56 +01:00
wm4
47687a2f8a avcodec: add metadata to identify wrappers and hardware decoders
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>
2017-12-14 16:58:45 +01:00
James Almer
dde7b1d485 Merge commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e'
* commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e':
  qsvenc: cavlc option is only available for h264

Merged-by: James Almer <jamrial@gmail.com>
2017-11-29 21:05:57 -03:00
Li, Zhong
b843b343d8 qsvenc: cavlc option is only available for h264
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>
2017-11-24 19:38:52 +01:00
Mark Thompson
562f386c77 Merge commit '37a9015ee84c15fec5247ba8f6577351a25fa8d2'
* commit '37a9015ee84c15fec5247ba8f6577351a25fa8d2':
  qsvenc: add support for p010

Merged-by: Mark Thompson <sw@jkqxz.net>
2017-03-12 15:04:45 +00:00
Mark Thompson
1f26a231bb qsv: Merge libav implementation
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.
2016-10-31 19:23:40 +00:00
Nablet Developer
8d858674fd avcodec/qsvenc_h264: fix segfault when a53 SEI is not available
Signed-off-by: Nablet Developer <sdk@nablet.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-06 14:01:40 +02:00
Carl Eugen Hoyos
93e041026f lavc: Enable a53cc by default for x264 and qsv_h264. 2016-09-14 17:52:50 +02:00
James Almer
7c8bf2dc2b Merge commit 'b24dafe10572254ff0decc18b0d7c3d3707d5a29'
* commit 'b24dafe10572254ff0decc18b0d7c3d3707d5a29':
  lavc: drop unnecessary h264dec.h includes

Merged-by: James Almer <jamrial@gmail.com>
2016-08-01 13:03:15 -03:00
Clément Bœsch
15b26e88cb Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'
* commit '9df889a5f116c1ee78c2f239e0ba599c492431aa':
  h264: rename h264.[ch] to h264dec.[ch]

Merged-by: Clément Bœsch <u@pkh.me>
2016-07-29 11:01:36 +02:00
Anton Khirnov
37a9015ee8 qsvenc: add support for p010 2016-07-22 19:08:13 +02:00
Anton Khirnov
b24dafe105 lavc: drop unnecessary h264dec.h includes 2016-06-21 11:15:11 +02:00
Anton Khirnov
9df889a5f1 h264: rename h264.[ch] to h264dec.[ch]
This is more consistent with the naming of other decoders.
2016-06-21 11:11:26 +02:00
James Almer
5f5a97dc3d avcodec/qsvenc_h264: declare the QSVEncContext variable before using it
Should fix compilation.

Regression introduced by commit 63adb3602d

Signed-off-by: James Almer <jamrial@gmail.com>
2016-06-19 12:04:03 -03:00
Andrey Turkin
63adb3602d libavcodec: factor out SEI generation for A53 captions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-19 02:11:20 +02:00
Derek Buitenhuis
2e9b995e4f Merge commit '0e6c8532215790bbe560a9eea4f3cc82bb55cf92'
* commit '0e6c8532215790bbe560a9eea4f3cc82bb55cf92'
  lavc: Move b_frame_strategy and b_sensitivity to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 20:18:04 +00:00
Vittorio Giovara
0e6c853221 lavc: Move b_frame_strategy and b_sensitivity to codec private options
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>
2016-01-21 15:33:19 -05:00
Will Kelleher
0eac93da0f qsvenc: write a53 caption data to SEI
Signed-off-by: Will Kelleher <wkelleher@gogoair.com>
Previous version reviewed-by: Ivan Uskov <ivan.uskov@nablet.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-30 23:31:12 +01:00
Hendrik Leppkes
5bc9c7a6db Merge commit 'fc4c27c4edfc6a5f9bc7c696e823652474a65ce8'
* commit 'fc4c27c4edfc6a5f9bc7c696e823652474a65ce8':
  qsvenc: expose additional encoding options

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-29 15:22:53 +01:00
Hendrik Leppkes
24563c20f1 Merge commit 'e7d7cf86dcaba8eaaed62c80172ff0aff2588c2a'
* commit 'e7d7cf86dcaba8eaaed62c80172ff0aff2588c2a':
  qsvenc: support more RC methods

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-29 15:18:08 +01:00
Derek Buitenhuis
9c35b8e219 Merge commit 'fb8753ada23189076bdf903c1c001c0ca8287fae'
* commit 'fb8753ada23189076bdf903c1c001c0ca8287fae':
  qsvenc: factor out common options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-24 13:48:28 +00:00
Anton Khirnov
fc4c27c4ed qsvenc: expose additional encoding options 2015-11-20 09:29:50 +01:00
Anton Khirnov
fb8753ada2 qsvenc: factor out common options 2015-11-20 09:26:12 +01:00
Hendrik Leppkes
6668214521 Merge commit '5d2daebf3cc8de4cee1973db6a2229beaad3b7cd'
* commit '5d2daebf3cc8de4cee1973db6a2229beaad3b7cd':
  qsvenc: mark the encoders as INIT_CLEANUP

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-29 14:12:47 +02:00