From e91946ed23dfbb9a6341266020ed8475ec15697d Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Wed, 27 Apr 2011 21:36:30 +0200 Subject: [PATCH] Rename y400a to gray8a. Signed-off-by: Michael Niedermayer --- libavcodec/pngdec.c | 2 +- libavcodec/raw.c | 2 +- libavutil/pixdesc.c | 4 ++-- libavutil/pixfmt.h | 4 +++- libswscale/swscale.c | 6 +++--- libswscale/swscale_internal.h | 6 +++--- libswscale/swscale_template.c | 6 +++--- libswscale/utils.c | 2 +- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 17fea6815b..3b31109671 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -473,7 +473,7 @@ static int decode_frame(AVCodecContext *avctx, } else if (s->color_type == PNG_COLOR_TYPE_PALETTE) { avctx->pix_fmt = PIX_FMT_PAL8; } else if (s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - avctx->pix_fmt = PIX_FMT_Y400A; + avctx->pix_fmt = PIX_FMT_GRAY8A; } else { goto fail; } diff --git a/libavcodec/raw.c b/libavcodec/raw.c index e607148a2b..0a865f470a 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -114,7 +114,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = { { PIX_FMT_YUV444P16LE, MKTAG('Y', '3', 0 , 16 ) }, { PIX_FMT_YUV444P16BE, MKTAG(16 , 0 , '3', 'Y') }, { PIX_FMT_YUVA420P, MKTAG('Y', '4', 11 , 8 ) }, - { PIX_FMT_Y400A, MKTAG('Y', '2', 0 , 8 ) }, + { PIX_FMT_GRAY8A, MKTAG('Y', '2', 0 , 8 ) }, /* quicktime */ { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') }, diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index ad2f5643a5..dae6dc264b 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -861,8 +861,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_Y400A] = { - .name = "y400a", + [PIX_FMT_GRAY8A] = { + .name = "gray8a", .nb_components= 2, .comp = { {0,1,1,0,7}, /* Y */ diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 3b48c1994a..f781967a7d 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -132,7 +132,7 @@ enum PixelFormat { PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 - PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha + PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha 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 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 @@ -145,6 +145,8 @@ enum PixelFormat { PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; +#define PIX_FMT_Y400A PIX_FMT_GRAY8A + #if AV_HAVE_BIGENDIAN # define PIX_FMT_NE(be, le) PIX_FMT_##be #else diff --git a/libswscale/swscale.c b/libswscale/swscale.c index bf41180a62..51882e4035 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -80,7 +80,7 @@ untested special converters (x)==PIX_FMT_PAL8 \ || (x)==PIX_FMT_YUYV422 \ || (x)==PIX_FMT_UYVY422 \ - || (x)==PIX_FMT_Y400A \ + || (x)==PIX_FMT_GRAY8A \ || isAnyRGB(x) \ ) @@ -1528,7 +1528,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 == PIX_FMT_Y400A) { + if (srcFormat == PIX_FMT_GRAY8A) { switch (dstFormat) { case PIX_FMT_RGB32 : conv = gray8aToPacked32; break; case PIX_FMT_BGR32 : conv = gray8aToPacked32; break; @@ -2017,7 +2017,7 @@ int sws_scale(SwsContext *c, const uint8_t* const src[], const int srcStride[], r= (i>>3 )*255; g= ((i>>1)&3)*85; b= (i&1 )*255; - } else if(c->srcFormat == PIX_FMT_GRAY8 || c->srcFormat == PIX_FMT_Y400A) { + } else if(c->srcFormat == PIX_FMT_GRAY8 || c->srcFormat == PIX_FMT_GRAY8A) { r = g = b = i; } else { assert(c->srcFormat == PIX_FMT_BGR4_BYTE); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 9c2f822fff..6eac7e97db 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -392,7 +392,7 @@ const char *sws_format_name(enum PixelFormat format); ) #define isGray(x) ( \ (x)==PIX_FMT_GRAY8 \ - || (x)==PIX_FMT_Y400A \ + || (x)==PIX_FMT_GRAY8A \ || (x)==PIX_FMT_GRAY16BE \ || (x)==PIX_FMT_GRAY16LE \ ) @@ -459,10 +459,10 @@ const char *sws_format_name(enum PixelFormat format); || (x)==PIX_FMT_BGR32_1 \ || (x)==PIX_FMT_RGB32 \ || (x)==PIX_FMT_RGB32_1 \ - || (x)==PIX_FMT_Y400A \ + || (x)==PIX_FMT_GRAY8A \ || (x)==PIX_FMT_YUVA420P \ ) -#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || (x) == PIX_FMT_Y400A) +#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || (x) == PIX_FMT_GRAY8A) extern const uint64_t ff_dither4[2]; extern const uint64_t ff_dither8[2]; diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index d616036646..c269281a14 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -3032,7 +3032,7 @@ static void RENAME(sws_init_swScale)(SwsContext *c) case PIX_FMT_YUV420P16BE: case PIX_FMT_YUV422P16BE: case PIX_FMT_YUV444P16BE: - case PIX_FMT_Y400A : + case PIX_FMT_GRAY8A : case PIX_FMT_GRAY16BE : c->lumToYV12 = RENAME(yuy2ToY); break; case PIX_FMT_UYVY422 : case PIX_FMT_YUV420P16LE: @@ -3067,12 +3067,12 @@ static void RENAME(sws_init_swScale)(SwsContext *c) case PIX_FMT_RGB32_1: case PIX_FMT_BGR32 : case PIX_FMT_BGR32_1: c->alpToYV12 = abgrToA; break; - case PIX_FMT_Y400A : c->alpToYV12 = RENAME(yuy2ToY); break; + case PIX_FMT_GRAY8A : c->alpToYV12 = RENAME(yuy2ToY); break; } } switch (srcFormat) { - case PIX_FMT_Y400A : + case PIX_FMT_GRAY8A : c->alpSrcOffset = 1; break; case PIX_FMT_RGB32 : diff --git a/libswscale/utils.c b/libswscale/utils.c index 2080742e90..d96cc57ccf 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -85,7 +85,7 @@ const char *swscale_license(void) || (x)==PIX_FMT_RGB565 \ || (x)==PIX_FMT_RGB555 \ || (x)==PIX_FMT_GRAY8 \ - || (x)==PIX_FMT_Y400A \ + || (x)==PIX_FMT_GRAY8A \ || (x)==PIX_FMT_YUV410P \ || (x)==PIX_FMT_YUV440P \ || (x)==PIX_FMT_NV12 \