A method for parallel decoding and rendering of a sequence of JPEG images

By employing a strategy of concurrent CPU programming and parallel GPU processing, the problem of time-consuming JPEG image sequence decoding and rendering was solved, achieving efficient and fast image sequence processing and improving system performance and user experience.

CN117834903BActive Publication Date: 2026-01-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311703765.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-12
Publication Date
2026-01-27
Estimated Expiration
2043-12-12

AI Technical Summary

Technical Problem

In existing technologies, the decoding and rendering process of JPEG image sequences is time-consuming and fails to fully utilize CPU and GPU resources. In particular, in the case of image sequences, optimization is limited to a single image and does not take the rendering process into account.

Method used

Huffman decoding is performed using a thread allocation strategy based on CPU concurrent programming. Combined with isolated writing and video memory allocation strategies, the GPU is used for parallel processing and IDCT transformation. The final image sequence is generated through OpenGL rendering.

Benefits of technology

It significantly accelerates the decoding and rendering process of JPEG image sequences, improves processing efficiency and quality, reduces redundant data operations, maximizes hardware resource utilization, and achieves efficient real-time image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117834903B_ABST
    Figure CN117834903B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of cloud computing, in particular to a JPEG image sequence parallel decoding and rendering method, comprising the following steps: based on CPU concurrent programming, adopting thread allocation strategy, carrying out Huffman decoding on the received JPEG image, and generating parallel processing frame sequence.In the present application, the CPU concurrent programming and thread allocation strategy are adopted, which greatly improves the Huffman decoding efficiency, saves the preliminary processing time, and significantly improves the throughput and efficiency through independent decoding of each thread.Further, combined with the isolated writing and video memory allocation strategy, the data is efficiently written to the GPU video memory, the data operation is reduced, the speed is improved, the parallel computing capability of the GPU makes the IDCT transformation and YUV to RGB processing rapid and efficient, the time delay is reduced, the output quality is improved, the shared video memory buffer strategy optimizes the hardware resource utilization, the application of OpenGL rendering guarantees the smoothness of rendering and visual effect, and the speed and quality of image processing are significantly improved through the comprehensive optimization, which lays a solid foundation for real-time application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing technology, and in particular to a method for parallel decoding and rendering of JPEG image sequences. Background Technology

[0002] Cloud desktop is a major application of cloud computing. Cloud servers send desktop content to clients as images or video streams. The clients then decode and render the content to view it, providing a user experience similar to operating a local desktop. JPEG is a lossy image encoding format with a high compression ratio. Using JPEG to transmit image data can save bandwidth and increase the bitrate to some extent.

[0003] However, decoding and rendering JPEG image sequences on the client side is a time-consuming operation. On one hand, JPEG uses variable-length Huffman coding, which makes parallel decoding difficult and generally requires serial decoding. On the other hand, JPEG uses DCT transform to change the layout of high and low frequency signals in image blocks; its inverse transform is a very complex convolution operation that requires significant computation time. Besides decoding, the image also needs to be displayed, which involves copying data from memory to GPU memory, often incurring considerable performance overhead.

[0004] Decoding a sequence of JPEG images typically involves loading the images sequentially into a queue, decoding them on the CPU, uploading the resulting RGB data to video memory, and rendering them using graphics APIs (D3D, OpenGL, etc.). This is a serial approach that doesn't fully utilize CPU and GPU resources. Common optimizations focus on JPEG image decoding, such as using assembly language for acceleration, leveraging the GPU for parallel IDCT transformations, or adding delimiters to the Huffman code during encoding to enable parallel decoding. These methods have limitations: firstly, they mostly optimize for single images, neglecting the case of image sequences; secondly, they don't optimize the rendering process. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a parallel decoding and rendering method for JPEG image sequences.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a method for parallel decoding and rendering of JPEG image sequences, comprising the following steps:

[0007] S1: Based on CPU concurrent programming, using a thread allocation strategy, the received JPEG images are Huffman decoded to generate a parallel processing frame sequence;

[0008] S2: Based on the parallel processing frame sequence, an isolated write strategy is adopted to write the decoded data into the GPU memory to generate the decoded frame sequence;

[0009] S3: For GPU memory management, a memory allocation strategy is adopted to pre-allocate memory and map memory data sequences;

[0010] S4: Based on the aforementioned video memory mapping data sequence, a macroblock segmentation algorithm is used for parallel processing to generate a macroblock data sequence;

[0011] S5: Based on the macroblock data sequence, the IDCT transform algorithm is used to recover the pixel matrix and generate two-dimensional pixel matrix image data;

[0012] S6: Based on the two-dimensional pixel matrix image data, a YUV to RGB algorithm is used to convert pixel values ​​and generate an RGB pixel value data sequence;

[0013] S7: Based on the RGB pixel value data sequence, use the OpenGL rendering method to perform sequence rendering and generate the final rendered image sequence.

[0014] As a further aspect of the present invention, the thread allocation strategy specifically refers to pre-allocating a thread for each JPEG image to be decoded; the isolation writing strategy specifically refers to maintaining the isolation of each frame of image data during the writing process; the video memory allocation strategy includes pre-allocating a header and a body; the header is used to store auxiliary decoding data including image sequence number, width, height, and quantization parameter table; the body is used to store the decoded image data; the pixel matrix recovery specifically refers to restoring one-dimensional image data into a two-dimensional pixel matrix; the pixel value conversion specifically refers to converting the YUV pixel value of each macroblock into an RGB pixel value; and the sequence rendering specifically refers to rendering the RGB data in the buffer using the OpenGL API according to the order of the image sequence.

[0015] As a further aspect of the present invention, the parallel processing frame sequence specifically refers to the simultaneous decoding and processing of multiple JPEG images in parallel. The decoded frame sequence specifically refers to storing the Huffman-decoded data in the GPU memory. The macroblock data sequence specifically refers to dividing the image data into multiple groups of 8×8 macroblocks.

[0016] As a further aspect of the present invention, the steps of performing Huffman decoding on the received JPEG image and generating a parallel processing frame sequence based on CPU concurrent programming and a thread allocation strategy are as follows:

[0017] S101: Based on the CPU concurrent programming model, it uses a thread pool scheduling algorithm to generate a decoding task sequence;

[0018] S102: Based on the decoding task sequence, a priority sorting algorithm is used to generate a priority sorted decoding task sequence;

[0019] S103: Based on the priority-sorted decoding task sequence, the Huffman decoding algorithm is used to generate a Huffman decoding frame sequence;

[0020] S104: Based on the Huffman decoded frame sequence and using a parallel execution framework, generate a parallel processing frame sequence.

[0021] As a further aspect of the present invention, based on the parallel processing frame sequence, an isolated write strategy is adopted to write the decoded data into the GPU memory, and the specific steps for generating the decoded frame sequence are as follows:

[0022] S201: Based on the parallel processing frame sequence, memory isolation technology is used to generate an isolated video memory write sequence;

[0023] S202: Based on the isolated video memory write sequence, a data stream synchronization algorithm is used to generate a synchronized video memory data sequence;

[0024] S203: Based on the synchronized video memory data sequence, an optimized video memory layout sequence is generated using a video memory optimization strategy;

[0025] S204: Based on the optimized memory layout sequence, GPU parallel writing technology is used to generate the decoded frame sequence.

[0026] As a further aspect of the present invention, for the management of GPU memory, a memory allocation strategy is adopted to perform memory pre-allocation, and the specific steps of memory mapping data sequence are as follows:

[0027] S301: Based on GPU resource requirements, a dynamic video memory allocation algorithm is adopted, and through resource requirement analysis, video memory resources are dynamically allocated to generate a dynamic video memory allocation sequence.

[0028] S302: Based on the dynamic video memory allocation sequence, video memory pre-allocation technology is adopted, and video memory pre-allocation is performed through video memory resource mapping to generate a pre-allocated video memory address mapping sequence;

[0029] S303: Based on the pre-allocated video memory address mapping sequence, a video memory defragmentation algorithm is adopted, and a video memory reorganization strategy is used to defragment the video memory and generate an optimized video memory mapping sequence.

[0030] S304: Based on the optimized memory mapping sequence, a memory compression algorithm is adopted, and data compression technology is used to compress the memory data to generate a memory mapping data sequence.

[0031] As a further aspect of the present invention, based on the memory mapping data sequence, the macroblock segmentation algorithm is used for parallel processing to generate the macroblock data sequence. The specific steps are as follows:

[0032] S401: Based on the aforementioned video memory mapping data sequence, an image preprocessing algorithm is used, and a decompressed image data sequence is generated using data decompression technology;

[0033] S402: Based on the decompressed image data sequence, a macroblock segmentation algorithm is adopted, and the image data macroblocks are divided using a fixed-size segmentation technique to generate an initial macroblock data sequence;

[0034] S403: Based on the initial macroblock data sequence, a GPU parallel processing strategy is adopted, and a multi-threaded processing technique is used to generate a parallel-processed macroblock sequence;

[0035] S404: Based on the macroblock sequence after parallel processing, a boundary optimization algorithm is adopted, and the macroblock boundaries are optimized through overlapping region analysis technology to generate a macroblock data sequence.

[0036] As a further aspect of the present invention, the steps for generating two-dimensional pixel matrix image data by performing pixel matrix recovery based on the macroblock data sequence using the IDCT transform algorithm are as follows:

[0037] S501: Based on the macroblock data sequence, the pixel matrix is ​​recovered using the inverse discrete cosine transform algorithm, and an IDCT transform pixel matrix sequence is generated;

[0038] S502: Based on the IDCT transform pixel matrix sequence, sharpening and noise reduction algorithms are used to enhance image details and reduce noise, generating a processed pixel matrix sequence.

[0039] S503: Based on the processed pixel matrix sequence, perform data reconstruction and color space conversion, and generate corrected pixel matrix image data;

[0040] S504: Based on the corrected pixel matrix image data, perform data reconstruction, prepare for color conversion, and generate complete two-dimensional pixel matrix image data.

[0041] As a further aspect of the present invention, the step of converting pixel values ​​and generating an RGB pixel value data sequence based on the two-dimensional pixel matrix image data using a YUV to RGB algorithm is as follows:

[0042] S601: Based on the two-dimensional pixel matrix image data, a color space conversion algorithm is used to convert YUV to RGB and generate a preliminary RGB pixel value data sequence;

[0043] S602: Based on the preliminary RGB pixel value data sequence, perform color calibration and generate a calibrated RGB pixel value data sequence;

[0044] S603: Based on the calibrated RGB pixel value data sequence, perform pixel synchronization processing to prevent image tearing and generate a synchronized RGB pixel value data sequence;

[0045] S604: Based on the synchronized RGB pixel value data sequence, perform data packaging and buffering, prepare for image rendering, and generate the final RGB pixel value data sequence.

[0046] As a further aspect of the present invention, the steps for generating the final rendered image sequence by performing sequence rendering using the OpenGL rendering method based on the RGB pixel value data sequence are as follows:

[0047] S701: Based on the RGB pixel value data sequence, data caching technology is used to store the data in the graphics hardware and generate buffered RGB data;

[0048] S702: Based on the buffered RGB data, a vertex shading algorithm is used to perform preliminary rendering of the image and generate initial rendered image data;

[0049] S703: Based on the initial rendered image data, fragment shading technology is applied to complete the detailed rendering of the image and generate fragment rendered image data;

[0050] S704: Based on the fragment rendering image data, perform the OpenGL rendering process, output the image, and obtain the final rendered image sequence.

[0051] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0052] In this invention, CPU concurrent programming and thread allocation strategies effectively accelerate Huffman decoding, significantly saving initial processing time. This acceleration provides a key boost to overall performance. Decoding is performed in parallel on the CPU, with each thread decoding independently, greatly enhancing throughput and efficiency. Combined with isolated write and memory allocation strategies, data is written to GPU memory efficiently and smoothly. This strategy optimizes memory utilization, reduces redundant data operations, and further accelerates the process. The GPU can simultaneously perform large-scale IDCT transformations and YUV to RGB conversions. Because GPUs are designed for parallel computing, they are far more efficient than CPUs when performing such intensive calculations. This parallel processing means rapidly processing large amounts of data, reducing latency, and maintaining high-quality output. Decoded data is rendered directly on the GPU, and the shared memory buffer strategy reduces redundant copying and maximizes hardware resource utilization. Through OpenGL rendering, efficient data preparation ensures smooth, high-quality rendering. These optimizations significantly improve both the quality and speed of the image processing workflow, providing technical support for real-time image processing. Attached Figure Description

[0053] Figure 1 This is a schematic diagram of the main steps of the present invention;

[0054] Figure 2 This is a detailed schematic diagram of S1 of the present invention;

[0055] Figure 3 This is a detailed schematic diagram of S2 of the present invention;

[0056] Figure 4 This is a detailed schematic diagram of S3 of the present invention;

[0057] Figure 5 This is a detailed schematic diagram of S4 of the present invention;

[0058] Figure 6 This is a detailed schematic diagram of S5 of the present invention;

[0059] Figure 7 This is a detailed schematic diagram of S6 of the present invention;

[0060] Figure 8 This is a detailed schematic diagram of S7 of the present invention. Detailed Implementation

[0061] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0062] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0063] Example 1

[0064] Please see Figure 1 This invention provides a technical solution: a method for parallel decoding and rendering of JPEG image sequences, comprising the following steps:

[0065] S1: Based on CPU concurrent programming, using a thread allocation strategy, the received JPEG images are Huffman decoded to generate a parallel processing frame sequence;

[0066] S2: Based on parallel processing of frame sequences, an isolated write strategy is adopted to write decoded data into GPU memory and generate decoded frame sequences.

[0067] S3: For GPU memory management, a memory allocation strategy is adopted to pre-allocate memory and map memory data sequences;

[0068] S4: Based on the video memory mapping data sequence, a macroblock segmentation algorithm is used for parallel processing to generate a macroblock data sequence;

[0069] S5: Based on macroblock data sequences, the IDCT transform algorithm is used to restore the pixel matrix and generate two-dimensional pixel matrix image data;

[0070] S6: Based on two-dimensional pixel matrix image data, a YUV to RGB conversion algorithm is used to convert pixel values ​​and generate an RGB pixel value data sequence;

[0071] S7: Based on the RGB pixel value data sequence, it uses OpenGL rendering method to perform sequence rendering and generate the final rendered image sequence.

[0072] The thread allocation strategy specifically refers to pre-allocating a thread for each JPEG image to be decoded. The isolation write strategy specifically refers to maintaining the isolation of each frame of image data during the write process. The video memory allocation strategy includes pre-allocating the header and body. The header is used to store auxiliary decoding data including the image sequence number, width, height, and quantization parameter table. The body is used to store the decoded image data. The pixel matrix restoration specifically refers to restoring the one-dimensional image data into a two-dimensional pixel matrix. The pixel value conversion specifically refers to converting the YUV pixel values ​​of each macroblock into RGB pixel values. The sequence rendering specifically refers to using the OpenGL API to render the RGB data in the buffer according to the order of the image sequence.

[0073] Parallel processing of frame sequences specifically refers to the simultaneous decoding and processing of multiple JPEG images in parallel. The decoded frame sequence specifically involves storing the Huffman-decoded data in the GPU memory, while the macroblock data sequence specifically involves dividing the image data into multiple 8×8 macroblocks.

[0074] First, parallel Huffman decoding of JPEG images is performed using CPU concurrent programming and thread allocation strategies, significantly accelerating the processing speed. This method fully utilizes the computing power of multi-core CPUs, allowing each core to work simultaneously, thus significantly improving decoding efficiency. The strategy of assigning one thread to each JPEG image ensures data independence during decoding, avoids data contention between threads, reduces thread synchronization overhead, and further enhances system response speed.

[0075] Secondly, regarding GPU memory utilization, efficient data management was achieved through isolated write and memory allocation strategies. Isolated writes ensure the independence of image data for each frame during parallel processing, avoiding write conflicts. Pre-allocation of memory, by dividing memory into header and body, not only optimizes memory usage but also reduces the overhead and fragmentation issues associated with dynamic memory allocation, which is particularly important for real-time image processing applications.

[0076] Parallel processing and pixel matrix restoration of the image are achieved through macroblock segmentation and IDCT transform algorithms, along with pixel value conversion using a YUV-to-RGB algorithm. The precise implementation of these algorithms ensures high fidelity from encoding to decoding. The recovered two-dimensional pixel matrix image data retains the original color and detail of the JPEG image, while the conversion to RGB format facilitates direct rendering on display devices.

[0077] Finally, the OpenGL rendering method not only provides hardware-accelerated image rendering capabilities but also leverages the efficiency of modern graphics APIs, resulting in smooth and high-quality image sequence rendering. This means users can enjoy richer and more realistic visual effects.

[0078] Please see Figure 2 Based on CPU concurrent programming and employing a thread allocation strategy, the specific steps for performing Huffman decoding on received JPEG images and generating parallel processing frame sequences are as follows:

[0079] S101: Based on the CPU concurrent programming model, it uses a thread pool scheduling algorithm to generate a decoding task sequence;

[0080] S102: Based on the decoding task sequence, a priority sorting algorithm is used to generate a priority sorted decoding task sequence;

[0081] S103: Based on the priority-sorted decoding task sequence, the Huffman decoding algorithm is used to generate the Huffman decoding frame sequence;

[0082] S104: Generates a parallel processing frame sequence based on Huffman decoding frame sequence and using a parallel execution framework.

[0083] First, by employing a thread pool scheduling algorithm to generate a decoding task sequence, thread resources can be effectively managed, improving system performance and response speed. Second, by using a task priority sorting algorithm to order the decoding task sequence, important tasks are ensured to be executed first, improving overall decoding efficiency and user experience. Then, the Huffman decoding algorithm is used to perform decoding operations on each task, reducing image data storage space and transmission bandwidth, and improving the image compression ratio. Finally, a parallel execution framework is used to simultaneously allocate multiple decoding tasks to different threads for processing, further improving decoding efficiency and speed, and leveraging the advantages of multi-core CPUs to accelerate the entire decoding process.

[0084] Please see Figure 3 Based on parallel processing of frame sequences, and employing an isolated write strategy, the specific steps for writing decoded data into GPU memory to generate the decoded frame sequence are as follows:

[0085] S201: Based on parallel processing of frame sequences, it uses memory isolation technology to generate isolated video memory write sequences;

[0086] S202: Based on isolated video memory write sequence, a data stream synchronization algorithm is used to generate a synchronized video memory data sequence;

[0087] S203: Based on the synchronized video memory data sequence, an optimized video memory layout sequence is generated using a video memory optimization strategy;

[0088] S204: Based on the optimized memory layout sequence, GPU parallel writing technology is used to generate the decoded frame sequence.

[0089] First, memory isolation technology generates isolated video memory write sequences, avoiding data conflicts and race conditions between different frames and improving data consistency and reliability. Second, a data flow synchronization algorithm generates synchronized video memory data sequences, ensuring that the data of each frame is arranged in the correct order, guaranteeing the correctness and integrity of the decoded frame sequence. Then, a video memory optimization strategy generates an optimized video memory layout sequence, improving video memory utilization and access efficiency, and accelerating the generation process of the decoded frame sequence. Finally, GPU parallel write technology is used to generate the decoded frame sequence, leveraging the parallel computing capabilities of the GPU to achieve efficient data transmission and processing, significantly shortening the generation time of the decoded frame sequence.

[0090] Please see Figure 4 For GPU memory management, a memory allocation strategy is adopted, including memory pre-allocation and the specific steps of the memory mapping data sequence:

[0091] S301: Based on GPU resource requirements, a dynamic video memory allocation algorithm is adopted, and through resource requirement analysis, video memory resources are dynamically allocated to generate a dynamic video memory allocation sequence.

[0092] S302: Based on the dynamic video memory allocation sequence, video memory pre-allocation technology is adopted, and video memory pre-allocation is performed through video memory resource mapping to generate a pre-allocated video memory address mapping sequence;

[0093] S303: Based on the pre-allocated video memory address mapping sequence, a video memory defragmentation algorithm is adopted, and a video memory reorganization strategy is used to defragment the video memory and generate an optimized video memory mapping sequence.

[0094] S304: Based on the optimized memory mapping sequence, a memory compression algorithm is adopted, and data compression technology is used to compress the memory data to generate a memory mapping data sequence.

[0095] First, based on GPU resource requirements, resource requirement analysis determines the size and amount of video memory needed for each task. Second, video memory resource mapping maps pre-allocated video memory addresses to the corresponding tasks. This avoids frequent video memory allocation and deallocation operations during task execution, improving performance and efficiency. Next, a video memory reorganization strategy merges and organizes scattered video memory fragments to reduce their impact on video memory utilization, improving memory utilization and reducing waste. Finally, data compression technology reduces the size of video memory data, thereby saving video memory space and improving data transfer efficiency.

[0096] Please see Figure 5 Based on the video memory mapping data sequence, a macroblock segmentation algorithm is used for parallel processing to generate the macroblock data sequence. The specific steps are as follows:

[0097] S401: Based on the video memory mapping data sequence, an image preprocessing algorithm is adopted, and a decompressed image data sequence is generated through data decompression technology;

[0098] S402: Based on the decompressed image data sequence, a macroblock segmentation algorithm is used, and the image data is divided into macroblocks using a fixed-size segmentation technique to generate an initial macroblock data sequence;

[0099] S403: Based on the initial macroblock data sequence, a GPU parallel processing strategy is adopted, and a multi-threaded processing technique is used to generate a parallel processed macroblock sequence;

[0100] S404: Based on the macroblock sequence after parallel processing, a boundary optimization algorithm is used, and overlapping region analysis technology is used to optimize the macroblock boundaries to generate a macroblock data sequence.

[0101] First, the compressed image data in the video memory is decompressed into the original image data sequence using data decompression technology. Next, the image data is divided into multiple macroblocks of the same size using a fixed-size partitioning technique. Each macroblock contains a certain number of pixel values. Then, each macroblock is assigned to a different thread for processing using multi-threaded processing. Each thread is responsible for processing the data of one macroblock. During parallel processing, boundary optimization algorithms can be used to optimize the macroblock boundaries. Overlap region analysis is used to determine the overlapping areas between adjacent macroblocks and perform corresponding optimization processing, which can improve processing efficiency and accuracy. Finally, based on the macroblock sequence after parallel processing, the final macroblock data sequence is generated.

[0102] Please see Figure 6 The specific steps for generating two-dimensional pixel matrix image data by using the IDCT transform algorithm to recover the pixel matrix based on macroblock data sequences are as follows:

[0103] S501: Based on macroblock data sequences, the inverse discrete cosine transform algorithm is used to recover the pixel matrix and generate an IDCT transform pixel matrix sequence;

[0104] S502: Based on the IDCT transform pixel matrix sequence, sharpening and noise reduction algorithms are used to enhance image details and reduce noise, generating a processed pixel matrix sequence.

[0105] S503: Based on the processed pixel matrix sequence, perform data reconstruction and color space conversion, and generate corrected pixel matrix image data;

[0106] S504: Based on the corrected pixel matrix image data, perform data reconstruction, prepare for color conversion, and generate complete two-dimensional pixel matrix image data.

[0107] First, the macroblock data represented in the frequency domain is converted back to a pixel matrix sequence represented in the spatial domain using IDCT transform. Next, a sharpening algorithm enhances the image's edges and details; a noise reduction algorithm lowers the noise level in the image, improving image quality and clarity. Then, data reconstruction converts the pixel matrix into a complete two-dimensional array; color space conversion transforms the image from the original color space to the target color space, ensuring the generated pixel matrix image data is consistent with the original image. Finally, data reconstruction converts the pixel matrix into a data format suitable for display and storage; color conversion preparation transforms the image from the source color space to the target color space, ensuring the generated complete two-dimensional pixel matrix image data can be correctly displayed and processed.

[0108] Please see Figure 7 The specific steps for converting pixel values ​​and generating an RGB pixel value data sequence based on two-dimensional pixel matrix image data and using a YUV to RGB conversion algorithm are as follows:

[0109] S601: Based on two-dimensional pixel matrix image data, a color space conversion algorithm is used to convert YUV to RGB and generate a preliminary RGB pixel value data sequence;

[0110] S602: Based on the initial RGB pixel value data sequence, perform color calibration and generate a calibrated RGB pixel value data sequence;

[0111] S603: Based on the calibrated RGB pixel value data sequence, perform pixel synchronization processing to prevent image tearing and generate a synchronized RGB pixel value data sequence;

[0112] S604: Based on the synchronized RGB pixel value data sequence, perform data packing and buffering, prepare for image rendering, and generate the final RGB pixel value data sequence.

[0113] First, converting the YUV color space to the RGB color space better adapts to the human eye's color perception characteristics. Compared to the combination of luminance signal Y and chromaticity signals U and V, the RGB color space better aligns with our intuitive understanding of the three primary colors (red, green, and blue), and can more accurately reproduce the color information of an image. Second, performing color calibration can further optimize the image's color performance. Since the color characteristics of different devices or monitors may vary, calibration maps the image's colors to a standard color space, making the image colors displayed on different devices more consistent and accurate. Furthermore, pixel synchronization processing can prevent image tearing. On high refresh rate displays, if the image rendering speed cannot keep up with the monitor's refresh rate, tearing may occur, meaning the same frame of image is split into two halves and displayed separately on the screen. By synchronizing pixels, smooth image display on the monitor can be ensured, avoiding tearing. Finally, data packing and buffering can improve image rendering efficiency. By packing and buffering pixel value data sequences, the number of data transmissions and latency can be reduced, improving the speed and performance of image rendering. This is particularly important for applications with high real-time requirements (such as video playback and games).

[0114] Please see Figure 8 The specific steps for generating the final rendered image sequence based on the RGB pixel value data sequence using OpenGL rendering methods are as follows:

[0115] S701: Based on the RGB pixel value data sequence, it uses data caching technology to store the data in the graphics hardware and generate buffered RGB data;

[0116] S702: Based on the buffered RGB data, the vertex shading algorithm is used to perform the initial rendering of the image and generate the initial rendered image data;

[0117] S703: Based on the initial rendered image data, fragment shading technology is applied to complete the detailed rendering of the image and generate fragment rendered image data;

[0118] S704: Based on fragment rendering image data, it performs the OpenGL rendering process, outputs the image, and obtains the final rendered image sequence.

[0119] First, by storing RGB pixel values ​​in the graphics hardware using data caching technology, data reading and transmission speeds are accelerated, data transmission latency is reduced, and rendering efficiency is improved. Second, using vertex shading algorithms for initial image rendering allows for preprocessing and transformation of the image using vertex shaders, reducing image processing complexity and computational load, and improving rendering efficiency and quality. Then, fragment shading technology is applied to complete the detailed rendering of the image. Fragment shaders perform precise calculations and drawing on each pixel, achieving more refined and realistic image effects, improving rendering quality and realism. Finally, the OpenGL rendering pipeline outputs the final rendered image sequence. OpenGL provides a complete rendering pipeline and rich rendering functions, enabling various complex rendering effects and operations.

[0120] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for parallel decoding and rendering of JPEG image sequences, characterized in that, Includes the following steps: Based on CPU concurrent programming and employing a thread allocation strategy, the received JPEG images are Huffman decoded to generate a parallel processing frame sequence. Based on the parallel processing frame sequence, an isolated write strategy is adopted to write the decoded data into the GPU memory, thereby generating the decoded frame sequence. For GPU memory management, a memory allocation strategy is adopted, including memory pre-allocation and memory mapping data sequence. Based on the aforementioned video memory mapping data sequence, a macroblock segmentation algorithm is used for parallel processing to generate a macroblock data sequence; Based on the macroblock data sequence, the IDCT transform algorithm is used to recover the pixel matrix and generate two-dimensional pixel matrix image data. Based on the two-dimensional pixel matrix image data, a YUV to RGB algorithm is used to convert pixel values ​​and generate an RGB pixel value data sequence. Based on the RGB pixel value data sequence, OpenGL rendering is used to perform sequence rendering and generate the final rendered image sequence. The thread allocation strategy specifically refers to pre-allocating one thread for each JPEG image to be decoded. The isolation write strategy specifically maintains the isolation of each frame of image data during the write process. The video memory allocation strategy includes pre-allocating a header and a body. The header stores auxiliary decoding data including the image sequence number, width, height, and quantization parameter table. The body stores the decoded image data. The pixel matrix recovery specifically restores the one-dimensional image data into a two-dimensional pixel matrix. The value conversion specifically involves converting the YUV pixel values ​​of each macroblock to RGB pixel values. The sequence rendering specifically involves rendering the RGB data in the buffer using the OpenGL API according to the order of the image sequence. The parallel processing frame sequence specifically refers to the simultaneous decoding and processing of multiple JPEG images in parallel. The decoded frame sequence specifically involves storing the Huffman-decoded data in the GPU memory. The macroblock data sequence specifically involves dividing the image data into multiple groups of 8×8 macroblocks. Based on CPU concurrent programming and using a thread allocation strategy, the steps for performing Huffman decoding on the received JPEG images to generate the parallel processing frame sequence are as follows: Based on the CPU concurrent programming model, a thread pool scheduling algorithm is used to generate a decoding task sequence; Based on the decoding task sequence, a priority sorting algorithm is used to generate a priority sorted decoding task sequence; Based on the priority-sorted decoding task sequence, the Huffman decoding algorithm is used to generate a Huffman decoding frame sequence. Based on the Huffman decoded frame sequence and using a parallel execution framework, a parallel processing frame sequence is generated.

2. The parallel decoding and rendering method for JPEG image sequences according to claim 1, characterized in that, Based on the aforementioned parallel processing frame sequence, and employing an isolated write strategy, the steps for writing decoded data into GPU memory and generating the decoded frame sequence are as follows: Based on the parallel processing frame sequence, memory isolation technology is used to generate isolated video memory write sequences; Based on the isolated video memory write sequence, a data stream synchronization algorithm is used to generate a synchronized video memory data sequence. Based on the synchronized video memory data sequence, a video memory optimization strategy is adopted to generate an optimized video memory layout sequence. Based on the optimized memory layout sequence, GPU parallel writing technology is used to generate the decoded frame sequence.

3. The parallel decoding and rendering method for JPEG image sequences according to claim 1, characterized in that, For GPU memory management, a memory allocation strategy is adopted, including memory pre-allocation and the specific steps of memory mapping data sequence: Based on GPU resource requirements, a dynamic video memory allocation algorithm is adopted, and through resource requirement analysis, video memory resources are dynamically allocated to generate a dynamic video memory allocation sequence. Based on the dynamic video memory allocation sequence, video memory pre-allocation technology is adopted, and video memory pre-allocation is performed through video memory resource mapping to generate a pre-allocated video memory address mapping sequence. Based on the pre-allocated video memory address mapping sequence, a video memory defragmentation algorithm is adopted, and a video memory reorganization strategy is used to defragment the video memory and generate an optimized video memory mapping sequence. Based on the optimized memory mapping sequence, a memory compression algorithm is used, and data compression technology is employed to compress the memory data, thereby generating a memory mapping data sequence.

4. The parallel decoding and rendering method for JPEG image sequences according to claim 1, characterized in that, Based on the aforementioned video memory mapping data sequence, the macroblock segmentation algorithm is used for parallel processing to generate the macroblock data sequence. The specific steps are as follows: Based on the aforementioned video memory mapping data sequence, an image preprocessing algorithm is employed, and a decompressed image data sequence is generated using data decompression technology. Based on the decompressed image data sequence, a macroblock segmentation algorithm is used, and a fixed-size segmentation technique is employed to divide the image data into macroblocks, generating an initial macroblock data sequence. Based on the initial macroblock data sequence, a GPU parallel processing strategy is adopted, and a multi-threaded processing technique is used to generate a parallel processed macroblock sequence. Based on the macroblock sequence after parallel processing, a boundary optimization algorithm is used, and overlapping region analysis technology is employed to optimize the macroblock boundaries, thereby generating a macroblock data sequence.

5. The parallel decoding and rendering method for JPEG image sequences according to claim 1, characterized in that, Based on the macroblock data sequence, the steps for performing pixel matrix recovery and generating two-dimensional pixel matrix image data using the IDCT transform algorithm are as follows: Based on the macroblock data sequence, the inverse discrete cosine transform algorithm is used to recover the pixel matrix and generate an IDCT transform pixel matrix sequence. Based on the IDCT transform pixel matrix sequence, sharpening and noise reduction algorithms are used to enhance image details and reduce noise, generating a processed pixel matrix sequence. Based on the processed pixel matrix sequence, data reconstruction and color space conversion are performed to generate corrected pixel matrix image data. Based on the corrected pixel matrix image data, data reconstruction is performed, color conversion is prepared, and complete two-dimensional pixel matrix image data is generated.

6. The parallel decoding and rendering method for JPEG image sequences according to claim 1, characterized in that, Based on the aforementioned two-dimensional pixel matrix image data, the specific steps for converting pixel values ​​using a YUV to RGB algorithm to generate an RGB pixel value data sequence are as follows: Based on the two-dimensional pixel matrix image data, a color space conversion algorithm is used to convert YUV to RGB and generate a preliminary RGB pixel value data sequence. Based on the initial RGB pixel value data sequence, color calibration is performed, and a calibrated RGB pixel value data sequence is generated; Based on the calibrated RGB pixel value data sequence, pixel synchronization processing is performed to prevent image tearing and generate a synchronized RGB pixel value data sequence. Based on the synchronized RGB pixel value data sequence, data is packaged and buffered to prepare for image rendering and generate the final RGB pixel value data sequence.

7. The parallel decoding and rendering method for JPEG image sequences according to claim 1, characterized in that, Based on the RGB pixel value data sequence, the steps for performing sequence rendering using the OpenGL rendering method to generate the final rendered image sequence are as follows: Based on the RGB pixel value data sequence, data caching technology is used to store the data in the graphics hardware and generate buffered RGB data. Based on the buffered RGB data, a vertex shading algorithm is used to perform preliminary rendering of the image and generate initial rendered image data. Based on the initial rendered image data, fragment shading technology is applied to complete the detailed rendering of the image and generate fragment rendered image data; based on the fragment rendered image data, the OpenGL rendering process is performed to output the image and obtain the final rendered image sequence.

Citation Information

Patent Citations

  • Method for high speed JPEG decoding

    CN101626504A

  • JPEG 2000 image uncompressing implementation method based on GPU

    CN104185030A