An alias is provided for compatibility. --- I would propose this change because all present (and future) grayscale format somehow have GRAY in their name, which makes them more consistent and easier to grep. Additionally this is not one of the most widespread format and the alias should cover all cases and purposes.
Vittorio libavcodec/brenderpix.c | 2 +- libavcodec/libopenjpegdec.c | 2 +- libavcodec/libopenjpegenc.c | 6 +++--- libavcodec/pngdec.c | 2 +- libavcodec/raw.c | 2 +- libavutil/pixdesc.c | 4 ++-- libavutil/pixfmt.h | 3 ++- libavutil/version.h | 2 +- libswscale/input.c | 4 ++-- libswscale/swscale-test.c | 2 +- libswscale/swscale_internal.h | 4 ++-- libswscale/swscale_unscaled.c | 4 ++-- libswscale/utils.c | 2 +- libswscale/x86/swscale.c | 4 ++-- 14 files changed, 22 insertions(+), 21 deletions(-) diff --git a/libavcodec/brenderpix.c b/libavcodec/brenderpix.c index 0c08f8d..88f1631 100644 --- a/libavcodec/brenderpix.c +++ b/libavcodec/brenderpix.c @@ -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_GRAY8A; bytes_pp = 2; break; default: diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index f279b33..8c3a266 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -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_GRAY8A, \ AV_PIX_FMT_GRAY16 #define YUV_PIXEL_FORMATS AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, \ diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index e98d550..8c21c1c 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -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_GRAY8A: 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_GRAY8A: 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_GRAY8A, 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, diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index fe5590d..6b085ac 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -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_GRAY8A; } else { goto fail; } diff --git a/libavcodec/raw.c b/libavcodec/raw.c index 547ac44..e7cd973 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -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_GRAY8A, MKTAG('Y', '2', 0 , 8 ) }, { AV_PIX_FMT_YUVA420P9LE, MKTAG('Y', '4', 11 , 9 ) }, { AV_PIX_FMT_YUVA420P9BE, MKTAG( 9 , 11 , '4', 'Y') }, diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index ced3e46..9683688 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -1335,8 +1335,8 @@ 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_GRAY8A] = { + .name = "gray8a", .nb_components = 2, .comp = { { 0, 1, 1, 0, 7 }, /* Y */ diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 29207d2..0c9467e 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -141,7 +141,7 @@ 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_GRAY8A, ///< 8bit gray, 8bit alpha 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 @@ -256,6 +256,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE) #define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) +#define AV_PIX_FMT_Y400A AV_PIX_FMT_GRAY8A #if FF_API_PIX_FMT #define PixelFormat AVPixelFormat diff --git a/libavutil/version.h b/libavutil/version.h index a2625b5..98f7037 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -55,7 +55,7 @@ #define LIBAVUTIL_VERSION_MAJOR 53 #define LIBAVUTIL_VERSION_MINOR 18 -#define LIBAVUTIL_VERSION_MICRO 0 +#define LIBAVUTIL_VERSION_MICRO 1 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ diff --git a/libswscale/input.c b/libswscale/input.c index c1cfd7c..e137842 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -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_GRAY8A: 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_GRAY8A: c->alpToYV12 = uyvyToY_c; break; } diff --git a/libswscale/swscale-test.c b/libswscale/swscale-test.c index 12fa9ed..ddfa68d 100644 --- a/libswscale/swscale-test.c +++ b/libswscale/swscale-test.c @@ -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_GRAY8A || \ (x) == AV_PIX_FMT_GRAY16BE || \ (x) == AV_PIX_FMT_GRAY16LE) #define hasChroma(x) \ diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 7ecf222..25a4f14 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -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_GRAY8A || \ (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_GRAY8A); } extern const uint64_t ff_dither4[2]; diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 02850ea..23b76a3 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -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_GRAY8A) { 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_GRAY8A) { r = g = b = i; } else { assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE); diff --git a/libswscale/utils.c b/libswscale/utils.c index fa00668..6d194e8 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -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_GRAY8A] = { 1, 0 }, [AV_PIX_FMT_BGR48BE] = { 1, 1 }, [AV_PIX_FMT_BGR48LE] = { 1, 1 }, [AV_PIX_FMT_BGRA64BE] = { 0, 0, 1 }, diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index a2bce48..91e6540 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -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_GRAY8A: 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_GRAY8A: c->lumToYV12 = ff_yuyvToY_sse2; if (c->alpPixBuf) c->alpToYV12 = ff_uyvyToY_sse2; -- 1.8.5.2 (Apple Git-48) _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel