---

I tied the supported formats to the ABI version.

 configure              | 12 ++++++------
 libavcodec/libvpx.c    |  8 ++++++--
 libavcodec/libvpxenc.c |  6 +++++-
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index a416dc2..8cb53d2 100755
--- a/configure
+++ b/configure
@@ -4312,19 +4312,19 @@ enabled libvo_amrwbenc    && require libvo_amrwbenc 
vo-amrwbenc/enc_if.h E_IF_in
 enabled libvorbis         && require libvorbis vorbis/vorbisenc.h 
vorbis_info_init -lvorbisenc -lvorbis -logg
 enabled libvpx            && {
     enabled libvpx_vp8_decoder && {
-        require "vpx >= 1.4.0" vpx/vpx_decoder.h vpx_codec_dec_init_ver -lvpx 
||
-            die "ERROR: libvpx encoder version must be >=1.4.0";
+        require_pkg_config "vpx >= 1.3.0" vpx/vpx_decoder.h 
vpx_codec_dec_init_ver ||
+            die "ERROR: libvpx encoder version must be >= 1.3.0";
     }
     enabled libvpx_vp8_encoder && {
-        require "vpx >= 1.4.0" vpx/vpx_encoder.h vpx_codec_enc_init_ver -lvpx 
||
-            die "ERROR: libvpx encoder version must be >=1.4.0";
+        require_pkg_config "vpx >= 1.3.0" vpx/vpx_encoder.h 
vpx_codec_enc_init_ver ||
+            die "ERROR: libvpx encoder version must be >= 1.3.0";
     }
     enabled libvpx_vp9_decoder && {
-        require "vpx >= 1.4.0" vpx/vpx_decoder.h vpx_codec_dec_init_ver -lvpx 
||
+        require_pkg_config "vpx >= 1.3.0" vpx/vpx_decoder.h 
vpx_codec_dec_init_ver ||
             disable libvpx_vp9_decoder;
     }
     enabled libvpx_vp9_encoder && {
-        require "vpx >= 1.4.0" vpx/vpx_encoder.h vpx_codec_enc_init_ver -lvpx 
||
+        require_pkg_config "vpx >= 1.3.0" vpx/vpx_encoder.h 
vpx_codec_enc_init_ver ||
             disable libvpx_vp9_encoder;
     }
 }
diff --git a/libavcodec/libvpx.c b/libavcodec/libvpx.c
index 603ed13..230bc49 100644
--- a/libavcodec/libvpx.c
+++ b/libavcodec/libvpx.c
@@ -39,11 +39,13 @@ enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t 
img)
     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_I440:      return AV_PIX_FMT_YUV440P;
     case VPX_IMG_FMT_444A:      return AV_PIX_FMT_YUVA444P;
+#ifdef VPX_IMG_FMT_HIGHBITDEPTH
+    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;
     }
 }
@@ -65,11 +67,13 @@ vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat 
pix)
     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_YUV440P:      return VPX_IMG_FMT_I440;
     case AV_PIX_FMT_YUVA444P:     return VPX_IMG_FMT_444A;
+#ifdef VPX_IMG_FMT_HIGHBITDEPTH
+    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;
     }
 }
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 16d239d..1b0b9e7 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -653,8 +653,12 @@ AVCodec ff_libvpx_vp9_encoder = {
     .close          = vp8_free,
     .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
     .pix_fmts       = (const enum AVPixelFormat[]) {
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
+        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),
--
2.3.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to