summaryrefslogtreecommitdiff
path: root/libavcodec/libvpxenc.c
Commit message (Collapse)AuthorAge
* avcodec/avcodec: Don't include cpu.hAndreas Rheinhardt2021-07-22
| | | | | | | It is not used here at all; instead, add it where it is used without including it or any of the arch-specific CPU headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Pass HDR10+ metadata to packet side data in VP9 encoderMohammad Izadi2021-06-24
| | | | | | | | | | | | | HDR10+ metadata is stored in the bit stream for HEVC. The story is different for VP9 and cannot store the metadata in the bit stream. HDR10+ should be passed to packet side data an stored in the container (mkv) for VP9. This CL is taking HDR10+ from AVFrame side data in libvpxenc and is passing it to the AVPacket side data. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Zern <jzern@google.com>
* lavc/libvpxenc: Show encoder config as a warning in case of failed ↵Matthieu Patou2021-06-14
| | | | | | initialization Suggested-By: ffmpeg@fb.com
* avcodec/libvpxenc: Avoid one level of indentationAndreas Rheinhardt2021-05-23
| | | | | | Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: James Zern <jzern@google.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libvpxenc: Avoid copying data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | | | | Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer() one can also allow user-supplied buffers. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: James Zern <jzern@google.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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 deprecated AVCodecContext.coded_frameAndreas Rheinhardt2021-04-27
| | | | | | | | | | Deprecated in 40cf1bbacc6220a0aa6bed5c331871d43f9ce370. (The currently disabled filter vf_mcdeint and vf_uspp were users of this field; they have not been changed, so that whoever wants to fix them can see the state of these filters when they were disabled.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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>
* lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADSAnton Khirnov2021-03-16
| | | | | | | | | | This cap is currently used to mark multithreading-capable codecs that wrap external libraries with their own multithreading code. The name is highly confusing for our API users, since libavcodec ALWAYS handles thread_count=0 (see commit message in previous commit). Therefore rename the cap and update its documentation to make its meaning clear. The old name is kept deprecated until next+1 major bump.
* lavc: replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal capAnton Khirnov2021-03-16
| | | | | | | | | | | | | | | | AV_CODEC_CAP_AUTO_THREADS was originally added in b4d44a45f9a to mark codecs that spawn threads internally and are able to select an optimal threads count by themselves (all such codecs are wrappers around external libraries). It is used by lavc generic code to check whether it should handle thread_count=0 itself or pass the zero directly to the codec implementation. Within this meaning, it is clearly supposed to be an internal cap rather than a public one, since from the viewpoint of a libavcodec user, lavc ALWAYS handles thread_count=0. Whether it happens in the generic code or within the codec internals is not a meaningful difference for the caller. External aspects of this flag will be dealt with in the following commit.
* avcodec/libvpxenc: optimize parsing vpx_svc_ref_frame_configWonkap Jang2021-02-19
| | | | | | | | Getting rid of unnecessary use of AVDictionary object in parsing vpx_svc_ref_frame_config. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Zern <jzern@google.com>
* avcodec/libvpxenc: add a way to set VP9E_SET_SVC_REF_FRAME_CONFIGWonkap Jang2021-01-14
| | | | | | In order to fine-control referencing schemes in VP9 encoding, there is a need to use VP9E_SET_SVC_REF_FRAME_CONFIG method. This commit provides a way to use the API through frame metadata.
* avcodec/libvpxenc: add missing FF_API_ERROR_FRAME checkJames Almer2020-10-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libvpxenc: use pix_fmt descriptors where usefulJames Zern2020-07-21
| | | | | | | | similar to: 36e51c190b avcodec/libaomenc: use pix_fmt descriptors where useful Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* avcodec/internal: move packet related functions to their own headerJames Almer2020-06-02
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/libvpxenc: Don't free user-provided AVPacketAndreas Rheinhardt2020-05-23
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/libvpxenc: add a way to explicitly set temporal layer idWonkap Jang2020-02-11
| | | | | | | | | In order for rate control to correctly allocate bitrate to each temporal layer, correct temporal layer id has to be set to each frame. This commit provides the ability to set correct temporal layer id for each frame. Signed-off-by: James Zern <jzern@google.com>
* avcodec/libvpxenc: add VP9 temporal scalability encoding optionWonkap Jang2020-02-03
| | | | | | | | | This commit reuses the configuration options for VP8 that enables temporal scalability for VP9. It also adds a way to enable three preset temporal structures (refer to the documentation for more detail) that can be used in offline encoding. Signed-off-by: James Zern <jzern@google.com>
* avcodec/libvpxenc,cosmetics: prefer sizeof(var)James Zern2020-01-06
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* avcodec/libvpxenc: use AV_OPT_TYPE_DICT for ts-parametersMarton Balint2020-01-01
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/libvpxenc,cosmetics: fix a typoJames Zern2019-11-08
| | | | predicition -> prediction
* avcodec/libvpxenc: only allocate alpha U/V planes on size changesMarton Balint2019-11-05
| | | | | Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: James Zern <jzern@google.com>
* avcodec/libvpxenc: fix alpha strideMarton Balint2019-11-05
| | | | | Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: James Zern <jzern@google.com>
* Change libvpxenc default to crf=32.elliottk2019-10-07
| | | | | | | | | 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>
* avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9Guo, Yejun2019-09-19
| | | | | | | | 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>
* lavc/libvpxenc: remove redundant condition checkJun Zhao2019-05-12
| | | | | | | Redundant condition: '!A || B' is equivalent to '!A || (A && B)' but more clearly. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/libvpxenc: add VP8/9 sharpness config optionRene Claus2018-12-24
| | | | | | | | 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>
* libvpxenc,cosmetics: fix { placementJames Zern2018-11-19
| | | | Signed-off-by: James Zern <jzern@google.com>
* avcodec/libvpxenc: add VP8 temporal scalability config optionsArd Oerlemans2018-11-19
| | | | | | | | | 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>
* avcodec/libvpxenc: Add a maximum constraint of 16 encoder threads.Chirag Lathia2018-11-15
| | | | | Signed-off-by: Chirag Lathia <clathia@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* libvpxenc: extend auto-alt-ref rangeJames Zern2018-11-09
| | | | | | | vp9 now supports [0, 6] Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* libvpxenc,vp9: add enable-tpl optionJames Zern2018-11-09
| | | | | | enables temporal dependency model Signed-off-by: James Zern <jzern@google.com>
* avcodec/libvpxenc: fix setting amount of threads used for encodingJames Almer2018-05-21
| | | | | | | | | | | | 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>
* 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.
* libvpxenc,vp9: add corpus-complexity optionJames Zern2017-11-28
| | | | | | | | | | 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>
* libvpxenc: remove pre-1.4.0 checksJames Zern2017-11-20
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* lavc/libvpxenc: add tune-content optionJames Zern2017-11-17
| | | | | | this matches the vpxenc parameter Signed-off-by: James Zern <jzern@google.com>
* Merge commit '94eed68ace9f2416af8457fcbf142b175928c06b'James Almer2017-10-23
|\ | | | | | | | | | | | | * commit '94eed68ace9f2416af8457fcbf142b175928c06b': lavc: Drop deprecated options moved to private contexts Merged-by: James Almer <jamrial@gmail.com>
| * lavc: Drop deprecated options moved to private contextsVittorio Giovara2017-03-23
| | | | | | | | Deprecated in 10/2014 and 07/2015.
* | libvpxenc: allow aq-mode 4 (equator360)James Zern2017-04-28
| | | | | | | | | | | | | | this was added in 1.6.0 Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* | Merge commit 'b183abfb5b6366b177cf44f244c66156257a6fd6'Clément Bœsch2017-03-15
|\| | | | | | | | | | | | | | | | | | | | | * 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>
| * vpx: Support color rangeLuca Barbato2016-07-23
| | | | | | | | The range field has been introduced in version 1.6.0
* | lavc/libvpxenc: add -row-mt optionKagami Hiiragi2017-03-06
| | | | | | | | Signed-off-by: James Zern <jzern@google.com>
* | libvpxenc: Don't spam level errors for VP8 encodesAlex Converse2016-12-13
| | | | | | | | | | Fixes "Failed to set VP9E_GET_LEVEL codec control: Codec does not implement requested capability" log messages on VP8 encodes.
* | libvpxenc: Report encoded VP9 levelAlex Converse2016-11-28
| | | | | | | | | | Report the actual level of the encoded output if a level is targeted or the level is passively tracked with a target of 0.
* | libvpxenc: Support targeting a VP9 levelAlex Converse2016-11-22
| | | | | | | | Levels are specified at https://www.webmproject.org/vp9/levels/
* | lavc/libvpxenc: fix -auto-alt-ref option typeKagami Hiiragi2016-10-21
| | | | | | | | | | | | | | | | 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>
* | lavc/libvpxenc: Avoid vp8 transparency encoding with auto-alt-ref.Carl Eugen Hoyos2016-09-17
| | | | | | | | Fixes ticket #5815.
* | libvpxenc,cosmetics: rename common fns vp8 -> vpxJames Zern2016-07-21
| | | | | | | | | | | | | | + the context struct Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Zern <jzern@google.com>
* | libvpx: Enable vp9 alpha encodingVignesh Venkatasubramanian2016-07-12
| | | | | | | | | | | | | | | | | | | | 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>