[FFmpeg-cvslog] sws/pixfmt/pixdesc: add support for yuv420p9le/be.

Ronald S. Bultje git at videolan.org
Sat Oct 22 01:26:47 CEST 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Fri Oct 21 00:38:04 2011 -0700| [dc49bf127010fdff2c3282755407cedd429475f5] | committer: Ronald S. Bultje

sws/pixfmt/pixdesc: add support for yuv420p9le/be.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc49bf127010fdff2c3282755407cedd429475f5
---

 libavcodec/utils.c            |    2 ++
 libavutil/pixdesc.c           |   23 +++++++++++++++++++++++
 libavutil/pixfmt.h            |    3 +++
 libswscale/swscale.c          |    4 ++++
 libswscale/swscale_internal.h |    4 ++++
 libswscale/utils.c            |    2 ++
 tests/ref/lavfi/pixdesc       |    2 ++
 tests/ref/lavfi/pixfmts_copy  |    2 ++
 tests/ref/lavfi/pixfmts_null  |    2 ++
 tests/ref/lavfi/pixfmts_scale |    2 ++
 tests/ref/lavfi/pixfmts_vflip |    2 ++
 11 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c1a5c19..3e49262 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -158,6 +158,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
     case PIX_FMT_YUV420P9BE:
     case PIX_FMT_YUV420P10LE:
     case PIX_FMT_YUV420P10BE:
+    case PIX_FMT_YUV422P9LE:
+    case PIX_FMT_YUV422P9BE:
     case PIX_FMT_YUV422P10LE:
     case PIX_FMT_YUV422P10BE:
     case PIX_FMT_YUV444P9LE:
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index c70a413..f7df0eb 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -809,6 +809,29 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         },
         .flags = PIX_FMT_BE,
     },
+    [PIX_FMT_YUV422P9LE] = {
+        .name = "yuv422p9le",
+        .nb_components= 3,
+        .log2_chroma_w= 1,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,8},        /* Y */
+            {1,1,1,0,8},        /* U */
+            {2,1,1,0,8},        /* V */
+        },
+    },
+    [PIX_FMT_YUV422P9BE] = {
+        .name = "yuv422p9be",
+        .nb_components= 3,
+        .log2_chroma_w= 1,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,8},        /* Y */
+            {1,1,1,0,8},        /* U */
+            {2,1,1,0,8},        /* V */
+        },
+        .flags = PIX_FMT_BE,
+    },
     [PIX_FMT_YUV422P10LE] = {
         .name = "yuv422p10le",
         .nb_components= 3,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 9bf7938..7068b43 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -145,6 +145,8 @@ enum PixelFormat {
     PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
     PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
     PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-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
 };
 
@@ -170,6 +172,7 @@ enum PixelFormat {
 #define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE)
 
 #define PIX_FMT_YUV420P9  PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
+#define PIX_FMT_YUV422P9  PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
 #define PIX_FMT_YUV444P9  PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
 #define PIX_FMT_YUV420P10 PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
 #define PIX_FMT_YUV422P10 PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 5d90250..227f65e 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -2662,6 +2662,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
         case PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV_c; break;
 #if HAVE_BIGENDIAN
         case PIX_FMT_YUV444P9LE:
+        case PIX_FMT_YUV422P9LE:
         case PIX_FMT_YUV420P9LE:
         case PIX_FMT_YUV422P10LE:
         case PIX_FMT_YUV444P10LE:
@@ -2671,6 +2672,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
         case PIX_FMT_YUV444P16LE: c->chrToYV12 = bswap16UV_c; break;
 #else
         case PIX_FMT_YUV444P9BE:
+        case PIX_FMT_YUV422P9BE:
         case PIX_FMT_YUV420P9BE:
         case PIX_FMT_YUV444P10BE:
         case PIX_FMT_YUV422P10BE:
@@ -2729,6 +2731,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
     switch (srcFormat) {
 #if HAVE_BIGENDIAN
     case PIX_FMT_YUV444P9LE:
+    case PIX_FMT_YUV422P9LE:
     case PIX_FMT_YUV420P9LE:
     case PIX_FMT_YUV444P10LE:
     case PIX_FMT_YUV422P10LE:
@@ -2739,6 +2742,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
     case PIX_FMT_GRAY16LE: c->lumToYV12 = bswap16Y_c; break;
 #else
     case PIX_FMT_YUV444P9BE:
+    case PIX_FMT_YUV422P9BE:
     case PIX_FMT_YUV420P9BE:
     case PIX_FMT_YUV444P10BE:
     case PIX_FMT_YUV422P10BE:
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index a13b89d..9b895b1 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -535,6 +535,8 @@ const char *sws_format_name(enum PixelFormat format);
 #define is9_OR_10BPS(x) (           \
            (x)==PIX_FMT_YUV420P9LE  \
         || (x)==PIX_FMT_YUV420P9BE  \
+        || (x)==PIX_FMT_YUV422P9LE  \
+        || (x)==PIX_FMT_YUV422P9BE  \
         || (x)==PIX_FMT_YUV444P9BE  \
         || (x)==PIX_FMT_YUV444P9LE  \
         || (x)==PIX_FMT_YUV422P10BE \
@@ -559,6 +561,7 @@ const char *sws_format_name(enum PixelFormat format);
 #define isPlanarYUV(x)  (           \
         isPlanar8YUV(x)             \
         || (x)==PIX_FMT_YUV420P9LE  \
+        || (x)==PIX_FMT_YUV422P9LE  \
         || (x)==PIX_FMT_YUV444P9LE  \
         || (x)==PIX_FMT_YUV420P10LE \
         || (x)==PIX_FMT_YUV422P10LE \
@@ -567,6 +570,7 @@ const char *sws_format_name(enum PixelFormat format);
         || (x)==PIX_FMT_YUV422P16LE \
         || (x)==PIX_FMT_YUV444P16LE \
         || (x)==PIX_FMT_YUV420P9BE  \
+        || (x)==PIX_FMT_YUV422P9BE  \
         || (x)==PIX_FMT_YUV444P9BE  \
         || (x)==PIX_FMT_YUV420P10BE \
         || (x)==PIX_FMT_YUV422P10BE \
diff --git a/libswscale/utils.c b/libswscale/utils.c
index ea5a1ab..64ac77d 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -129,6 +129,8 @@ const static FormatEntry format_entries[PIX_FMT_NB] = {
     [PIX_FMT_YUV420P9LE]  = { 1 , 1 },
     [PIX_FMT_YUV420P10BE] = { 1 , 1 },
     [PIX_FMT_YUV420P10LE] = { 1 , 1 },
+    [PIX_FMT_YUV422P9BE]  = { 1 , 1 },
+    [PIX_FMT_YUV422P9LE]  = { 1 , 1 },
     [PIX_FMT_YUV422P10BE] = { 1 , 1 },
     [PIX_FMT_YUV422P10LE] = { 1 , 1 },
     [PIX_FMT_YUV444P9BE]  = { 1 , 1 },
diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc
index f27d31b..c4d7890 100644
--- a/tests/ref/lavfi/pixdesc
+++ b/tests/ref/lavfi/pixdesc
@@ -42,6 +42,8 @@ yuv422p10be         bdc13b630fd668b34c6fe1aae28dfc71
 yuv422p10le         d0607c260a45c973e6639f4e449730ad
 yuv422p16be         4e9b3b3467aeebb6a528cee5966800ed
 yuv422p16le         f87c81bf16916b64d201359be0b4b6f4
+yuv422p9be          29b71579946940a8c00fa844c9dff507
+yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
 yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
 yuv444p             0a98447b78fd476aa39686da6a74fa2e
 yuv444p10be         e65cbae7e4f1892c23defbc8e8052cf6
diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/lavfi/pixfmts_copy
index f27d31b..c4d7890 100644
--- a/tests/ref/lavfi/pixfmts_copy
+++ b/tests/ref/lavfi/pixfmts_copy
@@ -42,6 +42,8 @@ yuv422p10be         bdc13b630fd668b34c6fe1aae28dfc71
 yuv422p10le         d0607c260a45c973e6639f4e449730ad
 yuv422p16be         4e9b3b3467aeebb6a528cee5966800ed
 yuv422p16le         f87c81bf16916b64d201359be0b4b6f4
+yuv422p9be          29b71579946940a8c00fa844c9dff507
+yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
 yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
 yuv444p             0a98447b78fd476aa39686da6a74fa2e
 yuv444p10be         e65cbae7e4f1892c23defbc8e8052cf6
diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/lavfi/pixfmts_null
index f27d31b..c4d7890 100644
--- a/tests/ref/lavfi/pixfmts_null
+++ b/tests/ref/lavfi/pixfmts_null
@@ -42,6 +42,8 @@ yuv422p10be         bdc13b630fd668b34c6fe1aae28dfc71
 yuv422p10le         d0607c260a45c973e6639f4e449730ad
 yuv422p16be         4e9b3b3467aeebb6a528cee5966800ed
 yuv422p16le         f87c81bf16916b64d201359be0b4b6f4
+yuv422p9be          29b71579946940a8c00fa844c9dff507
+yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
 yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
 yuv444p             0a98447b78fd476aa39686da6a74fa2e
 yuv444p10be         e65cbae7e4f1892c23defbc8e8052cf6
diff --git a/tests/ref/lavfi/pixfmts_scale b/tests/ref/lavfi/pixfmts_scale
index 4af1ca4..83b523e 100644
--- a/tests/ref/lavfi/pixfmts_scale
+++ b/tests/ref/lavfi/pixfmts_scale
@@ -42,6 +42,8 @@ yuv422p10be         cea7ca6b0e66d6f29539885896c88603
 yuv422p10le         a10c4a5837547716f13cd61918b145f9
 yuv422p16be         285993ee0c0f4f8e511ee46f93c5f38c
 yuv422p16le         61bfcee8e54465f760164f5a75d40b5e
+yuv422p9be          82494823944912f73cebc58ad2979bbd
+yuv422p9le          fc69c8a21f473916a4b4225636b97e06
 yuv440p             461503fdb9b90451020aa3b25ddf041c
 yuv444p             81b2eba962d12e8d64f003ac56f6faf2
 yuv444p10be         e9d3c8e744b8b0d8187ca092fa203fc9
diff --git a/tests/ref/lavfi/pixfmts_vflip b/tests/ref/lavfi/pixfmts_vflip
index 21988f1..66d803c 100644
--- a/tests/ref/lavfi/pixfmts_vflip
+++ b/tests/ref/lavfi/pixfmts_vflip
@@ -42,6 +42,8 @@ yuv422p10be         588fe319b96513c32e21d3e32b45447f
 yuv422p10le         11b57f2bd9661024153f3973b9090cdb
 yuv422p16be         c092d083548c2a144c372a98c46875c7
 yuv422p16le         c071b9397a416d51cbe339345cbcba84
+yuv422p9be          7c6f1e140b3999ee7d923854e507752a
+yuv422p9le          51f10d79c07989060dd06e767e6d7d60
 yuv440p             876385e96165acf51271b20e5d85a416
 yuv444p             9c3c667d1613b72d15bc6d851c5eb8f7
 yuv444p10be         944a4997c4edb3a8dd0f0493cfd5a1fd



More information about the ffmpeg-cvslog mailing list