[libav-devel] [PATCH] Deprecate XvMC decoding.

Anton Khirnov anton at khirnov.net
Mon Nov 4 11:58:43 CET 2013


It has long ago been superseded by newer acceleration APIs, such as
VDPAU. Most of our major downstreams do not use it. It is not
implemented within the hwaccel framework, but requires its own specific
code in the decoders, which is a maintenance burden.
---
 doc/APIchanges                |    3 +++
 doc/general.texi              |    1 -
 libavcodec/avcodec.h          |   11 ++++++---
 libavcodec/codec_desc.c       |    2 ++
 libavcodec/error_resilience.c |   12 ++++++++++
 libavcodec/mpeg12dec.c        |   51 ++++++++++++++++++++++++++++++++++++++---
 libavcodec/mpegvideo.c        |   18 ++++++++++++++-
 libavcodec/options_table.h    |    2 ++
 libavcodec/version.h          |    3 +++
 libavcodec/x86/dsputil_init.c |   14 +++++++++--
 libavutil/pixdesc.c           |    2 ++
 libavutil/pixfmt.h            |    2 ++
 libavutil/version.h           |    3 +++
 13 files changed, 114 insertions(+), 10 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index d9618f4..1cf25bb 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:     2012-10-22
 
 API changes, most recent first:
 
+2013-11-xx - xxxxxxx - lavc 55.25.0
+  Deprecate XvMC decoding.
+
 2013-11-xx - xxxxxxx - lavu 52.18.0 - mem.h
   Move av_fast_malloc() and av_fast_realloc() for libavcodec to libavutil.
 
diff --git a/doc/general.texi b/doc/general.texi
index 6c82ac7..811fb9a 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -577,7 +577,6 @@ following image formats are supported:
 @item Mobotix MxPEG video    @tab     @tab  X
 @item Motion Pixels video    @tab     @tab  X
 @item MPEG-1 video           @tab  X  @tab  X
- at item MPEG-1/2 video XvMC (X-Video Motion Compensation)  @tab     @tab  X
 @item MPEG-2 video           @tab  X  @tab  X
 @item MPEG-4 part 2          @tab  X  @tab  X
     @tab libxvidcore can be used alternatively for encoding.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f08a6fe..80538cf 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -107,7 +107,9 @@ enum AVCodecID {
     /* video codecs */
     AV_CODEC_ID_MPEG1VIDEO,
     AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+#if FF_API_LAVC_XVMC
     AV_CODEC_ID_MPEG2VIDEO_XVMC,
+#endif
     AV_CODEC_ID_H261,
     AV_CODEC_ID_H263,
     AV_CODEC_ID_RV10,
@@ -688,8 +690,10 @@ typedef struct RcOverride{
  */
 #define CODEC_CAP_DR1             0x0002
 #define CODEC_CAP_TRUNCATED       0x0008
+#if FF_API_LAVC_XVMC
 /* Codec can export data for HW decoding (XvMC). */
 #define CODEC_CAP_HWACCEL         0x0010
+#endif
 /**
  * Encoder or decoder requires flushing with NULL input at the end in order to
  * give the complete and correct output.
@@ -1527,12 +1531,13 @@ typedef struct AVCodecContext {
 #define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
 #define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
 
+#if FF_API_LAVC_XVMC
     /**
-     * XVideo Motion Acceleration
-     * - encoding: forbidden
-     * - decoding: set by decoder
+     * @deprecated xvmc support is deprecated
      */
+    attribute_deprecated
     int xvmc_acceleration;
+#endif
 
     /**
      * macroblock decision mode
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 73e8f6d..4a27bf3 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -39,6 +39,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
         .props     = AV_CODEC_PROP_LOSSY,
     },
+#if FF_API_LAVC_XVMC
     {
         .id        = AV_CODEC_ID_MPEG2VIDEO_XVMC,
         .type      = AVMEDIA_TYPE_VIDEO,
@@ -46,6 +47,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video XvMC (X-Video Motion Compensation)"),
         .props     = AV_CODEC_PROP_LOSSY,
     },
+#endif
     {
         .id        = AV_CODEC_ID_H261,
         .type      = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 1769d2b..3132633 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -33,6 +33,10 @@
 #include "rectangle.h"
 #include "thread.h"
 
+#if FF_API_LAVC_XVMC
+#include "libavutil/internal.h"
+#endif
+
 /**
  * @param stride the number of MVs to get to the next row
  * @param mv_step the number of MVs per row or column in a macroblock
@@ -672,11 +676,15 @@ static int is_intra_more_likely(ERContext *s)
     if (undamaged_count < 5)
         return 0; // almost all MBs damaged -> use temporal prediction
 
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
     // prevent dsp.sad() check, that requires access to the image
     if (CONFIG_MPEG_XVMC_DECODER    &&
         s->avctx->xvmc_acceleration &&
         s->cur_pic->f.pict_type == AV_PICTURE_TYPE_I)
         return 1;
+    FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     skip_amount     = FFMAX(undamaged_count / 50, 1); // check only up to 50 MBs
     is_intra_likely = 0;
@@ -1105,9 +1113,13 @@ void ff_er_frame_end(ERContext *s)
     } else
         guess_mv(s);
 
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
     /* the filters below are not XvMC compatible, skip them */
     if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
         goto ec_clean;
+    FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     /* fill DC for inter blocks */
     for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
         for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 53d1e0e..ffe6149 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -35,7 +35,9 @@
 #include "mpeg12.h"
 #include "mpeg12data.h"
 #include "bytestream.h"
+#if FF_API_LAVC_XVMC
 #include "xvmc_internal.h"
+#endif
 #include "thread.h"
 
 typedef struct Mpeg1Context {
@@ -44,7 +46,9 @@ typedef struct Mpeg1Context {
     int repeat_field; /* true if we must repeat the field */
     AVPanScan pan_scan;              /**< some temporary storage for the panscan */
     int slice_count;
+#if FF_API_LAVC_XVMC
     int swap_uv;//indicate VCR2
+#endif
     int save_aspect_info;
     int save_width, save_height, save_progressive_seq;
     AVRational frame_rate_ext;       ///< MPEG-2 specific framerate modificator
@@ -756,6 +760,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
         } else
             memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */
         s->mb_intra = 1;
+#if FF_API_LAVC_XVMC
+        FF_DISABLE_DEPRECATION_WARNINGS
         // if 1, we memcpy blocks in xvmcvideo
         if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
             ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks
@@ -763,6 +769,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
                 exchange_uv(s);
             }
         }
+        FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
         if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
             if (s->flags2 & CODEC_FLAG2_FAST) {
@@ -969,6 +977,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
                 return -1;
             }
 
+#if FF_API_LAVC_XVMC
+            FF_DISABLE_DEPRECATION_WARNINGS
             //if 1, we memcpy blocks in xvmcvideo
             if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) {
                 ff_xvmc_pack_pblocks(s, cbp);
@@ -976,6 +986,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
                     exchange_uv(s);
                 }
             }
+            FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
             if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
                 if (s->flags2 & CODEC_FLAG2_FAST) {
@@ -1098,10 +1110,12 @@ static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm,
     }
 }
 
+#if FF_API_LAVC_XVMC
 static const enum AVPixelFormat pixfmt_xvmc_mpg2_420[] = {
     AV_PIX_FMT_XVMC_MPEG2_IDCT,
     AV_PIX_FMT_XVMC_MPEG2_MC,
     AV_PIX_FMT_NONE };
+#endif
 
 static const enum AVPixelFormat mpeg12_hwaccel_pixfmt_list_420[] = {
 #if CONFIG_MPEG2_DXVA2_HWACCEL
@@ -1122,16 +1136,22 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
     Mpeg1Context *s1 = avctx->priv_data;
     MpegEncContext *s = &s1->mpeg_enc_ctx;
 
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
     if (avctx->xvmc_acceleration)
         return avctx->get_format(avctx, pixfmt_xvmc_mpg2_420);
     else {
+    FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         if (s->chroma_format <  2)
             return avctx->get_format(avctx, mpeg12_hwaccel_pixfmt_list_420);
         else if (s->chroma_format == 2)
             return AV_PIX_FMT_YUV422P;
         else
             return AV_PIX_FMT_YUV444P;
+#if FF_API_LAVC_XVMC
     }
+#endif
 }
 
 /* Call this function when we know all parameters.
@@ -1229,7 +1249,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
         avctx->pix_fmt = mpeg_get_pixelformat(avctx);
         avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
         // until then pix_fmt may be changed right after codec init
-        if (avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT ||
+        if (
+#if FF_API_LAVC_XVMC
+            avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT ||
+#endif
             avctx->hwaccel)
             if (avctx->idct_algo == FF_IDCT_AUTO)
                 avctx->idct_algo = FF_IDCT_SIMPLE;
@@ -1557,11 +1580,15 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
             return -1;
     }
 
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
 // MPV_frame_start will call this function too,
 // but we need to call it on every field
     if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
         if (ff_xvmc_field_start(s, avctx) < 0)
             return -1;
+    FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     return 0;
 }
@@ -1662,9 +1689,13 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
     }
 
     for (;;) {
+#if FF_API_LAVC_XVMC
+        FF_DISABLE_DEPRECATION_WARNINGS
         // If 1, we memcpy blocks in xvmcvideo.
         if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1)
             ff_xvmc_init_block(s); // set s->block
+        FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
         if (mpeg_decode_mb(s, s->block) < 0)
             return -1;
@@ -1854,8 +1885,12 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
             av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
     }
 
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
     if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
         ff_xvmc_field_end(s);
+    FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     /* end of slice reached */
     if (/*s->mb_y << field_pic == s->mb_height &&*/ !s->first_field) {
@@ -1960,7 +1995,9 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
     s->chroma_format        = 1;
     s->codec_id             = s->avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
     s->out_format           = FMT_MPEG1;
+#if FF_API_LAVC_XVMC
     s->swap_uv              = 0; // AFAIK VCR2 does not have SEQ_HEADER
+#endif
     if (s->flags & CODEC_FLAG_LOW_DELAY)
         s->low_delay = 1;
 
@@ -1990,14 +2027,20 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
     avctx->pix_fmt = mpeg_get_pixelformat(avctx);
     avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
 
-    if (avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel)
+    if (
+#if FF_API_LAVC_XVMC
+        avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT ||
+#endif
+        avctx->hwaccel)
         if (avctx->idct_algo == FF_IDCT_AUTO)
             avctx->idct_algo = FF_IDCT_SIMPLE;
 
     if (ff_MPV_common_init(s) < 0)
         return -1;
     exchange_uv(s); // common init reset pblocks, so we swap them here
+#if FF_API_LAVC_XVMC
     s->swap_uv = 1; // in case of xvmc we need to swap uv for each MB
+#endif
     s1->mpeg_enc_ctx_allocated = 1;
 
     for (i = 0; i < 64; i++) {
@@ -2436,7 +2479,8 @@ AVCodec ff_mpeg2video_decoder = {
     .profiles       = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
 };
 
-#if CONFIG_MPEG_XVMC_DECODER
+#if CONFIG_MPEG_XVMC_DECODER && FF_API_LAVC_XVMC
+FF_DISABLE_DEPRECATION_WARNINGS
 static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx)
 {
     if (avctx->active_thread_type & FF_THREAD_SLICE)
@@ -2468,4 +2512,5 @@ AVCodec ff_mpeg_xvmc_decoder = {
     .flush          = flush,
 };
 
+FF_ENABLE_DEPRECATION_WARNINGS
 #endif
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index ae458ab..e79654b 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -37,7 +37,10 @@
 #include "mpegvideo.h"
 #include "mjpegenc.h"
 #include "msmpeg4.h"
+#if FF_API_LAVC_XVMC
 #include "xvmc_internal.h"
+#include "libavutil/internal.h"
+#endif
 #include "thread.h"
 #include <limits.h>
 
@@ -1673,8 +1676,12 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
         update_noise_reduction(s);
     }
 
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
     if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
         return ff_xvmc_field_start(s, avctx);
+    FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     return 0;
 }
@@ -1686,9 +1693,14 @@ void ff_MPV_frame_end(MpegEncContext *s)
     int i;
     /* redraw edges for the frame if decoding didn't complete */
     // just to make sure that all data is rendered.
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
     if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
         ff_xvmc_field_end(s);
-   } else if ((s->er.error_count || s->encoding) &&
+    FF_ENABLE_DEPRECATION_WARNINGS
+   } else
+#endif
+   if ((s->er.error_count || s->encoding) &&
               !s->avctx->hwaccel &&
               s->unrestricted_mv &&
               s->current_picture.reference &&
@@ -1961,10 +1973,14 @@ void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
                             int is_mpeg12)
 {
     const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
+#if FF_API_LAVC_XVMC
+    FF_DISABLE_DEPRECATION_WARNINGS
     if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){
         ff_xvmc_decode_mb(s);//xvmc uses pblocks
         return;
     }
+    FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {
        /* print DCT coefficients */
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index fe8e72e..cb4892a 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -271,7 +271,9 @@ static const AVOption avcodec_options[] = {
 {"deflate", "deflate-based coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_DEFLATE }, INT_MIN, INT_MAX, V|E, "coder"},
 {"context", "context model", OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
+#if FF_API_LAVC_XVMC
 {"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
+#endif
 {"mbd", "macroblock decision algorithm (high quality mode)", OFFSET(mb_decision), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "mbd"},
 {"simple", "use mbcmp (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_SIMPLE }, INT_MIN, INT_MAX, V|E, "mbd"},
 {"bits", "use fewest bits", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_BITS }, INT_MIN, INT_MAX, V|E, "mbd"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index affe599..75d91cb 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -109,5 +109,8 @@
 #ifndef FF_API_FAST_MALLOC
 #define FF_API_FAST_MALLOC       (LIBAVCODEC_VERSION_MAJOR < 56)
 #endif
+#ifndef FF_API_LAVC_XVMC
+#define FF_API_LAVC_XVMC         (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
diff --git a/libavcodec/x86/dsputil_init.c b/libavcodec/x86/dsputil_init.c
index a38cf24..b7670ce 100644
--- a/libavcodec/x86/dsputil_init.c
+++ b/libavcodec/x86/dsputil_init.c
@@ -26,6 +26,10 @@
 #include "dsputil_x86.h"
 #include "idct_xvid.h"
 
+#if FF_API_LAVC_XVMC
+#include "libavutil/internal.h"
+#endif
+
 void ff_put_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
                               int dstStride, int src1Stride, int h);
 void ff_put_no_rnd_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1,
@@ -619,11 +623,17 @@ static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx,
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
 
     if (!high_bit_depth) {
+#if FF_API_LAVC_XVMC
+        FF_DISABLE_DEPRECATION_WARNINGS
         if (!(CONFIG_MPEG_XVMC_DECODER && avctx->xvmc_acceleration > 1)) {
+        FF_ENABLE_DEPRECATION_WARNINGS
             /* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */
-            c->clear_block  = ff_clear_block_sse;
-            c->clear_blocks = ff_clear_blocks_sse;
+#endif
+        c->clear_block  = ff_clear_block_sse;
+        c->clear_blocks = ff_clear_blocks_sse;
+#if FF_API_LAVC_XVMC
         }
+#endif
     }
 
     c->vector_clipf = ff_vector_clipf_sse;
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 49c9072..3f596db 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -299,6 +299,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         },
         .flags = AV_PIX_FMT_FLAG_PLANAR,
     },
+#if FF_API_LAVU_XVMC
     [AV_PIX_FMT_XVMC_MPEG2_MC] = {
         .name = "xvmcmc",
         .flags = AV_PIX_FMT_FLAG_HWACCEL,
@@ -307,6 +308,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         .name = "xvmcidct",
         .flags = AV_PIX_FMT_FLAG_HWACCEL,
     },
+#endif
     [AV_PIX_FMT_UYVY422] = {
         .name = "uyvy422",
         .nb_components = 3,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 43633e7..0085d4c 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -77,8 +77,10 @@ enum AVPixelFormat {
     AV_PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
     AV_PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
     AV_PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+#if FF_API_LAVU_XVMC
     AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
     AV_PIX_FMT_XVMC_MPEG2_IDCT,
+#endif
     AV_PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
     AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
     AV_PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
diff --git a/libavutil/version.h b/libavutil/version.h
index ec60533..2d9d9d0 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -88,6 +88,9 @@
 #ifndef FF_API_VDPAU
 #define FF_API_VDPAU                    (LIBAVUTIL_VERSION_MAJOR < 53)
 #endif
+#ifndef FF_API_LAVU_XVMC
+#define FF_API_LAVU_XVMC                (LIBAVUTIL_VERSION_MAJOR < 53)
+#endif
 
 /**
  * @}
-- 
1.7.10.4



More information about the libav-devel mailing list