enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
-enabled libvpx && require_pkg_config "vpx >= 1.3.0" vpx/vpx_codec.h vpx_codec_version && {
++
+enabled libvpx && {
- enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
- die "ERROR: libvpx decoder version must be >=0.9.1"; }
- enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
- die "ERROR: libvpx encoder version must be >=0.9.7"; }
- enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
- enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
+ enabled libvpx_vp8_decoder && {
- check_pkg_config vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
- disable libvpx_vp8_decoder;
++ use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
++ check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
++ die "ERROR: libvpx decoder version must be >=0.9.1";
+ }
+ enabled libvpx_vp8_encoder && {
- check_pkg_config vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
- disable libvpx_vp8_encoder;
++ use_pkg_config "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
++ check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
++ die "ERROR: libvpx encoder version must be >=0.9.7";
+ }
+ enabled libvpx_vp9_decoder && {
- check_pkg_config vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
- disable libvpx_vp9_decoder;
++ use_pkg_config "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
++ check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
++ disable libvpx_vp9_decoder;
+ }
+ enabled libvpx_vp9_encoder && {
- check_pkg_config vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
- disable libvpx_vp9_encoder;
++ use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
++ check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
++ disable libvpx_vp9_encoder;
+ }
+ if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
+ die "libvpx enabled but no supported decoders found"
+ fi
+ }
++
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
-enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
-enabled libx264 && require_pkg_config x264 "stdint.h x264.h" x264_encoder_encode &&
+enabled libwebp && {
+ enabled libwebp_encoder && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
+ enabled libwebp_anim_encoder && { use_pkg_config "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit || disable libwebp_anim_encoder; } }
+enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
+ { require libx264 x264.h x264_encoder_encode -lx264 &&
+ warn "using libx264 without pkg-config"; } } &&
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
- die "ERROR: libx264 version must be >= 0.118."; }
+ die "ERROR: libx264 must be installed and version must be >= 0.118."; }
enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
{ check_cpp_condition x265.h "X265_BUILD >= 57" ||
die "ERROR: libx265 version must be >= 57."; }
#define FF_PROFILE_HEVC_MAIN 1
#define FF_PROFILE_HEVC_MAIN_10 2
#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
+#define FF_PROFILE_HEVC_REXT 4
- #define FF_PROFILE_VP9_0 0
- #define FF_PROFILE_VP9_1 1
- #define FF_PROFILE_VP9_2 2
- #define FF_PROFILE_VP9_3 3
-
/**
* level
* - encoding: Set by user.
*/
#include <vpx/vpx_codec.h>
-
#include "libvpx.h"
+#include "config.h"
+
+#if CONFIG_LIBVPX_VP9_ENCODER
+#include <vpx/vpx_encoder.h>
+#include <vpx/vp8cx.h>
+#endif
+
+static const enum AVPixelFormat vp9_pix_fmts_def[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+};
+
+#if CONFIG_LIBVPX_VP9_ENCODER
+static const enum AVPixelFormat vp9_pix_fmts_highcol[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_NONE
+};
+
+static const enum AVPixelFormat vp9_pix_fmts_highbd[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV420P10LE,
+ AV_PIX_FMT_YUV422P10LE,
+ AV_PIX_FMT_YUV440P10LE,
+ AV_PIX_FMT_YUV444P10LE,
+ AV_PIX_FMT_YUV420P12LE,
+ AV_PIX_FMT_YUV422P12LE,
+ AV_PIX_FMT_YUV440P12LE,
+ AV_PIX_FMT_YUV444P12LE,
+ AV_PIX_FMT_NONE
+};
+#endif
+av_cold void ff_vp9_init_static(AVCodec *codec)
+{
+ if ( vpx_codec_version_major() < 1
+ || (vpx_codec_version_major() == 1 && vpx_codec_version_minor() < 3))
+ codec->capabilities |= CODEC_CAP_EXPERIMENTAL;
+ codec->pix_fmts = vp9_pix_fmts_def;
+#if CONFIG_LIBVPX_VP9_ENCODER
+ if ( vpx_codec_version_major() > 1
+ || (vpx_codec_version_major() == 1 && vpx_codec_version_minor() >= 4)) {
+#ifdef VPX_CODEC_CAP_HIGHBITDEPTH
+ vpx_codec_caps_t codec_caps = vpx_codec_get_caps(vpx_codec_vp9_cx());
+ if (codec_caps & VPX_CODEC_CAP_HIGHBITDEPTH)
+ codec->pix_fmts = vp9_pix_fmts_highbd;
+ else
+#endif
+ codec->pix_fmts = vp9_pix_fmts_highcol;
+ }
+#endif
+}
++#if 0
+ enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img)
+ {
+ switch (img) {
+ case VPX_IMG_FMT_RGB24: return AV_PIX_FMT_RGB24;
+ case VPX_IMG_FMT_RGB565: return AV_PIX_FMT_RGB565BE;
+ case VPX_IMG_FMT_RGB555: return AV_PIX_FMT_RGB555BE;
+ case VPX_IMG_FMT_UYVY: return AV_PIX_FMT_UYVY422;
+ case VPX_IMG_FMT_YUY2: return AV_PIX_FMT_YUYV422;
+ case VPX_IMG_FMT_YVYU: return AV_PIX_FMT_YVYU422;
+ case VPX_IMG_FMT_BGR24: return AV_PIX_FMT_BGR24;
+ case VPX_IMG_FMT_ARGB: return AV_PIX_FMT_ARGB;
+ case VPX_IMG_FMT_ARGB_LE: return AV_PIX_FMT_BGRA;
+ case VPX_IMG_FMT_RGB565_LE: return AV_PIX_FMT_RGB565LE;
+ case VPX_IMG_FMT_RGB555_LE: return AV_PIX_FMT_RGB555LE;
+ case VPX_IMG_FMT_I420: return AV_PIX_FMT_YUV420P;
+ case VPX_IMG_FMT_I422: return AV_PIX_FMT_YUV422P;
+ case VPX_IMG_FMT_I444: return AV_PIX_FMT_YUV444P;
+ case VPX_IMG_FMT_444A: return AV_PIX_FMT_YUVA444P;
+ #ifdef VPX_IMAGE_ABI_VERSION >= 3
+ case VPX_IMG_FMT_I440: return AV_PIX_FMT_YUV440P;
+ case VPX_IMG_FMT_I42016: return AV_PIX_FMT_YUV420P16BE;
+ case VPX_IMG_FMT_I42216: return AV_PIX_FMT_YUV422P16BE;
+ case VPX_IMG_FMT_I44416: return AV_PIX_FMT_YUV444P16BE;
+ #endif
+ default: return AV_PIX_FMT_NONE;
+ }
+ }
+
+ vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat pix)
+ {
+ switch (pix) {
+ case AV_PIX_FMT_RGB24: return VPX_IMG_FMT_RGB24;
+ case AV_PIX_FMT_RGB565BE: return VPX_IMG_FMT_RGB565;
+ case AV_PIX_FMT_RGB555BE: return VPX_IMG_FMT_RGB555;
+ case AV_PIX_FMT_UYVY422: return VPX_IMG_FMT_UYVY;
+ case AV_PIX_FMT_YUYV422: return VPX_IMG_FMT_YUY2;
+ case AV_PIX_FMT_YVYU422: return VPX_IMG_FMT_YVYU;
+ case AV_PIX_FMT_BGR24: return VPX_IMG_FMT_BGR24;
+ case AV_PIX_FMT_ARGB: return VPX_IMG_FMT_ARGB;
+ case AV_PIX_FMT_BGRA: return VPX_IMG_FMT_ARGB_LE;
+ case AV_PIX_FMT_RGB565LE: return VPX_IMG_FMT_RGB565_LE;
+ case AV_PIX_FMT_RGB555LE: return VPX_IMG_FMT_RGB555_LE;
+ case AV_PIX_FMT_YUV420P: return VPX_IMG_FMT_I420;
+ case AV_PIX_FMT_YUV422P: return VPX_IMG_FMT_I422;
+ case AV_PIX_FMT_YUV444P: return VPX_IMG_FMT_I444;
+ case AV_PIX_FMT_YUVA444P: return VPX_IMG_FMT_444A;
+ #ifdef VPX_IMAGE_ABI_VERSION >= 3
+ case AV_PIX_FMT_YUV440P: return VPX_IMG_FMT_I440;
+ case AV_PIX_FMT_YUV420P16BE: return VPX_IMG_FMT_I42016;
+ case AV_PIX_FMT_YUV422P16BE: return VPX_IMG_FMT_I42216;
+ case AV_PIX_FMT_YUV444P16BE: return VPX_IMG_FMT_I44416;
+ #endif
+ default: return VPX_IMG_FMT_NONE;
+ }
+ }
++#endif
#include "avcodec.h"
+void ff_vp9_init_static(AVCodec *codec);
+ enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img);
+ vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat pix);
#endif /* AVCODEC_LIBVPX_H */
const struct vpx_codec_iface *iface)
{
VP8Context *ctx = avctx->priv_data;
- struct vpx_codec_enc_cfg enccfg;
+ struct vpx_codec_enc_cfg enccfg = { 0 };
+ struct vpx_codec_enc_cfg enccfg_alpha;
+ vpx_codec_flags_t flags = (avctx->flags & CODEC_FLAG_PSNR) ? VPX_CODEC_USE_PSNR : 0;
int res;
+ vpx_img_fmt_t img_fmt = VPX_IMG_FMT_I420;
+#if CONFIG_LIBVPX_VP9_ENCODER
+ vpx_codec_caps_t codec_caps = vpx_codec_get_caps(iface);
+#endif
av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str());
av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_codec_build_config());
.encode2 = vp8_encode,
.close = vp8_free,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
- .pix_fmts = (const enum AVPixelFormat[]) {
- AV_PIX_FMT_YUV420P,
-#if VPX_IMAGE_ABI_VERSION >= 3
- AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUV440P,
-#endif
- AV_PIX_FMT_NONE,
- },
+ .profiles = NULL_IF_CONFIG_SMALL(profiles),
.priv_class = &class_vp9,
.defaults = defaults,
+ .init_static_data = ff_vp9_init_static,
};
#endif /* CONFIG_LIBVPX_VP9_ENCODER */
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR 26
-#define LIBAVCODEC_VERSION_MICRO 1
+#define LIBAVCODEC_VERSION_MINOR 42
- #define LIBAVCODEC_VERSION_MICRO 100
++#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \