JPEG 编解码耗时统计

您好,以下描述的是JPEG编解码耗时统计,请问从数据上是否合理?是否存在可优化空间?

JPEG编解码耗时统计:

  1. JPEG编码接口调用关系:NvBufSurfaceFromFd → Raw2NvBufSurface → encodeFromFd
JPEG编码耗时统计:

* ORIN/200万像素Camera: 4465.84us
* ORIN/800万像素Camera: 11747.72us
  1. JPEG解码接口调用关系:decodeToFd → NvBufSurfaceFromFd → NvBufSurface2Raw → gpuConvertI420toBGR
JPEG解码耗时统计:

* ORIN/200万像素Camera: 8962.67us
* ORIN/800万像素Camera: 28447.52us

Hi,
For encoding, the flow looks optimal.

For decoding, you may try like:

decodeToFd → NvBufSurfaceFromFd → NvBufSurfTransform → RGBA → convert RGBA to BGR through CUDA code

This may have further performance enhancement but you would need to implement converting RGBA to BGR through CUDA.

请问:从 … NvBufSurfTransform→ RGBA → convert RGBA to BGR through CUDA code,有使用示例吗?

Hi,
There is no existing CUDA code for converting RGBA to BGR, and you would need to implement it on your own.

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

Hi,

convert_bgr.zip (4.7 KB)

md5sum convert_bgr.zip 
51ae0331b592fc8fc2204255e7f0e03f  convert_bgr.zip

Please refer to the example.
Verified environment:

  • JetPack6.1/6.2

In the zip file contain:

convert_bgr
├── jpeg_convert_bgr.cpp
└── patch
  • move patch and jpeg_convert_bgr.cpp to /usr/src/jetson_multimedia_api/samples/06_jpeg_decode/
  • execute below command
sudo git apply patch
sudo make
# save the Image with raw format
./jpeg_decode num_files 1 ${Image}.jpg ${Image} --convert-bgr
  • After above commands will generate ${Image}.bgr, and you could use YUView to check the format

Thanks