Jpeg decode very slow for non-yuv420p jpg

Hi, I’m trying to use nvjpeg decode jpg, base on “06_jpeg_decode” samples, I’ve modified it for tests.
First, convert 1 bmp image(1920x1080) to yuv420p/yuv422p/yuv444p yuv data, then use turbojpeg to get 3 different planar jpg files, all encode with 85 quailty.

yuv420p jpg decode: Average in 2.8ms, it works and great.

yuv422p jpg decode: Average in 55.5ms, it takes almost 20x time, much slower than turbojpeg software decode. And it prints for everytime when decoding : “Consume the extra signalling for EOS” “NvMMLiteOpen” “NvMMLiteBlockCreate

yuv444p jpg decode: Average in 57.2ms, same as yuv422p

I read the doc about orin’s NVJPEG, if 444p cost 2X time than 420p is acceptable, but 20X time is so ridiculous, especially much slower than software decode.

The tests are simple, createJPEGDecoder → decodeToFd (cycle 100x), I’ve review the “decodeToFd”, it seems have no options/settings for different planars (it shouldn’t , other hw decoder for jpg are simple too). I’ve add some print at “pixel_format” , so it can recognize different planars. But “jpeg_start_decompress” in jpeglib , can’t see more detail.

So, is there any solutions for jpeg decode with yuv422p/yuv444p? USB Camera’s MJPEG stream all are yuv422p, software decoder not fast enough.

Here are some system info, jetpack6.1 L4T 36.4.0


Here are test code.
test_code.zip (1.5 MB)

Thanks

Hi,
Here are some suggestions for the common issues:

1. Performance

Please run the below command before benchmarking deep learning use case:

$ sudo nvpmodel -m 0
$ sudo jetson_clocks

2. Installation

Installation guide of deep learning frameworks on Jetson:

3. Tutorial

Startup deep learning tutorial:

4. Report issue

If these suggestions don’t help and you want to report an issue to us, please attach the model, command/step, and the customized app (if any) with us to reproduce locally.

Thanks!

My Orin’s NV Power already in “MAXN”, and my problem is about jpeg decoder , not deep learning. Thanks

Hi,
We will set up AGX Orin developer kit and check further. Will update once there is further finding.

Hi,
Please try the attached lib and see if it works

md5sum libnvjpeg.so                                 
e4e4294cd5ab8553cb8690bd96e91c3c  libnvjpeg.so

r36_4_TEST_libnvjpeg_1.zip (145.6 KB)

Thanks

1 Like

Hi, I’ve replaced libnvjpeg.so and did the same test.
yuv420p jpg decode : average in 2.7ms,
yuv422p jpg decode : average in 3.4ms,
yuv444p jpg decode : average in 4.7ms.
For now, decoding speed are normal, thank you very much !

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.