Rename y400a to gray8a.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Baptiste Coudurier 2011-04-27 21:36:30 +02:00 committed by Michael Niedermayer
parent 52a81cd0e4
commit e91946ed23
8 changed files with 17 additions and 15 deletions

View File

@ -473,7 +473,7 @@ static int decode_frame(AVCodecContext *avctx,
} else if (s->color_type == PNG_COLOR_TYPE_PALETTE) { } else if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = PIX_FMT_PAL8;
} else if (s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { } else if (s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
avctx->pix_fmt = PIX_FMT_Y400A; avctx->pix_fmt = PIX_FMT_GRAY8A;
} else { } else {
goto fail; goto fail;
} }

View File

@ -114,7 +114,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
{ PIX_FMT_YUV444P16LE, MKTAG('Y', '3', 0 , 16 ) }, { PIX_FMT_YUV444P16LE, MKTAG('Y', '3', 0 , 16 ) },
{ PIX_FMT_YUV444P16BE, MKTAG(16 , 0 , '3', 'Y') }, { PIX_FMT_YUV444P16BE, MKTAG(16 , 0 , '3', 'Y') },
{ PIX_FMT_YUVA420P, MKTAG('Y', '4', 11 , 8 ) }, { 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 */ /* quicktime */
{ PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') }, { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },

View File

@ -861,8 +861,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
.log2_chroma_h = 1, .log2_chroma_h = 1,
.flags = PIX_FMT_HWACCEL, .flags = PIX_FMT_HWACCEL,
}, },
[PIX_FMT_Y400A] = { [PIX_FMT_GRAY8A] = {
.name = "y400a", .name = "gray8a",
.nb_components= 2, .nb_components= 2,
.comp = { .comp = {
{0,1,1,0,7}, /* Y */ {0,1,1,0,7}, /* Y */

View File

@ -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_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_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_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_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 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 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 #if AV_HAVE_BIGENDIAN
# define PIX_FMT_NE(be, le) PIX_FMT_##be # define PIX_FMT_NE(be, le) PIX_FMT_##be
#else #else

View File

@ -80,7 +80,7 @@ untested special converters
(x)==PIX_FMT_PAL8 \ (x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_YUYV422 \ || (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \ || (x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_Y400A \ || (x)==PIX_FMT_GRAY8A \
|| isAnyRGB(x) \ || 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; uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY;
const uint8_t *srcPtr= src[0]; const uint8_t *srcPtr= src[0];
if (srcFormat == PIX_FMT_Y400A) { if (srcFormat == PIX_FMT_GRAY8A) {
switch (dstFormat) { switch (dstFormat) {
case PIX_FMT_RGB32 : conv = gray8aToPacked32; break; case PIX_FMT_RGB32 : conv = gray8aToPacked32; break;
case PIX_FMT_BGR32 : 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; r= (i>>3 )*255;
g= ((i>>1)&3)*85; g= ((i>>1)&3)*85;
b= (i&1 )*255; 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; r = g = b = i;
} else { } else {
assert(c->srcFormat == PIX_FMT_BGR4_BYTE); assert(c->srcFormat == PIX_FMT_BGR4_BYTE);

View File

@ -392,7 +392,7 @@ const char *sws_format_name(enum PixelFormat format);
) )
#define isGray(x) ( \ #define isGray(x) ( \
(x)==PIX_FMT_GRAY8 \ (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_Y400A \ || (x)==PIX_FMT_GRAY8A \
|| (x)==PIX_FMT_GRAY16BE \ || (x)==PIX_FMT_GRAY16BE \
|| (x)==PIX_FMT_GRAY16LE \ || (x)==PIX_FMT_GRAY16LE \
) )
@ -459,10 +459,10 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_BGR32_1 \ || (x)==PIX_FMT_BGR32_1 \
|| (x)==PIX_FMT_RGB32 \ || (x)==PIX_FMT_RGB32 \
|| (x)==PIX_FMT_RGB32_1 \ || (x)==PIX_FMT_RGB32_1 \
|| (x)==PIX_FMT_Y400A \ || (x)==PIX_FMT_GRAY8A \
|| (x)==PIX_FMT_YUVA420P \ || (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_dither4[2];
extern const uint64_t ff_dither8[2]; extern const uint64_t ff_dither8[2];

View File

@ -3032,7 +3032,7 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
case PIX_FMT_YUV420P16BE: case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUV422P16BE: case PIX_FMT_YUV422P16BE:
case PIX_FMT_YUV444P16BE: case PIX_FMT_YUV444P16BE:
case PIX_FMT_Y400A : case PIX_FMT_GRAY8A :
case PIX_FMT_GRAY16BE : c->lumToYV12 = RENAME(yuy2ToY); break; case PIX_FMT_GRAY16BE : c->lumToYV12 = RENAME(yuy2ToY); break;
case PIX_FMT_UYVY422 : case PIX_FMT_UYVY422 :
case PIX_FMT_YUV420P16LE: case PIX_FMT_YUV420P16LE:
@ -3067,12 +3067,12 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
case PIX_FMT_RGB32_1: case PIX_FMT_RGB32_1:
case PIX_FMT_BGR32 : case PIX_FMT_BGR32 :
case PIX_FMT_BGR32_1: c->alpToYV12 = abgrToA; break; 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) { switch (srcFormat) {
case PIX_FMT_Y400A : case PIX_FMT_GRAY8A :
c->alpSrcOffset = 1; c->alpSrcOffset = 1;
break; break;
case PIX_FMT_RGB32 : case PIX_FMT_RGB32 :

View File

@ -85,7 +85,7 @@ const char *swscale_license(void)
|| (x)==PIX_FMT_RGB565 \ || (x)==PIX_FMT_RGB565 \
|| (x)==PIX_FMT_RGB555 \ || (x)==PIX_FMT_RGB555 \
|| (x)==PIX_FMT_GRAY8 \ || (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_Y400A \ || (x)==PIX_FMT_GRAY8A \
|| (x)==PIX_FMT_YUV410P \ || (x)==PIX_FMT_YUV410P \
|| (x)==PIX_FMT_YUV440P \ || (x)==PIX_FMT_YUV440P \
|| (x)==PIX_FMT_NV12 \ || (x)==PIX_FMT_NV12 \