gallium: add P016 format
authorChristian König <christian.koenig@amd.com>
Fri, 13 Jan 2017 18:11:43 +0000 (19:11 +0100)
committerChristian König <christian.koenig@amd.com>
Mon, 13 Mar 2017 07:51:07 +0000 (08:51 +0100)
Same layout as NV12, but 16bit per channel instead of 8.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
src/gallium/auxiliary/util/u_format.csv
src/gallium/auxiliary/util/u_format_yuv.c
src/gallium/auxiliary/util/u_format_yuv.h
src/gallium/include/pipe/p_format.h

index c26d7331d4cd6c69bbcfcaaa2215db5f11f30073..cef530aae7c3030233098a7d7b4d903502154598 100644 (file)
@@ -320,6 +320,8 @@ PIPE_FORMAT_IYUV                  , other, 1, 1, x8  , x8  , x8  , x8  , xyzw, y
 PIPE_FORMAT_NV12                  , other, 1, 1, x8  , x8  , x8  , x8  , xyzw, yuv
 PIPE_FORMAT_NV21                  , other, 1, 1, x8  , x8  , x8  , x8  , xyzw, yuv
 
+PIPE_FORMAT_P016                  , other, 1, 1, x16 , x16 ,     ,     , xyzw, yuv
+
 # Usually used to implement IA44 and AI44 formats in video decoding
 PIPE_FORMAT_A4R4_UNORM            , plain, 1, 1, un4 , un4 ,     ,     , y00x, rgb, un4, un4 ,     ,     , x00y
 PIPE_FORMAT_R4A4_UNORM            , plain, 1, 1, un4 , un4 ,     ,     , x00y, rgb, un4, un4 ,     ,     , y00x
index 16ed8af7ba641307c03c241c0bcd49840e8b7e55..55f8ad68ec704d0045d8e311c065571945988d98 100644 (file)
@@ -1015,6 +1015,25 @@ util_format_nv21_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
 void
 util_format_nv21_fetch_rgba_float(float *dst, const uint8_t *src,
                              unsigned i, unsigned j) {}
+void
+util_format_p016_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height) {}
+void
+util_format_p016_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height) {}
+void
+util_format_p016_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height) {}
+void
+util_format_p016_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height) {}
+void
+util_format_p016_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j) {}
 
 void
 util_format_r8g8_r8b8_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
index 41524d63f3a567eb3043c816785c0e600145f4fa..d8e67b45940514e973730ba8e51d7856f8488012 100644 (file)
@@ -266,6 +266,25 @@ void
 util_format_nv21_fetch_rgba_float(float *dst, const uint8_t *src,
                              unsigned i, unsigned j);
 void
+util_format_p016_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_p016_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_p016_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_p016_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_p016_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+void
 util_format_r8g8_b8g8_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
                                          const uint8_t *src_row, unsigned src_stride,
                                          unsigned width, unsigned height);
index b22baa9c65035333c91a3095c0601ea1e711dd22..e4e09d8b435330f3d8319a677f3248d74aa6e0f0 100644 (file)
@@ -389,6 +389,8 @@ enum pipe_format {
    PIPE_FORMAT_ASTC_12x10_SRGB         = 305,
    PIPE_FORMAT_ASTC_12x12_SRGB         = 306,
 
+   PIPE_FORMAT_P016                    = 307,
+
    PIPE_FORMAT_COUNT
 };