imx6q jpeg encode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q jpeg encode

Jump to solution
1,155 Views
865410500
Contributor II

Hi,everyone

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

Labels (1)
0 Kudos
1 Solution
1,041 Views
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,

View solution in original post

3 Replies
1,042 Views
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,

1,041 Views
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 Kudos
1,041 Views
865410500
Contributor II

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

0 Kudos