[FFmpeg-devel] [PATCH 1/2] avcodec: remove duplicate AVCodecIDs

Hendrik Leppkes h.leppkes at gmail.com
Mon Sep 7 10:06:23 CEST 2015


On Mon, Sep 7, 2015 at 2:34 AM, James Almer <jamrial at gmail.com> wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/avcodec.h    |  60 +++++++++----------------
>  libavcodec/codec_desc.c | 115 ------------------------------------------------
>  libavcodec/utils.c      |  20 ---------
>  3 files changed, 21 insertions(+), 174 deletions(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 074b2cd..32235ab 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -275,55 +275,43 @@ enum AVCodecID {
>      AV_CODEC_ID_MSS2,
>      AV_CODEC_ID_VP9,
>      AV_CODEC_ID_AIC,
> -    AV_CODEC_ID_ESCAPE130_DEPRECATED,
> -    AV_CODEC_ID_G2M_DEPRECATED,
> -    AV_CODEC_ID_WEBP_DEPRECATED,
> +    AV_CODEC_ID_ESCAPE130,
> +    AV_CODEC_ID_G2M,
> +    AV_CODEC_ID_WEBP,
>      AV_CODEC_ID_HNM4_VIDEO,
> -    AV_CODEC_ID_HEVC_DEPRECATED,
> +    AV_CODEC_ID_HEVC,
> +#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
>      AV_CODEC_ID_FIC,
>      AV_CODEC_ID_ALIAS_PIX,
> -    AV_CODEC_ID_BRENDER_PIX_DEPRECATED,
> -    AV_CODEC_ID_PAF_VIDEO_DEPRECATED,
> -    AV_CODEC_ID_EXR_DEPRECATED,
> -    AV_CODEC_ID_VP7_DEPRECATED,
> -    AV_CODEC_ID_SANM_DEPRECATED,
> -    AV_CODEC_ID_SGIRLE_DEPRECATED,
> -    AV_CODEC_ID_MVC1_DEPRECATED,
> -    AV_CODEC_ID_MVC2_DEPRECATED,
> +    AV_CODEC_ID_BRENDER_PIX,
> +    AV_CODEC_ID_PAF_VIDEO,
> +    AV_CODEC_ID_EXR,
> +    AV_CODEC_ID_VP7,
> +    AV_CODEC_ID_SANM,
> +    AV_CODEC_ID_SGIRLE,
> +    AV_CODEC_ID_MVC1,
> +    AV_CODEC_ID_MVC2,
>      AV_CODEC_ID_HQX,
>      AV_CODEC_ID_TDSC,
>      AV_CODEC_ID_HQ_HQA,
>      AV_CODEC_ID_HAP,
>      AV_CODEC_ID_DDS,
>
> -    AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
>      AV_CODEC_ID_Y41P       = MKBETAG('Y','4','1','P'),
> -    AV_CODEC_ID_ESCAPE130  = MKBETAG('E','1','3','0'),
> -    AV_CODEC_ID_EXR        = MKBETAG('0','E','X','R'),
>      AV_CODEC_ID_AVRP       = MKBETAG('A','V','R','P'),
>
>      AV_CODEC_ID_012V       = MKBETAG('0','1','2','V'),
> -    AV_CODEC_ID_G2M        = MKBETAG( 0 ,'G','2','M'),
>      AV_CODEC_ID_AVUI       = MKBETAG('A','V','U','I'),
>      AV_CODEC_ID_AYUV       = MKBETAG('A','Y','U','V'),
>      AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'),
>      AV_CODEC_ID_V308       = MKBETAG('V','3','0','8'),
>      AV_CODEC_ID_V408       = MKBETAG('V','4','0','8'),
>      AV_CODEC_ID_YUV4       = MKBETAG('Y','U','V','4'),
> -    AV_CODEC_ID_SANM       = MKBETAG('S','A','N','M'),
> -    AV_CODEC_ID_PAF_VIDEO  = MKBETAG('P','A','F','V'),
>      AV_CODEC_ID_AVRN       = MKBETAG('A','V','R','n'),
>      AV_CODEC_ID_CPIA       = MKBETAG('C','P','I','A'),
>      AV_CODEC_ID_XFACE      = MKBETAG('X','F','A','C'),
> -    AV_CODEC_ID_SGIRLE     = MKBETAG('S','G','I','R'),
> -    AV_CODEC_ID_MVC1       = MKBETAG('M','V','C','1'),
> -    AV_CODEC_ID_MVC2       = MKBETAG('M','V','C','2'),
>      AV_CODEC_ID_SNOW       = MKBETAG('S','N','O','W'),
> -    AV_CODEC_ID_WEBP       = MKBETAG('W','E','B','P'),
>      AV_CODEC_ID_SMVJPEG    = MKBETAG('S','M','V','J'),
> -    AV_CODEC_ID_HEVC       = MKBETAG('H','2','6','5'),
> -#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
> -    AV_CODEC_ID_VP7        = MKBETAG('V','P','7','0'),
>      AV_CODEC_ID_APNG       = MKBETAG('A','P','N','G'),
>
>      /* various PCM "codecs" */
> @@ -356,12 +344,9 @@ enum AVCodecID {
>      AV_CODEC_ID_PCM_LXF,
>      AV_CODEC_ID_S302M,
>      AV_CODEC_ID_PCM_S8_PLANAR,
> -    AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED,
> -    AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED,
> -    AV_CODEC_ID_PCM_S16BE_PLANAR_DEPRECATED,
> -    AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'),
> -    AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'),
> -    AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16),
> +    AV_CODEC_ID_PCM_S24LE_PLANAR,
> +    AV_CODEC_ID_PCM_S32LE_PLANAR,
> +    AV_CODEC_ID_PCM_S16BE_PLANAR,
>
>      /* various ADPCM codecs */
>      AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
> @@ -394,8 +379,8 @@ enum AVCodecID {
>      AV_CODEC_ID_ADPCM_IMA_ISS,
>      AV_CODEC_ID_ADPCM_G722,
>      AV_CODEC_ID_ADPCM_IMA_APC,
> -    AV_CODEC_ID_ADPCM_VIMA_DEPRECATED,
> -    AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'),
> +    AV_CODEC_ID_ADPCM_VIMA,
> +
>  #if FF_API_VIMA_DECODER
>      AV_CODEC_ID_VIMA       = MKBETAG('V','I','M','A'),
>  #endif

Should probably make the VIMA correction in this patch
(AV_CODEC_ID_VIMA being an alias of AV_CODEC_ID_ADPCM_VIMA), to avoid
problems.

> @@ -484,19 +469,16 @@ enum AVCodecID {
>      AV_CODEC_ID_RALF,
>      AV_CODEC_ID_IAC,
>      AV_CODEC_ID_ILBC,
> -    AV_CODEC_ID_OPUS_DEPRECATED,
> +    AV_CODEC_ID_OPUS,
>      AV_CODEC_ID_COMFORT_NOISE,
> -    AV_CODEC_ID_TAK_DEPRECATED,
> +    AV_CODEC_ID_TAK,
>      AV_CODEC_ID_METASOUND,
> -    AV_CODEC_ID_PAF_AUDIO_DEPRECATED,
> +    AV_CODEC_ID_PAF_AUDIO,
>      AV_CODEC_ID_ON2AVC,
>      AV_CODEC_ID_DSS_SP,
>      AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
>      AV_CODEC_ID_SONIC       = MKBETAG('S','O','N','C'),
>      AV_CODEC_ID_SONIC_LS    = MKBETAG('S','O','N','L'),
> -    AV_CODEC_ID_PAF_AUDIO   = MKBETAG('P','A','F','A'),
> -    AV_CODEC_ID_OPUS        = MKBETAG('O','P','U','S'),
> -    AV_CODEC_ID_TAK         = MKBETAG('t','B','a','K'),
>      AV_CODEC_ID_EVRC        = MKBETAG('s','e','v','c'),
>      AV_CODEC_ID_SMV         = MKBETAG('s','s','m','v'),
>      AV_CODEC_ID_DSD_LSBF    = MKBETAG('D','S','D','L'),
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 487bc2f..4ba3aa1 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -2806,72 +2806,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
>      },
>
>      /* deprecated codec ids */
> -    {
> -        .id        = AV_CODEC_ID_BRENDER_PIX_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "brender_pix_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image (deprecated id)"),
> -        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_ESCAPE130_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "escape130_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("Escape 130 (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_EXR_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "exr_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image (deprecated id)"),
> -        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
> -                     AV_CODEC_PROP_LOSSLESS,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_G2M_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "g2m_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("Go2Meeting (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_HEVC_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "hevc_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("H.265 / HEVC (High Efficiency Video Coding) (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_PAF_VIDEO_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "paf_video_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_SANM_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "sanm_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/SMUSH video (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_VP7_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "vp7_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("On2 VP7 (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_WEBP_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_VIDEO,
> -        .name      = "webp_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("WebP (deprecated id)"),
> -        .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
> -                     AV_CODEC_PROP_LOSSLESS,
> -    },
> -
>  #if FF_API_VIMA_DECODER
>      {
>          .id        = AV_CODEC_ID_VIMA,
> @@ -2881,55 +2815,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
>          .props     = AV_CODEC_PROP_LOSSY,
>      },
>  #endif
> -    {
> -        .id        = AV_CODEC_ID_ADPCM_VIMA_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_AUDIO,
> -        .name      = "adpcm_vima_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_OPUS_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_AUDIO,
> -        .name      = "opus_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("Opus (Opus Interactive Audio Codec) (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_PAF_AUDIO_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_AUDIO,
> -        .name      = "paf_audio_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSY,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_AUDIO,
> -        .name      = "pcm_s24le_planar_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 24-bit little-endian planar (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSLESS,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_AUDIO,
> -        .name      = "pcm_s32le_planar_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 32-bit little-endian planar (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSLESS,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_PCM_S16BE_PLANAR_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_AUDIO,
> -        .name      = "pcm_s16be_planar_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16-bit big-endian planar (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSLESS,
> -    },
> -    {
> -        .id        = AV_CODEC_ID_TAK_DEPRECATED,
> -        .type      = AVMEDIA_TYPE_AUDIO,
> -        .name      = "tak_deprecated",
> -        .long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor) (deprecated id)"),
> -        .props     = AV_CODEC_PROP_LOSSLESS,
> -    },
>  };
>
>  const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id)
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index a519ada..e50fb6e 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -2546,26 +2546,6 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
>      switch(id){
>          //This is for future deprecatec codec ids, its empty since
>          //last major bump but will fill up again over time, please don't remove it
> -//         case AV_CODEC_ID_UTVIDEO_DEPRECATED: return AV_CODEC_ID_UTVIDEO;
> -        case AV_CODEC_ID_BRENDER_PIX_DEPRECATED         : return AV_CODEC_ID_BRENDER_PIX;
> -        case AV_CODEC_ID_OPUS_DEPRECATED                : return AV_CODEC_ID_OPUS;
> -        case AV_CODEC_ID_TAK_DEPRECATED                 : return AV_CODEC_ID_TAK;
> -        case AV_CODEC_ID_PAF_AUDIO_DEPRECATED           : return AV_CODEC_ID_PAF_AUDIO;
> -        case AV_CODEC_ID_PCM_S16BE_PLANAR_DEPRECATED    : return AV_CODEC_ID_PCM_S16BE_PLANAR;
> -        case AV_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED    : return AV_CODEC_ID_PCM_S24LE_PLANAR;
> -        case AV_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED    : return AV_CODEC_ID_PCM_S32LE_PLANAR;
> -        case AV_CODEC_ID_ADPCM_VIMA_DEPRECATED          : return AV_CODEC_ID_ADPCM_VIMA;
> -        case AV_CODEC_ID_ESCAPE130_DEPRECATED           : return AV_CODEC_ID_ESCAPE130;
> -        case AV_CODEC_ID_EXR_DEPRECATED                 : return AV_CODEC_ID_EXR;
> -        case AV_CODEC_ID_G2M_DEPRECATED                 : return AV_CODEC_ID_G2M;
> -        case AV_CODEC_ID_PAF_VIDEO_DEPRECATED           : return AV_CODEC_ID_PAF_VIDEO;
> -        case AV_CODEC_ID_WEBP_DEPRECATED                : return AV_CODEC_ID_WEBP;
> -        case AV_CODEC_ID_HEVC_DEPRECATED                : return AV_CODEC_ID_HEVC;
> -        case AV_CODEC_ID_MVC1_DEPRECATED                : return AV_CODEC_ID_MVC1;
> -        case AV_CODEC_ID_MVC2_DEPRECATED                : return AV_CODEC_ID_MVC2;
> -        case AV_CODEC_ID_SANM_DEPRECATED                : return AV_CODEC_ID_SANM;
> -        case AV_CODEC_ID_SGIRLE_DEPRECATED              : return AV_CODEC_ID_SGIRLE;
> -        case AV_CODEC_ID_VP7_DEPRECATED                 : return AV_CODEC_ID_VP7;
>          default                                         : return id;
>      }
>  }
> --
> 2.5.0
>

Otherwise LGTM, cleaning up the deprecated duplicates should be done
no matter what we decide to do with the FourCC tags.

- Hendrik


More information about the ffmpeg-devel mailing list