Video codec deadlock reset data calculation method and device, computer equipment, readable storage medium and program product
By obtaining the codec performance data of the video data stream and the influencing factor of the external memory access performance, the deadlock reset data of the hardware video codec is generated, which solves the problem of inaccurate deadlock reset data in the existing technology, and achieves the latest update Accurate deadlock reset and timely recovery of hardware codec functions.
Patent Information
- Application Number
- CN202411660341.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, there is inaccurate determination of the deadlock reset data of the hardware video codec, resulting in the false triggering of the deadlock reset mechanism and the inability to restore the hardware codec function in time.
Generate deadlock reset data by obtaining the codec performance data of the pending video data stream and the out-of-memory access performance impact factor. The specific steps include obtaining the performance data of the decoded frame and the performance impact factor of the external memory access, obtaining the corresponding influencing factor in the mapping table, and generating decoded deadlock reset data based on these data.
The adaptive generation of video codec deadlock reset data is realized, which improves the accuracy of deadlock reset data, avoids the false triggering of deadlock reset mechanism, and ensures timely recovery of hardware codec functions.
Smart Images

Figure CN119520807A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video codec technology, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for calculating deadlock reset data of a video codec. Background Art
[0002] The hardware video codec deadlock reset mechanism is an important functional module of the hardware video codec, and the data that triggers the hardware video codec deadlock reset is the key to the normal execution of the hardware video codec deadlock reset function. In the related art, when setting the hardware video codec deadlock reset data, it can generally be set to a fixed constant value, or only the attribute value of the codec frame is considered to determine the deadlock reset data.
[0003] In the related art, if it is set to a fixed constant value, it is generally set to a fixed value according to the maximum value of the codec performance data, or set to the maximum value that can be supported by the data type of the variable storing the deadlock reset data. However, this setting method cannot restore the hardware's codec function in time when the hardware encounters abnormal decoding deadlock, and the hardware deadlock reset is lost. If only the attribute value of the codec frame is considered to determine the deadlock reset data, the impact of the hardware operating environment on the hardware video codec performance is not considered. Generally, the hardware deadlock reset data is given to the hardware through the software driver. It is easy to obtain the attribute data of the codec frame at the hardware level, and the hardware codec performance data of the current frame is estimated based on the attribute data of the codec frame. However, the operation of the hardware is sometimes limited by the access speed of the external memory, which greatly reduces the hardware codec performance. In this case, only considering the attribute data of the codec frame will cause the hardware deadlock reset data to be calculated too small, which is easy to mistakenly trigger the deadlock reset mechanism of the hardware video codec.
[0004] Therefore, in the related art, the method of determining the deadlock reset data has the problem that the deadlock reset data is not accurately determined, which causes the deadlock reset mechanism of the hardware video codec to be erroneously triggered. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for calculating video codec deadlock reset data, which can improve the accuracy of determining video codec deadlock data, in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for calculating video codec deadlock reset data, the method comprising:
[0007] Obtaining a video data stream to be processed, and obtaining encoding and decoding performance data corresponding to the video data stream to be processed;
[0008] Get the external memory access performance impact factor corresponding to the video codec;
[0009] Generate deadlock reset data based on encoding and decoding performance data and external memory access performance influencing factors.
[0010] In one embodiment, the encoding and decoding performance data includes decoding frame performance data, the external memory access performance influencing factor includes decoding external memory access performance influencing factor, and the deadlock reset data includes decoding deadlock reset data; based on the encoding and decoding performance data and the external memory access performance factor, the deadlock reset data is generated, including: obtaining the first decoding external memory access performance data corresponding to the decoded frame, and obtaining the decoding external memory access performance influencing factor from the decoding external memory access performance influencing factor mapping table based on the first decoding external memory access performance data; generating the decoding deadlock reset data based on the decoding frame performance data and the decoding external memory access performance influencing factor.
[0011] In one of the embodiments, after obtaining the video data stream to be processed, the video codec deadlock reset data calculation method also includes: obtaining first code stream data and first resolution data corresponding to the video data stream to be processed; obtaining second resolution data of a basic processing block corresponding to the video codec; determining the number of copies based on the first resolution data and the second resolution data, the number of copies being used to characterize the number of second resolution data that the first resolution data can be divided into; determining the second code stream data based on the code stream data and the number of copies; obtaining a preset fitting coefficient, and generating decoding frame performance data based on the preset fitting coefficient and the second code stream data.
[0012] In an optional embodiment, before obtaining the decoding external memory access performance impact factor from the decoding external memory access performance impact factor table based on the first decoding external memory access performance data, the video codec deadlock reset data calculation method also includes: obtaining first actual decoding performance data corresponding to the video codec; generating second actual decoding performance data based on the first actual decoding performance data and the number of copies; obtaining second decoding external memory access performance data, generating a target decoding external memory access impact factor based on the second actual decoding performance data and the second decoding external memory access performance data, and generating a decoding external memory access performance impact factor mapping table based on the target decoding external memory access impact factor.
[0013] In one embodiment, the encoding and decoding performance data includes encoding frame performance data, the external memory access performance influencing factor includes the encoding external memory access performance influencing factor, and the deadlock reset data includes the encoding deadlock reset data. According to the encoding and decoding performance data and the external memory access performance influencing factor, generating the deadlock reset data includes: obtaining the first encoding external memory access performance data corresponding to the encoded frame, and obtaining the encoding external memory access performance influencing factor from the encoding external memory access performance influencing factor mapping table according to the first encoding external memory access performance data; obtaining the encoding frame performance data corresponding to the encoded frame associated with the current frame to be encoded, and generating the encoding deadlock reset data according to the encoding external memory access performance influencing factor and the encoding frame performance data.
[0014] In one of the embodiments, the encoding frame performance data includes at least one encoding configuration parameter; before obtaining the encoding external memory access performance impact factor from the encoding external memory access performance impact factor table based on the first encoding external memory access performance data, the video codec deadlock reset data calculation method also includes: obtaining first resolution data corresponding to the video data stream to be processed, and second resolution data of the basic processing block corresponding to the video codec; determining the number of copies based on the first resolution data and the second resolution data, and the number of copies is used to characterize the number of second resolution data that the first resolution data can be divided into; obtaining first actual encoding performance data corresponding to each encoding configuration parameter; generating second actual encoding performance data based on the first actual encoding performance data and the number of copies; obtaining second encoding external memory access performance data, generating a target encoding external memory access impact factor based on the second actual encoding performance data and the second encoding external memory access performance data, and generating an encoding external memory access impact factor mapping table based on the target encoding external memory access impact factor.
[0015] In a second aspect, the present application further provides a video codec deadlock reset data calculation device, comprising:
[0016] A data acquisition module is used to acquire the video data stream to be processed and acquire the encoding and decoding performance data corresponding to the video data stream to be processed;
[0017] An external memory factor acquisition module is used to obtain the external memory access performance influencing factor corresponding to the video codec;
[0018] The deadlock data generation module is used to generate deadlock reset data according to the encoding and decoding performance data and the external memory access performance influencing factors.
[0019] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.
[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method embodiments when the computer program is executed by a processor.
[0021] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method embodiments when executed by a processor.
[0022] The above-mentioned video codec deadlock reset data calculation method, device, computer equipment, computer-readable storage medium and computer program product determine the deadlock reset data according to the codec performance data corresponding to the video data stream to be processed and the external memory access performance influencing factor, and can realize the adaptive generation of the deadlock reset data of the video codec and improve the accuracy of the deadlock reset data determination. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A schematic diagram of a flow chart of a method for calculating video codec deadlock reset data in one embodiment;
[0025] Figure 2 A schematic flow chart of a method for calculating video codec deadlock reset data in another embodiment;
[0026] Figure 3 A schematic diagram of a flow chart of a method for calculating video codec deadlock reset data in yet another embodiment;
[0027] Figure 4 A structural block diagram of a video codec deadlock reset data calculation device in one embodiment;
[0028] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] In an exemplary embodiment, Figure 1As shown, a method for calculating video codec deadlock reset data is provided. This embodiment uses the method applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0031] Step 102: Obtain a video data stream to be processed, and obtain encoding and decoding performance data corresponding to the video data stream to be processed.
[0032] The video codec is used to implement a program or device for compressing or decompressing the video data stream to be processed.
[0033] Optionally, the video codec may be a hardware video codec.
[0034] The codec performance data is used to characterize the efficiency and effect of the video codec when processing the video data stream to be processed. Optionally, the codec performance data may include but is not limited to processing speed, compression ratio, encoding quality, delay, etc.
[0035] In one embodiment, the encoding and decoding performance data includes decoded frame performance data.
[0036] Optionally, determining the decoding frame performance data may include: obtaining first bitstream data and first resolution data corresponding to the video data stream to be processed; obtaining second resolution data of a basic processing block corresponding to the video codec; determining the number of copies based on the first resolution data and the second resolution data; determining the second bitstream data based on the bitstream data and the number of copies; obtaining a preset fitting coefficient, and generating the decoding frame performance data based on the preset fitting coefficient and the second bitstream data.
[0037] The number of copies is used to represent the number of second resolution data that can be divided into the first resolution data.
[0038] Optionally, the first code stream and the first resolution data may be acquired after the video codec receives the video data to be processed.
[0039] Optionally, the first resolution data may be resolution data of a video data stream to be processed, and the second resolution data may be resolution data of a basic processing block corresponding to a video codec.
[0040] In one embodiment, the second resolution data may be 16×16.
[0041] Optionally, the calculation formula of the first resolution may also be as shown in formula (1):
[0042] resolution f =widthf*heightf (1)
[0043] Optionally, the calculation formula for the number of copies can be as shown in formula (2):
[0044]
[0045] Among them, 16x16_block num Used to represent the number of copies, resolution f Used to characterize first resolution data.
[0046] In one embodiment, after the number of copies is determined, the second code stream data can be determined according to the first code stream data and the number of copies. Optionally, the calculation formula of the second code stream data can be as shown in formula (3):
[0047] factor f =bistreamsize f / 16x16_blockn umm (3)
[0048] Among them, factor f Used to represent the second stream data, bistreamsize f Used to represent the first code stream data.
[0049] Optionally, after determining the second bitstream data, a preset fitting coefficient may be obtained, and the decoding frame performance data may be generated according to the preset fitting coefficient and the second bitstream data. Optionally, the calculation formula of the decoding frame performance data may be as shown in formula (4):
[0050] decoded_cycle f =(α*factor f *factor f +β*factor f +γ)γ) (4)
[0051] Among them, decoded_cycle f It is used to characterize the decoding frame performance data, and α, β, and γ are used to characterize the fitting coefficients.
[0052] Optionally, the fitting coefficients may be fixed values.
[0053] In an optional embodiment, the codec performance data includes coded frame performance data. Optionally, the coded frame performance data includes at least one coding configuration parameter. Optionally, the coding configuration parameter may include but is not limited to rate distortion optimization (RDO), fractional pixel search (FRC), B frame coding, etc.
[0054] In one embodiment, the encoding and decoding performance data can be determined based on the encoded and decoded video frame. Exemplarily, the encoding frame performance data corresponding to the encoded frame is obtained as the encoding frame performance data of the current frame to be processed. Optionally, the encoded frame is a video frame associated with the current frame to be processed, and exemplarily, the encoded frame can be the encoded video frame closest to the current encoded frame in the picture display order value (POC) dimension.
[0055] Step 104: Obtain an external memory access performance impact factor corresponding to the video codec.
[0056] The external memory is used to represent a storage device outside the video codec, which can be connected to the video codec so that the video codec can obtain the video data stream to be processed from the external memory. Optionally, the external memory includes a hard disk, a floppy disk, an optical disk, a USB flash drive, and a magnetic tape.
[0057] Optionally, the external memory access performance influencing factor is used to characterize the efficiency of the video codec accessing the external memory. Optionally, the external memory access performance influencing factor may include but is not limited to the external memory access speed and the like.
[0058] In one embodiment, the external memory access performance impact factor includes decoding the external memory access performance impact factor.
[0059] Optionally, the external memory access performance influencing factor includes an encoded external memory access performance influencing factor.
[0060] In one embodiment, the external memory access row impact factor may be obtained from an external memory access performance impact factor mapping table.
[0061] Optionally, the external memory access performance impact factor mapping table includes a decoding external memory access performance impact factor mapping table and an encoding external memory access performance impact factor mapping table, wherein the decoding external memory access performance impact factor mapping table is used to store decoding external memory access performance impact factors, and the encoding external memory access performance impact factor mapping table is used to store encoding external memory access performance impact factors.
[0062] In one embodiment, a method for generating a decoding external memory access performance influencing factor mapping table may include: obtaining first actual decoding performance data corresponding to a video codec; generating second actual decoding performance data based on the first actual decoding performance data and the number of copies; obtaining second decoding external memory access performance data, generating a target decoding external memory access influencing factor based on the second actual decoding performance data and the second decoding external memory access performance data, and generating a decoding external memory access performance influencing factor mapping table based on the target decoding external memory access influencing factor.
[0063] The first actual decoding performance data is decoding performance data when the video codec decodes the video stream data.
[0064] In one embodiment, the first actual decoding performance data may be multiple. Optionally, multiple test video stream data may be set, and the test video stream data may be decoded using a video codec to obtain the first actual decoding performance data corresponding to each test video stream data. In one embodiment, after determining the first actual decoding performance data, the second actual decoding performance data may be determined in combination with the number of copies, as shown in formula (5):
[0065]
[0066] Among them, dperf_cycle f Used to characterize the first actual decoding performance data, dperf_cycle 16x16_block Used to characterize the second actual decoding performance data.
[0067] Optionally, when there are multiple first actual decoding performance data, there are also multiple corresponding second actual decoding performance data.
[0068] The second decoding external memory access performance data is used to represent the external memory access performance data when the video codec decodes the video stream data.
[0069] In one embodiment, the second decoding external memory access performance data may be average external memory access performance data of the video codec when performing decoding.
[0070] Optionally, multiple test video stream data can be set to obtain actual external memory access performance data of multiple test video stream data when the video codec decodes the multiple test video stream data, and the actual external memory access performance data obtained are averaged, and the obtained average value is used as the second decoded external memory access performance data.
[0071] In an optional embodiment, multiple external memories may be set up, each storing one or more test video stream data, and external memory access performance data of the test video stream data obtained by the video codec from each external memory is obtained respectively, and the obtained external memory access performance data is averaged, and the obtained average value is used as the second decoding external memory access performance data.
[0072] In one embodiment, after the second decoding external memory access performance data and the second actual decoding performance data are obtained, a target decoding external memory access impact factor may be generated according to the second decoding external memory access performance data and the second actual decoding performance data.
[0073] Optionally, when there are multiple second actual decoding performance data, there are also multiple target decoding external memory access influencing factors.
[0074] In one of the embodiments, after generating the target decoding external memory access impact factor, a decoding external memory access performance impact factor mapping table can be generated according to the target decoding external memory access impact factor and the external memory access performance data corresponding to the target decoding external memory access impact factor.
[0075] Exemplarily, according to the second actual decoding performance data and the second decoding external memory access performance data, a calculation formula for determining the target decoding external memory access impact factor may be shown as formula (6):
[0076] dperf_cycle 16x16_block ≈α range_idx *dmem_latency_cycler req (6)
[0077] Among them, "≈" is used to represent the fitting, dperf_cycle 16x16_block Used to characterize the second actual decoding performance data, α range_idx Used to characterize the impact factor of target decoding external memory access, dmem_latency_cycle req Used to characterize the second decoding external memory access performance data.
[0078] Optionally, the formula used to generate the decoding external memory access performance influencing factor mapping table can be as shown in formula (7):
[0079]
[0080] in, It is used to characterize the minimum value of the actual decoding external memory access performance data. Used to represent the maximum value of actual decoding external memory access performance data.
[0081] In an optional embodiment, a method for generating a coding external memory access impact factor mapping table may include: obtaining first actual coding performance data corresponding to each coding configuration parameter; generating second coding actual performance data based on the first actual coding performance data and the number of copies; obtaining second coding external memory access performance data, generating a target coding external memory access impact factor based on the second actual coding performance data and the second coding external memory access performance data, and generating a coding external memory access impact factor mapping table based on the target coding external memory access impact factor.
[0082] The first actual encoding performance data is encoding performance data of the encoder when the video codec encodes the video stream data.
[0083] In one embodiment, the first actual encoding performance data may be multiple. Optionally, multiple test video stream data may be set, and the test video stream data may be encoded using a video codec to obtain the actual encoding performance data corresponding to each test video stream data.
[0084] Optionally, actual encoding external memory access performance data may correspond to encoding configuration parameters, for example, rate-distortion optimization has corresponding encoding performance data, subpixel search has corresponding encoding performance data, and B frame encoding has corresponding encoding performance data, and the rate-distortion optimization has corresponding encoding performance data, the subpixel search has corresponding encoding performance data, and the B frame encoding has corresponding encoding performance data, and the rate-distortion optimization has corresponding encoding performance data, the subpixel search has corresponding encoding performance data, and the B frame encoding has corresponding encoding performance data.
[0085] In one embodiment, after determining a plurality of first actual decoding performance data, second actual encoding performance data may be determined, as shown in formula (8):
[0086]
[0087] Among them, cperf_cycle f The first actual decoding performance data corresponding to the configuration parameter, cperf_cycle 16x16_blockk Used to characterize the second actual encoding performance data.
[0088] In one embodiment, after the second actual encoding performance data is generated, a fitting process may be performed on the acquired second actual encoding performance data, and a target decoding external memory access influencing factor may be determined according to the fitting result.
[0089] In one embodiment, the second encoding external memory access performance data may be obtained, and the target encoding external memory access impact factor may be generated according to the second actual encoding performance data and the second encoding external memory access performance data.
[0090] Optionally, multiple test video stream data can be set to obtain actual external memory access performance data of multiple test stream data from the external memory when the video codec encodes the multiple test video stream data, and the actual external memory access performance data obtained are averaged, and the obtained average value is used as the second encoded external memory access performance data.
[0091] In an optional embodiment, multiple external memories may be set up, each storing one or more test video stream data, and external memory access performance data of the video codec when obtaining video stream data from each external memory during encoding is obtained respectively, and the obtained external memory access performance data is averaged, and the obtained average value is used as the second encoding external memory access performance data.
[0092] In one embodiment, after obtaining the second encoding external memory access performance data and the second actual encoding performance data, a target encoding external memory access impact factor may be generated according to the second encoding external memory access performance data and the second actual encoding performance data.
[0093] Exemplarily, the fitting formula for generating the target encoding external memory access influencing factor using the acquired second actual encoding performance data and the second encoding external memory access performance data can be shown as formula (9):
[0094]
[0095] ≈α [enc_cfg,range_idx] *cmem_latency_cycle req (9)
[0096] Among them, "≈" is used to represent the fitting, cperf_cycle 16x16_block Used to characterize the second actual coding performance data, α [enc_cfg,range_idx] Used to characterize the impact factor of target code external memory access, cmem_latency_cycle req Used to characterize the second encoding external memory access performance data.
[0097] In one embodiment, after obtaining the second actual encoding performance data and the second encoding external memory access performance data, a target encoding external memory access impact factor is generated. Optionally, when there are multiple second actual encoding performance data, there are also multiple target encoding external memory access impact factors. Optionally, a coding external memory access impact factor mapping table can be generated based on the generated multiple target coding external memory access impact factors. Optionally, the generated coding external memory access impact factor mapping table is respectively set corresponding to each configuration parameter.
[0098] In one embodiment, the formula used to generate the encoding external memory access impact factor mapping table can be shown as formula (10):
[0099]
[0100] in, It is used to characterize the minimum value of the actual encoding external memory access performance data. Used to represent the maximum value of actual encoding external memory access performance data.
[0101] Step 106: Generate deadlock reset data according to the encoding and decoding performance data and the external memory access performance influencing factor.
[0102] The deadlock reset data is used to determine whether the video codec is in a deadlock state. Exemplarily, when the deadlock reset data is a numerical value, the video codec uses the deadlock reset data as a counter. When the video codec starts encoding or decoding, the counter starts to decrease until the value of the counter is 0. If the video codec is still busy encoding or decoding at this time, the video codec is considered to be in a deadlock state. Optionally, when the video codec is in a deadlock state, a program for resetting the video codec can be triggered to reset the video codec, so that the video codec can return to normal and continue to encode and decode subsequent video frames.
[0103] In one embodiment, the deadlock reset data includes decoding deadlock reset data. Exemplarily, when the encoding performance data is decoding frame performance data and the external memory access performance impact factor is decoding external memory access performance impact factor, the decoding deadlock reset data can be determined according to the decoding frame performance data and the decoding external memory access performance impact factor.
[0104] Optionally, first decoding external memory access performance data corresponding to the decoded frame is obtained, and based on the first decoding external memory access performance data, a decoding external memory access performance impact factor is obtained from a decoding external memory access performance impact factor mapping table; and decoding deadlock reset data is generated based on the decoding frame performance data and the decoding external memory access performance impact factor.
[0105] In an optional embodiment, after determining the first decoded external memory access performance data, a decoded external memory access performance impact factor corresponding to the first decoded external memory access performance data can be obtained from a decoded external memory access performance impact factor mapping table based on the first decoded external memory access performance data.
[0106] Optionally, after the decoding external memory access performance influencing factor is obtained, the decoding deadlock reset data is generated according to the decoding external memory access performance influencing factor and the decoding frame performance data. Optionally, the calculation formula of the decoding deadlock reset data can be shown as formula (11):
[0107] dhw_hang_reset_cycle f =factor_mem range_idx *decoded_cycle f (11)
[0108] Among them, dhw_hang_reset_cyclef f Used to represent decoded deadlock reset data, decoded_cycle f Used to characterize the decoding frame performance data, factor_mem range_idxUsed to represent the decoding external memory access performance impact factor obtained from the decoding external memory access performance impact factor mapping table according to the decoding frame performance data.
[0109] In an optional embodiment, the deadlock reset data includes encoding deadlock reset data. Exemplarily, when the encoding and decoding performance data is encoding frame performance data and the external memory access performance impact factor is the encoding external memory access performance impact factor, the encoding deadlock reset data can be determined according to the encoding frame performance data and the encoding external memory access performance impact factor.
[0110] Optionally, first encoding external memory access performance data corresponding to the encoded frame is obtained, and based on the first encoding external memory access performance data, an encoding external memory access performance influence factor is obtained from an encoding external memory access performance influence factor mapping table; encoding frame performance data corresponding to the encoded frame associated with the current frame to be encoded is obtained, and encoding deadlock reset data is generated based on the encoding external memory access performance influence factor and the encoding frame performance data.
[0111] In an optional embodiment, after determining the first encoding external memory access performance data, the encoding external memory access performance impact factor corresponding to the first encoding external memory access performance data can be obtained from the encoding external memory access performance impact factor mapping table based on the first encoding external memory access performance data. Optionally, the encoding external memory access performance impact factor corresponds to a configuration parameter, and when obtaining the encoding external memory access performance impact factor, the obtained encoding external memory access performance impact factor corresponds to the configuration parameter.
[0112] Optionally, the coded frame associated with the current frame may be a coded frame closest to the current coded frame in terms of image display order value.
[0113] In one embodiment, encoding performance data corresponding to an encoded frame associated with the current frame is obtained.
[0114] Optionally, after obtaining the encoding performance data corresponding to the encoded frame associated with the current frame and the encoding external memory access performance impact factor, the encoding deadlock reset data can be generated according to the encoding performance data and the encoding external memory access performance impact factor. Optionally, the calculation formula of the encoding deadlock reset data can be shown as formula (12):
[0115] chw_hang_reset_cycle f
[0116] =factor_mem [enc_cfg,range_idx] *encoded_cycle f (12)
[0117] Among them, chw_hang_reset_cycle fUsed to represent the encoded deadlock reset data, encoded_cycle f Used to characterize the performance data of the encoded frame, factor_mem [enc_cfg,range_idx] Used to characterize the factors affecting encoding external memory access performance.
[0118] In the above-mentioned video codec deadlock reset data calculation method, the deadlock reset data is determined according to the codec performance data corresponding to the video data stream to be processed and the external memory access performance influencing factor, so as to realize the adaptive generation of the deadlock reset data of the video codec and improve the accuracy of the deadlock reset data determination.
[0119] In an exemplary embodiment, Figure 2 As shown, a method for calculating video codec deadlock reset data is provided. This embodiment uses the method applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0120] Step 202: Acquire a video data stream to be processed, and acquire first code stream data and first resolution data corresponding to the video data stream to be processed.
[0121] Step 204: Acquire second resolution data of a basic processing block corresponding to the video codec.
[0122] Step 206, determining the number of copies according to the first resolution data and the second resolution data.
[0123] The number of copies is used to represent the number of second resolution data that can be divided into the first resolution data.
[0124] Step 208: Determine the second code stream data according to the code stream data and the number of copies.
[0125] Step 210, obtaining a preset fitting coefficient, and generating decoding frame performance data according to the preset fitting coefficient and the second bitstream data.
[0126] Step 212: Obtain first actual decoding performance data corresponding to the video codec.
[0127] Step 214, generating second actual decoding performance data according to the first actual decoding performance data and the number of copies.
[0128] Step 216, obtain the second decoding external memory access performance data, generate a target decoding external memory access impact factor according to the second actual decoding performance data and the second decoding external memory access performance data, and generate a decoding external memory access performance impact factor mapping table according to the target decoding external memory access impact factor.
[0129] Step 218, obtaining first decoding external memory access performance data corresponding to the decoded frame, and obtaining a decoding external memory access performance influencing factor from a decoding external memory access performance influencing factor mapping table based on the first decoding external memory access performance data.
[0130] Step 220: Generate decoding deadlock reset data according to the decoding frame performance data and the decoding external memory access performance influencing factor.
[0131] In the above-mentioned video codec deadlock reset data calculation method, the deadlock reset data is determined according to the codec performance data corresponding to the video data stream to be processed and the external memory access performance influencing factor, so as to realize the adaptive generation of the deadlock reset data of the video codec and improve the accuracy of the deadlock reset data determination.
[0132] In an exemplary embodiment, Figure 3 As shown, a method for calculating video codec deadlock reset data is provided. This embodiment uses the method applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0133] Step 302: Obtain a video data stream to be processed, and obtain first resolution data corresponding to the video data stream to be processed.
[0134] Step 304: Acquire second resolution data of a basic processing block corresponding to the video codec.
[0135] Step 306, determining the number of copies according to the first resolution data and the second resolution data.
[0136] The number of copies is used to represent the number of second resolution data that can be divided into the first resolution data.
[0137] Step 308: Obtain first actual encoding performance data corresponding to each encoding configuration parameter.
[0138] Step 310, generating second actual encoding performance data according to the first actual encoding performance data and the number of copies.
[0139] Step 312, obtain the second encoding external memory access performance data, generate the target encoding external memory access impact factor according to the second actual encoding performance data and the second encoding external memory access performance data, and generate an encoding external memory access impact factor mapping table according to the target encoding external memory access impact factor.
[0140] Step 314, obtaining first encoding external memory access performance data corresponding to the encoded frame.
[0141] Step 316: Obtain the encoding external memory access performance impact factor from the encoding external memory access performance impact factor mapping table according to the first encoding external memory access performance data.
[0142] Step 318, obtaining encoding frame performance data corresponding to the encoded frame associated with the current frame to be encoded, and generating encoding deadlock reset data according to the encoding external memory access performance influencing factor and the encoding frame performance data.
[0143] In the above-mentioned video codec deadlock reset data calculation method, the deadlock reset data is determined according to the codec performance data corresponding to the video data stream to be processed and the external memory access performance influencing factor, so as to realize the adaptive generation of the deadlock reset data of the video codec and improve the accuracy of the deadlock reset data determination.
[0144] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0145] Based on the same inventive concept, the embodiment of the present application also provides a video codec deadlock reset data calculation device for implementing the video codec deadlock reset data calculation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more video codec deadlock reset data calculation device embodiments provided below can refer to the limitations of the video codec deadlock reset data calculation method above, and will not be repeated here.
[0146] In an exemplary embodiment, Figure 4 As shown, a video codec deadlock reset data calculation device 400 is provided, comprising: a data acquisition module 402, an external memory factor acquisition module 404 and a deadlock data generation module 406, wherein:
[0147] The data acquisition module 402 is used to acquire the video data stream to be processed and acquire the encoding and decoding performance data corresponding to the video data stream to be processed.
[0148] The external memory factor acquisition module 404 is used to acquire the external memory access performance impact factor corresponding to the video codec.
[0149] The deadlock data generating module 406 is used to generate deadlock reset data according to the encoding and decoding performance data and the external memory access performance influencing factor.
[0150] In one embodiment, the encoding and decoding performance data includes decoding frame performance data, the external memory access performance influencing factor includes decoding external memory access performance influencing factor, and the deadlock reset data includes decoding deadlock reset data; the deadlock data generation module 406 is also used to obtain the first decoding external memory access performance data corresponding to the decoded frame, and obtain the decoding external memory access performance influencing factor from the decoding external memory access performance influencing factor mapping table according to the first decoding external memory access performance data; generate decoding deadlock reset data according to the decoding frame performance data and the decoding external memory access performance influencing factor.
[0151] In one of the embodiments, the video codec deadlock reset data calculation device also includes a decoding frame performance data generation module, which is used to obtain first code stream data and first resolution data corresponding to the video data stream to be processed; obtain second resolution data of the basic processing block corresponding to the video codec; determine the number of copies based on the first resolution data and the second resolution data, and the number of copies is used to characterize the number of second resolution data that the first resolution data can be divided into; determine the second code stream data based on the code stream data and the number of copies; obtain a preset fitting coefficient, and generate decoding frame performance data based on the preset fitting coefficient and the second code stream data.
[0152] In one embodiment, the video codec deadlock reset data calculation device also includes an external memory access impact factor mapping table generation module, which is used to obtain first actual decoding performance data corresponding to the video codec; generate second actual decoding performance data based on the first actual decoding performance data and the number of copies; obtain the second decoding external memory access performance data, generate a target decoding external memory access impact factor based on the second actual decoding performance data and the second decoding external memory access performance data, and generate a decoding external memory access performance impact factor mapping table based on the target decoding external memory access impact factor.
[0153] In an optional embodiment, the encoding and decoding performance data includes encoding frame performance data, the external memory access performance influencing factor includes the encoding external memory access performance influencing factor, the deadlock reset data includes the encoding deadlock reset data, and the deadlock data generation module 406 is also used to obtain the first encoding external memory access performance data corresponding to the encoded frame, and obtain the encoding external memory access performance influencing factor from the encoding external memory access performance influencing factor mapping table according to the first encoding external memory access performance data; obtain the encoding frame performance data corresponding to the encoded frame associated with the current frame to be encoded, and generate the encoding deadlock reset data according to the encoding external memory access performance influencing factor and the encoding frame performance data.
[0154] In one embodiment, the encoding frame performance data includes at least one encoding configuration parameter; the external memory access impact factor mapping table generation module is also used to obtain the first resolution data corresponding to the video data stream to be processed, and the second resolution data of the basic processing block corresponding to the video codec; determine the number of copies based on the first resolution data and the second resolution data, and the number of copies is used to characterize the number of second resolution data that the first resolution data can be divided into; obtain the first actual encoding performance data corresponding to each encoding configuration parameter; generate the second actual encoding performance data based on the first actual encoding performance data and the number of copies; obtain the second encoding external memory access performance data, generate the target encoding external memory access impact factor based on the second actual encoding performance data and the second encoding external memory access performance data, and generate the encoding external memory access impact factor mapping table based on the target encoding external memory access impact factor.
[0155] Each module in the above-mentioned video codec deadlock reset data calculation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0156] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a method for calculating video codec deadlock reset data is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0157] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.
[0159] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments are implemented.
[0160] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned method embodiments when executed by a processor.
[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0162] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0164] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for calculating video codec deadlock reset data, characterized in that: The method comprises: Obtaining a video data stream to be processed, and obtaining encoding and decoding performance data corresponding to the video data stream to be processed; Obtaining an external memory access performance impact factor corresponding to the video codec; Deadlock reset data is generated according to the encoding and decoding performance data and the external memory access performance influencing factor.
2. The method according to claim 1, characterized in that The encoding and decoding performance data includes decoding frame performance data, the external memory access performance influencing factor includes decoding external memory access performance influencing factor, and the deadlock reset data includes decoding deadlock reset data; The generating of deadlock reset data according to the encoding and decoding performance data and the external memory access performance factor comprises: Acquire first decoding external memory access performance data corresponding to the decoded frame, and acquire the decoding external memory access performance impact factor from a decoding external memory access performance impact factor mapping table according to the first decoding external memory access performance data; The decoding deadlock reset data is generated according to the decoding frame performance data and the decoding external memory access performance influencing factor.
3. The method according to claim 2, characterized in that After obtaining the video data stream to be processed, the method further includes: Acquire first code stream data and first resolution data corresponding to the video data stream to be processed; Acquire second resolution data of a basic processing block corresponding to the video codec; Determine the number of copies according to the first resolution data and the second resolution data, where the number of copies is used to represent the number of the second resolution data that can be divided into the first resolution data; Determine second code stream data according to the code stream data and the number of copies; Obtain a preset fitting coefficient, and generate the decoding frame performance data according to the preset fitting coefficient and the second code stream data.
4. The method according to claim 3, characterized in that Before obtaining the decoding external memory access performance influencing factor from a decoding external memory access performance influencing factor table according to the first decoding external memory access performance data, the method further includes: Obtaining first actual decoding performance data corresponding to the video codec; generating second actual decoding performance data according to the first actual decoding performance data and the number of copies; Acquire second decoding external memory access performance data, generate a target decoding external memory access impact factor based on the second actual decoding performance data and the second decoding external memory access performance data, and generate the decoding external memory access performance impact factor mapping table based on the target decoding external memory access impact factor.
5. The method according to claim 1, characterized in that The encoding and decoding performance data includes encoding frame performance data, the external memory access performance influencing factor includes encoding external memory access performance influencing factor, the deadlock reset data includes encoding deadlock reset data, and generating deadlock reset data according to the encoding and decoding performance data and the external memory access performance influencing factor includes: Obtaining first encoding external memory access performance data corresponding to the encoded frame, According to the first encoding external memory access performance data, obtaining the encoding external memory access performance impact factor from an encoding external memory access performance impact factor mapping table; The encoding frame performance data corresponding to the encoded frame associated with the current frame to be encoded is obtained, and the encoding deadlock reset data is generated according to the encoding external memory access performance influencing factor and the encoding frame performance data.
6. The method according to claim 5, characterized in that The encoding frame performance data includes at least one encoding configuration parameter; before obtaining the encoding external memory access performance influencing factor from the encoding external memory access performance influencing factor table according to the first encoding external memory access performance data, the method further includes: Acquire first resolution data corresponding to the video data stream to be processed, and second resolution data of a basic processing block corresponding to the video codec; Determine the number of copies according to the first resolution data and the second resolution data, where the number of copies is used to represent the number of the second resolution data that can be divided into the first resolution data; Obtaining first actual encoding performance data corresponding to each of the encoding configuration parameters; Generate second actual encoding performance data according to the first actual encoding performance data and the number of copies; Acquire second encoding external memory access performance data, generate a target encoding external memory access impact factor according to the second actual encoding performance data and the second encoding external memory access performance data, and generate an encoding external memory access impact factor mapping table according to the target encoding external memory access impact factor.
7. A video codec deadlock reset data calculation device, characterized in that: The device comprises: A data acquisition module, used to acquire a video data stream to be processed, and acquire encoding and decoding performance data corresponding to the video data stream to be processed; An external memory factor acquisition module, used to obtain an external memory access performance influencing factor corresponding to the video codec; The deadlock data generating module is used to generate deadlock reset data according to the encoding and decoding performance data and the external memory access performance influencing factor.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.