imx6q jpeg encode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx6q jpeg encode

跳至解决方案
2,598 次查看
865410500
Contributor II

Hi,everyone

I wanna do jpeg encode with vpu,is there any demo we can reference ?

标签 (1)
0 项奖励
回复
1 解答
2,483 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Cxy Cxy,

There is not a demo per se, but the unit test included with the Linux BSP supports jpeg decoder and encoder.

Please refer to the following example I found from the L4.1.15 unit_test:

“Take attached 3.jpg as example, it’s format is yuv420.

  1. Decode to yuv

     /unit_tests/mxc_vpu_test.out -E "-i 3.yuv -o test.jpg -f 7 -w 1600 -h 1200 -t 0"

 

  1. Encode to jpg

     /unit_tests/mxc_vpu_test.out -D "-i 3.jpg -o 3.yuv -f 7 -t 0"

 

 

One thing you need to take care is the yuv format.

 In mxc_vpu_test/enc.c, the yuv format is hard code to MODE420. The code is

          if (enc->cmdl->format == STD_MJPG)

                  enc->mjpg_fmt = MODE420;  /* Please change this per your needs */

 

If your yuv format is 422 or 444, you need to change it to MODE422 or MODE444.

In the command, "-t" means CbCr interleaved, if your yuv source is planar, set "-t 0", if it's CbCr interleaved, set "-t 1". "

 

I hope this information helps!

Regards,

在原帖中查看解决方案

3 回复数
2,484 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Cxy Cxy,

There is not a demo per se, but the unit test included with the Linux BSP supports jpeg decoder and encoder.

Please refer to the following example I found from the L4.1.15 unit_test:

“Take attached 3.jpg as example, it’s format is yuv420.

  1. Decode to yuv

     /unit_tests/mxc_vpu_test.out -E "-i 3.yuv -o test.jpg -f 7 -w 1600 -h 1200 -t 0"

 

  1. Encode to jpg

     /unit_tests/mxc_vpu_test.out -D "-i 3.jpg -o 3.yuv -f 7 -t 0"

 

 

One thing you need to take care is the yuv format.

 In mxc_vpu_test/enc.c, the yuv format is hard code to MODE420. The code is

          if (enc->cmdl->format == STD_MJPG)

                  enc->mjpg_fmt = MODE420;  /* Please change this per your needs */

 

If your yuv format is 422 or 444, you need to change it to MODE422 or MODE444.

In the command, "-t" means CbCr interleaved, if your yuv source is planar, set "-t 0", if it's CbCr interleaved, set "-t 1". "

 

I hope this information helps!

Regards,

2,483 次查看
865410500
Contributor II

Hi,gusarambula

   First of all ,thank you so much.

   And I wonder how can get the source code of  mxc_vpu_test.out?

 

0 项奖励
回复
2,483 次查看
865410500
Contributor II

I 've found the source code in imx-test/mxc_vpu_test .

0 项奖励
回复