problem of VPU 720p mjpg decode with rotation

cancel
Showing results for 
Search instead for 
Did you mean: 

problem of VPU 720p mjpg decode with rotation

369 Views
usrg_s
Contributor II

Hello NXP experts,

We are developing a product which uses 720p(1280x720)  UVC camera. To get high frame rate, we use MJPG format input of the UVC camera and use VPU decode before pipe to 720p ( 720x1280) LCD display.  I found the VPU output with rotation has ghost effect. I reproduced problem on i.MX6Q Sabre-SD board with mxc_vpu_test

Software version : L3.14.52_1.1.0-ga_images_MX6QDLSOLO

Hardware: i.MX6Q sabre-sd

command: /unit_tests/mxc_vpu_test.out -D "-i mjpg0.jpg -o YUV422.raw -f 7 -r 90 -t 0"

1. in the below picture, the left is mjpg0.jpg, the right is the YUV output with above command

VPU_decode_rotation_problem.png

2. The VPU output is YUV422P

3. If don't use rotation option, the VPU output is correct.

4. VPU version:

          Product Info: i.MX6Q/D/S

          VPU firmware version: 3.1.1_r46070

          VPU library version: 5.4.32

5. I attached the mjpg0.jpg and output YUV422.raw  and YUV422_norot.raw

Please help to check.

Regards

G

Labels (3)
0 Kudos
5 Replies

178 Views
HongzhangYang
NXP Employee
NXP Employee

Hi, G,

The chroma format of mjpg0.jpg is 4:2:2 (horizontal), 1/2 horizontal subsampling.

The 90 degree rotated image is 4:2:2 (vertical), 1/2 vertical subsampling.

You need to select the correct chroma format in viewer.

Regards,

Hongzhang

0 Kudos

178 Views
usrg_s
Contributor II

Hello Hongzhang,

Thanks for your clarification. Could you give me V4L2 fourcc code of "4:2:2 (vertical), 1/2 vertical subsampling"?

I could not find the correct V4L2 format to display it.

Thanks.

/* Luminance+Chrominance formats */

#define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0     */

#define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0     */

#define V4L2_PIX_FMT_YUYV    v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16  YUV 4:2:2     */

#define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16  YUV 4:2:2     */

#define V4L2_PIX_FMT_YVYU    v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */

#define V4L2_PIX_FMT_UYVY    v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16  YUV 4:2:2     */

#define V4L2_PIX_FMT_VYUY    v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16  YUV 4:2:2     */

#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16  YVU422 planar */

#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16  YVU411 planar */

#define V4L2_PIX_FMT_Y41P    v4l2_fourcc('Y', '4', '1', 'P') /* 12  YUV 4:1:1     */

#define V4L2_PIX_FMT_YUV444  v4l2_fourcc('Y', '4', '4', '4') /* 16  xxxxyyyy uuuuvvvv */

#define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */

#define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */

#define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */

#define V4L2_PIX_FMT_YUV410  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */

#define V4L2_PIX_FMT_YUV420  v4l2_fourcc('Y', 'U', '1', '2') /* 12  YUV 4:2:0     */

#define V4L2_PIX_FMT_HI240   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */

#define V4L2_PIX_FMT_HM12    v4l2_fourcc('H', 'M', '1', '2') /*  8  YUV 4:2:0 16x16 macroblocks */

#define V4L2_PIX_FMT_M420    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */

Regards,


G

0 Kudos

178 Views
HongzhangYang
NXP Employee
NXP Employee

Hi G,

It should be like V4L2_PIX_FMT_YUV440P but I can't find it in linux/videodev2.h. Maybe this format is rarely used now.

Can you configure your camera to use 4:2:0 format?

Regards,

Hongzhang

0 Kudos

178 Views
usrg_s
Contributor II

Hello Hongzhang,

Our camera can't configure to 4:2:0 mjpg.   I will use VPU to decode and use G2D to rotate and convert to RGB, then draw to frame buffer directly.  Thanks for your help.

Regards,

G

0 Kudos

178 Views
HongzhangYang
NXP Employee
NXP Employee

It's a good idea. VPU is good at decoding, and GPU/IPU is more efficient in post processing.

0 Kudos