]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '2f8cbbc962dfc0dc1dd0a90b2cd6c21266380f51'
authorHendrik Leppkes <h.leppkes@gmail.com>
Sat, 5 Sep 2015 15:12:23 +0000 (17:12 +0200)
committerHendrik Leppkes <h.leppkes@gmail.com>
Sat, 5 Sep 2015 15:12:23 +0000 (17:12 +0200)
* commit '2f8cbbc962dfc0dc1dd0a90b2cd6c21266380f51':
  lavu: Drop deprecated external access to AVPixFmtDescriptor table

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavutil/pixdesc.c
libavutil/pixdesc.h
libavutil/version.h

diff --combined libavutil/pixdesc.c
index eb52113745ea3a40fb0c1395644fe10154eac638,cec35439fde4ee5e3ab67c593a1a32ade4a7742d..2ad78656919212cdfaef059f1dde8ff989379f0a
@@@ -2,27 -2,26 +2,27 @@@
   * pixel format descriptor
   * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
   *
 - * This file is part of Libav.
 + * This file is part of FFmpeg.
   *
 - * Libav is free software; you can redistribute it and/or
 + * FFmpeg is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
 - * Libav is distributed in the hope that it will be useful,
 + * FFmpeg is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
 - * License along with Libav; if not, write to the Free Software
 + * License along with FFmpeg; if not, write to the Free Software
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
  #include <stdio.h>
  #include <string.h>
  
 +#include "avassert.h"
  #include "avstring.h"
  #include "common.h"
  #include "pixfmt.h"
@@@ -127,10 -126,7 +127,7 @@@ void av_write_image_line(const uint16_
      }
  }
  
- #if !FF_API_PIX_FMT_DESC
- static
- #endif
- const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
+ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
      [AV_PIX_FMT_YUV420P] = {
          .name = "yuv420p",
          .nb_components = 3,
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 2, 1, 0, 7 },        /* B */
 -            { 0, 2, 2, 0, 7 },        /* G */
              { 0, 2, 3, 0, 7 },        /* R */
 +            { 0, 2, 2, 0, 7 },        /* G */
 +            { 0, 2, 1, 0, 7 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_RGB,
      },
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR,
      },
 +    [AV_PIX_FMT_YUVJ411P] = {
 +        .name = "yuvj411p",
 +        .nb_components = 3,
 +        .log2_chroma_w = 2,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 0, 1, 0, 7 },        /* Y */
 +            { 1, 0, 1, 0, 7 },        /* U */
 +            { 2, 0, 1, 0, 7 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
      [AV_PIX_FMT_GRAY8] = {
          .name = "gray",
          .nb_components = 1,
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            {0, 0, 1, 0, 7},        /* Y */
 -            {1, 0, 1, 0, 7},        /* U */
 -            {2, 0, 1, 0, 7},        /* V */
 +            { 0, 0, 1, 0, 7 },        /* Y */
 +            { 1, 0, 1, 0, 7 },        /* U */
 +            { 2, 0, 1, 0, 7 },        /* V */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR,
      },
          .flags = AV_PIX_FMT_FLAG_HWACCEL,
      },
  #endif /* FF_API_XVMC */
 +#if !FF_API_XVMC
 +    [AV_PIX_FMT_XVMC] = {
 +        .name = "xvmc",
 +        .flags = AV_PIX_FMT_FLAG_HWACCEL,
 +    },
 +#endif /* !FF_API_XVMC */
      [AV_PIX_FMT_UYVY422] = {
          .name = "uyvy422",
          .nb_components = 3,
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 0, 1, 6, 1 },        /* B */
 -            { 0, 0, 1, 3, 2 },        /* G */
              { 0, 0, 1, 0, 2 },        /* R */
 +            { 0, 0, 1, 3, 2 },        /* G */
 +            { 0, 0, 1, 6, 1 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 3, 1, 0, 0 },        /* B */
 -            { 0, 3, 2, 0, 1 },        /* G */
              { 0, 3, 4, 0, 0 },        /* R */
 +            { 0, 3, 2, 0, 1 },        /* G */
 +            { 0, 3, 1, 0, 0 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 0, 1, 3, 0 },        /* B */
 -            { 0, 0, 1, 1, 1 },        /* G */
              { 0, 0, 1, 0, 0 },        /* R */
 +            { 0, 0, 1, 1, 1 },        /* G */
 +            { 0, 0, 1, 3, 0 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PSEUDOPAL,
      },
          .log2_chroma_h = 1,
          .comp = {
              { 0, 0, 1, 0, 7 },        /* Y */
 -            { 1, 1, 1, 0, 7 },        /* V */
              { 1, 1, 2, 0, 7 },        /* U */
 +            { 1, 1, 1, 0, 7 },        /* V */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 3, 1, 0, 7 },        /* A */
              { 0, 3, 2, 0, 7 },        /* R */
              { 0, 3, 3, 0, 7 },        /* G */
              { 0, 3, 4, 0, 7 },        /* B */
 +            { 0, 3, 1, 0, 7 },        /* A */
          },
          .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 3, 1, 0, 7 },        /* A */
 -            { 0, 3, 2, 0, 7 },        /* B */
 -            { 0, 3, 3, 0, 7 },        /* G */
              { 0, 3, 4, 0, 7 },        /* R */
 +            { 0, 3, 3, 0, 7 },        /* G */
 +            { 0, 3, 2, 0, 7 },        /* B */
 +            { 0, 3, 1, 0, 7 },        /* A */
          },
          .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 3, 1, 0, 7 },        /* B */
 -            { 0, 3, 2, 0, 7 },        /* G */
              { 0, 3, 3, 0, 7 },        /* R */
 +            { 0, 3, 2, 0, 7 },        /* G */
 +            { 0, 3, 1, 0, 7 },        /* B */
              { 0, 3, 4, 0, 7 },        /* A */
          },
          .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
      },
 +    [AV_PIX_FMT_0RGB] = {
 +        .name = "0rgb",
 +        .nb_components= 3,
 +        .log2_chroma_w= 0,
 +        .log2_chroma_h= 0,
 +        .comp = {
 +            { 0, 3, 2, 0, 7 },        /* R */
 +            { 0, 3, 3, 0, 7 },        /* G */
 +            { 0, 3, 4, 0, 7 },        /* B */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_RGB0] = {
 +        .name = "rgb0",
 +        .nb_components= 3,
 +        .log2_chroma_w= 0,
 +        .log2_chroma_h= 0,
 +        .comp = {
 +            { 0, 3, 1, 0, 7 },        /* R */
 +            { 0, 3, 2, 0, 7 },        /* G */
 +            { 0, 3, 3, 0, 7 },        /* B */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_0BGR] = {
 +        .name = "0bgr",
 +        .nb_components= 3,
 +        .log2_chroma_w= 0,
 +        .log2_chroma_h= 0,
 +        .comp = {
 +            { 0, 3, 4, 0, 7 },        /* R */
 +            { 0, 3, 3, 0, 7 },        /* G */
 +            { 0, 3, 2, 0, 7 },        /* B */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BGR0] = {
 +        .name = "bgr0",
 +        .nb_components= 3,
 +        .log2_chroma_w= 0,
 +        .log2_chroma_h= 0,
 +        .comp = {
 +            { 0, 3, 3, 0, 7 },        /* R */
 +            { 0, 3, 2, 0, 7 },        /* G */
 +            { 0, 3, 1, 0, 7 },        /* B */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
      [AV_PIX_FMT_GRAY16BE] = {
          .name = "gray16be",
          .nb_components = 1,
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR,
      },
 +    [AV_PIX_FMT_YUV440P10LE] = {
 +        .name = "yuv440p10le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 9 },        /* Y */
 +            { 1, 1, 1, 0, 9 },        /* U */
 +            { 2, 1, 1, 0, 9 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV440P10BE] = {
 +        .name = "yuv440p10be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 9 },        /* Y */
 +            { 1, 1, 1, 0, 9 },        /* U */
 +            { 2, 1, 1, 0, 9 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV440P12LE] = {
 +        .name = "yuv440p12le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV440P12BE] = {
 +        .name = "yuv440p12be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
      [AV_PIX_FMT_YUVA420P] = {
          .name = "yuva420p",
          .nb_components = 4,
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
      },
 -        [AV_PIX_FMT_YUVA422P] = {
 +    [AV_PIX_FMT_YUVA422P] = {
          .name = "yuva422p",
          .nb_components = 4,
          .log2_chroma_w = 1,
              { 2, 1, 1, 0, 8 },        /* V */
              { 3, 1, 1, 0, 8 },        /* A */
          },
 -        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
      },
      [AV_PIX_FMT_YUVA420P9LE] = {
          .name = "yuva420p9le",
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 5, 1, 0, 15 },       /* B */
 -            { 0, 5, 3, 0, 15 },       /* G */
              { 0, 5, 5, 0, 15 },       /* R */
 +            { 0, 5, 3, 0, 15 },       /* G */
 +            { 0, 5, 1, 0, 15 },       /* B */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 5, 1, 0, 15 },       /* B */
 -            { 0, 5, 3, 0, 15 },       /* G */
              { 0, 5, 5, 0, 15 },       /* R */
 +            { 0, 5, 3, 0, 15 },       /* G */
 +            { 0, 5, 1, 0, 15 },       /* B */
          },
          .flags = AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 5, 1, 0, 15 },       /* B */
 -            { 0, 5, 3, 0, 15 },       /* G */
 -            { 0, 5, 5, 0, 15 },       /* R */
 -            { 0, 5, 7, 0, 15 },       /* A */
 +            { 0, 7, 5, 0, 15 },       /* R */
 +            { 0, 7, 3, 0, 15 },       /* G */
 +            { 0, 7, 1, 0, 15 },       /* B */
 +            { 0, 7, 7, 0, 15 },       /* A */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 5, 1, 0, 15 },       /* B */
 -            { 0, 5, 3, 0, 15 },       /* G */
 -            { 0, 5, 5, 0, 15 },       /* R */
 -            { 0, 5, 7, 0, 15 },       /* A */
 +            { 0, 7, 5, 0, 15 },       /* R */
 +            { 0, 7, 3, 0, 15 },       /* G */
 +            { 0, 7, 1, 0, 15 },       /* B */
 +            { 0, 7, 7, 0, 15 },       /* A */
          },
          .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 1, 0, 3, 4 },        /* B */
 -            { 0, 1, 1, 5, 5 },        /* G */
              { 0, 1, 1, 0, 4 },        /* R */
 +            { 0, 1, 1, 5, 5 },        /* G */
 +            { 0, 1, 0, 3, 4 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 1, 2, 3, 4 },        /* B */
 -            { 0, 1, 1, 5, 5 },        /* G */
              { 0, 1, 1, 0, 4 },        /* R */
 +            { 0, 1, 1, 5, 5 },        /* G */
 +            { 0, 1, 2, 3, 4 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 1, 0, 2, 4 },       /* B */
 -            { 0, 1, 1, 5, 4 },       /* G */
              { 0, 1, 1, 0, 4 },       /* R */
 +            { 0, 1, 1, 5, 4 },       /* G */
 +            { 0, 1, 0, 2, 4 },       /* B */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
       },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 1, 2, 2, 4 },        /* B */
 -            { 0, 1, 1, 5, 4 },        /* G */
              { 0, 1, 1, 0, 4 },        /* R */
 +            { 0, 1, 1, 5, 4 },        /* G */
 +            { 0, 1, 2, 2, 4 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 1, 0, 0, 3 },       /* B */
 -            { 0, 1, 1, 4, 3 },       /* G */
              { 0, 1, 1, 0, 3 },       /* R */
 +            { 0, 1, 1, 4, 3 },       /* G */
 +            { 0, 1, 0, 0, 3 },       /* B */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
       },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 -            { 0, 1, 2, 0, 3 },        /* B */
 -            { 0, 1, 1, 4, 3 },        /* G */
              { 0, 1, 1, 0, 3 },        /* R */
 +            { 0, 1, 1, 4, 3 },        /* G */
 +            { 0, 1, 2, 0, 3 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_RGB,
      },
 +#if FF_API_VAAPI
      [AV_PIX_FMT_VAAPI_MOCO] = {
          .name = "vaapi_moco",
          .log2_chroma_w = 1,
          .log2_chroma_h = 1,
          .flags = AV_PIX_FMT_FLAG_HWACCEL,
      },
 -    [AV_PIX_FMT_VDA_VLD] = {
 -        .name = "vda_vld",
 +#else
 +    [AV_PIX_FMT_VAAPI] = {
 +        .name = "vaapi",
          .log2_chroma_w = 1,
          .log2_chroma_h = 1,
          .flags = AV_PIX_FMT_FLAG_HWACCEL,
      },
 +#endif
      [AV_PIX_FMT_YUV420P9LE] = {
          .name = "yuv420p9le",
          .nb_components = 3,
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
      },
 +    [AV_PIX_FMT_YUV420P12LE] = {
 +        .name = "yuv420p12le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV420P12BE] = {
 +        .name = "yuv420p12be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV420P14LE] = {
 +        .name = "yuv420p14le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV420P14BE] = {
 +        .name = "yuv420p14be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 1,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
      [AV_PIX_FMT_YUV420P16LE] = {
          .name = "yuv420p16le",
          .nb_components = 3,
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
      },
 +    [AV_PIX_FMT_YUV422P12LE] = {
 +        .name = "yuv422p12le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV422P12BE] = {
 +        .name = "yuv422p12be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV422P14LE] = {
 +        .name = "yuv422p14le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV422P14BE] = {
 +        .name = "yuv422p14be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
      [AV_PIX_FMT_YUV422P16LE] = {
          .name = "yuv422p16le",
          .nb_components = 3,
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
      },
 +    [AV_PIX_FMT_YUV444P12LE] = {
 +        .name = "yuv444p12le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV444P12BE] = {
 +        .name = "yuv444p12be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 11 },        /* Y */
 +            { 1, 1, 1, 0, 11 },        /* U */
 +            { 2, 1, 1, 0, 11 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV444P14LE] = {
 +        .name = "yuv444p14le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR,
 +    },
 +    [AV_PIX_FMT_YUV444P14BE] = {
 +        .name = "yuv444p14be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 1, 1, 0, 13 },        /* Y */
 +            { 1, 1, 1, 0, 13 },        /* U */
 +            { 2, 1, 1, 0, 13 },        /* V */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 +    },
      [AV_PIX_FMT_D3D11VA_VLD] = {
          .name = "d3d11va_vld",
          .log2_chroma_w = 1,
          .log2_chroma_h = 1,
          .flags = AV_PIX_FMT_FLAG_HWACCEL,
      },
 +    [AV_PIX_FMT_VDA_VLD] = {
 +        .name = "vda_vld",
 +        .log2_chroma_w = 1,
 +        .log2_chroma_h = 1,
 +        .flags = AV_PIX_FMT_FLAG_HWACCEL,
 +    },
      [AV_PIX_FMT_YA8] = {
          .name = "ya8",
          .nb_components = 2,
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
      },
 +    [AV_PIX_FMT_VIDEOTOOLBOX] = {
 +        .name = "videotoolbox_vld",
 +        .flags = AV_PIX_FMT_FLAG_HWACCEL,
 +    },
      [AV_PIX_FMT_GBRP] = {
          .name = "gbrp",
          .nb_components = 3,
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 0, 1, 0, 7 },        /* R */
              { 0, 0, 1, 0, 7 },        /* G */
              { 1, 0, 1, 0, 7 },        /* B */
 -            { 2, 0, 1, 0, 7 },        /* R */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 8 },        /* R */
              { 0, 1, 1, 0, 8 },        /* G */
              { 1, 1, 1, 0, 8 },        /* B */
 -            { 2, 1, 1, 0, 8 },        /* R */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 8 },        /* R */
              { 0, 1, 1, 0, 8 },        /* G */
              { 1, 1, 1, 0, 8 },        /* B */
 -            { 2, 1, 1, 0, 8 },        /* R */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 9 },        /* R */
              { 0, 1, 1, 0, 9 },        /* G */
              { 1, 1, 1, 0, 9 },        /* B */
 -            { 2, 1, 1, 0, 9 },        /* R */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 9 },        /* R */
              { 0, 1, 1, 0, 9 },        /* G */
              { 1, 1, 1, 0, 9 },        /* B */
 -            { 2, 1, 1, 0, 9 },        /* R */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_GBRP12LE] = {
 +        .name = "gbrp12le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 2, 1, 1, 0, 11 },        /* R */
 +            { 0, 1, 1, 0, 11 },        /* G */
 +            { 1, 1, 1, 0, 11 },        /* B */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_GBRP12BE] = {
 +        .name = "gbrp12be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 2, 1, 1, 0, 11 },        /* R */
 +            { 0, 1, 1, 0, 11 },        /* G */
 +            { 1, 1, 1, 0, 11 },        /* B */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_GBRP14LE] = {
 +        .name = "gbrp14le",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 2, 1, 1, 0, 13 },        /* R */
 +            { 0, 1, 1, 0, 13 },        /* G */
 +            { 1, 1, 1, 0, 13 },        /* B */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_GBRP14BE] = {
 +        .name = "gbrp14be",
 +        .nb_components = 3,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 2, 1, 1, 0, 13 },        /* R */
 +            { 0, 1, 1, 0, 13 },        /* G */
 +            { 1, 1, 1, 0, 13 },        /* B */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 15 },       /* R */
              { 0, 1, 1, 0, 15 },       /* G */
              { 1, 1, 1, 0, 15 },       /* B */
 -            { 2, 1, 1, 0, 15 },       /* R */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 15 },       /* R */
              { 0, 1, 1, 0, 15 },       /* G */
              { 1, 1, 1, 0, 15 },       /* B */
 -            { 2, 1, 1, 0, 15 },       /* R */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB,
      },
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 0, 1, 0, 7 },        /* R */
              { 0, 0, 1, 0, 7 },        /* G */
              { 1, 0, 1, 0, 7 },        /* B */
 -            { 2, 0, 1, 0, 7 },        /* R */
              { 3, 0, 1, 0, 7 },        /* A */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 15 },       /* R */
              { 0, 1, 1, 0, 15 },       /* G */
              { 1, 1, 1, 0, 15 },       /* B */
 -            { 2, 1, 1, 0, 15 },       /* R */
              { 3, 1, 1, 0, 15 },       /* A */
          },
          .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
          .log2_chroma_w = 0,
          .log2_chroma_h = 0,
          .comp = {
 +            { 2, 1, 1, 0, 15 },       /* R */
              { 0, 1, 1, 0, 15 },       /* G */
              { 1, 1, 1, 0, 15 },       /* B */
 -            { 2, 1, 1, 0, 15 },       /* R */
              { 3, 1, 1, 0, 15 },       /* A */
          },
          .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
         },
          .flags = AV_PIX_FMT_FLAG_BE,
      },
 +
 +#define BAYER8_DESC_COMMON \
 +        .nb_components= 3, \
 +        .log2_chroma_w= 0, \
 +        .log2_chroma_h= 0, \
 +        .comp = {          \
 +            {0,0,0,0,1},   \
 +            {0,0,0,0,3},   \
 +            {0,0,0,0,1},   \
 +        },                 \
 +
 +#define BAYER16_DESC_COMMON \
 +        .nb_components= 3, \
 +        .log2_chroma_w= 0, \
 +        .log2_chroma_h= 0, \
 +        .comp = {          \
 +            {0,1,0,0, 3},  \
 +            {0,1,0,0, 7},  \
 +            {0,1,0,0, 3},  \
 +        },                 \
 +
 +    [AV_PIX_FMT_BAYER_BGGR8] = {
 +        .name = "bayer_bggr8",
 +        BAYER8_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_BGGR16LE] = {
 +        .name = "bayer_bggr16le",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_BGGR16BE] = {
 +        .name = "bayer_bggr16be",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_RGGB8] = {
 +        .name = "bayer_rggb8",
 +        BAYER8_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_RGGB16LE] = {
 +        .name = "bayer_rggb16le",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_RGGB16BE] = {
 +        .name = "bayer_rggb16be",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_GBRG8] = {
 +        .name = "bayer_gbrg8",
 +        BAYER8_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_GBRG16LE] = {
 +        .name = "bayer_gbrg16le",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_GBRG16BE] = {
 +        .name = "bayer_gbrg16be",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_GRBG8] = {
 +        .name = "bayer_grbg8",
 +        BAYER8_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_GRBG16LE] = {
 +        .name = "bayer_grbg16le",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_RGB,
 +    },
 +    [AV_PIX_FMT_BAYER_GRBG16BE] = {
 +        .name = "bayer_grbg16be",
 +        BAYER16_DESC_COMMON
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
 +    },
      [AV_PIX_FMT_NV16] = {
          .name = "nv16",
          .nb_components = 3,
          .name = "mmal",
          .flags = AV_PIX_FMT_FLAG_HWACCEL,
      },
 +    [AV_PIX_FMT_AYUV64LE] = {
 +        .name = "ayuv64le",
 +        .nb_components = 4,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 7, 3, 0, 15 },        /* Y */
 +            { 0, 7, 5, 0, 15 },        /* U */
 +            { 0, 7, 7, 0, 15 },        /* V */
 +            { 0, 7, 1, 0, 15 },        /* A */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_ALPHA,
 +    },
 +    [AV_PIX_FMT_AYUV64BE] = {
 +        .name = "ayuv64be",
 +        .nb_components = 4,
 +        .log2_chroma_w = 0,
 +        .log2_chroma_h = 0,
 +        .comp = {
 +            { 0, 7, 3, 0, 15 },        /* Y */
 +            { 0, 7, 5, 0, 15 },        /* U */
 +            { 0, 7, 7, 0, 15 },        /* V */
 +            { 0, 7, 1, 0, 15 },        /* A */
 +        },
 +        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_ALPHA,
 +    },
  };
  
  static const char *color_range_names[AVCOL_RANGE_NB] = {
@@@ -2091,26 -1661,6 +2088,26 @@@ int av_get_bits_per_pixel(const AVPixFm
      return bits >> log2_pixels;
  }
  
 +int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
 +{
 +    int c, bits = 0;
 +    int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
 +    int steps[4] = {0};
 +
 +    for (c = 0; c < pixdesc->nb_components; c++) {
 +        const AVComponentDescriptor *comp = &pixdesc->comp[c];
 +        int s = c == 1 || c == 2 ? 0 : log2_pixels;
 +        steps[comp->plane] = (comp->step_minus1 + 1) << s;
 +    }
 +    for (c = 0; c < 4; c++)
 +        bits += steps[c];
 +
 +    if(!(pixdesc->flags & AV_PIX_FMT_FLAG_BITSTREAM))
 +        bits *= 8;
 +
 +    return bits >> log2_pixels;
 +}
 +
  char *av_get_pix_fmt_string(char *buf, int buf_size,
                              enum AVPixelFormat pix_fmt)
  {
@@@ -2137,11 -1687,8 +2134,11 @@@ const AVPixFmtDescriptor *av_pix_fmt_de
  {
      if (!prev)
          return &av_pix_fmt_descriptors[0];
 -    if (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1)
 -        return prev + 1;
 +    while (prev - av_pix_fmt_descriptors < FF_ARRAY_ELEMS(av_pix_fmt_descriptors) - 1) {
 +        prev++;
 +        if (prev->name)
 +            return prev;
 +    }
      return NULL;
  }
  
@@@ -2153,6 -1700,7 +2150,6 @@@ enum AVPixelFormat av_pix_fmt_desc_get_
  
      return desc - av_pix_fmt_descriptors;
  }
 -FF_ENABLE_DEPRECATION_WARNINGS
  
  int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
                                       int *h_shift, int *v_shift)
@@@ -2181,259 -1729,56 +2178,259 @@@ int av_pix_fmt_count_planes(enum AVPixe
      return ret;
  }
  
 +void ff_check_pixfmt_descriptors(void){
 +    int i, j;
 +
 +    for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
 +        const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
 +        uint8_t fill[4][8+6+3] = {{0}};
 +        uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
 +        int linesize[4] = {0,0,0,0};
 +        uint16_t tmp[2];
 +
 +        if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
 +            continue;
 +//         av_log(NULL, AV_LOG_DEBUG, "Checking: %s\n", d->name);
 +        av_assert0(d->log2_chroma_w <= 3);
 +        av_assert0(d->log2_chroma_h <= 3);
 +        av_assert0(d->nb_components <= 4);
 +        av_assert0(d->name && d->name[0]);
 +        av_assert0((d->nb_components==4 || d->nb_components==2) == !!(d->flags & AV_PIX_FMT_FLAG_ALPHA));
 +        av_assert2(av_get_pix_fmt(d->name) == i);
 +
 +        for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
 +            const AVComponentDescriptor *c = &d->comp[j];
 +            if(j>=d->nb_components) {
 +                av_assert0(!c->plane && !c->step_minus1 && !c->offset_plus1 && !c->shift && !c->depth_minus1);
 +                continue;
 +            }
 +            if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {
 +                av_assert0(c->step_minus1 >= c->depth_minus1);
 +            } else {
 +                av_assert0(8*(c->step_minus1+1) >= c->depth_minus1+1);
 +            }
 +            if (!strncmp(d->name, "bayer_", 6))
 +                continue;
 +            av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
 +            av_assert0(tmp[0] == 0 && tmp[1] == 0);
 +            tmp[0] = tmp[1] = (1<<(c->depth_minus1 + 1)) - 1;
 +            av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
 +        }
 +    }
 +}
 +FF_ENABLE_DEPRECATION_WARNINGS
 +
  
  enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
  {
 -#define PIX_FMT_SWAP_ENDIANNESS(fmt)                                           \
 -    case AV_PIX_FMT_ ## fmt ## BE: return AV_PIX_FMT_ ## fmt ## LE;            \
 -    case AV_PIX_FMT_ ## fmt ## LE: return AV_PIX_FMT_ ## fmt ## BE
 -
 -    switch (pix_fmt) {
 -    PIX_FMT_SWAP_ENDIANNESS(GRAY16);
 -    PIX_FMT_SWAP_ENDIANNESS(YA16);
 -    PIX_FMT_SWAP_ENDIANNESS(RGB48);
 -    PIX_FMT_SWAP_ENDIANNESS(RGB565);
 -    PIX_FMT_SWAP_ENDIANNESS(RGB555);
 -    PIX_FMT_SWAP_ENDIANNESS(RGB444);
 -    PIX_FMT_SWAP_ENDIANNESS(BGR48);
 -    PIX_FMT_SWAP_ENDIANNESS(BGR565);
 -    PIX_FMT_SWAP_ENDIANNESS(BGR555);
 -    PIX_FMT_SWAP_ENDIANNESS(BGR444);
 -
 -    PIX_FMT_SWAP_ENDIANNESS(YUV420P9);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV422P9);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV444P9);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
 -    PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
 -
 -    PIX_FMT_SWAP_ENDIANNESS(GBRP9);
 -    PIX_FMT_SWAP_ENDIANNESS(GBRP10);
 -    PIX_FMT_SWAP_ENDIANNESS(GBRP16);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA420P9);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA422P9);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA444P9);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA420P10);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA422P10);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA444P10);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA420P16);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA422P16);
 -    PIX_FMT_SWAP_ENDIANNESS(YUVA444P16);
 -
 -    PIX_FMT_SWAP_ENDIANNESS(XYZ12);
 -    PIX_FMT_SWAP_ENDIANNESS(NV20);
 -    PIX_FMT_SWAP_ENDIANNESS(RGBA64);
 -    PIX_FMT_SWAP_ENDIANNESS(BGRA64);
 -    default:
 +    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
 +    char name[16];
 +    int i;
 +
 +    if (!desc || strlen(desc->name) < 2)
          return AV_PIX_FMT_NONE;
 +    av_strlcpy(name, desc->name, sizeof(name));
 +    i = strlen(name) - 2;
 +    if (strcmp(name + i, "be") && strcmp(name + i, "le"))
 +        return AV_PIX_FMT_NONE;
 +
 +    name[i] ^= 'b' ^ 'l';
 +
 +    return get_pix_fmt_internal(name);
 +}
 +
 +#define FF_COLOR_NA      -1
 +#define FF_COLOR_RGB      0 /**< RGB color space */
 +#define FF_COLOR_GRAY     1 /**< gray color space */
 +#define FF_COLOR_YUV      2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
 +#define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
 +
 +#define pixdesc_has_alpha(pixdesc) \
 +    ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
 +
 +
 +static int get_color_type(const AVPixFmtDescriptor *desc) {
 +    if (desc->flags & AV_PIX_FMT_FLAG_PAL)
 +        return FF_COLOR_RGB;
 +
 +    if(desc->nb_components == 1 || desc->nb_components == 2)
 +        return FF_COLOR_GRAY;
 +
 +    if(desc->name && !strncmp(desc->name, "yuvj", 4))
 +        return FF_COLOR_YUV_JPEG;
 +
 +    if(desc->flags & AV_PIX_FMT_FLAG_RGB)
 +        return  FF_COLOR_RGB;
 +
 +    if(desc->nb_components == 0)
 +        return FF_COLOR_NA;
 +
 +    return FF_COLOR_YUV;
 +}
 +
 +static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt)
 +{
 +    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
 +    int i;
 +
 +    if (!desc || !desc->nb_components) {
 +        *min = *max = 0;
 +        return AVERROR(EINVAL);
 +    }
 +
 +    *min = INT_MAX, *max = -INT_MAX;
 +    for (i = 0; i < desc->nb_components; i++) {
 +        *min = FFMIN(desc->comp[i].depth_minus1+1, *min);
 +        *max = FFMAX(desc->comp[i].depth_minus1+1, *max);
 +    }
 +    return 0;
 +}
 +
 +static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
 +                              enum AVPixelFormat src_pix_fmt,
 +                              unsigned *lossp, unsigned consider)
 +{
 +    const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
 +    const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
 +    int src_color, dst_color;
 +    int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
 +    int ret, loss, i, nb_components;
 +    int score = INT_MAX - 1;
 +
 +    if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE)
 +        return ~0;
 +
 +    /* compute loss */
 +    *lossp = loss = 0;
 +
 +    if (dst_pix_fmt == src_pix_fmt)
 +        return INT_MAX;
 +
 +    if ((ret = get_pix_fmt_depth(&src_min_depth, &src_max_depth, src_pix_fmt)) < 0)
 +        return ret;
 +    if ((ret = get_pix_fmt_depth(&dst_min_depth, &dst_max_depth, dst_pix_fmt)) < 0)
 +        return ret;
 +
 +    src_color = get_color_type(src_desc);
 +    dst_color = get_color_type(dst_desc);
 +    if (dst_pix_fmt == AV_PIX_FMT_PAL8)
 +        nb_components = FFMIN(src_desc->nb_components, 4);
 +    else
 +        nb_components = FFMIN(src_desc->nb_components, dst_desc->nb_components);
 +
 +    for (i = 0; i < nb_components; i++) {
 +        int depth_minus1 = (dst_pix_fmt == AV_PIX_FMT_PAL8) ? 7/nb_components : dst_desc->comp[i].depth_minus1;
 +        if (src_desc->comp[i].depth_minus1 > depth_minus1 && (consider & FF_LOSS_DEPTH)) {
 +            loss |= FF_LOSS_DEPTH;
 +            score -= 65536 >> depth_minus1;
 +        }
 +    }
 +
 +    if (consider & FF_LOSS_RESOLUTION) {
 +        if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w) {
 +            loss |= FF_LOSS_RESOLUTION;
 +            score -= 256 << dst_desc->log2_chroma_w;
 +        }
 +        if (dst_desc->log2_chroma_h > src_desc->log2_chroma_h) {
 +            loss |= FF_LOSS_RESOLUTION;
 +            score -= 256 << dst_desc->log2_chroma_h;
 +        }
 +        // don't favor 422 over 420 if downsampling is needed, because 420 has much better support on the decoder side
 +        if (dst_desc->log2_chroma_w == 1 && src_desc->log2_chroma_w == 0 &&
 +            dst_desc->log2_chroma_h == 1 && src_desc->log2_chroma_h == 0 ) {
 +            score += 512;
 +        }
 +    }
 +
 +    if(consider & FF_LOSS_COLORSPACE)
 +    switch(dst_color) {
 +    case FF_COLOR_RGB:
 +        if (src_color != FF_COLOR_RGB &&
 +            src_color != FF_COLOR_GRAY)
 +            loss |= FF_LOSS_COLORSPACE;
 +        break;
 +    case FF_COLOR_GRAY:
 +        if (src_color != FF_COLOR_GRAY)
 +            loss |= FF_LOSS_COLORSPACE;
 +        break;
 +    case FF_COLOR_YUV:
 +        if (src_color != FF_COLOR_YUV)
 +            loss |= FF_LOSS_COLORSPACE;
 +        break;
 +    case FF_COLOR_YUV_JPEG:
 +        if (src_color != FF_COLOR_YUV_JPEG &&
 +            src_color != FF_COLOR_YUV &&
 +            src_color != FF_COLOR_GRAY)
 +            loss |= FF_LOSS_COLORSPACE;
 +        break;
 +    default:
 +        /* fail safe test */
 +        if (src_color != dst_color)
 +            loss |= FF_LOSS_COLORSPACE;
 +        break;
 +    }
 +    if(loss & FF_LOSS_COLORSPACE)
 +        score -= (nb_components * 65536) >> FFMIN(dst_desc->comp[0].depth_minus1, src_desc->comp[0].depth_minus1);
 +
 +    if (dst_color == FF_COLOR_GRAY &&
 +        src_color != FF_COLOR_GRAY && (consider & FF_LOSS_CHROMA)) {
 +        loss |= FF_LOSS_CHROMA;
 +        score -= 2 * 65536;
      }
 -#undef PIX_FMT_SWAP_ENDIANNESS
 +    if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))) {
 +        loss |= FF_LOSS_ALPHA;
 +        score -= 65536;
 +    }
 +    if (dst_pix_fmt == AV_PIX_FMT_PAL8 && (consider & FF_LOSS_COLORQUANT) &&
 +        (src_pix_fmt != AV_PIX_FMT_PAL8 && (src_color != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && (consider & FF_LOSS_ALPHA))))) {
 +        loss |= FF_LOSS_COLORQUANT;
 +        score -= 65536;
 +    }
 +
 +    *lossp = loss;
 +    return score;
 +}
 +
 +int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
 +                            enum AVPixelFormat src_pix_fmt,
 +                            int has_alpha)
 +{
 +    int loss;
 +    int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
 +    if (ret < 0)
 +        return ret;
 +    return loss;
 +}
 +
 +enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
 +                                             enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
 +{
 +    enum AVPixelFormat dst_pix_fmt;
 +    int loss1, loss2, loss_mask;
 +    const AVPixFmtDescriptor *desc1 = av_pix_fmt_desc_get(dst_pix_fmt1);
 +    const AVPixFmtDescriptor *desc2 = av_pix_fmt_desc_get(dst_pix_fmt2);
 +    int score1, score2;
 +
 +    loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */
 +    if(!has_alpha)
 +        loss_mask &= ~FF_LOSS_ALPHA;
 +
 +    score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
 +    score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
 +
 +    if (score1 == score2) {
 +        if(av_get_padded_bits_per_pixel(desc2) != av_get_padded_bits_per_pixel(desc1)) {
 +            dst_pix_fmt = av_get_padded_bits_per_pixel(desc2) < av_get_padded_bits_per_pixel(desc1) ? dst_pix_fmt2 : dst_pix_fmt1;
 +        } else {
 +            dst_pix_fmt = desc2->nb_components < desc1->nb_components ? dst_pix_fmt2 : dst_pix_fmt1;
 +        }
 +    } else {
 +        dst_pix_fmt = score1 < score2 ? dst_pix_fmt2 : dst_pix_fmt1;
 +    }
 +
 +    if (loss_ptr)
 +        *loss_ptr = av_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
 +    return dst_pix_fmt;
  }
  
  const char *av_color_range_name(enum AVColorRange range)
@@@ -2466,31 -1811,3 +2463,31 @@@ const char *av_chroma_location_name(enu
          chroma_location_names[location] : NULL;
  }
  
 +#ifdef TEST
 +
 +int main(void){
 +    int i;
 +    int err=0;
 +    int skip = 0;
 +
 +    for (i=0; i<AV_PIX_FMT_NB*2; i++) {
 +        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(i);
 +        if(!desc || !desc->name) {
 +            skip ++;
 +            continue;
 +        }
 +        if (skip) {
 +            av_log(NULL, AV_LOG_INFO, "%3d unused pixel format values\n", skip);
 +            skip = 0;
 +        }
 +        av_log(NULL, AV_LOG_INFO, "pix fmt %s avg_bpp:%d colortype:%d\n", desc->name, av_get_padded_bits_per_pixel(desc), get_color_type(desc));
 +        if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
 +            av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
 +            err = 1;
 +        }
 +    }
 +    return err;
 +}
 +
 +#endif
 +
diff --combined libavutil/pixdesc.h
index dee4017f906e2ff8dc963536dc4d468de190d02f,351391389c636427ca73f3e202a946263a6e8cba..b0b82852a70bd31bd67a608b54f4ddd3e50b45d8
@@@ -2,20 -2,20 +2,20 @@@
   * pixel format descriptor
   * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
   *
 - * This file is part of Libav.
 + * This file is part of FFmpeg.
   *
 - * Libav is free software; you can redistribute it and/or
 + * FFmpeg is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
 - * Libav is distributed in the hope that it will be useful,
 + * FFmpeg is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
 - * License along with Libav; if not, write to the Free Software
 + * License along with FFmpeg; if not, write to the Free Software
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
@@@ -90,12 -90,9 +90,12 @@@ typedef struct AVPixFmtDescriptor 
      uint8_t flags;
  
      /**
 -     * Parameters that describe how pixels are packed. If the format
 -     * has chroma components, they must be stored in comp[1] and
 -     * comp[2].
 +     * Parameters that describe how pixels are packed.
 +     * If the format has 2 or 4 components, then alpha is last.
 +     * If the format has 1 or 2 components, then luma is 0.
 +     * If the format has 3 or 4 components:
 +     *   if the RGB flag is set then 0 is red, 1 is green and 2 is blue;
 +     *   otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
       */
      AVComponentDescriptor comp[4];
  
   * The pixel format contains RGB-like data (as opposed to YUV/grayscale).
   */
  #define AV_PIX_FMT_FLAG_RGB          (1 << 5)
 +
  /**
 - * The pixel format is "pseudo-paletted". This means that Libav treats it as
 - * paletted internally, but the palette is generated by the decoder and is not
 - * stored in the file.
 + * The pixel format is "pseudo-paletted". This means that it contains a
 + * fixed palette in the 2nd plane but the palette is fixed/constant for each
 + * PIX_FMT. This allows interpreting the data as if it was PAL8, which can
 + * in some cases be simpler. Or the data can be interpreted purely based on
 + * the pixel format without using the palette.
 + * An example of a pseudo-paletted format is AV_PIX_FMT_GRAY8
   */
  #define AV_PIX_FMT_FLAG_PSEUDOPAL    (1 << 6)
 +
  /**
 - * The pixel format has an alpha channel.
 + * The pixel format has an alpha channel. This is set on all formats that
 + * support alpha in some way. The exception is AV_PIX_FMT_PAL8, which can
 + * carry alpha as part of the palette. Details are explained in the
 + * AVPixelFormat enum, and are also encoded in the corresponding
 + * AVPixFmtDescriptor.
 + *
 + * The alpha is always straight, never pre-multiplied.
 + *
 + * If a codec or a filter does not support alpha, it should set all alpha to
 + * opaque, or use the equivalent pixel formats without alpha component, e.g.
 + * AV_PIX_FMT_RGB0 (or AV_PIX_FMT_RGB24 etc.) instead of AV_PIX_FMT_RGBA.
   */
  #define AV_PIX_FMT_FLAG_ALPHA        (1 << 7)
  
- #if FF_API_PIX_FMT_DESC
- /**
-  * The array of all the pixel format descriptors.
-  */
- extern attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[];
- #endif
  /**
   * Read a line from an image, and write the values of the
   * pixel format component c to dst.
@@@ -209,7 -184,7 +202,7 @@@ void av_write_image_line(const uint16_
   * For example in a little-endian system, first looks for "gray16",
   * then for "gray16le".
   *
 - * Finally if no pixel format has been found, returns PIX_FMT_NONE.
 + * Finally if no pixel format has been found, returns AV_PIX_FMT_NONE.
   */
  enum AVPixelFormat av_get_pix_fmt(const char *name);
  
@@@ -223,7 -198,7 +216,7 @@@ const char *av_get_pix_fmt_name(enum AV
  
  /**
   * Print in buf the string corresponding to the pixel format with
 - * number pix_fmt, or an header if pix_fmt is negative.
 + * number pix_fmt, or a header if pix_fmt is negative.
   *
   * @param buf the buffer where to write the string
   * @param buf_size the size of buf
@@@ -245,12 -220,6 +238,12 @@@ char *av_get_pix_fmt_string(char *buf, 
   */
  int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
  
 +/**
 + * Return the number of bits per pixel for the pixel format
 + * described by pixdesc, including any padding or unused bits.
 + */
 +int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
 +
  /**
   * @return a pixel format descriptor for provided pixel format or NULL if
   * this pixel format is unknown.
@@@ -276,14 -245,9 +269,14 @@@ enum AVPixelFormat av_pix_fmt_desc_get_
   * Utility function to access log2_chroma_w log2_chroma_h from
   * the pixel format AVPixFmtDescriptor.
   *
 + * See av_get_chroma_sub_sample() for a function that asserts a
 + * valid pixel format instead of returning an error code.
 + * Its recommended that you use avcodec_get_chroma_sub_sample unless
 + * you do check the return code!
 + *
   * @param[in]  pix_fmt the pixel format
 - * @param[out] h_shift store log2_chroma_h
 - * @param[out] v_shift store log2_chroma_w
 + * @param[out] h_shift store log2_chroma_w
 + * @param[out] v_shift store log2_chroma_h
   *
   * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
   */
@@@ -306,56 -270,6 +299,56 @@@ int av_pix_fmt_count_planes(enum AVPixe
   */
  enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
  
 +#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
 +#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
 +#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
 +#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
 +#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
 +#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
 +
 +/**
 + * Compute what kind of losses will occur when converting from one specific
 + * pixel format to another.
 + * When converting from one pixel format to another, information loss may occur.
 + * For example, when converting from RGB24 to GRAY, the color information will
 + * be lost. Similarly, other losses occur when converting from some formats to
 + * other formats. These losses can involve loss of chroma, but also loss of
 + * resolution, loss of color depth, loss due to the color space conversion, loss
 + * of the alpha bits or loss due to color quantization.
 + * av_get_fix_fmt_loss() informs you about the various types of losses
 + * which will occur when converting from one pixel format to another.
 + *
 + * @param[in] dst_pix_fmt destination pixel format
 + * @param[in] src_pix_fmt source pixel format
 + * @param[in] has_alpha Whether the source pixel format alpha channel is used.
 + * @return Combination of flags informing you what kind of losses will occur
 + * (maximum loss for an invalid dst_pix_fmt).
 + */
 +int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
 +                        enum AVPixelFormat src_pix_fmt,
 +                        int has_alpha);
 +
 +/**
 + * Compute what kind of losses will occur when converting from one specific
 + * pixel format to another.
 + * When converting from one pixel format to another, information loss may occur.
 + * For example, when converting from RGB24 to GRAY, the color information will
 + * be lost. Similarly, other losses occur when converting from some formats to
 + * other formats. These losses can involve loss of chroma, but also loss of
 + * resolution, loss of color depth, loss due to the color space conversion, loss
 + * of the alpha bits or loss due to color quantization.
 + * av_get_fix_fmt_loss() informs you about the various types of losses
 + * which will occur when converting from one pixel format to another.
 + *
 + * @param[in] dst_pix_fmt destination pixel format
 + * @param[in] src_pix_fmt source pixel format
 + * @param[in] has_alpha Whether the source pixel format alpha channel is used.
 + * @return Combination of flags informing you what kind of losses will occur
 + * (maximum loss for an invalid dst_pix_fmt).
 + */
 +enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
 +                                             enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
 +
  /**
   * @return the name for provided color range or NULL if unknown.
   */
diff --combined libavutil/version.h
index 85126dba036828a2959172467186b83fe6e23cb8,26fba376cb7880454df111623c91830d27dbcfbc..1ff92d9763f0b88286843b7a1728e45b9775d382
@@@ -1,20 -1,18 +1,20 @@@
  /*
 - * This file is part of Libav.
 + * copyright (c) 2003 Fabrice Bellard
   *
 - * Libav is free software; you can redistribute it and/or
 + * This file is part of FFmpeg.
 + *
 + * FFmpeg is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
 - * Libav is distributed in the hope that it will be useful,
 + * FFmpeg is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
 - * License along with Libav; if not, write to the Free Software
 + * License along with FFmpeg; if not, write to the Free Software
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
@@@ -24,7 -22,7 +24,7 @@@
  #include "macros.h"
  
  /**
 - * @defgroup version_utils Library Version Macros
 + * @addtogroup version_utils
   *
   * Useful to check and match library version in order to maintain
   * backward compatibility.
@@@ -32,7 -30,7 +32,7 @@@
   * @{
   */
  
 -#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
 +#define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c))
  #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
  #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
  
@@@ -55,9 -53,9 +55,9 @@@
   * @{
   */
  
 -#define LIBAVUTIL_VERSION_MAJOR 54
 -#define LIBAVUTIL_VERSION_MINOR 17
 -#define LIBAVUTIL_VERSION_MICRO  0
 +#define LIBAVUTIL_VERSION_MAJOR  54
 +#define LIBAVUTIL_VERSION_MINOR  31
 +#define LIBAVUTIL_VERSION_MICRO 100
  
  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                 LIBAVUTIL_VERSION_MINOR, \
   * dropped at a future version bump. The defines themselves are not part of
   * the public API and may change, break or disappear at any time.
   *
 + * @note, when bumping the major version it is recommended to manually
 + * disable each FF_API_* in its own commit instead of disabling them all
 + * at once through the bump. This improves the git bisect-ability of the change.
 + *
   * @{
   */
  
 +#ifndef FF_API_OLD_AVOPTIONS
 +#define FF_API_OLD_AVOPTIONS            (LIBAVUTIL_VERSION_MAJOR < 55)
 +#endif
  #ifndef FF_API_CONTEXT_SIZE
  #define FF_API_CONTEXT_SIZE             (LIBAVUTIL_VERSION_MAJOR < 55)
  #endif
- #ifndef FF_API_PIX_FMT_DESC
- #define FF_API_PIX_FMT_DESC             (LIBAVUTIL_VERSION_MAJOR < 55)
- #endif
  #ifndef FF_API_AV_REVERSE
  #define FF_API_AV_REVERSE               (LIBAVUTIL_VERSION_MAJOR < 55)
  #endif
  #ifndef FF_API_VDPAU
  #define FF_API_VDPAU                    (LIBAVUTIL_VERSION_MAJOR < 55)
  #endif
 +#ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
 +#define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 55)
 +#endif
  #ifndef FF_API_XVMC
  #define FF_API_XVMC                     (LIBAVUTIL_VERSION_MAJOR < 55)
  #endif
  #ifndef FF_API_DLOG
  #define FF_API_DLOG                     (LIBAVUTIL_VERSION_MAJOR < 55)
  #endif
 +#ifndef FF_API_HMAC
 +#define FF_API_HMAC                     (LIBAVUTIL_VERSION_MAJOR < 55)
 +#endif
  #ifndef FF_API_CRYPTO_CONTEXT
  #define FF_API_CRYPTO_CONTEXT           (LIBAVUTIL_VERSION_MAJOR < 56)
  #endif
 +#ifndef FF_API_VAAPI
 +#define FF_API_VAAPI                    (LIBAVUTIL_VERSION_MAJOR < 56)
 +#endif
  
 +#ifndef FF_CONST_AVUTIL55
 +#if LIBAVUTIL_VERSION_MAJOR >= 55
 +#define FF_CONST_AVUTIL55 const
 +#else
 +#define FF_CONST_AVUTIL55
 +#endif
 +#endif
  
  /**
   * @}
   */
  
  #endif /* AVUTIL_VERSION_H */
 +