Skip to content
Snippets Groups Projects
Commit d590c85e authored by Mirela Rabulea's avatar Mirela Rabulea Committed by Leonard Crestez
Browse files

MLK-19247: mxc-jpeg: Remove jpeg-encoder hardcoding to 64x64 yuv422


Remove hardcodings for encoder (configuration stream especially).
This fix also requires a fixed version of the test applications,
encoder_test.out/decoder_test.out (linux-test repo).

Also fixed MLK-19453: Add support for YUV420 format in jpeg decoder
YUV420 is generally working on encoder/decoder,
but for some particular small files the decoder enters infinite error:
"Instance released before the end of transaction".
RGB24 is working, but the colors are strange in jpeg.
Since YUV444 and RGB24 have the same subsampling,
a RGB24 raw file can be encoded/decoded as YUV444 with the same results.
Fixes for invalid pixel formats.
Full battery of tests run.

Signed-off-by: default avatarMirela Rabulea <mirela.rabulea@nxp.com>
parent 2b44d184
No related branches found
No related tags found
No related merge requests found
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
/* STM_CTRL fields */ /* STM_CTRL fields */
#define STM_CTRL_PIXEL_PRECISION (0x1 << 2) #define STM_CTRL_PIXEL_PRECISION (0x1 << 2)
#define STM_CTRL_IMAGE_FORMAT(img_fmt) ((img_fmt) << 3) #define STM_CTRL_IMAGE_FORMAT(img_fmt) ((img_fmt) << 3)
#define STM_CTRL_IMAGE_FORMAT_MASK (0xF << 3)
#define STM_CTRL_BITBUF_PTR_CLR(clr) ((clr) << 7) #define STM_CTRL_BITBUF_PTR_CLR(clr) ((clr) << 7)
#define STM_CTRL_AUTO_START(go) ((go) << 8) #define STM_CTRL_AUTO_START(go) ((go) << 8)
#define STM_CTRL_CONFIG_MOD(mod) ((mod) << 9) #define STM_CTRL_CONFIG_MOD(mod) ((mod) << 9)
...@@ -101,6 +102,7 @@ ...@@ -101,6 +102,7 @@
/* JPEG-Decoder Wrapper - STM_CTRL Register Fields */ /* JPEG-Decoder Wrapper - STM_CTRL Register Fields */
#define MXC_PIXEL_PRECISION(precision) ((precision)/8 << 2) #define MXC_PIXEL_PRECISION(precision) ((precision)/8 << 2)
enum mxc_jpeg_image_format { enum mxc_jpeg_image_format {
MXC_JPEG_INVALID = -1,
MXC_JPEG_YUV420 = 0x0, /* 2 Plannar, Y=1st plane UV=2nd plane */ MXC_JPEG_YUV420 = 0x0, /* 2 Plannar, Y=1st plane UV=2nd plane */
MXC_JPEG_YUV422 = 0x1, /* 1 Plannar, YUYV sequence */ MXC_JPEG_YUV422 = 0x1, /* 1 Plannar, YUYV sequence */
MXC_JPEG_RGB = 0x2, /* RGBRGB packed format */ MXC_JPEG_RGB = 0x2, /* RGBRGB packed format */
......
This diff is collapsed.
...@@ -25,11 +25,12 @@ ...@@ -25,11 +25,12 @@
#define MXC_JPEG_RUNNING 1 #define MXC_JPEG_RUNNING 1
#define MXC_JPEG_FMT_TYPE_ENC 0 #define MXC_JPEG_FMT_TYPE_ENC 0
#define MXC_JPEG_FMT_TYPE_RAW 1 #define MXC_JPEG_FMT_TYPE_RAW 1
#define MXC_JPEG_NUM_FORMATS 4
#define MXC_JPEG_MIN_HEIGHT 0x8 #define MXC_JPEG_MIN_HEIGHT 0x8
#define MXC_JPEG_MIN_WIDTH 0x8 #define MXC_JPEG_MIN_WIDTH 0x8
#define MXC_JPEG_MAX_HEIGHT 0x2000 #define MXC_JPEG_MAX_HEIGHT 0x2000
#define MXC_JPEG_MAX_WIDTH 0x2000 #define MXC_JPEG_MAX_WIDTH 0x2000
#define MXC_JPEG_H_ALIGN 3
#define MXC_JPEG_W_ALIGN 3
#define MXC_JPEG_DEFAULT_SIZEIMAGE 10000 #define MXC_JPEG_DEFAULT_SIZEIMAGE 10000
#define MXC_JPEG_ENC_CONF 1 #define MXC_JPEG_ENC_CONF 1
#define MXC_JPEG_ENC_DONE 0 #define MXC_JPEG_ENC_DONE 0
...@@ -135,7 +136,7 @@ struct mxc_jpeg_sof { ...@@ -135,7 +136,7 @@ struct mxc_jpeg_sof {
u8 precision; u8 precision;
u16 height, width; u16 height, width;
u8 components_no; u8 components_no;
struct mxc_jpeg_sof_comp comp[3]; struct mxc_jpeg_sof_comp comp[4];
} __packed; } __packed;
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment