Probability table updating device and method, medium and terminal
Through the probability table update device, the forward and backward update of the probability table is completed within the hardware, and the frequent interaction between software and hardware is solved, the efficiency and throughput of the decoder are improved, dynamic adaptability to different data characteristics is achieved, and the need for independent decoding of multiple frames is met.
Patent Information
- Application Number
- CN202480003989.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, the software and hardware interactions frequently during the update process of probability tables, resulting in an increase in bandwidth pressure and a decrease in the working efficiency of the decoder, and the inability to continuously process multi-frame images in a short time.
The probability table update device is adopted, including the pre-frame adaptation process module, the entropy decoding module and the post-frame adaptation update module. Through the forward and backward adaptation update process, the update of the probability table is completed within the hardware, reducing the software and hardware interaction, and using a state machine to control the update of the probability table elements of different categories.
It reduces bandwidth pressure, improves the working efficiency and throughput of the decoder, and can process multi-frame images independently faster, meeting the application needs of independently decoding multi-frames.
Smart Images

Figure CN120303934A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video decoding technology, and particularly to a probability table updating device, an updating method, a medium, and a terminal. Background Art
[0002] In the current field of multimedia processing, as the core component of video data processing, the performance of the decoder is directly related to the smoothness and quality of video playback. Traditional decoder designs often rely on the close cooperation of software and hardware to achieve efficient video decoding.
[0003] However, in the original design structure, the upper-layer software decodes the sequence header information and performs the probability table updating process. Although it realizes the modularization of functions to a certain extent, it also brings the problem of frequent software-hardware interaction. Specifically, whenever the hardware decoder finishes decoding a frame of image, it needs to transmit the counting information of relevant syntax elements generated during the decoding process to the upper-layer software through the bus. After receiving this information, the software can start to perform the probability table updating process, and then after the software update is completed, the new probability table is updated back to the DDR memory used by the hardware. This step not only increases the communication overhead between software and hardware, but also causes a delay in the software processing flow due to waiting for the completion of hardware decoding. This frequent interaction not only increases the bandwidth pressure, but also seriously reduces the working efficiency of the decoder.
[0004] Secondly, for the decoder, since the decoding of each frame of image requires the cooperation of software and hardware, this greatly limits the processing speed of the decoder. Especially when processing high-definition videos or high-frame-rate videos, the decoder is prone to jamming or delay due to insufficient processing power. In addition, for some application scenarios that require independent decoding of multiple frames, such as real-time monitoring, video analysis, etc., the original design structure is even more incompetent. Because the decoding of each frame needs to wait for the software-hardware interaction and the probability table update, the decoder cannot continuously process multiple frames of images in a short time. Summary of the Invention
[0005] In view of the above-mentioned disadvantages of the prior art, the purpose of this application is to provide a probability table updating device, an updating method, a medium, and a terminal to solve the technical problems in the prior art that there is too much software-hardware interaction in probability table updating, resulting in increased bandwidth pressure, reduced working efficiency of the decoder, and the decoder being unable to continuously process multiple frames of images in a short time.
[0006] To achieve the above and other related objectives, a first aspect of the present application provides a probability table update device, including: a pre-frame adaptation process module, an entropy decoding module, and a post-frame adaptation update module; the entropy decoding module is respectively connected to the pre-frame adaptation process module and the post-frame adaptation update module; the pre-frame adaptation process module is configured to obtain the original probability table and the update probability factor data corresponding to the current image frame, and perform a forward adaptation update process according to the original probability table and the update probability factor data to generate a new probability table required for decoding the current image frame, and send the new probability table required for decoding the current image frame to the entropy decoding module; the entropy decoding module is configured to perform a decoding operation on the current image frame according to the new probability table required for decoding the current image frame, and count the decoding times of the syntax elements corresponding to the relevant probability table elements; the post-frame adaptation update module is configured to, in response to the decoding completion signal, obtain the original probability table corresponding to the current image frame and the decoding times of the syntax elements corresponding to the relevant probability table elements, and perform a backward adaptation update process according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate an ultimate probability table.
[0007] In some embodiments of the first aspect of the present application, it further includes a first state machine and a first SRAM memory, and the pre-frame adaptation process module is respectively connected to the first state machine and the first SRAM memory; the first SRAM memory includes multiple first address partitions, and each first address partition is respectively used to store different types of probability table elements in the original probability table and their corresponding original probability values; the first state machine controls the pre-frame adaptation process module to perform a forward adaptation update process on different types of probability table elements according to the original probability table and the update probability factor data based on different set working states and the first address partitions corresponding to different types of probability table elements in the first SRAM memory to generate a new probability table required for decoding the current image frame.
[0008] In some embodiments of the first aspect of the present application, the working states of the first state machine include: a probability table initial update state, a motion vector probability update state, a coefficient probability update state, a segmented probability sub-update state, and an update completion state; the types of the probability table elements include four types: a first type of probability table element, a second type of probability table element, a third type of probability table element, and a fourth type of probability table element; wherein: when the first state machine is in the probability table initial update state, the motion vector probability update state, the coefficient probability update state, the segmented probability sub-update state, or the update completion state, the manner in which the pre-frame adaptation process module performs a forward adaptation update process on different types of probability table elements according to the original probability table and the update probability factor data includes: the probability table element of the subsequent type starts to perform a forward adaptation update process in response to the update completion signal of the probability table element of the previous type.
[0009] In some embodiments of the first aspect of the present application, the manner of performing the forward adaptation update process on the first category probability table elements includes: when the first state machine is in the probability table initial update state, controlling the frame forward adaptation process module to update the first category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability value corresponding to the first category probability table elements, and updating the new probability value corresponding to the first category probability table elements to the first address partition corresponding to the first category probability table elements in the first SRAM memory.
[0010] In some embodiments of the first aspect of the present application, the manner of performing the forward adaptation update process on the second category probability table elements includes: in response to the signal that the first category probability table elements are updated, determining whether the current image frame is a key frame; if the current image frame is a key frame, the working state of the first state machine jumps from the probability table initial update state to the coefficient probability update state; if the current image frame is not a key frame, the working state of the first state machine jumps from the probability table initial update state to the motion vector probability update state; when the first state machine is in the motion vector probability update state, controlling the frame forward adaptation process module to update the second category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability value corresponding to the second category probability table elements, and after updating the new probability value corresponding to the second category probability table elements to the first address partition corresponding to the second category probability table elements in the first SRAM memory, the working state of the first state machine jumps from the motion vector probability update state to the coefficient probability update state.
[0011] In some embodiments of the first aspect of the present application, the manner of performing the forward adaptation update process on the third category probability table elements includes: when the first state machine is in the coefficient probability update state, controlling the frame forward adaptation process module to update the third category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability value corresponding to the third category probability table elements, and updating the new probability value corresponding to the third category probability table elements to the first address partition corresponding to the third category probability table elements in the first SRAM memory.
[0012] In some embodiments of the first aspect of the present application, the manner of performing the forward adaptation update process on the fourth category probability table elements includes: in response to the signal indicating that the third category probability table elements have been updated, determining whether the segment update enable signal of the current image frame is high; if the segment update enable signal is high, the working state of the first state machine jumps from the coefficient probability update state to the segment probability sub-update state; when the first state machine is in the segment probability sub-update state, controlling the frame forward adaptation process module to update the fourth category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability value corresponding to the fourth category probability table elements, and after updating the new probability value corresponding to the fourth category probability table elements to the first address partition corresponding to the fourth category probability table elements in the first SRAM memory, the working state of the first state machine jumps from the segment probability sub-update state to the update completion state; if the segment update enable signal is low, the working state of the first state machine jumps from the coefficient probability update state to the update completion state.
[0013] In some embodiments of the first aspect of the present application, it further includes a second state machine and a second SRAM memory, and the frame post-adaptation update module is respectively connected to the second state machine and the second SRAM memory; the second SRAM memory includes a plurality of second address partitions, and each second address partition is respectively used to store different coding structure probability table elements in the original probability table and their corresponding original probability values; the second state machine controls the frame post-adaptation update module to perform a backward adaptation update process on different coding structure probability table elements according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements based on different set working states and the second address partitions corresponding to different coding structure probability table elements in the second SRAM memory, so as to generate an ultimate probability table.
[0014] In some embodiments of the first aspect of the present application, the working states of the second state machine include: a normal update state, and a plurality of tree update states; the different coding structure probability table elements include two types: non-tree coding structure probability table elements, and tree coding structure probability table elements; wherein, the second state machine jumps between the normal update state and each tree update state based on the second address partitions corresponding to different coding structure probability table elements in the second SRAM memory, and when in the normal update state, controls the frame post-adaptation update module to perform a backward adaptation update process on the non-tree coding structure probability table elements according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements; and when in the tree update state, controls the frame post-adaptation update module to perform a backward adaptation update process on the tree coding structure probability table elements according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements.
[0015] In some embodiments of the first aspect of the present application, performing a backward adaptation update process on non-tree coding structure probability table elements includes: when the second state machine is in the normal update state, controlling the frame backward adaptation update module to obtain the decoding times of the syntax elements corresponding to the non-tree coding structure probability table elements, and obtaining the new probability values corresponding to the non-tree coding structure probability table elements according to the decoding times of the syntax elements corresponding to the non-tree coding structure probability table elements and the original probability values, and updating the new probability values corresponding to the non-tree coding structure probability table elements to the second address partition corresponding to the non-tree coding structure probability table elements in the second SRAM memory.
[0016] In some embodiments of the first aspect of the present application, performing a backward adaptation update process on tree coding structure probability table elements includes: when the second state machine is in the tree update state, controlling the frame backward adaptation update module to obtain the decoding times of the syntax elements corresponding to the tree coding structure probability table elements, and obtaining the new probability values corresponding to the tree coding structure probability table elements according to the decoding times of the syntax elements corresponding to the tree coding structure probability table elements and the original probability values, and updating the new probability values corresponding to the tree coding structure probability table elements to the second address partition corresponding to the tree coding structure probability table elements in the second SRAM memory.
[0017] In some embodiments of the first aspect of the present application, it further includes a bus arbitration module and a DDR memory, the bus arbitration module is respectively connected to the frame forward adaptation process module, the frame backward adaptation update module and the DDR memory; the frame forward adaptation process module obtains the original probability table and the update probability factor data corresponding to the current image frame from the DDR memory through the bus arbitration module; the frame backward adaptation update module obtains the original probability table corresponding to the current image frame from the DDR memory through the bus arbitration module, and writes the ultimate probability table into the DDR memory through the bus arbitration module.
[0018] To achieve the above and other related objectives, a second aspect of the present application provides a probability table update method, which is applied to the probability table update device as described above. The probability table update device includes: a pre-frame adaptation process module, an entropy decoding module, and a post-frame adaptation update module; the entropy decoding module is respectively connected to the pre-frame adaptation process module and the post-frame adaptation update module; wherein, the probability table update method includes: the pre-frame adaptation process module obtains the original probability table and the update probability factor data corresponding to the current image frame, and according to the original probability table and the update probability factor data, performs a forward adaptation update process to generate a new probability table required for decoding the current image frame, and sends the new probability table required for decoding the current image frame to the entropy decoding module; the entropy decoding module decodes the current image frame according to the new probability table required for decoding the current image frame, and counts the decoding times of the syntax elements corresponding to the relevant probability table elements; the post-frame adaptation update module responds to the decoding completion signal, obtains the original probability table corresponding to the current image frame and the decoding times of the syntax elements corresponding to the relevant probability table elements, and according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements, performs a backward adaptation update process to generate the ultimate probability table.
[0019] To achieve the above and other related objectives, a third aspect of the present application provides a probability table update medium, on which a computer program is stored, and when the computer program is executed by a processor, the probability table update method as described above is implemented.
[0020] To achieve the above and other related objectives, a fourth aspect of the present application provides a probability table update terminal, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the probability table update method as described above.
[0021] As described above, the probability table updating device, updating method, medium and terminal of the present application have the following beneficial effects: The pre-frame adaptation process module updates the original probability table before the start of decoding to generate a new probability table required for decoding the current image frame. By updating the probability table in advance, the number of software-hardware interactions during the video decoding process is reduced, thereby reducing the bandwidth pressure and improving the overall performance of the system, enabling the decoder to work more efficiently. The entropy decoding module uses the updated new probability table to perform decoding operations on the current image frame, and during the decoding process, the entropy decoding module will count the decoding times of the syntax elements corresponding to the relevant probability table elements for the post-frame adaptation update module to perform the backward adaptation update process. The post-frame adaptation update module performs a backward adaptation update process on the original probability table according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate an ultimate probability table. Thus, using the forward and backward update processes of the hardware decoding probability table, the system can dynamically adjust the original probability table according to the actual decoding data to make it more conform to the current data characteristics. This dynamic adjustment mechanism not only improves the adaptability of the decoder to different data characteristics, enables it to be more widely applied to various decoding scenarios, meets the application requirements of independent decoding of multiple frames, but also further improves the decoding speed and accuracy.
[0022] Furthermore, since the storage addresses of various category probability table elements and each coding structure probability table element in the first SRAM memory and the second SRAM memory are different, by designing the first state machine of the pre-frame adaptation process module and the second state machine of the post-frame adaptation update module according to the storage addresses of various category probability table elements and each coding structure probability table element in the first SRAM memory and the second SRAM memory and the original probability table, the update of the probability table can be completed inside the hardware, simplifying the update process, reducing the jumps between states, and reducing the number of interactions between the upper-layer software and the hardware, thereby reducing the bandwidth pressure. Due to the reduction of software-hardware interaction and waiting time, the decoder can process image data faster without waiting for the software to update the probability table before performing hardware decoding, which helps to improve the throughput of the decoder, enabling it to process multiple frames of images faster and more independently, and enabling the decoder to complete the decoding of multiple frames of images independently without relying on the upper-layer software, meeting the application requirements of independent decoding of multiple frames. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It shows a schematic structural diagram of a probability table updating device in an embodiment of the present application.
[0024] Figure 2 It shows a working state transition diagram of the first state machine in an embodiment of the present application.
[0025] Figure 3AIt shows a schematic diagram of the state transition process for updating the first category probability table element in an embodiment of the present application.
[0026] Figure 3B It shows a schematic diagram of the state transition process for updating the second and third category probability table elements in an embodiment of the present application.
[0027] Figure 3C It shows a schematic diagram of the state transition process for updating the fourth category probability table element in an embodiment of the present application.
[0028] Figure 4 It shows the working state transition diagram of the second state machine in an embodiment of the present application.
[0029] Figure 5 It shows a schematic diagram of the process of the probability table update method in an embodiment of the present application.
[0030] Figure 6 It shows a schematic block diagram of the probability table update terminal in an embodiment of the present application.
[0031] Description of component labels
[0032] Probability table update device 100
[0033] Pre-frame adaptation process module 101
[0034] Entropy decoding module 102
[0035] Post-frame adaptation update module 103
[0036] First state machine 104
[0037] First SRAM memory 105
[0038] Second state machine 106
[0039] Second SRAM memory 107
[0040] Bus arbitration module 108
[0041] DDR memory 109
[0042] Third SRAM memory 110
[0043] Fourth SRAM memory 111 Detailed implementation manners
[0044] The following describes the implementation manners of the present application through specific examples. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0045] Before further elaborating on the present invention, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are applicable to the following explanations:
[0046] <1>DDR (Double Data Rate Synchronous Dynamic Random Access Memory): Double Data Rate Synchronous Dynamic Random Access Memory, which is a type of memory.
[0047] <2>VP9: An open format, royalty-free video compression standard developed by Google (Google), aiming to provide higher-quality video compression effects while maintaining low bandwidth occupancy.
[0048] <3>SRAM (Static Random-Access Memory): Static Random Access Memory, which is an important type of computer memory.
[0049] In the original design structure of the decoder, the upper-layer software is used to update the probability table, and it is necessary to wait for the relevant probability table of the hardware decoding to be completed, and then transmit the relevant information to the software through the bus, which increases the bandwidth pressure caused by the interaction between software and hardware and reduces the working efficiency of the decoder. For the decoder, if each frame needs to be jointly completed by software and hardware, it will undoubtedly greatly affect the performance of the decoder, and the original solution cannot well solve the application requirements of some independent decoding of multiple frames.
[0050] To solve the problems in the above background technology, the present application provides a probability table update device, update method, medium and terminal, which are used to solve the technical problems in the prior art such as excessive interaction between software and hardware in probability table update, resulting in increased bandwidth pressure, reduced working efficiency of the decoder, and the decoder being unable to continuously process multiple frames of images in a short time.
[0051] To facilitate the understanding of the embodiments of the present application, first, in combination with Figure 1 Detailed description. Figure 1The structural schematic diagram of the probability table updating device in the embodiment of the present application is shown. The probability table updating device 100 in this embodiment mainly includes: a pre-frame adaptation process module 101, an entropy decoding module 102, and a post-frame adaptation update module 103; the entropy decoding module 102 is respectively connected to the pre-frame adaptation process module 101 and the post-frame adaptation update module 103.
[0052] In this embodiment, the pre-frame adaptation process module 101 is used to obtain the original probability table and the updated probability factor data corresponding to the current image frame, and perform a forward adaptation update process according to the original probability table and the updated probability factor data to generate a new probability table required for decoding the current image frame, and send the new probability table required for decoding the current image frame to the entropy decoding module 102.
[0053] In this embodiment, the entropy decoding module 102 is used to decode the current image frame according to the new probability table required for decoding the current image frame, and count the decoding times of the syntax elements corresponding to the relevant probability table elements.
[0054] In this embodiment, the post-frame adaptation update module 103 is used to respond to the decoding completion signal, obtain the original probability table corresponding to the current image frame and the decoding times of the syntax elements corresponding to the relevant probability table elements, and perform a backward adaptation update process according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate an ultimate probability table.
[0055] In this embodiment, the probability table updating device 100 further includes a bus arbitration module 108 and a DDR memory 109. The bus arbitration module 108 is respectively connected to the pre-frame adaptation process module 101, the post-frame adaptation update module 103, and the DDR memory 109. The pre-frame adaptation process module 101 obtains the original probability table and the updated probability factor data corresponding to the current image frame from the DDR memory 109 through the bus arbitration module 108; the post-frame adaptation update module 103 obtains the original probability table corresponding to the current image frame from the DDR memory 109 through the bus arbitration module 108, and writes the ultimate probability table into the DDR memory 109 through the bus arbitration module 108.
[0056] In this embodiment, at the beginning of decoding a frame of image, the pre-frame adaptation process module 101 sends a read request to the bus arbitration module 108. The bus arbitration module 108 reads the original probability table and the updated probability factor data back from the DDR memory 109 and sends them to the pre-frame adaptation process module 101. The pre-frame adaptation process module 101 performs a forward adaptation update process according to the read original probability table and the updated probability factor data to obtain a new probability table required for decoding the current image frame, and sends it to the entropy decoding module 102.
[0057] In this embodiment, the entropy decoding module 102 decodes the current image frame according to the new probability table required for decoding the current image frame, and counts the decoding times of the syntax elements corresponding to the relevant probability table elements. The decoding times of the syntax elements corresponding to the probability table elements refer to the number of times that the syntax elements determined according to the probability table elements are decoded into a Boolean value of 0 or 1. After the decoding of the current image frame is completed, the entropy decoding module 102 sends a decoding completion signal to the post-frame adaptation update module 103. By using the new probability table for decoding, the entropy decoding module 102 can more accurately identify the coding mode and data characteristics, thereby improving the decoding speed and accuracy.
[0058] In this embodiment, the probability table update device 100 further includes a third SRAM memory 110. The third SRAM memory 110 is respectively connected to the entropy decoding module 102 and the post-frame adaptation update module 103, and the third SRAM memory 110 is used to store the new probability table required for decoding the current image frame.
[0059] In this embodiment, after receiving the decoding completion signal transmitted by the entropy decoding module 102, the post-frame adaptation update module 103 first reads the original probability table from the DDR memory 109 through the bus arbitration module 108, and performs a backward adaptation update process on the original probability table according to the decoding times of the syntax elements corresponding to the relevant probability table elements counted by the entropy decoding module 102. After the update process is completed, a write request is sent to the bus arbitration module 108 to write the generated ultimate probability table back to the corresponding buffer area of the DDR memory 109, thereby completing the probability table update process.
[0060] It should be noted that in the probability table update device 100 of the present application, the pre-frame adaptation process module 101 updates the original probability table before the decoding starts to generate a new probability table required for decoding the current image frame. By updating the probability table in advance, the number of software-hardware interactions during the video decoding process is reduced, thereby reducing the bandwidth pressure and improving the overall performance of the system, enabling the decoder to work more efficiently. The entropy decoding module 102 decodes the current image frame using the updated new probability table, and during the decoding process, the entropy decoding module 102 counts the decoding times of the syntax elements corresponding to the relevant probability table elements for the post-frame adaptation update module 103 to perform the backward adaptation update process. The post-frame adaptation update module 103 performs a backward adaptation update process on the original probability table according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate an ultimate probability table. Thus, using the forward and backward update processes of the hardware decoding probability table, the system can dynamically adjust the original probability table according to the actual decoding data to make it more conform to the current data characteristics. This dynamic adjustment mechanism not only improves the adaptability of the decoder to different data characteristics, enabling it to be more widely applied to various decoding scenarios and meeting the application requirements of independent decoding of multiple frames, but also further improves the decoding speed and accuracy.
[0061] In this embodiment, the probability table update device 100 further includes a first state machine 104 and a first SRAM memory 105. The pre-frame adaptation process module 101 is respectively connected to the first state machine 104 and the first SRAM memory 105. The first SRAM memory 105 includes multiple first address partitions, and each first address partition is respectively used to store different types of probability table elements in the original probability table and their corresponding original probability values. The first state machine 104 controls the pre-frame adaptation process module 101 to perform a forward adaptation update process on different types of probability table elements according to the original probability table and the update probability factor data based on the set different working states and the first address partitions corresponding to different types of probability table elements in the first SRAM memory 105 to generate a new probability table required for decoding the current image frame.
[0062] In this embodiment, the working states of the first state machine 104 include: probability table initial update state (PROB_DIFF_UPDATE_PZERO), motion vector probability update state (PROB_DIFF_UPDATE_MV), coefficient probability update state (PROB_DIFF_UPDATE_COEFF), segmented probability sub-update state (PROB_SEGMENT_PROB_SUB), and update completion state (PROB_DIFF_UPDATE_DONE); the categories of probability table elements include four types: first-category probability table elements, second-category probability table elements, third-category probability table elements, and fourth-category probability table elements; where: when the first state machine 104 is in the probability table initial update state, motion vector probability update state, coefficient probability update state, segmented probability sub-update state, or update completion state, the frame pre-adaptation process module 101 performs the forward adaptation update process on different-category probability table elements according to the original probability table and the update probability factor data in the following manner: the probability table elements of the subsequent category start to perform the forward adaptation update process in response to the signal indicating that the probability table elements of the previous category have been updated.
[0063] In this embodiment, as Figure 3A shown, to update the first-category probability table elements, steps S301 - S304 are executed. After the update of the first-category probability table elements is completed, as Figure 3B shown, step S305 is executed to determine whether the current image frame is a key frame. If it is a key frame, steps S306 and S309 are executed to directly update the third-category probability table elements. If it is not a key frame, steps S307 and S308 are executed to first update the second-category probability table elements, and after the update of the second-category probability table elements is completed, step S309 is executed to then update the third-category probability table elements.
[0064] In this embodiment, as Figure 3C shown, after the update of the third-category probability table elements is completed, step S310 is executed to determine whether the segmented update enable signal of the current image frame is high. If it is, steps S311, S312, and S314 are executed to update the fourth-category probability table elements, and then the entire forward adaptation update process ends; if not, steps S313 and S314 are executed without updating the fourth-category probability table elements, that is, after the update of the third-category probability table elements is completed, the entire forward adaptation update process ends.
[0065] In this embodiment, whether the second - category probability - table element is updated depends on whether the current image frame is a key frame. Whether the fourth - category probability - table element is updated depends on whether the segmented - update enable signal of the current image frame is high. Therefore, the cases where the latter - category probability - table element starts to execute the forward - adaptation update process in response to the signal that the previous - category probability - table element has been updated include:
[0066] (1) Update the first - category, second - category, third - category, and fourth - category probability - table elements in sequence.
[0067] (2) Update the first - category, third - category, and fourth - category probability - table elements in sequence.
[0068] (3) Update the first - category, second - category, and third - category probability - table elements in sequence.
[0069] (4) Update the first - category and third - category probability - table elements in sequence.
[0070] In this embodiment, the working states of the first state machine 104 further include: pre - frame idle state (PROB_IDLE), bus - request state (PROB_MAKE_BUS_REQUEST), and initialize differential - probability state (PROB_INIT_DELTA_PROB). Thus, the first state machine 104 has a total of 8 working states, namely pre - frame idle state, bus - request state, initialize differential - probability state, probability - table initial - update state, motion - vector probability - update state, coefficient - probability - update state, segmented - probability sub - update state, and update - completed state. The first state machine 104 controls the pre - frame adaptation process module 101 to update different - category probability - table elements according to different working states, based on the original probability table and the updated probability - factor data, and based on the calculation process used in the forward - adaptation update process defined in the VP9 standard protocol, that is, the probability - update difference calculation process (diff_update_prob). Among them, the probability - update difference calculation process includes the following methods:
[0071] (1) Obtain the original probability values of each category of probability - table elements according to the original probability table.
[0072] (2) Adjust the original probability values using the updated probability - factor data to obtain a new probability value. Usually, it involves a look - up table and addition - subtraction operations, which specifically depend on the updated probability - factor data and the original probability values.
[0073] In this embodiment, the original probability table is a table containing a series of original probability values, which are used to guide various decisions in the encoding process. The updated probability factor data reflects the difference between the actual situation observed in the encoding process and the original probability table, and they are from the bitstream of the current decoded frame.
[0074] In this embodiment, when the first state machine 104 is in the pre-frame idle state, the bus request state, or the initialization differential probability state, the pre-frame adaptation process module 101 stores the obtained original probability table and the updated probability factor data into the first SRAM memory 105; wherein, the following methods are included:
[0075] (1) The first state machine 104 controls the pre-frame adaptation process module 101 to generate a differential update start signal (diff_update_start) after obtaining the original probability table corresponding to the current image frame, and the working state of the first state machine 104 jumps from the pre-frame idle state to the bus request state. The pre-frame idle state is the initial state of the first state machine 104, indicating that the pre-frame adaptation process module 101 is not performing any operation currently. When the decoder is ready to start processing a new video frame, it starts from this state.
[0076] (2) When the first state machine 104 is in the bus request state, it controls the pre-frame adaptation process module 101 to send an updated probability factor read request to the bus arbitration module 108, and after the communication protocol is successfully established, the working state of the first state machine 104 jumps from the bus request state to the initialization differential probability state.
[0077] (3) When the first state machine 104 is in the initialization differential probability state, it controls the pre-frame adaptation process module 101 to receive the updated probability factor data read from the bus arbitration module 108 and stores it into the first SRAM memory 105.
[0078] (4) In response to the data reception complete signal, the working state of the first state machine 104 jumps from the initialization differential probability state to the probability table initial update state.
[0079] In this embodiment, the method for performing the forward adaptation update process on the first category probability table elements includes: when the first state machine 104 is in the probability table initial update state, it controls the pre-frame adaptation process module 101 to update the first category probability table elements according to the original probability table and the updated probability factor data, so as to obtain the new probability values corresponding to the first category probability table elements, and update the new probability values corresponding to the first category probability table elements to the first address partition corresponding to the first category probability table elements in the first SRAM memory 105.
[0080] In this embodiment, the first category probability table elements include: transform mode probability table elements (tx_mode_probs), skip mode probability table elements (skip_mode), inter-frame prediction mode probability table elements (inter_mode_probs), interpolation filter probability table elements (interp_filter_probs), intra-frame prediction mode probability table elements (intra_inter_probs), frame reference mode probability table elements (frame_reference_mode_probs), luminance prediction mode probability table elements (y_mode_probs), and partition probability table elements (partition_probs).
[0081] In this embodiment, the method for performing the forward adaptation update process on the second category probability table elements includes:
[0082] (1) In response to the signal indicating that the first category probability table elements have been updated, determine whether the current image frame is a key frame.
[0083] (2) If the current image frame is a key frame, the working state of the first state machine 104 jumps from the probability table initial update state to the coefficient probability update state.
[0084] (3) If the current image frame is not a key frame, the working state of the first state machine 104 jumps from the probability table initial update state to the motion vector probability update state; when the first state machine 104 is in the motion vector probability update state, control the frame forward adaptation process module 101 to update the second category probability table elements according to the original probability table and the updated probability factor data to obtain the new probability values corresponding to the second category probability table elements, and after updating the new probability values corresponding to the second category probability table elements to the first address partition corresponding to the second category probability table elements in the first SRAM memory 105, the working state of the first state machine 104 jumps from the motion vector probability update state to the coefficient probability update state.
[0085] In this embodiment, the second category probability table elements include: motion vector probability table elements (MV_probs). For the update of the motion vector probability table elements, it is not necessary to perform the probability update difference calculation process. Its update process is defined as updating the motion vector probability (update_mv_prob) in the VP9 standard protocol. Decode the specific parameters or probability values related to the update probability from the current image frame, and then obtain the new probability values corresponding to the motion vector probability table elements through simple operations.
[0086] In this embodiment, the method for performing the forward adaptation update process on the third category probability table elements includes: when the first state machine 104 is in the coefficient probability update state, the control frame pre-adaptation process module 101 updates the third category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability value corresponding to the third category probability table elements, and updates the new probability value corresponding to the third category probability table elements to the first address partition corresponding to the third category probability table elements in the first SRAM memory 105.
[0087] In this embodiment, the third category probability table elements include: coefficient probability table elements (coeff_probs). For the update of the coefficient probability table elements, the probability update difference calculation process defined in the VP9 standard protocol is performed, and the result is updated to the first SRAM memory 105.
[0088] In this embodiment, the method for performing the forward adaptation update process on the fourth category probability table elements includes:
[0089] (1) In response to the signal indicating that the third category probability table elements are updated, determine whether the segment update enable signal of the current image frame is high.
[0090] (2) If the segment update enable signal is high, the working state of the first state machine 104 jumps from the coefficient probability update state to the segment probability sub-update state; when the first state machine 104 is in the segment probability sub-update state, the control frame pre-adaptation process module 101 updates the fourth category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability value corresponding to the fourth category probability table elements, and after updating the new probability value corresponding to the fourth category probability table elements to the first address partition corresponding to the fourth category probability table elements in the first SRAM memory 105, the working state of the first state machine 104 jumps from the segment probability sub-update state to the update completion state.
[0091] (3) If the segment update enable signal is low, the working state of the first state machine 104 jumps from the coefficient probability update state to the update completion state.
[0092] In this embodiment, the fourth category probability table elements include: segment probability table elements (segment_prob). When the first state machine 104 is in the segment probability sub-update state, the frame pre-adaptation process module 101 updates the fourth category probability table elements. After the update process is completed, the first state machine 104 jumps to the update completion state. The update completion state represents the end of the entire forward adaptation update process, and transmits the new probability table required for decoding the current image frame to the entropy decoding module 102, and starts the frame decoding process.
[0093] In this embodiment, asFigure 2 As described above, it shows the working state transition diagram of the first state machine in the embodiment of the present application. As Figures 3A - 3C described above, it shows the schematic flow diagram of the entire forward adaptation update process in the embodiment of the present application. Below, in combination with Figure 2 and Figures 3A - 3C the working principle of the frame forward adaptation update will be described. The forward adaptation update process for different categories of syntax elements includes the following steps: (1) the state transition process of the first category probability table element update; (2) the state transition process of the second category probability table element and the third category probability table element update; (3) the state transition process of the fourth category probability table element update.
[0094] In this embodiment, as Figure 3A described above, it shows the schematic flow diagram of the state transition of the first category probability table element update in the embodiment of the present application. Among them, the state transition process of the first category probability table element update includes the following steps:
[0095] S301: After the first state machine 104 controls the frame forward adaptation process module 101 to obtain the original probability table corresponding to the current image frame, it generates a differential update start signal, and the working state of the first state machine 104 jumps from the frame forward idle state to the bus request state.
[0096] S302: When the first state machine 104 is in the bus request state, it controls the frame forward adaptation process module 101 to send an update probability factor read request to the bus arbitration module 108, and after the communication protocol is successfully established, the working state of the first state machine 104 jumps from the bus request state to the initialize differential probability state.
[0097] S303: When the first state machine 104 is in the initialize differential probability state, it controls the frame forward adaptation process module 101 to receive the update probability factor data read from the bus arbitration module 108 and store it in the first SRAM memory 105; in response to the data reception completion signal, the working state of the first state machine 104 jumps from the initialize differential probability state to the probability table initial update state.
[0098] S304: When the first state machine 104 is in the probability table initial update state, it controls the frame forward adaptation process module 101 to update the first category probability table element according to the original probability table and the update probability factor data to obtain the new probability value corresponding to the first category probability table element, and updates the new probability value corresponding to the first category probability table element to the first address partition corresponding to the first category probability table element in the first SRAM memory 105.
[0099] In this embodiment, as Figure 3BAs described above, a schematic diagram of the state transition process for updating the second and third category probability table elements in an embodiment of the present application is shown. The state transition process for updating the second category probability table elements and the third category probability table elements includes the following steps:
[0100] S305: In response to the signal indicating that the first category probability table elements have been updated, determine whether the current image frame is a key frame.
[0101] S306: If the current image frame is a key frame, the working state of the first state machine 104 jumps from the probability table initial update state to the coefficient probability update state, and step S309 is executed.
[0102] S307: If the current image frame is not a key frame, the working state of the first state machine 104 jumps from the probability table initial update state to the motion vector probability update state.
[0103] S308: When the first state machine 104 is in the motion vector probability update state, control the frame pre-adaptation process module 101 to update the second category probability table elements according to the original probability table and the updated probability factor data, so as to obtain the new probability value corresponding to the second category probability table elements, and update the new probability value corresponding to the second category probability table elements to the first address partition corresponding to the second category probability table elements in the first SRAM memory 105; in response to the signal indicating that the second category syntax elements have been updated, the working state of the first state machine 104 jumps from the motion vector probability update state to the coefficient probability update state.
[0104] S309: When the first state machine 104 is in the coefficient probability update state, control the frame pre-adaptation process module 101 to update the third category probability table elements according to the original probability table and the updated probability factor data, so as to obtain the new probability value corresponding to the third category probability table elements, and update the new probability value corresponding to the third category probability table elements to the first address partition corresponding to the third category probability table elements in the first SRAM memory 105.
[0105] In this embodiment, as Figure 3C described above, a schematic diagram of the state transition process for updating the fourth category probability table elements in an embodiment of the present application is shown. The state transition process for updating the fourth category probability table elements includes the following steps:
[0106] S310: In response to the signal indicating that the third category probability table elements have been updated, determine whether the segmentation update enable signal of the current image frame is high.
[0107] S311: If the segmentation update enable signal is high, the working state of the first state machine 104 jumps from the coefficient probability update state to the segmentation probability sub-update state, and step S312 is executed.
[0108] S312: When the first state machine 104 is in the segmented probability sub-update state, the control frame pre-adaptation process module 101 updates the fourth-category probability table elements according to the original probability table and the updated probability factor data to obtain the new probability values corresponding to the fourth-category probability table elements, and updates the new probability values corresponding to the fourth-category probability table elements to the first address partition corresponding to the fourth-category probability table elements in the first SRAM memory 105; in response to the signal indicating that the update of the fourth-category probability table elements is completed, the working state of the first state machine 104 jumps from the segmented probability sub-update state to the update completion state, and step S314 is executed.
[0109] S313: If the segmented update enable signal is low, the working state of the first state machine 104 jumps from the coefficient probability update state to the update completion state, and step S314 is executed.
[0110] S314: The end of the entire forward adaptation update process, and the new probability table required for decoding the current image frame is transmitted to the entropy decoding module 102.
[0111] In this embodiment, when the entropy decoding module 102 performs decoding operations, a total of four sets of probability tables are required. Before decoding each frame of image, the frame pre-adaptation process module 101 will first select a set of original probability tables corresponding to the current frame. Each original probability table has nearly 3800 bytes, and the bit width of each syntax element is 1 byte. And because the storage addresses of the probability table elements of each category in the first SRAM memory 105 are different, by designing the first state machine 104 according to the storage addresses of the probability table elements of each category in the first SRAM memory 105 and the original probability table required for the forward adaptation update process, the update of the probability table can be completed inside the hardware, simplifying the update process, reducing the jumps between states, reducing the number of interactions between the upper-layer software and the hardware, thereby reducing the bandwidth pressure. Due to the reduction of software-hardware interaction and waiting time, the decoder can process image data faster without waiting for the software to update the probability table before performing hardware decoding, which helps to improve the throughput of the decoder, enabling it to process multiple frames of images faster and more independently, and enabling the decoder to complete the decoding of multiple frames of images independently without relying on the upper-layer software.
[0112] In this embodiment, the probability table updating device 100 further includes a second state machine 106 and a second SRAM memory 107. The post-frame adaptation updating module 103 is respectively connected to the second state machine 106 and the second SRAM memory 107. The second SRAM memory 107 includes a plurality of second address partitions, and each second address partition is respectively used to store the probability table elements of different coding structures in the original probability table and their corresponding original probability values. The second state machine 106 controls the post-frame adaptation updating module 103 to perform a backward adaptation updating process on the probability table elements of different coding structures according to the decoding times of the syntax elements corresponding to the original probability table and the relevant probability table elements, based on the set different working states and the second address partitions corresponding to the probability table elements of different coding structures in the second SRAM memory 107, so as to generate the ultimate probability table.
[0113] In this embodiment, the working states of the second state machine 106 include: a normal updating state and a plurality of tree updating states. The probability table elements of different coding structures include two types: non-tree coding structure probability table elements and tree coding structure probability table elements. Among them, the second state machine 106 jumps between the normal updating state and each tree updating state based on the second address partitions corresponding to the probability table elements of different coding structures in the second SRAM memory 107, and when in the normal updating state, controls the post-frame adaptation updating module 103 to perform a backward adaptation updating process on the non-tree coding structure probability table elements according to the decoding times of the syntax elements corresponding to the original probability table and the relevant probability table elements; and when in the tree updating state, controls the post-frame adaptation updating module 103 to perform a backward adaptation updating process on the tree coding structure probability table elements according to the decoding times of the syntax elements corresponding to the original probability table and the relevant probability table elements.
[0114] In this embodiment, the working states of the second state machine 106 further include: post-frame idle state, initialize original probability table state, and update end state. The tree update state includes: inter-frame mode tree update state, chroma mode tree update state, 16x16 change block tree update state, 32x32 change block tree update state, luminance mode tree update state, segmentation mode tree update state, inter-frame filtering tree update state, motion vector tree 1 update state, motion vector tree 2 update state, motion vector tree 3 update state, motion vector tree 4 update state, and transform coefficient tree update state. The second state machine 106 has a total of 16 working states, namely post-frame idle state, initialize original probability table state, normal update state, inter-frame mode tree update state, chroma mode tree update state, 16x16 change block tree update state, 32x32 change block tree update state, luminance mode tree update state, segmentation mode tree update state, inter-frame filtering tree update state, motion vector tree 1 update state, motion vector tree 2 update state, motion vector tree 3 update state, motion vector tree 4 update state, transform coefficient tree update state, and update end state.
[0115] In this embodiment, as Figure 4 described, the working state transition diagram of the second state machine in the embodiment of the present application is shown. The following combines Figure 4 to illustrate the working principle of post-frame adaptive update:
[0116] (1) After the entropy decoding module 102 finishes decoding the current image frame, the entropy decoding module 102 sends a decoding completed signal to the post-frame adaptive update module 103. At this time, the second state machine 106 jumps from the post-frame idle state to the initialize original probability table state, as Figure 4 indicated by label ① in
[0117] (2) When the second state machine 106 is in the initialize original probability table state, it controls the post-frame adaptive update module 103 to send a read request to the bus arbitration module 108. After the communication protocol is successfully established, it receives the original probability table information and stores it in the second SRAM memory 107. After the data reception is completed, the working state of the second state machine 106 jumps from the initialize original probability table state to the normal update state, as Figure 4 indicated by label ② in
[0118] (3) When the second state machine 106 is in the normal update state, the post-frame adaptive update module updates the non-tree coding structure probability table elements, as Figure 4 indicated by labels ③, ⑤, ⑦, in
[0119] (4) When encountering a tree - structured coding - structure probability - table element, the second state machine 106 jumps from the normal update state to the corresponding tree - structured update state, and the post - frame adaptation update module 103 updates the tree - structured coding - structure probability - table element, such as Figure 4 the labels ④, ⑥, ⑧, ⑨, ⑩ in which are the state jumps after the update of the corresponding tree - structured coding - structure probability - table element is completed. After updating the probability values of all the syntax elements corresponding to the current tree - structured coding - structure probability - table element, if the update mode of the next probability - table element is the normal mode, at this time, the tree - structured update state corresponding to the next tree - structured coding - structure probability - table element needs to be updated to the tree - state register, and when the normal update state ends, it jumps to the correct tree - structured update state. The non - tree - structured coding - structure probability - table elements updated in the normal update state are scattered. After updating a part of them, it turns to update other tree - structured coding - structure probability - table elements, and then jumps back to the normal update state. The specific update order is related to the addresses where the corresponding coding - structure probability - table elements are stored in the second SRAM memory 107.
[0120] (5) After completing the update of the corresponding probability - table element in the transform - coefficient tree - structured update state, when the second state machine 106 jumps to the update - end state, the post - frame adaptation update module 103 sends a write request to the bus arbitration module 108 to write the generated ultimate probability table back to the corresponding buffer in the DDR memory 109, thus completing the entire update process of the probability table.
[0121] In this embodiment, the probability - table update device 100 further includes a fourth SRAM memory 111. The fourth SRAM memory 111 is connected to the post - frame adaptation update module 103, and the fourth SRAM memory 111 is used to store the decoding times of the syntax elements corresponding to different coding - structure probability - table elements.
[0122] In this embodiment, the post - frame adaptation update module 103 mainly performs the backward - adaptation update process including: the update of non - tree - structured coding - structure probability - table elements and the update of tree - structured coding - structure probability - table elements. Its backward - adaptation update process adjusts and calculates the original probability table according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability - table elements statistically calculated by the entropy decoding module 102 after the decoding of the current image frame is completed. The calculation formula is as follows:
[0123] prob_pre=(cnt0 * 256+(cnt0 + cnt1)>>1) / (cnt0 + cnt1); Formula (1)
[0124] Among them, prob_pre represents the adaptive value corresponding to the elements of the probability table of different coding structures; cnt0 represents the number of times the syntax element corresponding to the element of the probability table of different coding structures is decoded into a Boolean value of 0; cnt1 represents the number of times the syntax element corresponding to the element of the probability table of different coding structures is decoded into a Boolean value of 1.
[0125] prob = (oriprob * (256 - factor) + prob_pre * factor + 1 << 7) >> 8; Formula (2)
[0126] Among them, prob represents the new probability value corresponding to the element of the probability table of different coding structures; oriprob represents the original probability value corresponding to the element of the probability table of different coding structures; prob_pre represents the adaptive value corresponding to the element of the probability table of different coding structures; factor represents a constant factor obtained by looking up a table.
[0127] In this embodiment, the process of performing backward adaptation update on the elements of the non - tree - shaped coding structure probability table includes: when the second state machine 106 is in the normal update state, the control frame backward adaptation update module 103 obtains the decoding times of the syntax elements corresponding to the elements of the non - tree - shaped coding structure probability table, and according to the decoding times of the syntax elements corresponding to the elements of the non - tree - shaped coding structure probability table and the original probability value, obtains the new probability value corresponding to the elements of the non - tree - shaped coding structure probability table, and updates the new probability value corresponding to the elements of the non - tree - shaped coding structure probability table to the second address partition corresponding to the elements of the non - tree - shaped coding structure probability table in the second SRAM memory 107.
[0128] In this embodiment, for the decoding times of the syntax elements corresponding to the elements of the non - tree - shaped coding structure probability table, the frame backward adaptation update module 103 can directly obtain them from the decoding times of the syntax elements corresponding to the relevant probability table elements statistically counted by the entropy decoding module 102 during the decoding process, and according to the obtained decoding times of the syntax elements corresponding to the elements of the non - tree - shaped coding structure probability table and the original probability value, calculate the new probability value corresponding to the elements of the non - tree - shaped coding structure probability table according to the above Formula (1) and Formula (2), and update the original probability table.
[0129] In this embodiment, the process of performing backward adaptation update on the elements of the tree - shaped coding structure probability table includes: when the second state machine 106 is in the tree - shaped update state, the control frame backward adaptation update module 103 obtains the decoding times of the syntax elements corresponding to the elements of the tree - shaped coding structure probability table, and according to the decoding times of the syntax elements corresponding to the elements of the tree - shaped coding structure probability table and the original probability value, obtains the new probability value corresponding to the elements of the tree - shaped coding structure probability table, and updates the new probability value corresponding to the elements of the tree - shaped coding structure probability table to the second address partition corresponding to the elements of the tree - shaped coding structure probability table in the second SRAM memory 107.
[0130] In this embodiment, for the decoding times of the syntax elements corresponding to the probability table elements of the tree coding structure, after the tree coding structures of different syntax elements are updated in sequence, the decoding times cnt0 and cnt1 required for their update can be obtained. The post-frame adaptation update process in the VP9 standard protocol involves a total of 12 syntax element trees, corresponding to 12 tree update states in the second state machine.
[0131] In this embodiment, specifically, the VP9 video specification uses a tree coding mode for some syntax elements to optimize coding and achieve the purpose of reducing coding bits. This structure reduces the storage of relevant counting information and saves the hardware storage overhead. This method can be regarded as a recursive coding method. For the syntax element group belonging to the same tree coding structure, the decoding count information of each element in the group is related to the syntax element count of its lower-layer tree nodes. Therefore, the syntax element at the root node needs to wait until the syntax elements of other tree nodes are updated before the decoding times cnt0 and cnt1 required for its update can be obtained. Except that the counting information of the bottom layer nodes can be directly obtained, the decoding times of the remaining nodes need to decode the syntax elements of their lower-layer nodes before they can all be obtained. After obtaining them, according to the above formulas (1) and (2), calculate the new probability value corresponding to the probability table element of the tree coding structure, and update the original probability table. The post-frame adaptation update module 103 updates the original probability table according to the new probability value corresponding to the non-tree coding structure probability table element and the new probability value corresponding to the tree coding structure probability table element to generate the ultimate probability table.
[0132] In this embodiment, for the update of the probability table elements of the tree coding structure, it is necessary to update them in sequence according to the tree coding structures of different syntax elements. The post-frame adaptation update process of VP9 involves a total of 12 syntax element trees, corresponding to 12 tree update states in the second state machine 106, such as the inter-frame mode tree update state, the chroma mode tree update state, the changed block 16 tree update state, the changed block 32 tree update state, the luma mode tree update state, the segmentation mode tree update state, the inter-frame filtering tree update state, the motion vector tree 1 update state, the motion vector tree 2 update state, the motion vector tree 3 update state, the motion vector tree 4 update state, and the transform coefficient tree update state. The state transition process is as Figure 4 shown.
[0133] In this embodiment, the first state machine 104 and the second state machine 106 are the control centers of the probability table updating device 100, which are used to drive the decoding process of the entire device. There are many probability table elements defined in the VP9 specification, and the probability table elements correspond to the syntax elements. Therefore, by setting the first state machine 104 and the second state machine 106, the updating process of the probability table can be optimized, the updating efficiency can be improved, the updating process can be simplified, and the jumps between states can be reduced.
[0134] In this embodiment, the probability table updating device 100 of the present application realizes the direct updating of the probability table inside the hardware through the setting of the state machine, reduces the interaction between the upper-layer software and the hardware, and takes into account the timing requirements, improves the response speed, and ensures the reliability of the probability table updating process.
[0135] It should be noted that since the storage addresses of various types of probability table elements and probability table elements of each coding structure in the first SRAM memory 105 and the second SRAM memory 107 are different, by designing the first state machine 104 of the frame pre-adaptation process module 101 and the second state machine 106 of the frame post-adaptation update module 103 according to the storage addresses of various types of probability table elements and probability table elements of each coding structure in the first SRAM memory 105 and the second SRAM memory 107 and the original probability table, the updating of the probability table can be completed inside the hardware, the updating process can be simplified, the jumps between states can be reduced, and the number of interactions between the upper-layer software and the hardware can be reduced, thereby reducing the bandwidth pressure. Since the software-hardware interaction and waiting time are reduced, the decoder can process image data faster, without waiting for the software to update the probability table before performing hardware decoding, which helps to improve the throughput of the decoder, enabling it to process multiple frames of images faster and more independently, and enabling the decoder to complete the decoding of multiple frames of images independently without relying on the upper-layer software, meeting the application requirements of independent decoding of multiple frames.
[0136] In the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. For example, the first SRAM memory and the second SRAM memory are only used to distinguish different memories, and their sequence is not limited. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and terms such as "first" and "second" do not necessarily mean different.
[0137] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" represent examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0138] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b, c can be single or multiple.
[0139] Figure 5 1 is a flow chart of a probability table updating method provided by an embodiment of the present application. The probability table updating method is applied to the probability table updating device 100 as described above. The probability table updating device 100 includes: a pre-frame adaptation process module 101, an entropy decoding module 102, and a post-frame adaptation update module 103; the entropy decoding module 102 is connected to the pre-frame adaptation process module 101 and the post-frame adaptation update module 103 respectively. Figure 5 As shown, the probability table updating method includes the following steps:
[0140] S501: The frame pre-adaptation process module 101 obtains the original probability table and updated probability factor data corresponding to the current image frame, and performs a forward adaptive update process based on the original probability table and the updated probability factor data to generate a new probability table required for decoding the current image frame, and sends the new probability table required for decoding the current image frame to the entropy decoding module 102.
[0141] S502: The entropy decoding module 102 decodes the current image frame according to the new probability table required for decoding the current image frame, and counts the number of times the syntax elements corresponding to the elements in the relevant probability table are decoded.
[0142] S503: The frame post - adaptation update module 103, in response to the decoding completion signal, obtains the original probability table corresponding to the current image frame and the decoding times of the syntax elements corresponding to the relevant probability table elements, and performs a backward adaptation update process based on the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate the ultimate probability table.
[0143] Since the implementation principle of the probability table update method in this embodiment is basically the same as that of the probability table update device, the technical content that can be shared between the principles will not be repeated here.
[0144] Figure 6 It is a schematic block diagram of the probability table update terminal provided by the embodiment of the present application. As Figure 6 shown, the probability table update terminal 600 includes: at least one processor 601, a memory 602, at least one network interface 603, and a user interface 605. Each component in the device is coupled together through a bus system 604. It can be understood that the bus system 604 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Figure 6 all kinds of buses are labeled as the bus system.
[0145] Among them, the user interface 605 may include a display, a keyboard, a mouse, a trackball, a click gun, a button, a button, a touchpad, or a touch screen, etc.
[0146] It can be understood that the memory 602 can be a volatile memory or a non - volatile memory, and may also include both volatile and non - volatile memories. Among them, the non - volatile memory can be a read - only memory (ROM, Read Only Memory), a programmable read - only memory (PROM, Programmable Read - Only Memory), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM, Static Random Access Memory), synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory). The memory described in the embodiments of the present invention is intended to include but not be limited to these and any other suitable categories of memory.
[0147] The memory 602 in the embodiments of the present invention is used to store various types of data to support the operation of the probability table update terminal 600. Examples of such data include: any executable programs for operating on the probability table update terminal 600, such as the operating system 6021 and application programs 6022; the operating system 6021 contains various system programs, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application programs 6022 may include various application programs, such as a Media Player, a Browser, etc., for implementing various application services. The method for updating the probability table provided by the embodiments of the present invention may be included in the application programs 6022.
[0148] The method disclosed in the above embodiments of the present invention can be applied to the processor 601 or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 601 or by instructions in the form of software. The above-mentioned processor 601 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 601 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor 601 may be a microprocessor or any conventional processor, etc. Combining the steps of the accessory optimization method provided by the embodiments of the present invention can be directly embodied as being executed and completed by the hardware decoding processor, or by a combination of the hardware and software modules in the decoding processor. The software module may be located in the storage medium, and the storage medium is located in the memory. The processor reads the information in the memory and combines its hardware to complete the steps of the foregoing method.
[0149] In an exemplary embodiment, the probability table update terminal 600 may be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs) for executing the foregoing method.
[0150] According to the method provided by the embodiments of the present application, the present application also provides a computer program product, which includes: computer program code that, when the computer program code runs on a computer, causes the computer to execute Figure 5 the method of any one of the embodiments shown.
[0151] According to the method provided by an embodiment of the present application, the present application also provides a probability table update medium, on which program codes are stored. When the program codes are run on a computer, the computer is caused to execute Figure 5 the method of any one of the embodiments shown in the embodiments.
[0152] As used in this specification, the terms "component", "module", "system", etc. are used to denote computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a component may be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. By way of illustration, both an application running on a computing device and the computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on one computer and / or distributed between two or more computers. In addition, these components may execute from various computer-readable media on which various data structures are stored. A component may communicate, for example, through local and / or remote processes according to signals having one or more data packets (such as data from two components interacting with another component between a local system, a distributed system, and / or a network, such as the Internet interacting with other systems through signals).
[0153] Those of ordinary skill in the art can realize that the various illustrative logical blocks and steps described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.
[0154] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0155] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings, direct couplings, or communication connections shown or discussed among each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0156] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0158] In the above embodiments, the functions of the functional units can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a high-definition digital video disc (DVD)), or a semiconductor medium (for example, a solid-state disk (SSD), etc.).
[0159] When a function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0160] As described above, the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, and all should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
[0161] In summary, this application provides a probability table update device, an update method, a medium, and a terminal. The pre-frame adaptation process module 101 updates the original probability table before the start of decoding to generate a new probability table required for decoding the current image frame. By updating the probability table in advance, the number of software-hardware interactions during the video decoding process is reduced, thereby reducing the bandwidth pressure and improving the overall performance of the system, enabling the decoder to work more efficiently. The entropy decoding module 102 decodes the current image frame using the updated new probability table, and during the decoding process, the entropy decoding module 102 will count the decoding times of the syntax elements corresponding to the relevant probability table elements for the post-frame adaptation update module 103 to perform the backward adaptation update process. The post-frame adaptation update module 103 performs a backward adaptation update process on the original probability table according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate an ultimate probability table. Thus, using the forward and backward update processes of the hardware decoding probability table, the system can dynamically adjust the original probability table according to the actual decoding data to make it more conform to the current data characteristics. This dynamic adjustment mechanism not only improves the adaptability of the decoder to different data characteristics, enables it to be more widely applied to various decoding scenarios, and meets the application requirements of independent decoding of multiple frames, but also further improves the decoding speed and accuracy. Therefore, this application effectively overcomes various drawbacks in the prior art and has high industrial utilization value.
[0162] The above embodiments are only illustrative of the principles and effects of the present application and are not intended to limit the present application. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical idea disclosed by the present application should still be covered by the claims of the present application.
Claims
1. A probability table updating device, characterized in that, Including: A pre-frame adaptation process module, an entropy decoding module, and a post-frame adaptation update module; The entropy decoding module is respectively connected to the pre-frame adaptation process module and the post-frame adaptation update module; The pre-frame adaptation process module is configured to obtain the original probability table and the updated probability factor data corresponding to the current image frame, and perform a forward adaptation update process according to the original probability table and the updated probability factor data to generate a new probability table required for decoding the current image frame, and send the new probability table required for decoding the current image frame to the entropy decoding module; The entropy decoding module is configured to perform a decoding operation on the current image frame according to the new probability table required for decoding the current image frame, and count the decoding times of the syntax elements corresponding to the relevant probability table elements; The post-frame adaptation update module is configured to, in response to a decoding completion signal, obtain the original probability table corresponding to the current image frame and the decoding times of the syntax elements corresponding to the relevant probability table elements, and perform a backward adaptation update process according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate an ultimate probability table.
2. The probability table updating device according to claim 1, characterized in that, It further includes a first state machine and a first SRAM memory. The pre-frame adaptation process module is respectively connected to the first state machine and the first SRAM memory. The first SRAM memory includes a plurality of first address partitions, and each first address partition is respectively used to store different category probability table elements in the original probability table and their corresponding original probability values. The first state machine controls the pre-frame adaptation process module to perform a forward adaptation update process on different category probability table elements according to the original probability table and the updated probability factor data based on different working states set and the first address partitions corresponding to different category probability table elements in the first SRAM memory to generate a new probability table required for decoding the current image frame.
3. The probability table updating device according to claim 2, characterized in that, The working states of the first state machine include: a probability table initial update state, a motion vector probability update state, a coefficient probability update state, a segmented probability sub-update state, and an update completion state. The categories of the probability table elements include four types: first category probability table elements, second category probability table elements, third category probability table elements, and fourth category probability table elements. Among them: When the first state machine is in the probability table initial update state, the motion vector probability update state, the coefficient probability update state, the segmented probability sub-update state, or the update completion state, the manner in which the pre-frame adaptation process module performs a forward adaptation update process on different category probability table elements includes: the probability table elements of the subsequent category start to perform a forward adaptation update process in response to the update completion signal of the probability table elements of the previous category.
4. The probability table updating device according to claim 3, wherein The manner of performing a forward adaptation update process on the first category probability table elements includes: When the first state machine is in the initial probability table update state, control the frame pre-adaptation process module to update the first category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability values corresponding to the first category probability table elements, and update the new probability values corresponding to the first category probability table elements to the first address partition corresponding to the first category probability table elements in the first SRAM memory.
5. The probability table updating device according to claim 3, characterized in that, The ways to perform the forward adaptation update process on the second category probability table elements include: In response to the signal indicating that the update of the first category probability table elements is completed, determine whether the current image frame is a key frame; If the current image frame is a key frame, the working state of the first state machine jumps from the initial probability table update state to the coefficient probability update state; If the current image frame is not a key frame, the working state of the first state machine jumps from the initial probability table update state to the motion vector probability update state; when the first state machine is in the motion vector probability update state, control the frame pre-adaptation process module to update the second category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability values corresponding to the second category probability table elements, and after updating the new probability values corresponding to the second category probability table elements to the first address partition corresponding to the second category probability table elements in the first SRAM memory, the working state of the first state machine jumps from the motion vector probability update state to the coefficient probability update state.
6. The probability table updating device according to claim 3, wherein, The ways to perform the forward adaptation update process on the third category probability table elements include: When the first state machine is in the coefficient probability update state, control the frame pre-adaptation process module to update the third category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability values corresponding to the third category probability table elements, and update the new probability values corresponding to the third category probability table elements to the first address partition corresponding to the third category probability table elements in the first SRAM memory.
7. The probability table updating device according to claim 3, wherein The ways to perform the forward adaptation update process on the fourth category probability table elements include: In response to the signal indicating that the update of the third category probability table elements is completed, determine whether the segment update enable signal of the current image frame is high; If the segment update enable signal is high, the working state of the first state machine jumps from the coefficient probability update state to the segment probability sub-update state; when the first state machine is in the segment probability sub-update state, control the frame pre-adaptation process module to update the fourth category probability table elements according to the original probability table and the update probability factor data, so as to obtain the new probability values corresponding to the fourth category probability table elements, and after updating the new probability values corresponding to the fourth category probability table elements to the first address partition corresponding to the fourth category probability table elements in the first SRAM memory, the working state of the first state machine jumps from the segment probability sub-update state to the update completion state; If the segment update enable signal is low, the working state of the first state machine jumps from the coefficient probability update state to the update completion state.
8. The probability table updating device according to claim 1, wherein It further includes a second state machine and a second SRAM memory. The post-frame adaptation update module is respectively connected to the second state machine and the second SRAM memory. The second SRAM memory includes multiple second address partitions, and each second address partition is respectively used to store the probability table elements of different coding structures in the original probability table and their corresponding original probability values. The second state machine, according to the set different working states and based on the second address partitions corresponding to different coding structure probability table elements in the second SRAM memory, controls the post-frame adaptation update module to perform a backward adaptation update process on different coding structure probability table elements according to the decoding times of the syntax elements corresponding to the original probability table and the relevant probability table elements, so as to generate an ultimate probability table.
9. The probability table updating device according to claim 8, wherein The working states of the second state machine include: a normal update state and multiple tree update states. The different coding structure probability table elements include two types: non-tree coding structure probability table elements and tree coding structure probability table elements. Among them, Based on the second address partitions corresponding to different coding structure probability table elements in the second SRAM memory, the second state machine jumps between the normal update state and each tree update state, and in the normal update state, controls the post-frame adaptation update module to perform a backward adaptation update process on the non-tree coding structure probability table elements according to the decoding times of the syntax elements corresponding to the original probability table and the relevant probability table elements; and in the tree update state, controls the post-frame adaptation update module to perform a backward adaptation update process on the tree coding structure probability table elements according to the decoding times of the syntax elements corresponding to the original probability table and the relevant probability table elements.
10. The probability table updating device according to claim 9, characterized in that, Performing a backward adaptation update process on the non-tree coding structure probability table elements includes: When the second state machine is in the normal update state, it controls the post-frame adaptation update module to obtain the decoding times of the syntax elements corresponding to the non-tree coding structure probability table elements, and according to the decoding times of the syntax elements corresponding to the non-tree coding structure probability table elements and the original probability value, obtains the new probability value corresponding to the non-tree coding structure probability table element, and updates the new probability value corresponding to the non-tree coding structure probability table element to the second address partition corresponding to the non-tree coding structure probability table element in the second SRAM memory.
11. The probability table updating device according to claim 9, characterized in that, Performing a backward adaptation update process on the tree coding structure probability table elements includes: When the second state machine is in the tree update state, it controls the post-frame adaptation update module to obtain the decoding times of the syntax elements corresponding to the tree coding structure probability table elements, and according to the decoding times of the syntax elements corresponding to the tree coding structure probability table elements and the original probability value, obtains the new probability value corresponding to the tree coding structure probability table element, and updates the new probability value corresponding to the tree coding structure probability table element to the second address partition corresponding to the tree coding structure probability table element in the second SRAM memory.
12. The probability table updating device according to claim 1, wherein It further includes a bus arbitration module and a DDR memory. The bus arbitration module is respectively connected to the pre-frame adaptation process module, the post-frame adaptation update module, and the DDR memory. The pre-frame adaptation process module obtains the original probability table and updated probability factor data corresponding to the current image frame from the DDR memory through the bus arbitration module; The post-frame adaptation update module obtains the original probability table corresponding to the current image frame from the DDR memory through the bus arbitration module, and writes the ultimate probability table into the DDR memory through the bus arbitration module.
13. A method for updating a probability table, applied to the probability table updating device according to any one of claims 1-12, the probability table updating device comprising: A pre-frame adaptation process module, an entropy decoding module, and a post-frame adaptation update module; The entropy decoding module is respectively connected to the pre-frame adaptation process module and the post-frame adaptation update module; wherein, the probability table update method includes: The pre-frame adaptation process module obtains the original probability table and updated probability factor data corresponding to the current image frame, and performs a forward adaptation update process according to the original probability table and the updated probability factor data to generate a new probability table required for decoding the current image frame, and sends the new probability table required for decoding the current image frame to the entropy decoding module; The entropy decoding module decodes the current image frame according to the new probability table required for decoding the current image frame, and counts the decoding times of the syntax elements corresponding to the relevant probability table elements; The post-frame adaptation update module responds to the decoding completion signal, obtains the original probability table corresponding to the current image frame and the decoding times of the syntax elements corresponding to the relevant probability table elements, and performs a backward adaptation update process according to the original probability table and the decoding times of the syntax elements corresponding to the relevant probability table elements to generate an ultimate probability table.
14. A probability table update medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the probability table update method as described in claim 13.
15. A probability table update terminal, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the probability table update method as described in claim 13.