[vlc-commits] avcodec: remove libavutils checks that are always true based on configure checks

Steve Lhomme git at videolan.org
Mon Aug 6 07:08:26 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Aug  3 10:59:16 2018 +0200| [782f07b6074304c1e3eef692e6eb9546426f282c] | committer: Steve Lhomme

avcodec: remove libavutils checks that are always true based on configure checks

We assume we use 55.9.0 and 55.22.101

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=782f07b6074304c1e3eef692e6eb9546426f282c
---

 modules/codec/avcodec/avcommon_compat.h |  4 ----
 modules/codec/avcodec/chroma.c          |  6 ------
 modules/codec/avcodec/encoder.c         |  6 +-----
 modules/codec/avcodec/va.c              |  5 +----
 modules/codec/avcodec/video.c           | 12 ++----------
 5 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h
index 8f9c12081c..afd5cc476f 100644
--- a/modules/codec/avcodec/avcommon_compat.h
+++ b/modules/codec/avcodec/avcommon_compat.h
@@ -91,10 +91,6 @@
     ( (LIBAVUTIL_VERSION_MICRO <  100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
       (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
 
-#if !LIBAVUTIL_VERSION_CHECK( 52, 11, 0, 32, 100 )
-#   define AV_PIX_FMT_FLAG_HWACCEL  PIX_FMT_HWACCEL
-#endif
-
 #endif /* HAVE_LIBAVUTIL_AVUTIL_H */
 
 #if LIBAVUTIL_VERSION_MAJOR >= 55
diff --git a/modules/codec/avcodec/chroma.c b/modules/codec/avcodec/chroma.c
index cd8d714bf2..454a20381e 100644
--- a/modules/codec/avcodec/chroma.c
+++ b/modules/codec/avcodec/chroma.c
@@ -147,13 +147,11 @@ static const struct
     VLC_RGB( VLC_CODEC_RGB32, AV_PIX_FMT_0BGR32, AV_PIX_FMT_0RGB32, 0x000000ff, 0x0000ff00, 0x00ff0000 )
 #endif
 
-#if (LIBAVUTIL_VERSION_MICRO == 0 || LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 0, 100 ) )
 #ifdef WORDS_BIGENDIAN
     {VLC_CODEC_RGBA64, AV_PIX_FMT_RGBA64BE, 0, 0, 0 },
 #else /* !WORDS_BIGENDIAN */
     {VLC_CODEC_RGBA64, AV_PIX_FMT_RGBA64LE, 0, 0, 0 },
 #endif /* !WORDS_BIGENDIAN */
-#endif
 
     {VLC_CODEC_RGBA, AV_PIX_FMT_RGBA, 0, 0, 0 },
     {VLC_CODEC_ARGB, AV_PIX_FMT_ARGB, 0, 0, 0 },
@@ -188,15 +186,11 @@ static const struct
     {VLC_CODEC_GBRA_PLANAR_12L, AV_PIX_FMT_GBRAP12LE, 0, 0, 0 },
     {VLC_CODEC_GBRA_PLANAR_12B, AV_PIX_FMT_GBRAP12BE, 0, 0, 0 },
 #endif
-#if LIBAVUTIL_VERSION_CHECK(54, 7, 0, 17, 100)
     {VLC_CODEC_GBRA_PLANAR_16L, AV_PIX_FMT_GBRAP16LE, 0, 0, 0 },
     {VLC_CODEC_GBRA_PLANAR_16B, AV_PIX_FMT_GBRAP16BE, 0, 0, 0 },
-#endif
 
     /* XYZ */
-#if LIBAVUTIL_VERSION_CHECK(52, 10, 0, 25, 100)
     {VLC_CODEC_XYZ12, AV_PIX_FMT_XYZ12, 0xfff0, 0xfff0, 0xfff0},
-#endif
     { 0, 0, 0, 0, 0 }
 };
 
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index a00439e939..cbe150c701 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -48,9 +48,7 @@
 #include "avcodec.h"
 #include "avcommon.h"
 
-#if LIBAVUTIL_VERSION_CHECK( 52,2,6,0,0 )
-# include <libavutil/channel_layout.h>
-#endif
+#include <libavutil/channel_layout.h>
 
 #define HURRY_UP_GUARD1 (450000)
 #define HURRY_UP_GUARD2 (300000)
@@ -730,7 +728,6 @@ int InitVideoEnc( vlc_object_t *p_this )
         p_context->time_base.num = 1;
         p_context->time_base.den = p_context->sample_rate;
         p_context->channels      = p_enc->fmt_out.audio.i_channels;
-#if LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 0)
         p_context->channel_layout = channel_mask[p_context->channels][1];
 
         /* Setup Channel ordering for multichannel audio
@@ -780,7 +777,6 @@ int InitVideoEnc( vlc_object_t *p_this )
         p_sys->i_channels_to_reorder =
             aout_CheckChannelReorder( NULL, pi_order_dst, order_mask,
                                       p_sys->pi_reorder_layout );
-#endif
 
         if ( p_enc->fmt_out.i_codec == VLC_CODEC_MP4A )
         {
diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c
index d1e3048259..ecf4e8aa14 100644
--- a/modules/codec/avcodec/va.c
+++ b/modules/codec/avcodec/va.c
@@ -57,7 +57,6 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt)
             }
             break;
 
-#if LIBAVUTIL_VERSION_CHECK(54, 13, 1, 24, 100)
         case AV_PIX_FMT_D3D11VA_VLD:
             switch (swfmt)
             {
@@ -67,8 +66,7 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt)
                     return VLC_CODEC_D3D11_OPAQUE;
             }
         break;
-#endif
-#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 4, 0))
+
         case AV_PIX_FMT_VDPAU:
             switch (swfmt)
             {
@@ -85,7 +83,6 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt)
                     return 0;
             }
             break;
-#endif
         default:
             return 0;
     }
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index a9d45ba4ab..3c2b3adb26 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -40,16 +40,14 @@
 #include <libavcodec/avcodec.h>
 #include <libavutil/mem.h>
 #include <libavutil/pixdesc.h>
-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 16, 101 ) )
+#if (LIBAVUTIL_VERSION_MICRO >= 100)
 #include <libavutil/mastering_display_metadata.h>
 #endif
 
 #include "avcodec.h"
 #include "va.h"
 
-#if LIBAVUTIL_VERSION_CHECK( 52, 20, 0, 58, 100 )
 #include <libavutil/stereo3d.h>
-#endif
 
 #include "../codec/cc.h"
 #define FRAME_INFO_DEPTH 64
@@ -819,7 +817,7 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_
     decoder_sys_t *p_sys = p_dec->p_sys;
     bool format_changed = false;
 
-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 16, 101 ) )
+#if (LIBAVUTIL_VERSION_MICRO >= 100)
 #define FROM_AVRAT(default_factor, avrat) \
 (uint64_t)(default_factor) * (avrat).num / (avrat).den
     const AVFrameSideData *metadata =
@@ -894,7 +892,6 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_
     }
 #endif
 
-#if LIBAVUTIL_VERSION_CHECK( 52, 20, 0, 58, 100 )
     const AVFrameSideData *p_stereo3d_data =
             av_frame_get_side_data( frame,
                                     AV_FRAME_DATA_STEREO3D );
@@ -942,7 +939,6 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_
     }
     else
         p_pic->format.multiview_mode = p_dec->fmt_out.video.multiview_mode;
-#endif
 
     if (format_changed && decoder_UpdateVideoFormat( p_dec ))
         return -1;
@@ -1689,15 +1685,11 @@ no_reuse:
     static const enum PixelFormat hwfmts[] =
     {
 #ifdef _WIN32
-#if LIBAVUTIL_VERSION_CHECK(54, 13, 1, 24, 100)
         AV_PIX_FMT_D3D11VA_VLD,
-#endif
         AV_PIX_FMT_DXVA2_VLD,
 #endif
         AV_PIX_FMT_VAAPI_VLD,
-#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 4, 0))
         AV_PIX_FMT_VDPAU,
-#endif
         AV_PIX_FMT_NONE,
     };
 



More information about the vlc-commits mailing list