]> git.sesse.net Git - ffmpeg/commitdiff
avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8
authorVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 29 Jul 2014 13:02:09 +0000 (14:02 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 4 Aug 2014 11:55:08 +0000 (12:55 +0100)
The rationale is that you have a packed format in form
<greyscale sample> <alpha sample> <greyscale sample> <alpha sample>
and shortening greyscale to 'G' might make one thing about Greenscale instead.
An alias pixel format and color space name are provided for compatibility.

15 files changed:
doc/APIchanges
libavcodec/brenderpix.c
libavcodec/libopenjpegdec.c
libavcodec/libopenjpegenc.c
libavcodec/pngdec.c
libavcodec/raw.c
libavutil/pixdesc.c
libavutil/pixfmt.h
libavutil/version.h
libswscale/input.c
libswscale/swscale-test.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
libswscale/x86/swscale.c

index 5b865462d7fc18c65d28cee6f0309ba29528e265..38e53bc15cbc61e1cad7737485d81511d93cb654 100644 (file)
@@ -13,6 +13,10 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-08-xx - xxxxxxx - lavu 53.21.1 - avstring.h
+  Rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8 to better identify the format.
+  An alias pixel format and color space name are provided for compatibility.
+
 2014-08-xx - xxxxxxx - lavu 53.21.0 - pixdesc.h
   Support name aliases for pixel formats.
 
index 0c08f8d46c6a31a924f75ccc68006030127703ed..25aebed7d7b6b87bfbc3f853f52c6fb1df7edd1e 100644 (file)
@@ -193,7 +193,7 @@ static int pix_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         bytes_pp = 4;
         break;
     case 18:
-        avctx->pix_fmt = AV_PIX_FMT_Y400A;
+        avctx->pix_fmt = AV_PIX_FMT_YA8;
         bytes_pp = 2;
         break;
     default:
index f279b33374b7f21c2ded0c62713e1a42a80874fd..c7697a5e879805b86dc35d07a7836dbf17dd7517 100644 (file)
@@ -45,7 +45,7 @@
 #define RGB_PIXEL_FORMATS  AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,                 \
                            AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64
 
-#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_Y400A,                \
+#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_YA8,                  \
                            AV_PIX_FMT_GRAY16
 
 #define YUV_PIXEL_FORMATS  AV_PIX_FMT_YUV410P,   AV_PIX_FMT_YUV411P,          \
index e98d5502bbb5edad9a20a38ee6b19539e1729ab3..2c2109f07601cdd0da8fd9285ee783135a484be1 100644 (file)
@@ -90,7 +90,7 @@ static opj_image_t *libopenjpeg_create_image(AVCodecContext *avctx,
     switch (avctx->pix_fmt) {
     case AV_PIX_FMT_GRAY8:
     case AV_PIX_FMT_GRAY16:
-    case AV_PIX_FMT_Y400A:
+    case AV_PIX_FMT_YA8:
         color_space = CLRSPC_GRAY;
         break;
     case AV_PIX_FMT_RGB24:
@@ -302,7 +302,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     switch (avctx->pix_fmt) {
     case AV_PIX_FMT_RGB24:
     case AV_PIX_FMT_RGBA:
-    case AV_PIX_FMT_Y400A:
+    case AV_PIX_FMT_YA8:
         libopenjpeg_copy_packed8(avctx, frame, image);
         break;
     case AV_PIX_FMT_RGB48:
@@ -424,7 +424,7 @@ AVCodec ff_libopenjpeg_encoder = {
     .pix_fmts       = (const enum AVPixelFormat[]) {
         AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48,
         AV_PIX_FMT_RGBA64,
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_Y400A,
+        AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_YA8,
         AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P,
         AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
         AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
index bbe42230db93a822fe0c3acf51e6c9be0fab52e2..7bc2ad484798698b21f0a28f40034a8cd1952f1e 100644 (file)
@@ -499,7 +499,7 @@ static int decode_frame(AVCodecContext *avctx,
                     avctx->pix_fmt = AV_PIX_FMT_PAL8;
                 } else if (s->bit_depth == 8 &&
                            s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
-                    avctx->pix_fmt = AV_PIX_FMT_Y400A;
+                    avctx->pix_fmt = AV_PIX_FMT_YA8;
                 } else {
                     goto fail;
                 }
index 547ac442f1b5755ff36c50f4e82a7fb537459d83..541ef7aa3afa7b1e422cf15d827859b59833c1a0 100644 (file)
@@ -127,7 +127,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { AV_PIX_FMT_YUV444P16LE, MKTAG('Y', '3',  0 , 16 ) },
     { AV_PIX_FMT_YUV444P16BE, MKTAG(16 ,  0 , '3', 'Y') },
     { AV_PIX_FMT_YUVA420P,    MKTAG('Y', '4', 11 ,  8 ) },
-    { AV_PIX_FMT_Y400A,       MKTAG('Y', '2',  0 ,  8 ) },
+    { AV_PIX_FMT_YA8,         MKTAG('Y', '2',  0 ,  8 ) },
 
     { AV_PIX_FMT_YUVA420P9LE,  MKTAG('Y', '4', 11 ,  9 ) },
     { AV_PIX_FMT_YUVA420P9BE,  MKTAG( 9 , 11 , '4', 'Y') },
index 8fb715132121004926eaec8fccc39cf4464b1057..526e0010d4e3436ea0479ab3099aae4e8dbf50a1 100644 (file)
@@ -1339,14 +1339,15 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         .log2_chroma_h = 1,
         .flags = AV_PIX_FMT_FLAG_HWACCEL,
     },
-    [AV_PIX_FMT_Y400A] = {
-        .name = "y400a",
+    [AV_PIX_FMT_YA8] = {
+        .name = "ya8",
         .nb_components = 2,
         .comp = {
             { 0, 1, 1, 0, 7 },        /* Y */
             { 0, 1, 2, 0, 7 },        /* A */
         },
         .flags = AV_PIX_FMT_FLAG_ALPHA,
+        .alias = "gray8a",
     },
     [AV_PIX_FMT_GBRP] = {
         .name = "gbrp",
index 29207d2a2d3decbce31be95837ea0da1034b440c..835550ad18981195b48d2ea1cd41c73e42ed5283 100644 (file)
@@ -141,7 +141,10 @@ enum AVPixelFormat {
     AV_PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
     AV_PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
     AV_PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-    AV_PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
+    AV_PIX_FMT_YA8,       ///< 8bit gray, 8bit alpha
+
+    AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8
+
     AV_PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
     AV_PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
     AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
index 6f2873c6121cf03f41cb14669c29a1bd725b5b90..15ab8903bcefcbff785209ecacb78b032df422d8 100644 (file)
@@ -55,7 +55,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR 53
 #define LIBAVUTIL_VERSION_MINOR 21
-#define LIBAVUTIL_VERSION_MICRO  0
+#define LIBAVUTIL_VERSION_MICRO  1
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \
index c1cfd7cf7d2b9481a0a8a4eea4514d7fa9081e9c..1ffdfe534b2c6c50322be9cc2e301587c8192a67 100644 (file)
@@ -989,7 +989,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 #endif
     case AV_PIX_FMT_YUYV422:
     case AV_PIX_FMT_YVYU422:
-    case AV_PIX_FMT_Y400A:
+    case AV_PIX_FMT_YA8:
         c->lumToYV12 = yuy2ToY_c;
         break;
     case AV_PIX_FMT_UYVY422:
@@ -1085,7 +1085,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
         case AV_PIX_FMT_ARGB:
             c->alpToYV12 = abgrToA_c;
             break;
-        case AV_PIX_FMT_Y400A:
+        case AV_PIX_FMT_YA8:
             c->alpToYV12 = uyvyToY_c;
             break;
         }
index 12fa9edd50266bc65dc2934f81b58ea6f7296ced..7cf2dc06af6f9a345b4d1a663d3a074870c99e1f 100644 (file)
@@ -37,7 +37,7 @@
  * Should be removed when a cleaner pixel format system exists. */
 #define isGray(x)                      \
     ((x) == AV_PIX_FMT_GRAY8       ||     \
-     (x) == AV_PIX_FMT_Y400A       ||     \
+     (x) == AV_PIX_FMT_YA8         ||     \
      (x) == AV_PIX_FMT_GRAY16BE    ||     \
      (x) == AV_PIX_FMT_GRAY16LE)
 #define hasChroma(x)                   \
index 7ecf222e7f64eab777f1aab01da3260050804ae1..4aef9617dd30a96bad44d55248711bfec960682e 100644 (file)
@@ -606,7 +606,7 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
 #else
 #define isGray(x)                      \
     ((x) == AV_PIX_FMT_GRAY8       ||  \
-     (x) == AV_PIX_FMT_Y400A       ||  \
+     (x) == AV_PIX_FMT_YA8         ||  \
      (x) == AV_PIX_FMT_GRAY16BE    ||  \
      (x) == AV_PIX_FMT_GRAY16LE)
 #endif
@@ -697,7 +697,7 @@ static av_always_inline int usePal(enum AVPixelFormat pix_fmt)
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
     av_assert0(desc);
     return ((desc->flags & AV_PIX_FMT_FLAG_PAL) || (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) ||
-            pix_fmt == AV_PIX_FMT_Y400A);
+            pix_fmt == AV_PIX_FMT_YA8);
 }
 
 extern const uint64_t ff_dither4[2];
index a1ccc5ab76e746261771789e58f0cc9846fe78f2..21762a72ae34c84c2a117557dc46fabde6bb7654 100644 (file)
@@ -351,7 +351,7 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
     uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY;
     const uint8_t *srcPtr = src[0];
 
-    if (srcFormat == AV_PIX_FMT_Y400A) {
+    if (srcFormat == AV_PIX_FMT_YA8) {
         switch (dstFormat) {
         case AV_PIX_FMT_RGB32  : conv = gray8aToPacked32; break;
         case AV_PIX_FMT_BGR32  : conv = gray8aToPacked32; break;
@@ -1204,7 +1204,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
                 g = ((i >> 1) & 3) * 85;
                 b = ( i       & 1) * 255;
             } else if (c->srcFormat == AV_PIX_FMT_GRAY8 ||
-                      c->srcFormat == AV_PIX_FMT_Y400A) {
+                       c->srcFormat == AV_PIX_FMT_YA8) {
                 r = g = b = i;
             } else {
                 assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE);
index fa00668c8e043c3733c5ab603546b99b8a3b4d4c..ae121f85298863e6bd0dae02b65d947bf46f3d6b 100644 (file)
@@ -154,7 +154,7 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
     [AV_PIX_FMT_RGB444BE]    = { 1, 1 },
     [AV_PIX_FMT_BGR444LE]    = { 1, 1 },
     [AV_PIX_FMT_BGR444BE]    = { 1, 1 },
-    [AV_PIX_FMT_Y400A]       = { 1, 0 },
+    [AV_PIX_FMT_YA8]         = { 1, 0 },
     [AV_PIX_FMT_BGR48BE]     = { 1, 1 },
     [AV_PIX_FMT_BGR48LE]     = { 1, 1 },
     [AV_PIX_FMT_BGRA64BE]    = { 0, 0, 1 },
index a2bce48339e551ce1f046bea18e099781884cacc..f310a7593f6ed6bc1b8903ed7c60e8608d8e6f76 100644 (file)
@@ -363,7 +363,7 @@ switch(c->dstBpc){ \
         ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmxext, cpu_flags & AV_CPU_FLAG_MMXEXT);
 
         switch (c->srcFormat) {
-        case AV_PIX_FMT_Y400A:
+        case AV_PIX_FMT_YA8:
             c->lumToYV12 = ff_yuyvToY_mmx;
             if (c->alpPixBuf)
                 c->alpToYV12 = ff_uyvyToY_mmx;
@@ -412,7 +412,7 @@ switch(c->dstBpc){ \
         ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2, sse2, 1);
 
         switch (c->srcFormat) {
-        case AV_PIX_FMT_Y400A:
+        case AV_PIX_FMT_YA8:
             c->lumToYV12 = ff_yuyvToY_sse2;
             if (c->alpPixBuf)
                 c->alpToYV12 = ff_uyvyToY_sse2;