A data storage method supporting multi-standard decoding
By splitting the HDR stream pixel values into high and low bits to store separately, combined with the SDR stream storage method, the storage space and bandwidth problems of the video decoding chip when compatible with SDR and HDR video formats are solved, and efficient storage of multi-standard video decoding is realized.
Patent Information
- Application Number
- CN202310125451.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-03
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2043-02-03
AI Technical Summary
The existing video decoding chips are risked to be eliminated when supporting a single encoding standard, and the storage space and bandwidth requirements are too large when processing HDR videos, making it difficult to be compatible with SDR and HDR video formats.
A data storage method is adopted to separate the pixel values of the HDR stream into high and low bits. Combined with the storage method of the SDR stream, the storage space and bandwidth requirements are reduced, and multi-standard video decoding is supported.
It realizes that while reducing storage space, it is compatible with SDR and HDR video formats, reducing the storage volume and bandwidth pressure of the video decoding chip, and ensuring the video playback effect.
Smart Images

Figure CN116156195B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of multimedia signal processing, and in particular relates to a method for storing video decoding data. Background Art
[0002] Currently, the most widely used video coding and compression technologies are primarily based on a number of video coding standards. These include: H.262 / MPEG-2, which drove the transition from analog to digital television; H.264 / AVC, which enabled the widespread adoption of high-definition and internet video; and H.265 / HEVC, which successfully promoted the adoption of 4K ultra-high-definition video. These standards are the result of joint efforts by the ISO / IEC Moving Picture Experts Group and the ITU-T Video Coding Experts Group. Other standards include Microsoft's VC-1 standard; Google's VP8 and VP9 standards; and the AVS series of standards developed by the Chinese Digital Audio and Video Codec Technical Standards Working Group. With the increasing adoption of video-related products such as HDTV, satellite TV, HD set-top boxes, and digital video broadcasting, various video coding standards will coexist for a considerable period of time. Video decoding chips that only support a single coding standard will be eliminated from the market due to their limited functionality.
[0003] Simply increasing the number of pixels without changing the pixel color gamut will result in UHD video looking inferior to HD on TV. Therefore, dynamic range (DR) technology has evolved with the development of video coding. Standard dynamic range (SDR) is the most commonly used standard in HDTV today. Traditional SDR TVs typically display brightness between 0.1 and 100 nits, with a dynamic range of approximately 1000:1. While it can preserve many of the brightness variations found in natural images, making them appear realistic, it falls far short of capturing the many bright and dark details found in natural images. With the advancement of UHD TV technology, dynamic range has also been increasing towards high dynamic range (HDR), with a dynamic range of approximately 200,000:1. HDR TVs require a peak brightness of no less than 1000 nits and a black level of no more than 0.005 nits. Therefore, high dynamic range video offers a wider dynamic range of brightness within a single frame, resulting in darker blacks and brighter highlights. This provides viewers with stronger contrast, a wider brightness range, and more vibrant, vibrant images, resulting in a greater visual impact.
[0004] Each pixel in an SDR image can be represented using 24 bits. In YUV space, luminance (Y) is represented with an 8-bit color depth, and chroma (U and V) are each represented with an 8-bit color depth. White is encoded as (Y: 255, U: 255, V: 255). To better depict the real world, HDR images use a color depth higher than 8 bits to represent each color channel in YUV space. Representative technologies currently in development include perceptual quantizer (PQ)-based HDR formats, including HDR10, HDR10+, Dolby Vision, and Hybrid Log Gamma (HLG). These HDR technologies mostly use a 10-bit color depth, while dual-layer Dolby Vision uses a higher 12-bit color depth. This higher color depth allows for more and smoother color transitions, resulting in more detailed images. However, since HDR10, HLG, and other standards are licensed free, their adoption is more widespread than the licensing fees for Dolby Vision, leading to the widespread use of 10-bit color depth in HDR video. However, 10-bit color depth requires more hardware storage and bandwidth than 8-bit color depth. Existing HDR video uses two bytes per color channel to represent image pixels, significantly increasing the frame memory size and chip area required for video decoding chips. Furthermore, existing video coding standards such as H.264 / AVC, H.265 / HEVC, VP9, and AC-1 already support HDR video encoding and decoding. Given the increasing cost pressures on consumer electronics, it is necessary to find a data storage method that can support multi-standard video decoding, HDR support, and SDR compatibility, while also reducing data storage requirements. Summary of the Invention
[0005] The purpose of the present invention is to address the deficiencies of the existing technology and provide a data storage method that can support multi-standard video decoding, support multi-bit HDR data format, be compatible with SDR data format, and reduce the amount of data storage.
[0006] In order to achieve the above object, the storage method of the present invention includes the following steps:
[0007] Step (1) obtaining image parameters according to the video type;
[0008] Step (2) registering the frame memory space, including the luminance space and the chrominance space, according to the frame memory quantity required by the video decoder and the frame memory related parameters in the image parameters;
[0009] Step (3) decoding a frame image or a field image in a video decoder according to the encoding method used by the video compression stream;
[0010] Step (4) storing a frame of decoded data into a corresponding position in the frame storage space according to the data type;
[0011] Step (5) outputting part of the data in the frame memory to a subsequent image processing module for data processing according to the video playback requirements;
[0012] Step (6) repeats steps (3) to (5), and the decoded data of subsequent frame images or field images of the video compression stream fills the remaining frame storage space. If the frame storage space is already filled, the frame storage space with no reference function is overwritten until the video compression stream is decoded.
[0013] Furthermore, step (1) is specifically as follows: the video decoder reads data from the compressed stream memory, searches for data containing header information content in the video compression stream, including a sequence header and an image header, and extracts image reference information, including the encoding method used by the video compression stream, the color depth used, the frame field image mode, the image product width, and the image height; processes the image product width to be 64-byte aligned, and processes the image height to be 64-byte aligned; if the frame field image mode is currently a frame image, the image height represents the height of the frame, and if it is a field image, the image height represents the height of the field.
[0014] Furthermore, step (2) is specifically as follows: the encoding method of the video compression stream determines the number of frame storage spaces, and configures the first address group of each frame storage space, including the image brightness first address (Y_BASE_ADDR) and the image chrominance first address (UV_BASE_ADDR); first, determine whether the video compression stream is a frame stream or a field stream. If the video compression stream is a frame stream, then only one frame storage space is required for one frame image. If the video compression stream is a field stream, then one frame image is stored as two parts, the top field and the bottom field, and two independent frame storage spaces are allocated for the top field and the bottom field; then determine the data type of the video compression stream, whether it is an SDR bit stream or an HDR bit stream. If the video compression stream is an SDR bit stream, then The luminance space size of a frame image or a field image of the video compression stream is the product of the image area width and the image height, and the chrominance space size is half of the product of the image area width and the image height; if the video compression stream is an HDR10 bit stream, the luminance space size of a frame image or a field image of the video compression stream is five-quarters of the product of the image area width and the image height, and the chrominance space size is five-eighths of the product of the image area width and the image height; if the video compression stream is an HDR12 bit stream, the luminance space size of a frame image or a field image of the video compression stream is three-half of the product of the image area width and the image height, and the chrominance space size is three-quarters of the product of the image area width and the image height.
[0015] Step (3) specifically comprises: selecting a corresponding decoding method for decoding a frame image or a field image in a video decoder according to the encoding method of the video compression stream, wherein the video decoder is a complex of independent decoders of various encoding methods, or a multi-standard video decoder. The encoding methods include H.264 / AVC, H.265 / HEVC, H.262 / MPEG-2, AVS, and VC-1.
[0016] Step (4) is specifically: the video decoder stores a decoded frame image or a field image into a pre-registered frame storage space. The frame storage methods of the SDR bit stream and the HDR bit stream are different. An address space of the frame storage space is 64 bits, a total of 8 bytes:
[0017] If the video compression stream is an SDR bit stream, the decoded image data is stored in the corresponding frame storage space line by line, and the brightness value of each pixel is stored in the brightness space line by line in a little-endian manner. Each address space of the brightness space stores the brightness values of 8 consecutive pixels in 8 lines until a frame image or a field image is stored; the chrominance value of each pixel is stored in the chrominance space line by line in a little-endian manner. Each address space of the chrominance space stores the chrominance values of 4 groups of consecutive pixels in 4 lines until a frame image or a field image is stored.
[0018] If the video compression stream is an HDR10 bit stream, the brightness value of each pixel of the decoded image data is split into high 8 bits and low 2 bits for storage respectively, and the chroma splitting method is the same as the brightness; the high 8 bits of the brightness value of the pixel are stored in the brightness space row by row in a little-endian manner starting from the brightness first address of the frame storage space, and the low 2 bits of the brightness pixel are stored in the address space of the brightness space in the form of 8×4 pixel blocks in a little-endian manner starting from the brightness first address of the frame storage plus the product of the image width and image height, and then stored in the address space of the brightness space in the form of 8×4 pixel blocks in the row direction. Continue to store the remaining space until a luminance frame is stored; the high 8 bits of the chrominance value of each pixel of the decoded image data are interleaved and stored continuously row by row in the chrominance space starting from the chrominance first address of the frame storage in a little-endian manner, and the low 2 bits of the chrominance value of the pixel are stored in the address space of the chrominance space in the form of 8×4 pixel blocks in a little-endian manner starting from the chrominance first address of the frame storage space plus half of the product of the image width and the image height, and then continuously store the remaining space in the row direction until a chrominance frame is stored.
[0019] If the video compression stream is an HDR12 bit stream, the brightness value of each pixel of the decoded image data is split into high 8 bits and low 4 bits for storage respectively, and the chroma splitting method is the same as the brightness; the high 8 bits of the brightness value of the pixel are stored in the brightness space row by row in a little-endian manner starting from the brightness first address of the frame storage space, and the low 4 bits of the brightness pixel are stored in the address space of the brightness space in the form of 8×2 pixel blocks in a little-endian manner starting from the brightness first address of the frame storage plus the product of the image width and image height, and then stored in the address space of the brightness space in the form of 8×2 pixel blocks in a row direction. Continue to store the remaining space until a luminance frame is stored; the high 8 bits of the chrominance value of each pixel of the decoded image data are interleaved and stored continuously row by row in the chrominance space starting from the chrominance first address of the frame storage, in a little-endian manner; the low 4 bits of the chrominance value of the pixel are stored in the address space of the chrominance space in the form of 8×2 pixel blocks starting from the chrominance first address of the frame storage space plus half of the product of the image width and the image height, in a little-endian manner, and then continuously store the remaining space in the row direction until a chrominance frame is stored.
[0020] Step (5) is specifically as follows: the subsequent image processing module extracts and processes the decoded image data from the frame memory; if the video compression stream is an SDR bit stream, the data in the entire frame memory is directly extracted for processing; if the video compression stream is an HDR bit stream, the high 8-bit data in the frame memory is directly extracted for processing, and the low 2-bit or 4-bit data is not processed. The processed high 8-bit data is spliced with the low 2-bit or 4-bit data to reduce the amount of data transported and reduce bandwidth pressure. The subsequent image processing modules include a deblocking effect module and a deinterlacing effect module.
[0021] The key to the data storage method of the present invention lies in the split storage method for the 10-bit or 12-bit pixels of the HDR stream, while being compatible with the 8-bit pixel storage of the SDR stream. This improved method reduces storage space for a single frame of a 10-bit or 12-bit stream compared to traditional storage methods, particularly for 10-bit streams, by 37.5%. It also reduces bandwidth usage when the deblocking and deinterlacing modules of the video decoder use data in the frame storage space. Deblocking and deinterlacing effects for 10-bit or 12-bit streams can only use the upper 8 bits of data, ensuring that the decoded data stream displays better results when played on a television, while also reducing bandwidth usage and alleviating bandwidth pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of the decoding structure of the present invention;
[0023] Figure 2 1. It is a schematic diagram of the storage space of the SDR bitstream frame format of the present invention;
[0024] Figure 3 This is a schematic diagram of the storage space of the SDR bitstream field format frame of the present invention;
[0025] Figure 4 1. It is a schematic diagram of the storage space of the HDR10 bitstream frame format of the present invention;
[0026] Figure 5 This is a schematic diagram of the storage space of the HDR10 bitstream field format frame of the present invention. DETAILED DESCRIPTION
[0027] A data storage method supporting multi-standard decoding, the specific steps are as follows:
[0028] Step (1) obtains image parameters according to the video type; specifically: the video decoder reads data from the compressed stream memory, searches for data containing header information content in the video compression stream, including a sequence header and an image header, and extracts image reference information, including the encoding method used by the video compression stream, the color depth used, the frame field image mode, the image product width, and the image height; processes the image product width to be 64-byte aligned, and processes the image height to be 64-byte aligned; if the frame field image mode is currently a frame image, the image height represents the height of the frame, and if it is a field image, the image height represents the height of the field.
[0029] Step (2) registers the frame memory space according to the number of frame memories required by the video decoder and the frame memory related parameters in the image parameters, including the brightness space and the chrominance space; specifically: the encoding method of the video compression stream determines the number of frame memories, and configures the first address group of each frame memory space, including the image brightness first address (Y_BASE_ADDR) and the image chrominance first address (UV_BASE_ADDR); first, determine whether the video compression stream is a frame stream or a field stream. If the video compression stream is a frame stream, then only one frame memory space is required to be allocated for one frame image. If the video compression stream is a field stream, then one frame image is stored as two parts, the top field and the bottom field, and two independent frame memory spaces are allocated for the top field and the bottom field; then determine the data type of the video compression stream, whether it is an SDR bit stream or an H DR bit stream, if the video compression stream is an SDR bit stream, the luminance space size of a frame image or a field image of the video compression stream is the product of the image product width and the image height, and the chrominance space size is half of the product of the image product width and the image height; if the video compression stream is an HDR10 bit stream, the luminance space size of a frame image or a field image of the video compression stream is five-quarters of the product of the image product width and the image height, and the chrominance space size is five-eighths of the product of the image product width and the image height; if the video compression stream is an HDR12 bit stream, the luminance space size of a frame image or a field image of the video compression stream is three-half of the product of the image product width and the image height, and the chrominance space size is three-quarters of the product of the image product width and the image height.
[0030] Step (3) decodes a frame image or a field image in a video decoder according to the encoding method used in the video compression stream; specifically, according to the encoding method of the video compression stream, a corresponding decoding method is selected in the video decoder for decoding a frame image or a field image, and the video decoder is a complex of independent decoders for various encoding methods, or a multi-standard video decoder. The encoding methods include H.264 / AVC, H.265 / HEVC, H.262 / MPEG-2, AVS, and VC-1.
[0031] Step (4) stores a frame of decoded data in a corresponding position of the frame storage space according to the data type; specifically, the video decoder stores a decoded frame image or a field image in a pre-registered frame storage space. The frame storage methods of the SDR bit stream and the HDR bit stream are different. An address space of the frame storage space is 64 bits, a total of 8 bytes:
[0032] If the video compression stream is an SDR bit stream, the decoded image data is stored in the corresponding frame storage space line by line, and the brightness value of each pixel is stored in the brightness space line by line in a little-endian manner. Each address space of the brightness space stores the brightness values of 8 consecutive pixels in 8 lines until a frame image or a field image is stored; the chrominance value of each pixel is stored in the chrominance space line by line in a little-endian manner. Each address space of the chrominance space stores the chrominance values of 4 groups of consecutive pixels in 4 lines until a frame image or a field image is stored.
[0033] If the video compression stream is an HDR10 bit stream, the brightness value of each pixel of the decoded image data is split into high 8 bits and low 2 bits for storage respectively, and the chroma splitting method is the same as the brightness; the high 8 bits of the brightness value of the pixel are stored in the brightness space row by row in a little-endian manner starting from the brightness first address of the frame storage space, and the low 2 bits of the brightness pixel are stored in the address space of the brightness space in the form of 8×4 pixel blocks in a little-endian manner starting from the brightness first address of the frame storage plus the product of the image width and image height, and then stored in the address space of the brightness space in the form of 8×4 pixel blocks in the row direction. Continue to store the remaining space until a luminance frame is stored; the high 8 bits of the chrominance value of each pixel of the decoded image data are interleaved and stored continuously row by row in the chrominance space starting from the chrominance first address of the frame storage in a little-endian manner, and the low 2 bits of the chrominance value of the pixel are stored in the address space of the chrominance space in the form of 8×4 pixel blocks in a little-endian manner starting from the chrominance first address of the frame storage space plus half of the product of the image width and the image height, and then continuously store the remaining space in the row direction until a chrominance frame is stored.
[0034] If the video compression stream is an HDR12 bit stream, the brightness value of each pixel of the decoded image data is split into high 8 bits and low 4 bits for storage respectively, and the chroma splitting method is the same as the brightness; the high 8 bits of the brightness value of the pixel are stored in the brightness space row by row in a little-endian manner starting from the brightness first address of the frame storage space, and the low 4 bits of the brightness pixel are stored in the address space of the brightness space in the form of 8×2 pixel blocks in a little-endian manner starting from the brightness first address of the frame storage plus the product of the image width and image height, and then stored in the address space of the brightness space in the form of 8×2 pixel blocks in a row direction. Continue to store the remaining space until a luminance frame is stored; the high 8 bits of the chrominance value of each pixel of the decoded image data are interleaved and stored continuously row by row in the chrominance space starting from the chrominance first address of the frame storage, in a little-endian manner; the low 4 bits of the chrominance value of the pixel are stored in the address space of the chrominance space in the form of 8×2 pixel blocks starting from the chrominance first address of the frame storage space plus half of the product of the image width and the image height, in a little-endian manner, and then continuously store the remaining space in the row direction until a chrominance frame is stored.
[0035] Step (5) outputs part of the data in the frame memory to the subsequent image processing module for data processing according to the video playback requirements; specifically: the subsequent image processing module extracts and processes the decoded image data from the frame memory; if the video compression stream is an SDR bit stream, the data in the entire frame memory is directly extracted for processing; if the video compression stream is an HDR bit stream, the high 8-bit data in the frame memory is directly extracted for processing, and the low 2-bit or 4-bit data is not processed. The processed high 8-bit data is spliced with the low 2-bit or 4-bit data to reduce the amount of data transported and reduce bandwidth pressure. The subsequent image processing module includes a deblocking effect module and a deinterlacing effect module.
[0036] Step (6) repeats steps (3) to (5), and the decoded data of subsequent frame images or field images of the video compression stream fills the remaining frame storage space. If the frame storage space is already filled, the frame storage space with no reference function is overwritten until the video compression stream is decoded.
[0037] The following is a further detailed description with reference to the accompanying drawings and specific embodiments.
[0038] Figure 1 This is a schematic diagram of the decoding structure of the present invention, which includes the following modules: compressed stream buffer and compressed stream reading interface, video decoding operation module, write-back interface and write-back memory, frame buffer, image processing module. The frame buffer is usually SDRAM. Figure 1The data streams contained in the video processing module include the following stream formats: original video compressed stream data, data stream to be decoded, decoded writeback data, reference data for video decoding, and decoded video output data. The original video compressed stream may be a frame-formatted SDR bitstream, a field-formatted SDR bitstream, a frame-formatted HDR 10-bit stream, or a field-formatted HDR 10-bit stream. The compression scheme for this stream may be H.264 / AVC, H.265 / HEVC, H.262 / MPEG-2, AVS, VC-1, or other encoding schemes. The video processing module can be a complex of independent decoders for each encoding standard, or a multi-standard video decoder. It only needs to know the encoding scheme of the video compressed stream and select the corresponding decoding scheme for decoding. After the video compressed stream enters the video processing module, it searches the stream header for reference information about the video stream, including pixel color depth, video frame field format, image width, and image height. This data is integrated and the corresponding frame storage space is registered in the frame buffer. The video decoding module then transmits the decoded data to the write-back module, which then enters the written data into the frame buffer's frame storage space, completing the decoding and storage of one frame. This frame of data can be used as reference image data for video decoding or output to image processing modules, including the deblocking and deinterlacing modules. The video decoding module then waits for the next frame of the compressed video stream to arrive, references the image data in the frame buffer, decodes the next frame, and then writes the decoded data into a new frame storage space in the frame buffer, or overwrites the previously existing data. This cycle repeats until the compressed video stream is fully decoded.
[0039] The subject of the present invention is the storage method of data in the frame buffer. Figure 2 , Figure 3 , Figure 4 , Figure 5 The decoder used in this embodiment decodes the video image in NV12 format, which is a YUV space with a 4:2:0 format and chroma interleaved video format.
[0040] Figure 2 The following is a diagram of the frame buffer storage space for 8SDR bitstream frame format. If the video stream is an SDR bitstream and is played in frame mode, the frame buffer space registered in the frame buffer is Figure 2 As shown. The frame memory space is divided into luminance space and chrominance space, and the luminance space base address (Y_BASE_ADDR) and chrominance space base address (UV_BASE_ADDR) need to be configured. Figure 2(a) is the brightness space of the frame storage space, which indicates the set of brightness pixels of a frame image, and the number of its pixel brightness is the product of the image width and the image height. The brightness value of the first pixel in the upper left corner of the image is stored in the lowest 8 bits of the brightness space base address (Y_BASE_ADDR), and then the brightness values of the 7 pixels after the first row are stored in the address in sequence according to the little-endian storage method. In the next address of the brightness base address, the brightness values of the 8 consecutive pixels following the first row are stored in sequence according to the little-endian method. The pixel brightness values of the first row are stored in the brightness space in the above manner, and the remaining pixels are stored in the brightness space row by row in the above manner until the brightness of a frame image is completely stored. As shown Figure 2 (b) is the chroma space stored for the frame, which indicates the set of chroma pixels of a frame image, and the number of its pixel chroma is half the product of the image width and the image height. The chroma UV of the pixels in this set are stored interleaved, and the chroma values of the first pair of pixels in the upper left corner of the image are stored in the lowest 16 bits of the chroma space base address (UV_BASE_ADDR), with chroma U being 8 bits and chroma V being 8 bits. Then, the chroma values of the last three pairs of pixels in the first row are stored in sequence in the address according to the little-endian storage method. In the address next to the chroma base address, the chroma values of the four consecutive pairs of pixels in the first row are stored in sequence according to the little-endian method. The pixel chroma values of the first row are stored in the chroma space in the above manner, and the remaining pixels are stored in the chroma space row by row in the above manner until all the chroma of a frame image is stored. The above is the storage method of the decoded stream in the SDR bitstream frame format.
[0041] Figure 3 The following is a diagram of the SDR bitstream field format frame buffer storage space. If the video stream is an SDR bitstream and is played in field mode, the frame buffer format registered in the frame buffer is Figure 3 As shown. The frame storage space is divided into top field space and bottom field space. The top field space is further divided into top field luminance space and top field chrominance space. Similarly, the bottom field space is further divided into bottom field luminance space and bottom field chrominance space. In the decoded video stream, the top field content is stored in the top field space, and the bottom field content is stored in the bottom field space. The top field space needs to be configured with the top field luminance space base address (FIELD_TOP_Y_BASE_ADDR) and the top field chrominance space base address (FIELD_TOP_UV_BASE_ADDR). Figure 3 (a) is the top field brightness space of the frame, Figure 3(b) is the top field chroma space of the frame. The image height of this space is the height of the field image. The brightness value of the pixels inside the top field brightness space is stored in the same way as the brightness value of the pixels in the 8-bit frame format, except that the stored content is the top field brightness value. Similarly, the chroma value of the pixels inside the top field chroma space is stored in the same way as the chroma value of the pixels in the 8-bit frame format, except that the stored content is the top field chroma value. The bottom field space needs to be configured with the bottom field brightness space base address (FIELD_BTM_Y_BASE_ADDR) and the bottom field chroma space base address (FIELD_BTM_UV_BASE_ADDR). Figure 3 (c) is the bottom field brightness space of the frame, Figure 3 (d) is the bottom field chroma space of the frame. The luminance values of bottom field pixels are stored in the same manner as the luminance values of top field pixels, and the chroma values of bottom field pixels are also stored in the same manner as the chroma values of top field pixels. For video images of the same size, the overall frame storage space for the SDR bitstream field format is essentially the same as the overall frame storage space for the SDR bitstream frame format. The above describes the storage method for the decoded stream in the SDR bitstream field format.
[0042] Figure 4 The following is a diagram showing the storage space for the HDR10 bitstream frame format. If the video stream is an HDR10 bitstream and is played in frame mode, the frame format registered in the frame buffer is Figure 4 As shown. The frame memory space is divided into luminance space and chrominance space. The luminance space is divided into high 8-bit luminance space and low 2-bit luminance space. The chrominance space is divided into high 8-bit chrominance space and low 2-bit chrominance space. Figure 4 (a) is the brightness space stored in the frame, in which the low 2-bit brightness space follows the high 8-bit brightness space, that is, the size of the entire brightness space is one-fourth of the product of the image width and the image height. The brightness base address (Y_BASE_ADDR) needs to be configured in the brightness space, and the low 2-bit brightness base address (Y_BASE_ADDR_2BIT) should be the brightness base address (Y_BASE_ADDR) plus the address space required for the number of pixel brightness values multiplied by the image width and the image height. When the brightness value of the pixel starts to be stored, the high 8 bits of the brightness value of the first pixel in the upper left corner of the image are stored in the lowest 8 bits of the brightness base address (Y_BASE_ADDR) space, and then the storage method is the same as the storage method of the pixel brightness value in the 8-bit frame format frame. The high 8 bits of the remaining pixel brightness values are stored in the corresponding address space line by line in a little-endian manner. The storage method of the low 2 bits of the pixel brightness value of the image is as follows: Figure 4 As shown in (b), the width of the lower 2-bit brightness space of the pixel brightness value is the image product width, and its height is one-fourth of the image height. The pixels of the image are divided into blocks of 4 rows and 8 columns to obtain Figure 4(b) Block combination, the data in a block is the low 2 bits combination of the brightness values of these 32 pixels, stored in an address space, such as Figure 4 As shown in (c). In an address space, bits 0 to 15 are assigned to the pixels in row 0 of 4 rows and 8 columns, bits 16 to 32 are assigned to the pixels in row 1, bits 32 to 47 are assigned to the pixels in row 2, and bits 48 to 63 are assigned to the pixels in row 3; bits 6, 7, 22, 23, 38, 39, 54, 55 are assigned to the pixels in column 0, bits 4, 5, 20, 21, 36, 37, 52, 53 are assigned to the pixels in column 1, bits 2, 3, 18, 19, 34, 35, 50, 51 are assigned to the pixels in column 2, Bits 0 and 1, 16 and 17, 32 and 33, 48 and 49 are assigned to the third column of pixels; bits 14 and 15, 30 and 31, 46 and 47, 62 and 63 are assigned to the fourth column of pixels; bits 12 and 13, 28 and 29, 44 and 45, 60 and 61 are assigned to the fifth column of pixels; bits 10 and 11, 26 and 27, 42 and 43, 58 and 59 are assigned to the sixth column of pixels; bits 8 and 9, 24 and 25, 40 and 41, 56 and 57 are assigned to the seventh column of pixels. The above completes the storage of the lower 2 bits of the brightness value of a block of 4 rows and 8 columns. The lower 2 bits of the brightness values of the remaining pixels are stored row by row in the row direction of the block until the lower 2 bits of the brightness value of a frame of image are completely stored. Figure 4 (d) is the chroma space of the frame storage space, in which the low 2-bit color space follows the high 8-bit color space, that is, the size of the entire chroma space is five-eighths of the product of the image width and the image height. The chroma base address (UV_BASE_ADDR) needs to be configured in the chroma space, and the low 2-bit color base address (UV_BASE_ADDR_2BIT) should be the chroma base address (UV_BASE_ADDR) plus the address space required for the pixel chroma value of half the product of the image width and the image height. When the pixel chroma value begins to be stored, the high 8 bits of the chroma value of the first pair of pixels in the upper left corner of the image are stored in the lowest 16 bits of the chroma base address (UV_BASE_ADDR) space, and then the storage method is the same as the 8-bit frame format frame storage pixel chroma value storage method, and the high 8 bits of the remaining pixel chroma values are stored in the corresponding address space line by line in little-endian manner. The storage method of the low 2 bits of pixel chroma of the image is as follows: Figure 4 As shown in (e), the width of the color space of the pixel chroma is 2 bits lower than the image width, and its height is one eighth of the image height. Divide the interleaved chroma pairs of the image into blocks of 4 rows and 4 columns to obtain Figure 4 (e) Block combination, the data in a block is the low 2 bits combination of these 16 pairs of chrominance values, stored in an address space, such as Figure 4(f) As shown in the figure. In an address space, bits 0 to 15 are assigned to the chroma pair in row 0 of the 4 rows and 4 columns, bits 16 to 32 are assigned to the chroma pair in row 1, bits 32 to 47 are assigned to the chroma pair in row 2, and bits 48 to 63 are assigned to the chroma pair in row 3; bits 6, 7, 22, 23, 38, 39, 54, 55 are assigned to the chroma U in column 0, bits 4, 5, 20, 21, 36, 37, 52, 53 are assigned to the chroma V in column 0, bits 2, 3, 18, 19, 34, 35, 50, 51 are assigned to the chroma U in column 1. , 0, 1, 16, 17, 32, 33, 48, 49 are allocated to the first column of chroma V, 14, 15, 30, 31, 46, 47, 62, 63 are allocated to the second column of chroma U, 12, 13, 28, 29, 44, 45, 60, 61 are allocated to the second column of chroma V, 10, 11, 26, 27, 42, 43, 58, 59 are allocated to the third column of chroma U, 8, 9, 24, 25, 40, 41, 56, 57 are allocated to the third column of chroma V. The above completes the storage of the lower 2 bits of the chroma value of a block of 4 rows and 4 columns. The remaining lower 2 bits of the chroma value are stored row by row in the row direction of the block until the lower 2 bits of the chroma value of a frame of image are all stored. The above is how the decoded stream in the HDR10 bitstream frame format is stored.
[0043] Figure 5 This is a diagram of the storage space for the HDR10 bitstream field format frame buffer. If the video stream is an HDR10 bitstream and is played in field mode, the frame buffer format registered in the frame buffer is Figure 5 As shown. The frame memory space is divided into top field space and bottom field space. The top field space is further divided into top field luma space and top field chroma space. The top field luma space is divided into upper 8-bit luma space and lower 2-bit luma space. The top field chroma space is also divided into upper 8-bit chroma space and lower 2-bit chroma space. Similarly, the bottom field space is divided into lower 8-bit luma space and lower 2-bit luma space, lower 8-bit chroma space and lower 2-bit chroma space. In the decoded video stream, the top field content is stored in the top field space, and the bottom field content is stored in the bottom field space. The top field space requires configuration of the top field luma space base address (FIELD_TOP_Y_BASE_ADDR), the top field lower 2-bit luma space base address (FIELD_TOP_Y_BASE_ADDR_2BIT), the top field chroma space base address (FIELD_TOP_UV_BASE_ADDR), and the top field lower 2-bit chroma space base address (FIELD_TOP_BASE_ADDR). Figure 5 (a) is the top field brightness space of the frame, Figure 5 (b) is the lower 2-bit luminance space of the top field of the frame, Figure 5 (c) is the data storage method of the top field low 2-bit brightness address space. Figure 5 (d) is the top field chroma space of the frame, Figure 5 (e) is the lower 2-bit brightness space of the top field of the frame, Figure 5 (f) shows the data storage method for the top field's lower 2-bit color address space. The image height of this space is the same as the field height. The top field's luminance space is stored in the upper 8 bits and the lower 2 bits, similar to the 10-bit frame format, except that the stored content is the top field's luminance value. Similarly, the chrominance values of pixels within the top field's chrominance space are stored in the same manner as the 10-bit frame format, except that the stored content is the top field's chrominance value. The bottom field space requires configuration of the bottom field's luminance space base address (FIELD_BTM_Y_BASE_ADDR), the bottom field's lower 2-bit luminance space base address (FIELD_BTM_Y_BASE_ADDR_2BIT), the bottom field's chrominance space base address (FIELD_BTM_UV_BASE_ADDR), and the bottom field's lower 2-bit color space base address (FIELD_BTM_BASE_ADDR). Figure 5 (g) is the bottom field brightness space of the frame, Figure 5 (h) is the lower 2-bit brightness space of the bottom field of the frame, Figure 5 (i) is the data storage method of the bottom field low 2-bit brightness address space. Figure 5 (j) is the bottom field chroma space of the frame, Figure 5 (k) is the lower 2-bit brightness space of the bottom field of the frame, Figure 5 (1) shows the data storage method for the bottom field's low-order 2-bit color address space. The luminance values of bottom field pixels are stored in the same manner as the top field's luminance values, and the chrominance values of bottom field pixels are also stored in the same manner as the top field's chrominance values. For video images of the same size, the overall frame storage space for the HDR10 bit-field format is essentially the same as the overall frame storage space for the HDR10 bit-frame format. The above describes the storage method for the decoded stream in the HDR10 bit-field format.
[0044] In order to be compatible with SDR bitstream video decoding and HDR10 bitstream video decoding, this example implements the above frame memory management. This invention can not only ensure the normal use of SDR bitstream frame memory and HDR10 bitstream frame memory, but also save storage space compared to the conventional frame memory method of using 2 bytes to store 10-bit data. It can also save bandwidth compared to the conventional storage method when using 10-bit frame memory. In the subsequent transmission as a reference image, or the subsequent image processing module including deblocking effect and deinterlacing effect only uses the high 8-bit data to reduce data transmission and reduce bandwidth pressure. The above is only the preferred embodiment of the present invention. Further optimization can be made without departing from the principle of the present invention. These optimizations should also be considered as the scope of protection of the present invention.
Claims
1. A data storage method supporting multi-standard decoding, characterized by: Step (1) obtaining image parameters according to the video type; Step (2) registering the frame memory space, including the luminance space and the chrominance space, according to the frame memory quantity required by the video decoder and the frame memory related parameters in the image parameters; Specifically: the encoding method of the video compression stream determines the number of frame storage spaces, and configures the first address group of each frame storage space, including the image brightness first address and the image chrominance first address; first determine whether the video compression stream is a frame stream or a field stream. If the video compression stream is a frame stream, then only one frame storage space needs to be allocated for one frame of image. If the video compression stream is a field stream, then one frame of image is stored as two parts, the top field and the bottom field, and two independent frame storage spaces are allocated for the top field and the bottom field; then determine the data type of the video compression stream, whether it is an SDR bit stream or an HDR bit stream. If the video compression stream is an SDR bit stream, then one frame image or one field image of the video compression stream The luminance space size is the product of the image width and the image height, and the chrominance space size is half the product of the image width and the image height; if the video compression stream is an HDR10 bit stream, the luminance space size of a frame image or a field image of the video compression stream is five-quarters of the product of the image width and the image height, and the chrominance space size is five-eighths of the product of the image width and the image height; if the video compression stream is an HDR12 bit stream, the luminance space size of a frame image or a field image of the video compression stream is three-half the product of the image width and the image height, and the chrominance space size is three-quarters the product of the image width and the image height; Step (3) decoding a frame image or a field image in a video decoder according to the encoding method used by the video compression stream; Step (4) storing a frame of decoded data into a corresponding position in the frame storage space according to the data type; Step (5) outputting part of the data in the frame memory to a subsequent image processing module for data processing according to the video playback requirements; Step (6) repeats steps (3) to (5), and the decoded data of subsequent frame images or field images of the video compression stream fills the remaining frame storage space. If the frame storage space is already filled, the frame storage space with no reference function is overwritten until the video compression stream is decoded.
2. The data storage method supporting multi-standard decoding according to claim 1, wherein: Step (1) is specifically as follows: the video decoder reads data from the compressed stream memory, searches for data containing header information content in the video compression stream, including a sequence header and an image header, and extracts image reference information, including the encoding method used by the video compression stream, the color depth used, the frame field image mode, the image product width, and the image height; processes the image product width to be 64-byte aligned, and processes the image height to be 64-byte aligned; if the frame field image mode is currently a frame image, the image height represents the height of the frame, and if it is a field image, the image height represents the height of the field.
3. The data storage method supporting multi-standard decoding according to claim 1, wherein: Step (3) specifically comprises: selecting a corresponding decoding method for decoding a frame image or a field image in a video decoder according to the encoding method of the video compression stream. The video decoder is a complex of independent decoders of various encoding methods, or a multi-standard video decoder.
4. The data storage method supporting multi-standard decoding according to claim 1, wherein: Step (4) is specifically: the video decoder stores a decoded frame image or a field image into a pre-registered frame storage space. The frame storage methods of the SDR bit stream and the HDR bit stream are different. An address space of the frame storage space is 64 bits, a total of 8 bytes: If the video compression stream is an SDR bit stream, the decoded image data is stored in the corresponding frame storage space in a row-by-row manner, and the brightness value of each pixel is stored in the brightness space row by row in a little-endian manner. Each address space of the brightness space stores the brightness values of 8 consecutive pixels in a row until a frame image or a field image is stored; the chrominance value of each pixel is stored in the chrominance space row by row in a little-endian manner. Each address space of the chrominance space stores the chrominance values of 4 groups of consecutive pixels in a row until a frame image or a field image is stored; If the video compression stream is an HDR10 bit stream, the brightness value of each pixel of the decoded image data is split into high 8 bits and low 2 bits for storage respectively, and the chrominance splitting method is the same as the brightness; the high 8 bits of the brightness value of the pixel are stored in the brightness space row by row in a little-endian manner starting from the brightness first address of the frame storage space, and the low 2 bits of the brightness pixel are stored in the address space of the brightness space in the form of 8×4 pixel blocks in a little-endian manner starting from the brightness first address of the frame storage plus the product of the image width and the image height, and then the remaining space is stored continuously in the row direction until a brightness frame storage is completed; The high 8 bits of the chroma value of each pixel of the decoded image data are interleaved and stored continuously row by row in the chroma space starting from the chroma first address of the frame memory in a little-endian manner. The low 2 bits of the chroma value of the pixel are stored in the address space of the chroma space in the form of 8×4 pixel blocks starting from the position of the chroma first address of the frame memory space plus half of the product of the image width and the image height in a little-endian manner. Then the remaining space is stored continuously in the row direction until a chroma frame memory is fully stored. If the video compression stream is an HDR12 bit stream, the brightness value of each pixel of the decoded image data is split into high 8 bits and low 4 bits for storage respectively, and the chroma splitting method is the same as the brightness; the high 8 bits of the brightness value of the pixel are stored in the brightness space row by row in a little-endian manner starting from the brightness first address of the frame storage space, and the low 4 bits of the brightness pixel are stored in the address space of the brightness space in the form of 8×2 pixel blocks in a little-endian manner starting from the brightness first address of the frame storage plus the product of the image width and the image height, and then the remaining space is stored continuously in the row direction until a brightness frame storage is completed; The high 8 bits of the chrominance value of each pixel of the decoded image data are interleaved and stored continuously row by row in the chrominance space starting from the chrominance first address of the frame memory in a little-endian manner. The low 4 bits of the chrominance value of the pixel are stored in the address space of the chrominance space in the form of 8×2 pixel blocks starting from the chrominance first address of the frame memory space plus half of the product of the image width and image height in a little-endian manner. Then the remaining space is stored continuously in the row direction until a chrominance frame memory is stored.
5. The data storage method supporting multi-standard decoding according to claim 1, wherein: Step (5) is specifically as follows: the subsequent image processing module takes out the decoded image data from the frame memory and processes it; if the video compression stream is an SDR bit stream, the data in the entire frame memory is directly taken out for processing; if the video compression stream is an HDR bit stream, the high 8-bit data in the frame memory is directly taken out for processing, and the low 2-bit or 4-bit data is not processed, and the processed high 8-bit data is spliced with the low 2-bit or 4-bit data.
Citation Information
Patent Citations
Interlaced video processing method, system and device in interleaving mode and medium
CN111683216A
Method and apparatus for an HDR hardware processor inline to hardware encoder and decoder
CN112868242A