From 35f6c154056549a24d9400587c62eb48bd7cad67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20T=C3=A4uber?= Date: Sat, 5 Sep 2009 23:33:25 +0000 Subject: [PATCH] =?UTF-8?q?Make=2016bit=20YUV=20formats=20compatible=20wit?= =?UTF-8?q?h=20NE=20avcodec=5Fget=5Fpix=5Ffmt().=20Patch=20by=20Lars=20T?= =?UTF-8?q?=C3=A4uber=20=20taeuber=20=20gmx=20=20net?= =?UTF-8?q?>.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 19775 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/imgconvert.c | 48 ++++++++++++++++++++--------------------- libavcodec/pixdesc.c | 24 ++++++++++----------- libavutil/pixfmt.h | 18 ++++++++-------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index fb45c65249..ecadd6339b 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -130,48 +130,48 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { .depth = 8, .x_chroma_shift = 0, .y_chroma_shift = 1, }, - [PIX_FMT_YUV420PLE] = { - .name = "yuv420ple", + [PIX_FMT_YUV420P16LE] = { + .name = "yuv420p16le", .nb_channels = 3, .color_type = FF_COLOR_YUV, .pixel_type = FF_PIXEL_PLANAR, .depth = 16, .x_chroma_shift = 1, .y_chroma_shift = 1, }, - [PIX_FMT_YUV422PLE] = { - .name = "yuv422ple", + [PIX_FMT_YUV422P16LE] = { + .name = "yuv422p16le", .nb_channels = 3, .color_type = FF_COLOR_YUV, .pixel_type = FF_PIXEL_PLANAR, .depth = 16, .x_chroma_shift = 1, .y_chroma_shift = 0, }, - [PIX_FMT_YUV444PLE] = { - .name = "yuv444ple", + [PIX_FMT_YUV444P16LE] = { + .name = "yuv444p16le", .nb_channels = 3, .color_type = FF_COLOR_YUV, .pixel_type = FF_PIXEL_PLANAR, .depth = 16, .x_chroma_shift = 0, .y_chroma_shift = 0, }, - [PIX_FMT_YUV420PBE] = { - .name = "yuv420pbe", + [PIX_FMT_YUV420P16BE] = { + .name = "yuv420p16be", .nb_channels = 3, .color_type = FF_COLOR_YUV, .pixel_type = FF_PIXEL_PLANAR, .depth = 16, .x_chroma_shift = 1, .y_chroma_shift = 1, }, - [PIX_FMT_YUV422PBE] = { - .name = "yuv422pbe", + [PIX_FMT_YUV422P16BE] = { + .name = "yuv422p16be", .nb_channels = 3, .color_type = FF_COLOR_YUV, .pixel_type = FF_PIXEL_PLANAR, .depth = 16, .x_chroma_shift = 1, .y_chroma_shift = 0, }, - [PIX_FMT_YUV444PBE] = { - .name = "yuv444pbe", + [PIX_FMT_YUV444P16BE] = { + .name = "yuv444p16be", .nb_channels = 3, .color_type = FF_COLOR_YUV, .pixel_type = FF_PIXEL_PLANAR, @@ -662,12 +662,12 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width) picture->linesize[1] = w2; picture->linesize[2] = w2; break; - case PIX_FMT_YUV420PLE: - case PIX_FMT_YUV422PLE: - case PIX_FMT_YUV444PLE: - case PIX_FMT_YUV420PBE: - case PIX_FMT_YUV422PBE: - case PIX_FMT_YUV444PBE: + case PIX_FMT_YUV420P16LE: + case PIX_FMT_YUV422P16LE: + case PIX_FMT_YUV444P16LE: + case PIX_FMT_YUV420P16BE: + case PIX_FMT_YUV422P16BE: + case PIX_FMT_YUV444P16BE: w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift; picture->linesize[0] = 2*width; picture->linesize[1] = 2*w2; @@ -760,12 +760,12 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, case PIX_FMT_YUVJ422P: case PIX_FMT_YUVJ444P: case PIX_FMT_YUVJ440P: - case PIX_FMT_YUV420PLE: - case PIX_FMT_YUV422PLE: - case PIX_FMT_YUV444PLE: - case PIX_FMT_YUV420PBE: - case PIX_FMT_YUV422PBE: - case PIX_FMT_YUV444PBE: + case PIX_FMT_YUV420P16LE: + case PIX_FMT_YUV422P16LE: + case PIX_FMT_YUV444P16LE: + case PIX_FMT_YUV420P16BE: + case PIX_FMT_YUV422P16BE: + case PIX_FMT_YUV444P16BE: h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift; size2 = picture->linesize[1] * h2; picture->data[0] = ptr; diff --git a/libavcodec/pixdesc.c b/libavcodec/pixdesc.c index a313c95cf1..d9f2eaac80 100644 --- a/libavcodec/pixdesc.c +++ b/libavcodec/pixdesc.c @@ -511,8 +511,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { {0,1,1,0,4}, /* R */ }, }, - [PIX_FMT_YUV420PLE] = { - .name = "yuv420ple", + [PIX_FMT_YUV420P16LE] = { + .name = "yuv420p16le", .nb_channels = 3, .log2_chroma_w= 1, .log2_chroma_h= 1, @@ -522,8 +522,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { {2,1,1,0,15}, /* V */ }, }, - [PIX_FMT_YUV420PBE] = { - .name = "yuv420pbe", + [PIX_FMT_YUV420P16BE] = { + .name = "yuv420p16be", .nb_channels = 3, .log2_chroma_w= 1, .log2_chroma_h= 1, @@ -534,8 +534,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE, }, - [PIX_FMT_YUV422PLE] = { - .name = "yuv422ple", + [PIX_FMT_YUV422P16LE] = { + .name = "yuv422p16le", .nb_channels = 3, .log2_chroma_w= 1, .log2_chroma_h= 0, @@ -545,8 +545,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { {2,1,1,0,15}, /* V */ }, }, - [PIX_FMT_YUV422PBE] = { - .name = "yuv422pbe", + [PIX_FMT_YUV422P16BE] = { + .name = "yuv422p16be", .nb_channels = 3, .log2_chroma_w= 1, .log2_chroma_h= 0, @@ -557,8 +557,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE, }, - [PIX_FMT_YUV444PLE] = { - .name = "yuv444ple", + [PIX_FMT_YUV444P16LE] = { + .name = "yuv444p16le", .nb_channels = 3, .log2_chroma_w= 0, .log2_chroma_h= 0, @@ -568,8 +568,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { {2,1,1,0,15}, /* V */ }, }, - [PIX_FMT_YUV444PBE] = { - .name = "yuv444pbe", + [PIX_FMT_YUV444P16BE] = { + .name = "yuv444p16be", .nb_channels = 3, .log2_chroma_w= 0, .log2_chroma_h= 0, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 421bd4b3aa..0b15238ff7 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -117,12 +117,12 @@ enum PixelFormat { PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers - PIX_FMT_YUV420PLE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian - PIX_FMT_YUV420PBE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian - PIX_FMT_YUV422PLE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian - PIX_FMT_YUV422PBE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian - PIX_FMT_YUV444PLE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian - PIX_FMT_YUV444PBE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian 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 }; @@ -144,8 +144,8 @@ enum PixelFormat { #define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE) #define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE) -#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420PBE, YUV420PLE) -#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422PBE, YUV422PLE) -#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444PBE, YUV444PLE) +#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420P16BE, YUV420P16LE) +#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE) +#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE) #endif /* AVUTIL_PIXFMT_H */