I wanna do jpeg encode with vpu,is there any demo we can reference ?
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.
/unit_tests/mxc_vpu_test.out -E "-i 3.yuv -o test.jpg -f 7 -w 1600 -h 1200 -t 0"
/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!
First of all ,thank you so much.
And I wonder how can get the source code of mxc_vpu_test.out?
I 've found the source code in imx-test/mxc_vpu_test .
Retrieving data ...