1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

313 Commits

Author SHA1 Message Date
Carl Eugen Hoyos
690cab3232 lavc/libx264: Cast cpb bit_rates to int64_t to avoid an integer overflow.
Fixes remaining part of ticket #8071 on next version bump.
2019-08-10 23:52:59 +02:00
Carl Eugen Hoyos
4b1687f23c lavc/libx264: Cast bit_rate to int64_t to avoid an integer overflow.
Fixes ticket #8071.
2019-08-10 23:29:58 +02:00
Carl Eugen Hoyos
57987deefc lavc/libx264: bit_rates > INT_MAX are not supported. 2019-08-10 23:27:58 +02:00
Mark Thompson
d76e2aaf08 libx264: Update ROI behaviour to match documentation
Fix the quantisation offset - use the whole range, and don't change the
offset size based on bit depth.

Iterate the list in reverse order.  The first region in the list is the one
that applies in the case of overlapping regions.
2019-07-07 19:19:26 +01:00
Jun Zhao
1e6338c2da lavc/libx264: Use avctx->framerate first for frame rate setting
perfer avctx->framerate first than use avctx->time_base when setting
the frame rate to encoder. 1/time_base is not the average frame rate
if the frame rate is not constant. In this case, we need to setting
avctx->framerate and avctx->time_base both, but avctx->framerate not
equal to 1/(avctx->time_base).

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-11 00:10:44 +08:00
Guo, Yejun
aceb9131c1 avcodec/libx264: add support for ROI-based encoding
This patch just enables the path from ffmpeg to libx264,
the more encoders can be added later.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2019-01-17 21:47:52 +00:00
Martin Storsjö
882ae091d4 libx264: Pass the reordered_opaque field through the encoder
libx264 does have a field for opaque data to pass along with frames
through the encoder, but it is a pointer, while the libavcodec
reordered_opaque field is an int64_t. Therefore, allocate an array
within the libx264 wrapper, where reordered_opaque values in flight
are stored, and pass a pointer to this array to libx264.

Update the public libavcodec documentation for the AVCodecContext
field to explain this usage, and add a codec capability that allows
detecting whether an encoder handles this field.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-11-05 15:52:14 +02:00
Marton Balint
b02490a497 avcodec/libx264: remove FF_CODEC_CAP_INIT_THREADSAFE flag
Libx264 uses strtok which is not thread safe. Strtok is used in
x264_param_default_preset in param_apply_tune in x264/common/base.c.
Therefore the flag must be removed.

x264 fixed the issue, once the fix is pushed to stable, an #if can be added
to re-enable the flag based on X264_BUILD number.

Fixes ticket #7446.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-10-24 23:18:37 +02:00
Carl Eugen Hoyos
81f25a1051 lavc/libx264: Support monochrome encoding. 2018-08-07 20:41:02 +02:00
James Almer
2f96190732 Merge commit 'c6558e8840fbb2386bf8742e4d68dd6e067d262e'
* commit 'c6558e8840fbb2386bf8742e4d68dd6e067d262e':
  x264: Support version 153

See
2a111c99a6
7e60c74329

Merged-by: James Almer <jamrial@gmail.com>
2017-12-27 21:11:10 -03:00
Luca Barbato
c6558e8840 x264: Support version 153
It has native simultaneus 8 and 10 bit support.
2017-12-27 15:59:45 +00:00
James Almer
7e60c74329 avcodec/libx264: set supported pix_fmts at runtime rather than build time
This partially reverts a change in behavior introduced in 2a111c99a6.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-26 19:41:04 -03:00
James Almer
2a111c99a6 avcodec/libx264: fix compilation with x264 builds >= 153
x264 now supports multibitdepth builds, with a slightly changed API to
request bitdepth during initialization.

Reviewed-by: Ricardo Constantino <wiiaboo@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-26 11:57:01 -03:00
James Almer
89f704caba avcodec/libx264: use the pixfmt descriptor to check for high bit depths
The x264_bit_depth constant has been removed in newer x264 builds.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-25 23:18:41 -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
bfab430856 Merge commit '94eed68ace9f2416af8457fcbf142b175928c06b'
* commit '94eed68ace9f2416af8457fcbf142b175928c06b':
  lavc: Drop deprecated options moved to private contexts

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 17:08:32 -03:00
James Almer
7bbe33b052 avcodec/libx264: add me_method alias to set X264Context->motion_est
Replaces the now dropped global option.

Addresses ticket #6771.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-23 15:36:36 -03:00
Vittorio Giovara
94eed68ace lavc: Drop deprecated options moved to private contexts
Deprecated in 10/2014 and 07/2015.
2017-03-23 10:09:17 +01:00
Timo Rothenpieler
5ea8f70623 avcodec/libx264: fix forced_idr logic
Currently, it forces IDR frames for both true and false.
Not entirely sure what the original idea behind the tri-state bool
option is.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-11-22 16:35:08 +01:00
Carl Eugen Hoyos
93e041026f lavc: Enable a53cc by default for x264 and qsv_h264. 2016-09-14 17:52:50 +02:00
Sasi Inguva
282477bf45 libx264: Increase x264 opts character limit to 4096
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-22 16:37:44 +02:00
Michael Niedermayer
947daffa59 avcodec/libx264: Remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-23 21:36:02 +02: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
Michael Niedermayer
134cba728b Seperate x264rgb encoder and only enable when its actually supported
This avoids enabling and building the x264rgb encoder when its actually not supported and
thus would not work

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-05 17:04:29 +02:00
Derek Buitenhuis
5b9a4476e3 Merge commit '5fca95c8e515a5ae542d9626ec088bdfc658450e'
* commit '5fca95c8e515a5ae542d9626ec088bdfc658450e':
  libx264: Forbid inverted Stereo3D mode

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-12 14:29:34 +01:00
Derek Buitenhuis
e3cfd1b275 Merge commit '9e2af0e9071a1229cfe21efff394691d91f979b2'
* commit '9e2af0e9071a1229cfe21efff394691d91f979b2':
  libx264: Allow Stereo3D monoscopic value

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-12 14:29:09 +01:00
Vittorio Giovara
5fca95c8e5 libx264: Forbid inverted Stereo3D mode 2016-04-21 12:25:42 -04:00
Vittorio Giovara
9e2af0e907 libx264: Allow Stereo3D monoscopic value 2016-04-21 12:24:35 -04:00
Vittorio Giovara
0837d1dfe2 libx264: Fix noise_reduction option assignment
First check the context, then check internal option. Drop the ! typo.
Introduced in 60f0fde309.
2016-02-22 19:06:48 -05:00
Vittorio Giovara
60f0fde309 libx264: Make sure to preserve default option values
The private options chromaoffset, sc_threshold, and noise_reduction
were set to 0 rather than -1, and were always initializing values
in libx264 rather than letting the library use its default.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-02-01 00:35:37 +01:00
Derek Buitenhuis
899e19f177 Merge commit '936f0d98f864f9f6bb4f9e5458b78537e146bacd'
* commit '936f0d98f864f9f6bb4f9e5458b78537e146bacd':
  lavc: Move rtp_payload_size to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-31 13:19:50 +00:00
Vittorio Giovara
b340bd8a58 libx264: Make sure to preserve default option values
The private options chromaoffset, sc_threshold, and noise_reduction
were set to 0 rather than -1, and were always initializing values
in libx264 rather than letting the library use its default.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-28 18:45:40 +01:00
Michael Niedermayer
cb06be6136 avcodec/libx264: Fix sc_threshold after 30c1bdb87c
After the merge the default threshold was unconditionally overwritten

A similar fix was written by Vittorio Giovara, but i didnt see that before
i wrote this and it also doesnt apply cleanly

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-28 18:25:56 +01:00
Derek Buitenhuis
b986a4625d Merge commit '1482aff2048511b821ff9feac19426113cc641a2'
* commit '1482aff2048511b821ff9feac19426113cc641a2':
  lavc: Move noise_reduction to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 16:42:32 +00:00
Derek Buitenhuis
30c1bdb87c Merge commit '7c79587d7407dab4b9445d66b5f111fe657c8c4d'
* commit '7c79587d7407dab4b9445d66b5f111fe657c8c4d':
  lavc: Move scenechange_threshold to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 15:24:00 +00:00
Derek Buitenhuis
7c6e86c0ce Merge commit '5764d38173661c29d954711dd5abfddf709e9ba4'
* commit '5764d38173661c29d954711dd5abfddf709e9ba4':
  lavc: Move chromaoffset to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 15:22:19 +00: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
Derek Buitenhuis
21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Vittorio Giovara
1482aff204 lavc: Move noise_reduction to codec private options
This option is only used by mpegvideoenc, x264, xavs, and vpx.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara
7c79587d74 lavc: Move scenechange_threshold to codec private options
This option is only used by mpegvideoenc, x264, and xavs.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Vittorio Giovara
5764d38173 lavc: Move chromaoffset to codec private options
This option is only used by x264 and xavs.
It is a very codec-specific option, so deprecate the global variant.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05: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
Carl Eugen Hoyos
f587ed0cbb lavc/x264: Add compatibility values for coder options.
Fixes ticket #5142.
2016-01-10 14:25:56 +01:00
Hendrik Leppkes
2630f7f709 Merge commit 'be00ec832c519427cd92218abac77dafdc1d5487'
* commit 'be00ec832c519427cd92218abac77dafdc1d5487':
  lavc: Deprecate coder_type and its symbols

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-18 14:27:41 +01:00
Hendrik Leppkes
b77061b5ca Merge commit '732a37d1466d45b3812509d68c82e783530e291a'
* commit '732a37d1466d45b3812509d68c82e783530e291a':
  libx264: export CPB props side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-17 13:34:51 +01:00
Vittorio Giovara
be00ec832c lavc: Deprecate coder_type and its symbols
Most option values are simply unused or ignored and in practice the
majory of codecs only need to check whether to enable rle or not.

Add appropriate codec private options which better expose the allowed
features.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-12-07 11:01:22 -05:00
Anton Khirnov
732a37d146 libx264: export CPB props side data 2015-12-06 10:25:00 +01:00
Clément Bœsch
fb99ef0bd3 avcodec: use AV_OPT_TYPE_BOOL in a bunch of places 2015-12-04 15:37:05 +01:00
Hendrik Leppkes
e7a57d4873 Merge commit '1ec72c6c68dbc78bf4ebb6f06c13316dc488bdfa'
* commit '1ec72c6c68dbc78bf4ebb6f06c13316dc488bdfa':
  libx264: Make sure the extradata are padded

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:48:27 +01:00