The application relates to a general-purpose GPU-oriented
JPEG decoding
batch processing and double-buffer
pipeline scheduling method, belongs to the field of heterogeneous computing and
image processing, and comprises the following steps: obtaining code
stream data of a to-be-decoded
JPEG image; performing entropy decoding and
inverse quantization on the code
stream data by a CPU to obtain a plurality of
DCT coefficient blocks; if the size of the to-be-decoded
JPEG image is not smaller than a preset size threshold, the
DCT coefficient blocks are cached in a ring buffer located in a
host memory; the state of the ring buffer is continuously monitored; when a preset batch triggering condition is met and a GPU is detected to be available, the
DCT coefficient blocks in the ring buffer are batch copied to GPU
display memory; based on the DCT coefficient blocks in the GPU
display memory, integer IDCT transformation and
color space conversion calculation are performed by the GPU to obtain an original image corresponding to the to-be-decoded JPEG image, and the original image is read back to the
host memory; wherein the double-buffer pipeline is adopted to perform batch
copying of the DCT coefficient blocks, integer IDCT transformation,
color space conversion calculation and reading back of the original image. Efficient real-time decoding is realized.