vc_image/mmal/il/isp: Add support for 16bit/component YUV420 and YUVUV
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Tue, 13 Jun 2017 17:05:59 +0000 (18:05 +0100)
committerpopcornmix <popcornmix@gmail.com>
Tue, 13 Jun 2017 17:05:59 +0000 (18:05 +0100)
Adopt 64pixel/128byte wide columns for YUV_UV_16 so that the strides
work out the same as YUV_UV.

Plumbed int through vc_image for basic setup.
OpenMaxIL/MMAL have the plumbing in place.
IL "source" component can generate YUV420_16, YUV_UV_128, or
YUVUV_16 for most patterns. (YUVUV_128 and YUVUV_16 produce
different results to other formats for random. YUVUV_16 also
produces a doubled slope angle for diagonal)

IL "isp" component will accept them as input formats.

interface/mmal/mmal_encodings.h
interface/mmal/util/mmal_il.c
interface/mmal/util/mmal_util.c
interface/vctypes/vc_image_types.h
interface/vmcs_host/khronos/IL/OMX_IVCommon.h

index dc99ca0235c0d4064a901d5161f22921fde6cb33..75128275faa1b1e04336a94b505f5be542e7198a 100644 (file)
@@ -94,6 +94,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define MMAL_ENCODING_BGR32            MMAL_FOURCC('B','G','R','4')
 #define MMAL_ENCODING_BGR32_SLICE      MMAL_FOURCC('b','g','r','4')
 
+/** YUV 4:2:0 planar, 16bit/component.
+*/
+#define MMAL_ENCODING_I420_16          MMAL_FOURCC('i','4','2','0')
+
 //Bayer formats
 //FourCC values copied from V4L2 where defined.
 //10 bit per pixel packed Bayer formats.
@@ -132,6 +136,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * of YUV_UV video.
  */
 #define MMAL_ENCODING_YUVUV128         MMAL_FOURCC('S','A','N','D')
+/** 16 bit SAND Video (YUVUV64_16) format.
+ * This format is *not* opaque - if requested you will receive full frames
+ * of YUV_UV_16 video.
+ */
+#define MMAL_ENCODING_YUVUV64_16      MMAL_FOURCC('S','A','1','6')
 
 /** VideoCore opaque image format, image handles are returned to
  * the host but not the actual image data.
index bb11a4c6160cb5605cee4f3a063793726b776c5b..cbad425b21e45379147c8929e5ec5f7403ba04c3 100644 (file)
@@ -739,6 +739,8 @@ static struct {
    {MMAL_ENCODING_BAYER_SRGGB16,  OMX_COLOR_FormatRawBayer16bit},
    {MMAL_ENCODING_BAYER_SBGGR10DPCM8,OMX_COLOR_FormatRawBayer8bitcompressed},
    {MMAL_ENCODING_OPAQUE,         OMX_COLOR_FormatBRCMOpaque},
+   {MMAL_ENCODING_I420_16,        OMX_COLOR_FormatYUV420_16PackedPlanar},
+   {MMAL_ENCODING_YUVUV64_16,     OMX_COLOR_FormatYUVUV64_16},
    {MMAL_ENCODING_UNKNOWN,        OMX_COLOR_FormatUnused}
 };
 
index 0281d15ff8a4eccad4f626d6505a84020ad3a343..cf040dcbddeb7a49620b56dc8a393bb41dd8cb34 100644 (file)
@@ -86,6 +86,7 @@ static struct {
    {MMAL_ENCODING_RGB24, 3, 1, 1},
    {MMAL_ENCODING_BGR16, 2, 1, 1},
    {MMAL_ENCODING_BGR24, 3, 1, 1},
+   {MMAL_ENCODING_I420_16, 2, 1, 1},
 
    {MMAL_ENCODING_I420_SLICE,  1, 1, 1},
    {MMAL_ENCODING_I422_SLICE,  1, 1, 1},
@@ -129,6 +130,7 @@ static struct {
    {MMAL_ENCODING_BAYER_SRGGB16,       2, 1, 32},
 
    /* {MMAL_ENCODING_YUVUV128, 1, 1}, That's a special case which must not be included */
+   /* {MMAL_ENCODING_YUVUV64_16, 1, 1}, That's a special case which must not be included */
    {MMAL_ENCODING_UNKNOWN, 0, 0}
 };
 
index b0feeb405440427abf699bf3ff9b032ec12bdc18..922cd2384bd7d1b47cc1c8f83eaa6ecd7dbf3c83 100644 (file)
@@ -116,6 +116,9 @@ typedef enum
    VC_IMAGE_TF_U8,   /* T-format 8-bit U - same as TF_Y8 buf from U plane */
    VC_IMAGE_TF_V8,   /* T-format 8-bit U - same as TF_Y8 buf from V plane */
    
+   VC_IMAGE_YUV420_16,  /* YUV4:2:0 planar, 16bit values */
+   VC_IMAGE_YUV_UV_16,  /* YUV4:2:0 codec format, 16bit values */
+
    VC_IMAGE_MAX,     //bounds for error checking
    VC_IMAGE_FORCE_ENUM_16BIT = 0xffff,
 } VC_IMAGE_TYPE_T;
index bf86b7ca2c21ab8676a32eb3c9ba1d3678d547e4..de4b86b9b5fc556c6f043db6223b670328eedf37 100644 (file)
@@ -143,6 +143,8 @@ typedef enum OMX_COLOR_FORMATTYPE {
     OMX_COLOR_FormatYVU420PackedPlanar,
     OMX_COLOR_FormatYVU420PackedSemiPlanar,
     OMX_COLOR_FormatRawBayer16bit,
+    OMX_COLOR_FormatYUV420_16PackedPlanar,
+    OMX_COLOR_FormatYUVUV64_16,
     OMX_COLOR_FormatMax = 0x7FFFFFFF
 } OMX_COLOR_FORMATTYPE;