Commit Graph

197 Commits

Author SHA1 Message Date
elliottk 14941d386a Change libvpxenc default to crf=32.
Current default is 200kbps, which produces inconsistent
results (too high for low-res, too low for hi-res). Use
CRF instead, which will adapt. Affects VP9. Also have
VP8 use a default bitrate of 256kbps.

Signed-off-by: James Zern <jzern@google.com>
2019-10-07 22:32:32 -07:00
Guo, Yejun ecd026a48d avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9
example command line to verify it:
./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M tmp.webm

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: James Zern <jzern@google.com>
2019-09-19 23:49:28 -07:00
Jun Zhao f82a02aa89 lavc/libvpxenc: remove redundant condition check
Redundant condition: '!A || B' is equivalent to '!A || (A && B)' but
more clearly.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-12 14:17:52 +08:00
Rene Claus 6a8cc86963 avcodec/libvpxenc: add VP8/9 sharpness config option
This commit adds configuration options to libvpxenc.c that can be used to
tune the sharpness parameter for VP8 and VP9.

Signed-off-by: Rene Claus <rclaus@google.com>
Signed-off-by: James Zern <jzern@google.com>
2018-12-24 13:20:06 -08:00
James Zern e1f895838d libvpxenc,cosmetics: fix { placement
Signed-off-by: James Zern <jzern@google.com>
2018-11-19 11:38:34 -08:00
Ard Oerlemans 95107af314 avcodec/libvpxenc: add VP8 temporal scalability config options
This commit adds configuration options to libvpxenc.c that can be used to
enable VP8 temporal scalability. It also adds a way to programmatically set the
per-frame encoding flags which can be used to control usage and updates of
reference frames while encoding with temporal scalability enabled.

Signed-off-by: James Zern <jzern@google.com>
2018-11-19 11:33:43 -08:00
Chirag Lathia d6b1248fc6 avcodec/libvpxenc: Add a maximum constraint of 16 encoder threads.
Signed-off-by: Chirag Lathia <clathia@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-11-15 21:25:53 -03:00
James Zern 55e021f39b libvpxenc: extend auto-alt-ref range
vp9 now supports [0, 6]

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2018-11-09 17:54:16 -08:00
James Zern 6d3890ee34 libvpxenc,vp9: add enable-tpl option
enables temporal dependency model

Signed-off-by: James Zern <jzern@google.com>
2018-11-09 17:41:31 -08:00
James Almer 27df34bf1f avcodec/libvpxenc: fix setting amount of threads used for encoding
The libvpx doxy says that a value of 0 for the g_threads field is
equivalent to a value of 1, whereas for avctx->thread_count it means
the maximum amount of threads possible for the host system.

Use av_cpu_count() to get the correct thread count when auto threads
is requested.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-05-21 18:52:31 -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
James Zern 86cead5256 libvpxenc,vp9: add corpus-complexity option
Corpus VBR mode is a variant of standard VBR where the complexity
distribution midpoint is passed in rather than calculated for a specific
clip or chunk.

The valid range is [0, 10000]. 0 (default) uses standard VBR.

Signed-off-by: James Zern <jzern@google.com>
2017-11-28 15:17:51 -08:00
James Zern 753074721b libvpxenc: remove pre-1.4.0 checks
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2017-11-20 16:02:55 -08:00
James Zern 3071434f4d lavc/libvpxenc: add tune-content option
this matches the vpxenc parameter

Signed-off-by: James Zern <jzern@google.com>
2017-11-17 12:06:38 -08: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 Zern 1bee78a019 libvpxenc: allow aq-mode 4 (equator360)
this was added in 1.6.0

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2017-04-28 17:56:09 -07: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
Clément Bœsch 89a032634b Merge commit 'b183abfb5b6366b177cf44f244c66156257a6fd6'
* commit 'b183abfb5b6366b177cf44f244c66156257a6fd6':
  vpx: Support color range

Decoder chunk not merged as the framework automatically copies avctx
color range to the frame color range. And we already set the avctx field
since cbcc88c039.

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-03-15 12:23:18 +01:00
Kagami Hiiragi 734d760e2f lavc/libvpxenc: add -row-mt option
Signed-off-by: James Zern <jzern@google.com>
2017-03-06 11:58:33 -08:00
Alex Converse bf15981b12 libvpxenc: Don't spam level errors for VP8 encodes
Fixes "Failed to set VP9E_GET_LEVEL codec control: Codec does not
implement requested capability" log messages on VP8 encodes.
2016-12-13 10:43:57 -08:00
Alex Converse 8899057d91 libvpxenc: Report encoded VP9 level
Report the actual level of the encoded output if a level is
targeted or the level is passively tracked with a target of 0.
2016-11-28 12:02:43 -08:00
Alex Converse 3ee59939a1 libvpxenc: Support targeting a VP9 level
Levels are specified at https://www.webmproject.org/vp9/levels/
2016-11-22 11:31:48 -08:00
Kagami Hiiragi 41da4f8cb3 lavc/libvpxenc: fix -auto-alt-ref option type
vp9_cx_iface actually allows values in range [0..2].
This fixes ticket #5894.

Signed-off-by: Kagami Hiiragi <kagami@genshiken.org>
Signed-off-by: James Zern <jzern@google.com>
2016-10-21 18:16:46 -07:00
Carl Eugen Hoyos 44bcb636c1 lavc/libvpxenc: Avoid vp8 transparency encoding with auto-alt-ref.
Fixes ticket #5815.
2016-09-17 10:42:23 +02:00
Luca Barbato b183abfb5b vpx: Support color range
The range field has been introduced in version 1.6.0
2016-07-23 08:27:29 +02:00
James Zern 640c0962c0 libvpxenc,cosmetics: rename common fns vp8 -> vpx
+ the context struct

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Zern <jzern@google.com>
2016-07-21 20:51:13 -07:00
Vignesh Venkatasubramanian acca56d962 libvpx: Enable vp9 alpha encoding
Chrome canary now supports decoding of VP9 streams with alpha
channel [1]. Add support to ffmpeg for creating such files.

[1] https://codereview.chromium.org/2096813002/

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2016-07-12 23:19:50 -07:00
James Zern 7586b3adf2 libvpxenc: quiet unused-variable warning
with older versions of libvpx
since:
432be63 lavc/libvpx: Fix support for RGB colorspace.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2016-02-22 20:23:31 -08:00
Carl Eugen Hoyos 73781741b7 lavc/libvpx: Reindent after last commit. 2016-02-19 21:11:56 +01:00
Carl Eugen Hoyos 432be6362c lavc/libvpx: Fix support for RGB colorspace.
Reported and tested by Nicolas George.
Fixes ticket #5249.
2016-02-19 21:06:26 +01:00
Carl Eugen Hoyos 84d7933e3b lavc/libvpx: Fix high-bitdepth pix_fmts on big endian. 2016-02-19 21:02:42 +01:00
Timothy Gu 32fed702b8 libvpxenc: Allow setting tune parameter 2016-02-07 09:12:46 -08: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 13be46c08e Merge commit '0ac9f33a9e69c64eee592791be3c5441a6a3d6b7'
* commit '0ac9f33a9e69c64eee592791be3c5441a6a3d6b7':
  lavc: Move frame_skip_* to codec private options

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-28 15:08:10 +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 0ac9f33a9e lavc: Move frame_skip_* to codec private options
These options are only used by mpegvideoenc and vpx.
They are very codec-specific options, so deprecate the global variants.

Add an allowed value to the private options for frame_skip_cmp which
seems to have been forgotten, but perfectly working.

The libvpx frame dropping feature uses one of such option
(frame_skip_threshold) without the other three. For this reason rename
the option to something more consistent with the other libvpx variables.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-21 15:33:19 -05:00
Sasi Inguva cbcc88c039 libvpx: Support setting color range for vp9.
Pass through color range to vp9 encoder. Parse color range in libvpxdec.c.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-01-09 12:51:34 -03:00
Carl Eugen Hoyos 836c793514 lavc/libvpxenc: Improve documentation for option cpu-used.
Fixes ticket #5140.
Reviewed-by: James Zern
2016-01-09 10:53:22 +01:00
Hendrik Leppkes e760641720 lavc: add vp9 profiles to AVCodecDescriptor 2016-01-01 16:25:50 +01:00
Ganesh Ajjanagadde b9c2ebeee4 lavc/libvpxenc: replace round by lrint
Mostly cosmetic here.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-21 08:20:26 -08:00
Hendrik Leppkes d6322710c5 Merge commit '03afb62e83516141ba999536fc97575faefb98af'
* commit '03afb62e83516141ba999536fc97575faefb98af':
  libvpxenc: export CPB props side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-17 13:33:20 +01:00
Anton Khirnov 03afb62e83 libvpxenc: export CPB props side data 2015-12-06 10:24:47 +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
James Zern 4d05e9392f libvpxenc: remove some unused ctrl id mappings
VP8E_UPD_ENTROPY, VP8E_UPD_REFERENCE, VP8E_USE_REFERENCE were removed
from libvpx and the remaining values were never used here

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Zern <jzern@google.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-23 18:38:04 +01:00
Hendrik Leppkes c2f861ca42 Replace remaining occurances of av_free_packet with av_packet_unref 2015-10-27 14:35:30 +01:00
James Zern 6540fe04a3 libvpxenc: remove some unused ctrl id mappings
VP8E_UPD_ENTROPY, VP8E_UPD_REFERENCE, VP8E_USE_REFERENCE were removed
from libvpx and the remaining values were never used here

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Zern <jzern@google.com>
2015-10-20 20:25:53 -07:00
Ronald S. Bultje b07d2a2509 libvpxenc: make flags i64 instead of dbl. 2015-08-18 12:04:57 -04:00
Ronald S. Bultje 6471040f56 FF_OPT_TYPE_* -> AV_OPT_TYPE_*. 2015-08-18 11:48:49 -04:00
James Zern 9723d439fd libvpxenc: report pict_type/error via side-data
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Zern <jzern@google.com>
2015-07-29 19:59:20 -07:00
James Zern 88df16fe6d libvpxenc: quiet coded_frame deprecation warnings
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Zern <jzern@google.com>
2015-07-29 19:59:19 -07:00