A short-term reference image parameter set parsing method and code stream updating method

By building a short-term reference image parameter set data structure suitable for hard decoder in the video hard decoder and parsing the incoming parameter set, the hard decoder cannot obtain the short-term reference image parameter set normally when decoding H265 video. Problem, better compatibility with VAAPI or VDPAU decoding frameworks is achieved.

CN119094792BActive Publication Date: 2025-02-14WUHAN LINGJIU MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411570704.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-14
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

Under the video hard decoding framework, when the hard decoder decodes the H265 video, the short-term reference image parameter set cannot be obtained normally, resulting in the problem of decoding abnormalities.

Method used

Provide a short-term reference image parameter set analysis method and code stream update method based on video hard decoding framework. By constructing the data structure of the sequence parameter set SPS and the short-term reference image parameter set STRPPS required by the hard decoder, and decode the hard decoding The short-term reference image parameter set data passed in by the framework is parsed to ensure that it complies with the video hard decoder standards.

Benefits of technology

Solve the problem that hard decoder cannot obtain short-term reference image parameter sets normally under the video hard decoding framework, ensure the normal progress of the decoding process, and enable the hard decoder to hard decoding H265 video through hard decoding frameworks such as VAAPI or VDPAU, improving the hard The decoder drivers compatibility with VAAPI or VDPAU decoding frameworks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094792B_ABST
    Figure CN119094792B_ABST
Patent Text Reader

Abstract

The present invention provides a short-term reference image parameter set parsing method and a code stream updating method, including: constructing a data structure of a sequence parameter set SPS and a short-term reference image parameter set STRPPS required by a hard decoder; parsing the short-term reference image parameter set data passed in by a hard decoding framework, and passing the parsed parameters into the data structure; parsing the slice layer code stream data to be decoded, and obtaining the sequence number of the short-term reference image parameter set data in the sequence parameter set SPS; according to the sequence number, copying the short-term reference image parameter set STRPPS to the corresponding position of the sequence parameter set SPS data structure; updating the code stream according to the short-term reference image parameters passed in by the hard decoding framework, and ensuring that subsequent decoding is carried out normally. The present invention implements the parsing of the short-term reference image parameter set data in advance based on the hard decoding framework, so that the hard decoder can hard decode H265 video through a hard decoding framework such as VAAPI or VDPAU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video stream decoding, and more specifically, to a short-term reference image parameter set parsing method and a code stream updating method. Background Art

[0002] Short-term reference picture parameter set (STRPPS, Short Time Reference Picture Parameter Set) is an important parameter in the decoding process of H265, and is an information description of short-term picture set (STRPS, Short Time Reference Picture Set). When the frame to be decoded is a predicted frame P frame (Predicted Frame) or a bidirectional predicted frame B frame (Bidirectional Frame), it needs to refer to the image frame closer to the decoded frame. These image frames are STRPS, and these image frame data are stored in the decoded picture buffer (DPB, Decode Picture Buffer). When decoding multiple slices (Slice) of the same image, or multiple images of the same complete group of video frames (GOP, Group of Pictures), the STRPS information is similar. In order to save bits, H265 encoding often puts part of the short-term reference picture parameter set (STRPPS) into the sequence parameter set (SPS, Sequence Parameter Set) of H265. In the process of decoding H265, it is necessary to decode the slice header data of the P frame or B frame. In the process of decoding the slice header data, it is necessary to use the short-term reference image parameter set in the SPS to construct the reference image frame list of the current slice. Therefore, parsing the short-term reference image parameter set is an important process for decoding H265.

[0003] The video hard decoding framework is a standard universal interface for GPU video hard decoding. Players or other video applications will call GPU hardware through the video hard decoding framework to complete video encoding and decoding tasks, thereby reducing CPU utilization during video processing and improving the efficiency and quality of video processing. VAAPI (Video Acceleration API) and VDPAU (VideoDecode and Presentation API for Unix) are the most widely used hard decoding frameworks in the Linux operating system. These two frameworks will complete the analysis of the short-term reference image parameter set data in advance and pass the corresponding data as parameters.

[0004] Theoretically, the video hardware decoder can be used normally after assigning these parameters without the need for the parsing process of the short-term reference image parameter set data. However, the parameters passed in the framework cannot be directly used by other types of hardware decoders, except for the graphics card decoders of AMD and Intel. It is necessary to parse the relevant parameters into the common form required by the hardware decoder and ensure the normal progress of the decoding process, so that STRPPS can be used normally by the hardware decoder. Summary of the invention

[0005] The present invention aims at the technical problems existing in the prior art and provides a short-term reference image parameter set parsing method and a code stream updating method based on a video hard decoding framework.

[0006] According to a first aspect of the present invention, a method for parsing a short-term reference picture parameter set based on a video hard decoding framework is provided, comprising:

[0007] Step S1, constructing a data structure of a sequence parameter set SPS and a short-term reference picture parameter set STRPPS required by a hard decoder, wherein the sequence parameter set SPS can store up to 64 short-term reference picture parameter sets STRPPS_SPS

[64] , and a short-term reference picture parameter set STRPPS includes the number of preceding reference frames num_negative_pics, the number of following reference frames num_positive_pics, and a 16-element array elem

[16] , each of which includes a position difference between a reference frame and a current frame elem[i].delta_poc and a flag elem[i].used_by_pic on whether the reference frame is used;

[0008] Step S2, parsing the short-term reference image parameter set data input by the hard decoding framework, and inputting the parsed short-term reference image parameters into the data structure established in step S1;

[0009] Step S3, parsing the slice code stream data to be decoded, and obtaining the sequence number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the sequence parameter set SPS;

[0010] Step S4, according to the obtained serial number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the sequence parameter set SPS, copy the short-term reference picture parameter set STRPPS to the corresponding position of the sequence parameter set SPS data structure.

[0011] According to a second aspect of the present invention, there is provided a code stream updating method, comprising:

[0012] Step S1', parsing the short-term reference image parameter set based on the short-term reference image parameter set parsing method;

[0013] Step S2', constructing a slice header data structure slice_header, wherein the slice header data structure includes a STRPPS structure variable;

[0014] Step S3', re-parse the slice code stream data obtained from the video hard decoding framework, and pass the parameters required for decoding the parsed slice code stream data to the slice header data structure slice_header;

[0015] Step S4', parsing the slice code stream data to obtain the flag bit short_term_ref_pic_set_sps_flag of the short-term reference picture parameter set STRPPS in the sequence parameter set SPS;

[0016] Step S5', determine whether the flag short_term_ref_pic_set_sps_flag is 0. If not, continue parsing the slice code stream data, obtain the serial number position of the short-term reference picture parameter set data in the 64 short-term reference picture parameter sets STRPPS_SPS

[64] of the sequence parameter set SPS again, that is, short_term_ref_pic_set_idx, copy the corresponding short-term reference picture parameter set STRPPS in the sequence parameter set SPS to the slice header data structure slice_header, and provide it for subsequent decoding;

[0017] Step S6', if short_term_ref_pic_set_sps_flag is 0, determine whether the number of bits st_rps_bit consumed by the short-term reference frame calculation transmitted from the video hard decoding framework is 0; if st_rps_bits is 0, continue to parse the slice-layer code stream data to obtain the short-term reference image parameter set required for decoding the slice-layer code stream data; if st_rps_bits is not 0, it is necessary to update the slice-layer code stream data, skip the parsing operation of some short-term reference image parameter sets, and directly obtain the short-term reference image parameter set data STRPPS from the corresponding position of the sequence parameter set SPS.

[0018] The present invention provides a short-term reference image parameter set parsing method and a bitstream updating method based on a video hard decoding framework. According to the characteristics of data transmitted by the video hard decoding framework, a short-term reference image parameter set that meets the video hard decoder standard is parsed, while ensuring that subsequent normal decoding is not affected. The problem that the short-term reference image parameter set cannot be normally obtained and the decoding is abnormal when the hard decoder decodes H265 under the video hard decoding framework is solved, so that the hard decoder can decode H265 video through a hard decoding framework such as VAAPI or VDPAU, and the compatibility of the hard decoder driver with the VAAPI or VDPAU decoding framework is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A flow chart of a short-term reference image parameter set parsing method based on a video hard decoding framework provided by the present invention;

[0020] Figure 2 A flowchart of parsing a short-term reference picture parameter set from a hard decoding framework according to the present invention;

[0021] Figure 3 A flowchart of a code stream updating method provided by one embodiment of the present invention;

[0022] Figure 4 A flowchart of a code stream updating method provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In addition, the technical features in the various embodiments or single embodiments provided by the present invention can be arbitrarily combined with each other to form a feasible technical solution. This combination is not subject to the constraints of the sequence of steps and / or the structural composition mode, but must be based on the ability of ordinary technicians in this field to achieve. When the combination of technical solutions is contradictory or cannot be achieved, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0024] A hardware decoder is a hardware device that inputs analog video signals and converts them into digital signal formats for further compression and transmission. It decodes high-definition videos through the video acceleration function of the graphics card. Therefore, the video hardware decoder can release the CPU from the heavy video decoding operations, so that the computer has the ability to play high-definition videos smoothly. GPU / VPU is more suitable for such large-scale, low-difficulty repetitive work than CPU. Since the decompression task is basically handed over to the display chip, the CPU can be relieved and take on more other tasks easily, which is more important for users who often need to run multiple tasks. The existence of hardware decoders is because audio and video data storage must be compressed first, otherwise the data volume is too large, and compression requires certain encoding to store the highest quality audio and video data with the smallest capacity. Therefore, when the data needs to be played, it must be decoded by the decoder first.

[0025] The video hardware decoding framework refers to the standard API for video decoding by hardware decoders, such as VAAPI (VideoAcceleration API, video hardware acceleration interface), a video hardware acceleration interface proposed and built by Intel in 1999. After years of development, it has become one of the most widely used open source decoding libraries and API specifications. It provides access to graphics hardware acceleration functions for video processing. VAAPI consists of a main library and a specific driver hardware acceleration end for each supported hardware vendor, and is finally called by various multimedia platforms in the form of plug-ins. This makes VAAPI independent of these platforms and has good stability. At the same time, it is convenient for hardware manufacturers to carry out integrated development, saving a lot of adaptation work. Currently, VAAPI supports Intel, AMD and NVidia graphics cards.

[0026] VDPAU (Video Decode and Presentation API for Unix) is a video processing hardware acceleration interface proposed by AMD, which provides functions such as video decoding, video rendering, and video display. VDPAU consists of the main library and the hardware acceleration library provided by the hardware manufacturer. It is similar to VAAPI in structure and has the same advantages as the VAAPI library, supporting multiple graphics cards such as AMD and NVidia.

[0027] H265 is a new video codec standard. H.265 / HEVC compressed data adopts a layered structure similar to H.264 / AVC, which separates most of the syntax elements shared by the GOP layer and the Slice layer to form a sequence parameter set (SPS) and a picture parameter set (PPS). SPS contains information shared by all images in a CVS (Coded Video Sequence). CVS is defined as compressed data generated after a GOP is encoded. The content of SPS generally includes decoding-related information, such as profile level, resolution, coding tool switch identifier and parameters involved in a profile, time domain scalability information, etc. PPS contains common parameters used for an image, that is, all SSs in an image reference the same PPS. Its general content includes initial image control information, such as initial quantization parameter (QP), block information, etc. In addition, in order to be compatible with the extension of the standard in other applications, such as scalable video encoders and multi-view video encoders, a video parameter set (VPS) is added to the syntax architecture of H.265 / HEVC. Its content generally includes syntax elements shared by multiple sublayers, other specific information that does not belong to SPS, etc. For an SS, by referencing the PPS it uses, the PPS in turn references its corresponding SPS, and the SPS in turn references its corresponding VPS, the public information of the SS is finally obtained.

[0028] An image can be divided into one or more slices. The compressed data of each slice is independent, and the Slice header information cannot be inferred from the header information of the previous Slice. This requires that the Slice cannot cross its boundaries for intra-frame or inter-frame prediction, and it needs to be initialized before entropy coding. However, when performing loop filtering, the filter is allowed to cross the Slice boundary for filtering. Except that the Slice boundary may be affected by loop filtering, the Slice decoding process can be free of any influence from other Slices, and is conducive to parallel computing. The main purpose of using Slices is to ensure decoding synchronization again when data is lost.

[0029] The hard decoder decodes H265 to obtain the short-term reference image parameter set, which is usually obtained directly from SPS, or processed in combination with the short-term reference image parameter set in SPS to obtain a new parameter set for decoding. After the video is decapsulated, the SPS raw data will exist in the decoding context and can be directly obtained. The short-term reference image parameter set required by the hard decoder can be obtained by analyzing the SPS raw data according to the H265 standard protocol. However, the hard decoding framework will not pass in the SPS raw data, especially the short-term reference image parameter set. Video hard decoding frameworks such as VAAPI or VDPAU will complete the parsing of the SPS data in advance and pass in the corresponding parameters. In theory, the hard decoder can use these parameters normally after assigning them to values, without the need for the SPS data parsing process. However, the parameters passed in the framework cannot be used directly by other types of hard decoders, except for AMD and Intel graphics card decoders that support direct use. In particular, the short-term reference image parameter set needs to be parsed into the universal form required by the hard decoder and ensure the normal progress of the decoding process. Through the method of the present invention, the above-mentioned technical difficulties can be solved, so that the hard decoder can hard decode H265 video through a hard decoding framework such as VAAPI or VDPAU, so as to achieve the purpose of directly applying the parameters passed in by the hard decoding framework without parsing the SPS raw data decoding.

[0030] Figure 1 A flow chart of a short-term reference image parameter set parsing method based on a video hard decoding framework provided by the present invention is as follows: Figure 1 and Figure 2 As shown, the method includes:

[0031] Step S1, construct the data structure of the sequence parameter set SPS and the short-term reference picture parameter set STRPPS required by the hard decoder. The sequence parameter set SPS can store up to 64 short-term reference picture parameter sets STRPPS_SPS

[64] . A short-term reference picture parameter set STRPPS includes the number of preceding reference frames num_negative_pics, the number of following reference frames num_positive_pics and a 16-element array elem

[16] . Each element array includes a position difference between a reference frame and the current frame elem[i].delta_poc and a mark elem[i].used_by_pic on whether the reference frame is used.

[0032] It is understandable that two data structures are first constructed, a sequence parameter set SPS, which is used to store the parsed short-term reference image parameter set STRPPS, wherein multiple short-term reference image parameter sets STRPPS can be stored in the SPS. In the present invention, the sequence parameter set SPS can store up to 64 short-term reference image parameter sets STRPPS. Among them, a short-term reference image parameter set STRPPS includes a preceding reference frame number bit, a 16-element array for storing information of 16 reference frames, and a post-reference frame number. The reference frame information stored in each element array includes the position difference between the reference frame and the current frame and a mark of whether the reference frame is used.

[0033] Step S2, parsing the short-term reference image parameter set data input by the hard decoding framework, and inputting the parsed short-term reference image parameters into the data structure established in step S1.

[0034] Wherein, step S2 specifically includes:

[0035] Step S201, obtain a reference frame information sequence through a hard decoding framework, the reference frame parameter sequence includes 16 reference frame information, the reference frame information includes reference frame position information reference[i].poc, information whether the reference frame is used by the current frame reference[i].used_by_pic and current frame position information current_poc, where i represents the index of the reference frame.

[0036] Step S202, calculate the difference between the reference frame sequence position information (reference[i].poc) and the current frame position information (current_poc), and assign it to elem[i].delta_poc. If the difference is positive, increase the number of subsequent reference frames (num_positive_pics). If the difference is negative, increase the number of preceding reference frames (num_negative_pics). The information on whether the reference frame is used (reference[i].used_by_pic) is assigned to elem[i].used_by_pic.

[0037] Step S203, sort the 16 element groups stored in the short-term reference image parameter set data structure, and the elements whose elem[i].delta_poc is greater than 0 are arranged after the elements whose elem[i].delta_poc is less than 0. When elem[i].delta_poc is greater than 0, the smaller the elem[i].delta_poc is, the smaller the corresponding element number i is. When elem[i].delta_poc is less than 0, the smaller the absolute value is, the larger the corresponding element number i is. In other words, elem[i].delta_poc less than zero is arranged in front, and elem[i].delta_poc greater than zero is arranged in the back, and those less than zero are arranged in descending order, and those greater than zero are arranged in ascending order, that is, the 16 reference frame information is sorted in order from small to large according to the size of elem[i].delta_poc.

[0038] Step S3, parsing the slice code stream data to be decoded, and obtaining the serial number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the sequence parameter set SPS.

[0039] The step S3, parsing the slice code stream data to be decoded, and obtaining the sequence number of the short-term reference picture parameter set data in the sequence parameter set SPS, includes:

[0040] Step S301, copying the slice layer code stream data to be decoded to a memory area;

[0041] Step S302, read the slice code stream to be decoded from the memory area, and parse the slice code stream data from the beginning to obtain the sequence number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the 64 structure elements of the sequence parameter set SPS;

[0042] Step S303: releasing the memory area for copying the slice layer code stream data.

[0043] Step S4, according to the obtained serial number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the sequence parameter set SPS, the short-term reference picture parameter set STRPPS is copied to the corresponding position of the sequence parameter set SPS data structure, that is, the parsed STRPPS is copied to STRPPS_SPS[short_term_ref_pic_set_idx], thereby completing the parsing of the short-term reference picture parameter set data.

[0044] See also Figure 3 , provides a code stream update method, such as Figure 3 and Figure 4 , the code stream updating method includes:

[0045] Step S1 ′: parsing the short-term reference image parameter set based on the short-term reference image parameter set parsing method.

[0046] Step S2', constructing a slice header data structure slice_header, wherein the slice header data structure includes a STRPPS structure variable for subsequent analysis.

[0047] It is understandable that constructing a slice header data structure can store parameters required for decoding slice code stream data, including a short-term reference picture parameter set and some other parameters.

[0048] Step S3', re-parse the slice-layer code stream data obtained from the video hard decoding framework, and pass the parameters required for decoding the parsed slice-layer code stream data to the slice-layer header data structure slice_header.

[0049] It is understandable that by parsing the slice code stream data to be decoded, the parameters obtained by parsing are transferred to the slice header data structure slice_header for subsequent use in decoding the slice code stream data.

[0050] Step S4', parsing the slice code stream data to obtain the flag bit short_term_ref_pic_set_sps_flag of the short-term reference picture parameter set STRPPS in the sequence parameter set SPS;

[0051] Step S5', determine whether the flag short_term_ref_pic_set_sps_flag is 0. If not, continue parsing the slice code stream data, obtain the serial number position of the short-term reference picture parameter set data in the 64 short-term reference picture parameter sets STRPPS_SPS

[64] of the sequence parameter set SPS again, that is, short_term_ref_pic_set_idx, copy the corresponding short-term reference picture parameter set STRPPS in the sequence parameter set SPS to the slice header data structure slice_header, and provide it for subsequent decoding;

[0052] Step S6', if short_term_ref_pic_set_sps_flag is 0, determine whether the number of bits st_rps_bit consumed by the short-term reference frame calculation transmitted from the video hard decoding framework is 0; if st_rps_bits is 0, continue to parse the slice-layer code stream data to obtain the short-term reference image parameter set required for decoding the slice-layer code stream data; if st_rps_bits is not 0, it is necessary to update the slice-layer code stream data, skip the parsing operation of some short-term reference image parameter sets, and directly obtain the short-term reference image parameter set data STRPPS from the corresponding position of the sequence parameter set SPS.

[0053] See also Figure 4 , step S6' specifically includes:

[0054] Step S601, if short_term_ref_pic_set_sps_flag is 0, determine whether the number of bits consumed by the short-term reference frame calculation transmitted from the hard decoding framework (st_rps_bits) is 0. If st_rps_bit is 0, it means that it is necessary to parse and obtain the short-term reference picture parameter set (STRPPS) from the slice-layer code stream data without relying on the short-term reference picture parameter set in the SPS. The required STRPPS can be obtained by parsing the slice-layer code stream.

[0055] Step S602, if short_term_ref_pic_set_sps_flag is 0 and st_rps_bit is not 0, then it is necessary to read the next flag value (tmp) of the code stream again. If tmp is not 0, there is no need to parse STRPPS from the slice header data. The short-term reference picture parameter set can be directly used for subsequent decoding by reading from the hard decoding framework, that is, STRPPS_SPS[short_term_ref_pic_set_idx] of SPS is the required STRPPS. At the same time, it is necessary to use the incoming bit number (st_rps_bit) to move the head pointer of the code stream by the corresponding bit number (st_rps_bit), so that subsequent decoding can proceed normally, otherwise a decoding error will occur; if tmp is 0, continue to parse the slice code stream data to parse and obtain STRPPS.

[0056] Step S603, copying the short-term reference picture parameter set data obtained in step S601 and step S602 to the slice header data structure for use in decoding the slice code stream data.

[0057] The present invention provides a short-term reference image parameter set parsing method and a code stream updating method based on a video hard decoding framework. According to the characteristics of data transmitted by the video hard decoding framework, a short-term reference image parameter set that meets the video hard decoder standard is parsed, while ensuring that subsequent normal decoding is not affected. The problem that the short-term reference image parameter set cannot be normally obtained and the decoding is abnormal when the hard decoder decodes H265 under the video hard decoding framework is solved, so that the hard decoder can decode H265 video through a hard decoding framework such as VAAPI or VDPAU, and the compatibility of the hard decoder driver with the VAAPI or VDPAU decoding framework is improved.

[0058] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0059] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0060] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0061] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0062] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0063] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0064] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A short-term reference picture parameter set parsing method based on a video hard decoding framework, characterized in that: Methods include: Step S1, constructing a data structure of a sequence parameter set SPS and a short-term reference picture parameter set STRPPS required by a hard decoder, wherein the sequence parameter set SPS can store up to 64 short-term reference picture parameter sets STRPPS_SPS[64], and a short-term reference picture parameter set STRPPS includes the number of preceding reference frames num_negative_pics, the number of following reference frames num_positive_pics, and a 16-element array elem[16], each of which includes a position difference between a reference frame and a current frame elem[i].delta_poc and a flag elem[i].used_by_pic on whether the reference frame is used; Step S2, parsing the short-term reference image parameter set data input by the hard decoding framework, and inputting the parsed short-term reference image parameters into the data structure established in step S1; Step S3, parsing the slice code stream data to be decoded, and obtaining the sequence number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the sequence parameter set SPS; Step S4, according to the obtained serial number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the sequence parameter set SPS, copy the short-term reference picture parameter set STRPPS to the corresponding position of the sequence parameter set SPS data structure.

2. The short-term reference image parameter set parsing method according to claim 1, characterized in that: The step S2, parsing the short-term reference image parameter set data input by the hard decoding framework, and inputting the parsed short-term reference image parameters into the data structure established in step S1, includes: Step S201, obtaining a reference frame information sequence through a hard decoding framework, wherein the reference frame information sequence includes 16 reference frame information, wherein the reference frame information includes reference frame position information reference[i].poc, information indicating whether the reference frame is used by the current frame reference[i].used_by_pic, and current frame position information current_poc, wherein i represents the index of the reference frame; Step S202, calculate the difference between each reference frame position information reference[i].poc and the current frame position information current_poc, assign the difference to elem[i].delta_poc, if the difference is positive, increase the number of subsequent reference frames num_positive_pics, if the difference is negative, increase the number of preceding reference frames num_negative_pics, and assign the information reference[i].used_by_pic of whether each reference frame is used to elem[i].used_by_pic; Step S203, sorting the 16 element groups stored in the short-term reference image parameter set data structure in ascending order according to the size of elem[i].delta_poc.

3. The short-term reference image parameter set parsing method according to claim 2, characterized in that: The step S3, parsing the slice code stream data to be decoded, and obtaining the sequence number of the short-term reference picture parameter set data in the sequence parameter set SPS, includes: Step S301, copying the slice layer code stream data to be decoded to a memory area; Step S302, read the slice code stream to be decoded from the memory area, and parse the slice code stream data from the beginning to obtain the sequence number short_term_ref_pic_set_idx of the short-term reference picture parameter set data in the 64 structure elements of the sequence parameter set SPS; Step S303: releasing the memory area for copying the slice layer code stream data.

4. A code stream updating method, characterized in that: include: Step S1', parsing the short-term reference image parameter set based on the short-term reference image parameter set parsing method according to claim 1; Step S2', constructing a slice header data structure slice_header, wherein the slice header data structure includes a STRPPS structure variable; Step S3', re-parse the slice code stream data obtained from the video hard decoding framework, and pass the parameters required for decoding the parsed slice code stream data to the slice header data structure slice_header; Step S4', parsing the slice code stream data to obtain the flag bit short_term_ref_pic_set_sps_flag of the short-term reference picture parameter set STRPPS in the sequence parameter set SPS; Step S5', determine whether the flag short_term_ref_pic_set_sps_flag is 0. If not, continue parsing the slice code stream data, obtain the serial number position of the short-term reference picture parameter set data in the 64 short-term reference picture parameter sets STRPPS_SPS[64] of the sequence parameter set SPS again, that is, short_term_ref_pic_set_idx, copy the corresponding short-term reference picture parameter set STRPPS in the sequence parameter set SPS to the slice header data structure slice_header, and provide it for subsequent decoding; Step S6', if short_term_ref_pic_set_sps_flag is 0, determine whether the number of bits st_rps_bit consumed by the short-term reference frame calculation transmitted from the video hard decoding framework is 0; if st_rps_bits is 0, continue to parse the slice-layer code stream data to obtain the short-term reference image parameter set required for decoding the slice-layer code stream data; if st_rps_bits is not 0, it is necessary to update the slice-layer code stream data, skip the parsing operation of some short-term reference image parameter sets, and directly obtain the short-term reference image parameter set data STRPPS from the corresponding position of the sequence parameter set SPS.

5. The code stream updating method according to claim 4, characterized in that: The step S6' comprises: Step S601, if short_term_ref_pic_set_sps_flag is 0, determine whether the number of bits st_rps_bits consumed by the short-term reference frame calculation transmitted from the hard decoding framework is 0. If st_rps_bit is 0, it is necessary to parse the slice layer code stream to obtain the required short-term reference picture parameter set STRPPS; Step S602, if short_term_ref_pic_set_sps_flag is 0 and st_rps_bit is not 0, read the next flag value tmp of the slice code stream data, if tmp is not 0, read the short-term reference picture parameter set STRPPS from the hard decoding framework, and move the head pointer of the slice code stream data by the corresponding bit number st_rps_bit, if tmp is 0, continue to parse the slice code stream to parse and obtain STRPPS; Step S603, copying the short-term reference picture parameter set data obtained in step S601 and step S602 to the slice header data structure for use in decoding the slice code stream data.

Citation Information

Patent Citations

  • Signaling a sign value and an absolute value for a delta picture order count

    CN112840651A

  • Method, decoding equipment, decoding device and system for decoding coded video bit stream

    CN114697663A