[1/6] libvpx: Require at least version 1.5.0

Message ID 1472138898-16470-1-git-send-email-diego@biurrun.de
State New
Headers show

Commit Message

Diego Biurrun Aug. 25, 2016, 3:28 p.m.
This allows dropping some compatibility ifdefs, which will simplify
sharing code with the libaom wrapper.
---

Bumping the requirement up to 1.5.0 instead of 1.4.0.

 configure              | 2 +-
 libavcodec/libvpx.c    | 4 ----
 libavcodec/libvpxdec.c | 2 --
 libavcodec/libvpxenc.c | 2 --
 4 files changed, 1 insertion(+), 9 deletions(-)

Patch

diff --git a/configure b/configure
index e7bf537..8049d90 100755
--- a/configure
+++ b/configure
@@ -4628,7 +4628,7 @@  enabled libtwolame        && require libtwolame twolame.h twolame_init -ltwolame
 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            && require_pkg_config "vpx >= 1.5.0" vpx/vpx_codec.h vpx_codec_version && {
     enabled libvpx_vp8_decoder && {
         check_pkg_config vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
             disable libvpx_vp8_decoder;
diff --git a/libavcodec/libvpx.c b/libavcodec/libvpx.c
index 49f966d..cb07177 100644
--- a/libavcodec/libvpx.c
+++ b/libavcodec/libvpx.c
@@ -40,12 +40,10 @@  enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img)
     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;
-#if 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;
     }
 }
@@ -68,12 +66,10 @@  vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat pix)
     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;
-#if 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;
     }
 }
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 93a720f..ddc5530 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -99,7 +99,6 @@  static int vp8_decode(AVCodecContext *avctx,
             return ret;
         av_image_copy(picture->data, picture->linesize, img->planes,
                       img->stride, avctx->pix_fmt, img->d_w, img->d_h);
-#if VPX_IMAGE_ABI_VERSION >= 4
         switch (img->range) {
         case VPX_CR_STUDIO_RANGE:
             picture->color_range = AVCOL_RANGE_MPEG;
@@ -108,7 +107,6 @@  static int vp8_decode(AVCodecContext *avctx,
             picture->color_range = AVCOL_RANGE_JPEG;
             break;
         }
-#endif
         *got_frame           = 1;
     }
     return avpkt->size;
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index bb4c98f..c6c9105 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -694,11 +694,9 @@  AVCodec ff_libvpx_vp9_encoder = {
     .capabilities   = AV_CODEC_CAP_DELAY | AV_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),