WO2023220970A1 - Video coding method and apparatus, and device, system and storage medium - Google Patents
Video coding method and apparatus, and device, system and storage medium Download PDFInfo
- Publication number
- WO2023220970A1 WO2023220970A1 PCT/CN2022/093582 CN2022093582W WO2023220970A1 WO 2023220970 A1 WO2023220970 A1 WO 2023220970A1 CN 2022093582 W CN2022093582 W CN 2022093582W WO 2023220970 A1 WO2023220970 A1 WO 2023220970A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- current
- ctu
- prediction mode
- violent motion
- violent
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 376
- 230000033001 locomotion Effects 0.000 claims abstract description 656
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 claims abstract description 198
- 230000015654 memory Effects 0.000 claims description 35
- 238000004590 computer program Methods 0.000 claims description 25
- 239000002699 waste material Substances 0.000 abstract description 10
- 238000004904 shortening Methods 0.000 abstract 1
- 238000013139 quantization Methods 0.000 description 38
- 230000008569 process Effects 0.000 description 35
- 230000009466 transformation Effects 0.000 description 24
- 239000013598 vector Substances 0.000 description 22
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 description 20
- 238000001914 filtration Methods 0.000 description 20
- 238000006073 displacement reaction Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 16
- 230000006835 compression Effects 0.000 description 13
- 238000007906 compression Methods 0.000 description 13
- 238000005516 engineering process Methods 0.000 description 13
- 238000004364 calculation method Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 9
- 238000013519 translation Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 241000023320 Luma <angiosperm> Species 0.000 description 7
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 7
- 230000001788 irregular Effects 0.000 description 6
- 230000001360 synchronised effect Effects 0.000 description 5
- 230000003044 adaptive effect Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 238000005192 partition Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000000638 solvent extraction Methods 0.000 description 3
- 230000000903 blocking effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000002123 temporal effect Effects 0.000 description 2
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000012958 reprocessing Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/11—Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
Definitions
- the present application relates to the field of video coding and decoding technology, and in particular, to a video coding method, device, equipment, system, and storage medium.
- the present application provides a video decoding device for performing the method in the above first aspect or its respective implementations.
- the decoding device includes a functional unit for executing the method in the above-mentioned first aspect or its respective implementations.
- a video decoder including a processor and a memory.
- the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the above first aspect or its respective implementations.
- a computer program product including computer program instructions, which enable a computer to execute any one of the above-mentioned first to second aspects or the methods in each implementation thereof.
- a twelfth aspect provides a code stream, which is generated by any one of the above-mentioned first aspects or implementations thereof.
- the violent motion parameters it is determined whether the current video is a translational motion video. If the current video is a translational motion video, the affine motion compensation prediction mode is skipped, thereby avoiding the need for translational motion videos.
- the waste of computing resources caused by using affine motion compensation prediction mode prediction can reduce encoding time, improve video encoding efficiency, and save computing resources.
- Figure 1 is a schematic block diagram of a video encoding and decoding system related to an embodiment of the present application
- Figures 4A and 4B are schematic diagrams of control point selection in the affine motion compensation prediction mode according to embodiments of the present application.
- Figure 7 is a schematic flow chart of a video encoding method provided by an embodiment of the present application.
- Figure 8 is a schematic block diagram of a video decoding device provided by an embodiment of the present application.
- This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, real-time video encoding and decoding, etc.
- the solution of this application can be combined with the audio and video coding standard (AVS for short), such as H.264/audio video coding (AVC for short) standard, H.265/high-efficiency video coding (AVS for short) high efficiency video coding (HEVC) standard and H.266/versatile video coding (VVC) standard.
- AVC audio video coding
- HEVC high efficiency video coding
- VVC variatile video coding
- FIG. 1 For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG. 1 .
- the encoding device 110 in the embodiment of the present application can be understood as a device with a video encoding function
- the decoding device 120 can be understood as a device with a video decoding function. That is, the embodiment of the present application includes a wider range of devices for the encoding device 110 and the decoding device 120. Examples include smartphones, desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle-mounted computers, and the like.
- the encoding device 110 may transmit the encoded video data (eg, code stream) to the decoding device 120 via the channel 130 .
- Channel 130 may include one or more media and/or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120 .
- Inverse quantization/transform unit 330 may inversely quantize (ie, dequantize) transform coefficients associated with a TU. Inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
- Step 3 After calculating the motion vector for each sub-block (as shown in Figure 5), motion compensation interpolation filtering is performed based on the motion vector to obtain the predicted value of each sub-block.
- the second information is an index of the prediction mode of the current CTU.
- one or more prediction modes are determined as the i-th block partitioning mode from prediction modes other than the affine motion compensation prediction mode. The corresponding optimal prediction mode.
- the at least one candidate prediction mode of the jth CU does not include the affine motion compensation prediction mode.
- the severe motion parameter indicates skipping the affine motion compensation prediction mode
- the severe motion parameter indicates not to skip the affine motion compensation prediction mode
- use each of the candidate prediction modes of at least one candidate prediction mode of the j-th CU to predict the j-th CU, and obtain the prediction value corresponding to each candidate prediction mode.
- the above violent motion parameters include at least one of the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU. That is to say, the violent motion parameters in this embodiment of the present application include at least one of frame-level violent motion parameters, CTU-level motion translation parameters, and CU-level motion parameters.
- the severe motion parameters of the current frame are determined based on the severe motion parameters of K CTUs included in the current frame.
- the k-th CTU among the K CTUs included in the current frame the k-th CTU
- the violent motion parameter is determined based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame.
- K is a positive integer
- k is a positive integer less than or equal to K.
- the violent motion parameters of each of the K CTUs included in the current frame can be determined, and then based on the violent motion parameters of each of the K CTUs, the Violent motion parameters of the current frame.
- the above violent motion parameter of the k-th CTU is determined based on the pixel value of the k-th CTU and the pixel value of the reference CTU. That is, based on the pixel value of the k-th CTU and the pixel value of the reference CTU, the violent motion parameters of the k-th CTU are determined.
- the violent motion parameter of the k-th CTU is determined based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU. That is, for each pixel in the k-th CTU, determine the absolute difference between the pixel value of the pixel in the k-th CTU and the pixel value in the reference CTU, and then based on the difference between each pixel in the k-th CTU and Referring to the absolute difference of the pixel value of each pixel in the CTU, determine the violent motion parameters of the k-th CTU.
- the sum of violent motion parameters of K CTUs included in the current frame is determined as the violent motion parameter of the current frame.
- the violent motion parameter of the current frame is determined based on the violent motion parameters of P CTUs among the K CTUs whose violent motion parameters are greater than the first preset value, where P is a positive integer less than or equal to K. Specifically, according to the violent motion parameters of each CTU among the K CTUs included in the current frame, P CTUs whose violent motion parameters are greater than the first preset value are selected from the K CTUs, and then according to the parameters of the P CTUs Violent motion parameters, determine the violent motion parameters of the current frame.
- the violent motion parameter of the current frame is determined based on the sum of the violent motion parameters of P CTUs and the total area of P CTUs.
- the violent motion parameter of the current frame is the ratio of the sum of the violent motion parameters of P CTUs to the total area of P CTUs.
- the severe motion parameter of the current CTU in this embodiment of the present application is used to indicate whether the current CTU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CTU is less than the second threshold, it means that the current CTU is a translational motion video. At this time, when determining the prediction mode of each CU in the current CTU, the affine motion compensation prediction mode is skipped. , thereby improving the efficiency of determining the prediction model and reducing the calculation amount of determining the prediction model. If the violent motion parameter of the current CTU is greater than or equal to the second threshold, it means that the current CTU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
- the strenuous motion parameters of the current CTU are determined according to the following formula (5):
- the severe motion parameter of the current CU in this embodiment of the present application is used to indicate whether the current CU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CU is less than the third threshold, it means that the current CU is a translational motion video. At this time, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the prediction The efficiency of determining the model is improved and the calculation amount of determining the prediction model is reduced. If the violent motion parameter of the current CU is greater than or equal to the third threshold, it means that the current CU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
- the embodiment of the present application does not limit the specific method of determining the strenuous exercise parameters of the current CU.
- the above violent motion parameter of the current CU is determined based on the pixel value of the current CU and the pixel value of the reference CU. That is, based on the pixel value of the current CU and the pixel value of the reference CU, the violent motion parameters of the current CU are determined.
- the strenuous motion parameters of the current CU are determined according to the following formula (6):
- the above describes in detail the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU in the embodiment of the present application. In this way, during prediction, it can be determined whether to skip the affine motion compensation prediction mode based on the violent motion parameters, thereby saving computing resources and improving prediction efficiency.
- the value of the first flag when the value of the first flag is a first numerical value, it indicates that the current sequence is allowed to use the affine motion compensation prediction mode; when the value of the first flag is a second numerical value, it indicates that the current sequence is not allowed to use the affine motion compensation. Prediction mode.
- the preset condition includes that the value of the first flag is a first value. That is to say, when the value of the first flag is the first value, the violent motion parameter of the current frame is determined.
- the preset condition includes that the value of the first flag is a first value. That is to say, the value of the first flag is the first numerical value, which determines the violent motion parameters of the current CTU.
- the optimal prediction mode of the current CU when the optimal prediction mode of the current CU is determined, if the value of the first flag is the first value, the violent motion parameter indicates not to skip the affine motion compensation prediction mode, and the size of the current CU satisfies
- use the affine motion compensation prediction mode to perform motion estimation on the current CU obtain the calculated prediction cost CurBestCostAffine, and save the prediction mode CurBestModeAffine.
- calculate the prediction cost corresponding to each candidate prediction mode in other candidate prediction modes of the current CU compare the prediction cost corresponding to the affine motion compensation prediction mode with the prediction costs corresponding to other candidate prediction modes, and select the prediction mode with the smallest cost. As the optimal prediction mode of the current CU.
- the value of the first flag is not equal to the first value, and/or the severe motion parameter indicates skipping the affine motion compensation prediction mode, and/or the size of the current CU does not meet the prediction size, then skip Through the affine motion compensation prediction mode, use prediction modes other than the affine motion compensation prediction mode to predict the current CU, obtain the cost corresponding to each prediction mode, and determine the prediction mode with the smallest cost as the optimal prediction mode for the current CU .
- the decoding end After determining the block division method and prediction mode of the current CTU, the decoding end performs reconstruction according to the block division method and prediction mode of the current CTU. For details, refer to the following descriptions of S603 to S605.
- the decoder determines the block division method and prediction mode of the current CTU based on the above-mentioned S602, and then uses the block division method of the current CTU to perform block division on the current CTU, for example, divides the current CTU into at least one CU.
- the prediction mode of the current CTU includes the prediction mode of each CU in the above-mentioned at least one CU. In this way, when determining the prediction value of each CU in the at least one CU, the prediction corresponding to the CU in the prediction mode of the CTU can be used.
- the mode predicts the CU and obtains the predicted value of the CU.
- the reconstruction value of the current CU is filtered to obtain a filtered reconstruction value. For example, perform DBF, SAO, ALF, etc. filtering on the reconstruction value of the current CU, send the filtered image to the buffer, and wait for video playback.
- the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode; use the block division method of the current CTU to block divide the current CTU to obtain at least one coding unit CU; for the current CU in at least one CU, use The prediction mode corresponding to the current CU in the prediction mode of the current CTU is used to predict the current CU to obtain the prediction value of the current CU; based on the residual value of the current CTU, the residual value of the current CU is determined, and based on the residual value of the current CU and the predicted value to obtain the reconstruction value of the current CU. That is, in the embodiment of the present application, the violent motion parameters are used to determine whether the current video is a translational motion video.
- the current CU is also called a current block, a current image block, a current decoding block, a current coding unit, a current block to be decoded, a current image block to be decoded, etc.
- the encoding process in this embodiment of the present application is to divide the current image frame into blocks to obtain the current CU, determine the prediction mode of the current CU, use the prediction mode of the current CU to predict the current CU, and obtain the prediction value of the current CU.
- the original value of the current CU is subtracted from the predicted value to obtain the residual value of the current CU.
- the transform coefficients are quantized, and the quantized transform coefficients are encoded to obtain a code stream.
- the affine motion compensation prediction mode is skipped, thereby avoiding the waste of computing resources caused by using the affine motion compensation prediction mode for prediction of translational motion videos, thereby improving the coding efficiency of the video and saving computing resources.
- the violent motion parameter in the embodiment of the present application is used to indicate whether the current video is a translational motion-type video. If it is a translational motion-type video, the affine motion compensation prediction mode is skipped. Therefore, the violent motion parameter in the embodiment of the present application is Can also be used directly to indicate whether to skip affine motion compensation prediction mode. For example, if the violent motion parameter is less than the preset value, it is determined that the current video is a translational motion video, and the affine motion compensation prediction mode is skipped at this time, thereby avoiding the use of the affine motion compensation prediction mode for prediction of translational motion videos. , resulting in a waste of computing resources, thereby improving the video encoding efficiency and saving computing resources.
- the violent motion parameter of the current frame is used to indicate whether the current frame skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current frame is less than the first threshold, it means that the current frame is a translational motion video. At this time, when determining the prediction mode of each CU in the current frame, the affine motion compensation prediction mode is skipped. , thereby improving the efficiency of determining the prediction model and reducing the calculation amount of determining the prediction model. If the violent motion parameter of the current frame is greater than or equal to the first threshold, it means that the current frame is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
- the encoding end determines the violent motion parameter of the current frame according to the following steps S701-A1 and S701-A21:
- the current frame is divided into K CTUs, the violent motion parameters of each of the K CTUs are determined, and the violent motion parameters of the current frame are determined based on the violent motion parameters of each of the K CTUs.
- the reference CTU of the K-th CTU is determined in the previous frame of the current frame, and then the reference CTU of the k-th CTU and the k-th CTU in the previous frame is determined. Referring to the CTU, determine the strenuous exercise parameters of the k-th CTU.
- the violent motion parameters of each of the K CTUs included in the current frame can be determined, and then based on the violent motion parameters of each of the K CTUs, the Violent motion parameters of the current frame.
- the above-mentioned S701-A2 includes: determining the sum of the violent motion parameters of the K CTUs included in the current frame as the violent motion parameter of the current frame.
- the sum of the violent motion parameters of the P CTUs is determined as the violent motion parameter of the current frame.
- the violent motion parameter of the current frame is determined based on the sum of violent motion parameters of P CTUs and the total area of P CTUs.
- the ratio of the sum of the violent motion parameters of P CTUs to the total area of P CTUs is determined as the violent motion parameter of the current frame.
- the severe motion parameter of the current CTU in this embodiment of the present application is used to indicate whether the current CTU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CTU is less than the second threshold, it means that the current CTU is a translational motion video. At this time, when determining the prediction mode of each CU in the current CTU, the affine motion compensation prediction mode is skipped. , thereby improving the efficiency of determining the prediction model and reducing the calculation amount of determining the prediction model. If the violent motion parameter of the current CTU is greater than or equal to the second threshold, it means that the current CTU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
- the embodiment of the present application does not limit the specific value of the above-mentioned second threshold.
- the encoding end determines the current CTU based on the translational displacement of the pixels in the current CTU relative to the pixels of the reference CTU in the previous frame. parameters of strenuous exercise.
- the encoding end determines the strenuous motion parameters of the current CTU through the following step S701-B:
- S701-B includes determining the violent motion parameter of the current CTU according to the pixel value of the current CTU and the pixel value of the reference CTU.
- the translational displacement of the current CTU relative to the reference CTU is determined based on the pixel value of the pixel in the current CTU and the pixel value of the pixel in the reference CTU, and then the current CTU is determined based on the translational displacement of the current CTU relative to the reference CTU. Vigorous exercise parameters of CTU.
- the violent motion parameter of the current CTU is determined based on the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU.
- the severe motion parameters of the current CTU are determined according to the above formula (5).
- the severe motion parameter of the current CU in this embodiment of the present application is used to indicate whether the current CU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CU is less than the third threshold, it means that the current CU is a translational motion video. At this time, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the prediction The efficiency of determining the model is improved and the calculation amount of determining the prediction model is reduced. If the violent motion parameter of the current CU is greater than or equal to the third threshold, it means that the current CU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
- the embodiment of the present application does not limit the specific method of determining the strenuous exercise parameters of the current CU.
- S701-C Determine the violent motion parameters of the current CU according to the pixel value of the current CU and the pixel value of the reference CU.
- the violent motion parameter of the current CU is determined based on the absolute difference between the pixel value of the current CU and the pixel value of the reference CU.
- each pixel in the current CU determines the absolute difference between the pixel value of the pixel in the current CU and the pixel value in the reference CU, and then determine the absolute difference between each pixel in the current CU and each pixel in the reference CU.
- the absolute difference in pixel values of pixels determines the violent motion parameters of the current CU.
- the strenuous motion parameters of the current CU are determined according to the above formula (6).
- the above describes in detail the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU in the embodiment of the present application. In this way, during prediction, it can be determined whether to skip the affine motion compensation prediction mode based on the violent motion parameters, thereby saving computing resources and improving prediction efficiency.
- the preset conditions include that the value of the first flag is a first numerical value, and the size of the current CU meets at least one of the preset sizes.
- the first flag is used to indicate whether the current sequence is allowed to use the affine motion compensation prediction mode, and the first value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
- the value of the first flag when the value of the first flag is a first numerical value, it indicates that the current sequence is allowed to use the affine motion compensation prediction mode; when the value of the first flag is a second numerical value, it indicates that the current sequence is not allowed to use the affine motion compensation. Prediction mode.
- the decoder decodes the code stream to obtain the first flag, and determines whether the current sequence is allowed to use the affine motion compensation prediction mode based on the first flag. For example, if the value of the first flag is 0, it is determined that the current sequence is not allowed to use it. Affine motion compensated prediction mode.
- the embodiment of the present application does not limit the specific value of the preset size that the size of the current CU satisfies.
- the preset size is that the length and/or width of the CU is greater than or equal to a preset value, such as greater than or equal to 16 , or the area of the preset size CU is greater than a certain preset value.
- the preset condition includes that the value of the first flag is a first value. That is to say, the value of the first flag is the first numerical value, which determines the violent motion parameters of the current CTU.
- the preset condition includes that the value of the first flag is a first value, and the size of the current CU meets the preset size. That is to say, when the value of the first flag is the first value and the size of the current CU meets the preset size, the violent motion parameter of the current CU is determined.
- the value of the first flag is not equal to the first value, and/or the severe motion parameter indicates skipping the affine motion compensation prediction mode, and/or the size of the current CU does not meet the prediction size, then skip Through the affine motion compensation prediction mode, use prediction modes other than the affine motion compensation prediction mode to predict the current CU, obtain the cost corresponding to each prediction mode, and determine the prediction mode with the smallest cost as the optimal prediction mode for the current CU .
- the block division method of the current CTU can be understood as the optimal block division method of the current CTU.
- the block division method of the current CTU is the block division method with the lowest cost among multiple preset block division methods.
- the above prediction mode of the current CTU can be understood as a set, including the prediction mode of each CU in at least one CU included in the current CTU, where the prediction mode of the CU can be understood as the optimal prediction mode of the CU.
- the prediction mode of the current CTU is the prediction mode corresponding to the block division method of the current CTU.
- the current CTU is divided into at least one CU using the block division method of the current CTU, and each CU in the at least one CU is The set of prediction modes is determined as the prediction mode of the current CTU.
- the affine motion compensation prediction mode can be skipped when determining the block division method and prediction mode of the current CTU, thereby reducing the number of blocks required to determine the current CTU.
- the workload in the division method and prediction mode is reduced, computing resources are saved, and the efficiency of determining the block division method and prediction mode of the current CTU is improved.
- This embodiment of the present application does not limit the specific method of determining the block division method and prediction mode of the current CTU based on the violent motion parameters in S702.
- the above-mentioned S702 includes the following steps of S702-A1 to S702-A2:
- N is a positive integer, and i is less than or equal to N is a positive integer;
- S702-A2 Determine the block division method and prediction mode of the current CTU according to the optimal prediction modes corresponding to the N block division methods.
- the embodiment of the present application does not limit the specific method of determining the optimal prediction mode corresponding to the i-th block division method.
- the affine motion compensation prediction mode is determined to be the optimal prediction mode corresponding to the i-th block division mode.
- determining the optimal prediction mode corresponding to the i-th block division method according to the violent motion parameter in S702-A1 includes the following steps:
- S702-A14 Determine the optimal prediction mode corresponding to the i-th block division method based on the optimal prediction modes of the M CUs.
- the current CTU is divided into blocks using the i-th block division method to obtain M CUs.
- the optimal prediction mode corresponding to each of the M CUs is determined.
- at least one candidate prediction mode of the j-th CU is determined based on the violent motion parameter.
- the severe motion parameter indicates skipping the affine motion compensation prediction mode
- a prediction mode is determined from at least one candidate prediction mode of the j-th CU as the optimal prediction mode of the j-th CU.
- the cost when predicting the j-th CU according to at least one candidate prediction mode of the j-th CU is determined from at least one candidate prediction mode.
- Cost for example, based on the predicted value corresponding to each candidate prediction mode and the original value of the j-th CU, calculate the sum of absolute errors (Sum of Absolute Difference, SAD) or the sum of absolute values after adamard transformation (Sum of Absolute Transformed Difference, SATD) and other approximate costs.
- SAD Sum of Absolute Difference
- SATD Sum of Absolute Transformed Difference
- a candidate prediction mode is determined from the at least one candidate prediction mode as the optimal prediction mode of the jth CU, for example, the jth CU
- the candidate prediction mode with the smallest cost among at least one candidate prediction mode of the jth CU is regarded as the optimal prediction mode of the j-th CU.
- the optimal prediction mode of each CU in the M CUs under the i-th block division method can be determined, and the optimal prediction mode of each CU in the M CUs can be determined.
- the prediction mode is determined as the optimal prediction mode corresponding to the i-th block division method, and the sum of the costs corresponding to the optimal prediction modes of each CU in the M CUs is determined as the cost corresponding to the i-th block division method. .
- the optimal prediction mode and cost corresponding to each of the N block division methods are determined.
- the block division method with the smallest cost is determined as the block division method of the current CTU, and then the optimal prediction mode corresponding to the block division method of the current CTU is determined as the optimal prediction mode of the current CTU .
- the block division method 1 is the block division method with the lowest cost among N block division methods, and then the block division method 1 is determined as the block division method of the current CTU. It is assumed that the block division method 1 divides the current CTU into 4 CUs. , the optimal prediction modes of each of these four CUs are prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4, and then prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4 are Determine the optimal prediction mode for the current CTU.
- the encoding end determines the block division method and prediction mode of the current CTU according to the above steps, in order to maintain consistency between the encoding and decoding ends, it indicates the block division method and prediction mode of the current CTU to the decoder. . Specifically, at least one of first information and second information is written into the code stream, where the first information is used to indicate the block division mode of the current CTU, and the second information is used to indicate the prediction mode of the current CTU.
- the decoder obtains at least one of the first information and the second information by decoding the code stream, and then determines the block division method of the current CTU based on the first information, and/or determines the prediction mode of the current CTU based on the second information.
- the first information is an index of the block division mode of the current CTU.
- the second information is an index of the prediction mode of the current CTU.
- the encoding end After determining the block division method and prediction mode of the current CTU according to the above steps of S702, the encoding end performs the following steps of S703.
- S703 Use the block division method of the current CTU to divide the current CTU into blocks to obtain at least one CU.
- the decoder determines the block division method and prediction mode of the current CTU based on the above-mentioned S602, and then uses the block division method of the current CTU to perform block division on the current CTU, for example, divides the current CTU into at least one CU.
- the prediction mode of the current CTU includes the prediction mode of each CU in the above-mentioned at least one CU. In this way, when determining the prediction value of each CU in the at least one CU, the prediction corresponding to the CU in the prediction mode of the CTU can be used.
- the mode predicts the CU and obtains the predicted value of the CU.
- the encoding end determines the residual value of the current CU based on the predicted value of the current CU and the current CU. For example, the difference between the current CU and the predicted value of the current CU is determined as the residual value of the current CU.
- the above-mentioned transform coefficients of the current CU are directly encoded to obtain a code stream.
- step S701 the violent motion parameter MS of the current frame is determined.
- the current frame is divided into multiple non-overlapping CTU blocks.
- each CTU is processed sequentially in raster scanning order to determine the block division method and prediction mode of each CTU.
- determining the optimal block division method of the current CTU mainly includes the following steps:
- Step 31 For the i-th block division method Split[i] among the preset N block division methods, use the i-th block division method to divide the current CTU to obtain at least one CU. For the current CTU in at least one CU CU, calculates the optimal prediction mode CurBestModeInter[i] corresponding to the current CU in inter prediction mode, and the minimum prediction cost CurBestCostInter[i] corresponding to the optimal prediction mode. Specifically, the traditional inter-frame prediction mode (that is, no affine prediction) is first used to perform motion estimation on the current CU, and the prediction cost CurBestCostNoAffine is calculated, and the prediction mode CurBestModeNoAffine is saved.
- the traditional inter-frame prediction mode that is, no affine prediction
- Step 32 Calculate the minimum prediction cost CurBestCostOther[i] and the optimal prediction mode CurBestModeOther[i] in other prediction modes such as intra prediction. Compare CurBestCostInter[i] and CurBestCostOther[i] to select the optimal prediction mode bestMode[i] and prediction cost bestCost[i] under the i-th block division method.
- Step 33 Traverse all the block division methods among the N block division methods, and select the block division method Split[opt] and the corresponding prediction mode bestMode[opt] that minimize the current CTU prediction cost. Finally, use the block division method of the current CTU to perform block division on the current CTU to obtain at least one coding unit CU; for the current CU in at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to perform the block division on the current CU. Prediction, get the predicted value of the current CU. According to the predicted value of the current CU, determine the residual value of the current CU, transform, quantize, and entropy encode the residual value. Optionally, perform prediction information (including whether the CU uses the AFF identifier cu.affine and motion vector, etc. ) to encode and output the code stream.
- prediction information including whether the CU uses the AFF identifier cu.affine and motion vector, etc.
- the embodiment of the present application modifies the usage conditions of the affine motion compensation prediction mode, that is, the usage conditions of the affine motion compensation prediction mode in the coding unit syntax are modified.
- the modified Coding unit syntax is as shown in Table 1:
- the condition that the severe motion parameter MS is greater than or equal to T1 is added to the usage conditions of the affine motion compensation prediction mode. That is to say, in the embodiment of the present application, the value of the current first flag is the first value, and the width of the current CU is greater than or equal to 16, the height of the current CU is greater than or equal to 16, and the value of the violent motion parameter is greater than or equal to 16.
- the affine motion compensation prediction mode can be used, otherwise the affine motion compensation prediction mode is skipped. This can avoid the waste of computing resources caused by using the affine motion compensation prediction mode to predict translational motion videos, thereby reducing Encoding time, improve video encoding efficiency, and save computing resources.
- the size of the sequence numbers of the above-mentioned processes does not mean the order of execution.
- the execution order of each process should be determined by its functions and internal logic, and should not be used in this application.
- the implementation of the examples does not constitute any limitations.
- the term "and/or" is only an association relationship describing associated objects, indicating that three relationships can exist. Specifically, A and/or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
- the character "/" in this article generally indicates that the related objects are an "or" relationship.
- Figure 8 is a schematic block diagram of a video decoding device provided by an embodiment of the present application.
- the video decoding device 10 includes:
- Decoding unit 11 used to decode the code stream and determine the residual value of the current coding tree unit CTU;
- Determining unit 12 used to determine the block division method and prediction mode of the current CTU.
- the block division method and prediction mode of the current CTU are determined based on the violent motion parameter.
- the violent motion parameter is used to indicate whether to skip affine motion. Compensation prediction mode;
- the dividing unit 13 is configured to use the block dividing method of the current CTU to block divide the current CTU to obtain at least one coding unit CU;
- the prediction unit 14 is configured to predict the current CU in the at least one CU using the prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction of the current CU. value;
- the reconstruction unit 15 is configured to determine the residual value of the current CU according to the residual value of the current CTU, and obtain the reconstruction value of the current CU based on the residual value and the prediction value of the current CU.
- the at least one candidate prediction mode of the jth CU does not include the affine motion compensation prediction mode.
- At least one candidate prediction mode of the jth CU includes the affine motion compensation prediction mode.
- the optimal prediction mode of the j-th CU is a cost when predicting the j-th CU according to at least one candidate prediction mode of the j-th CU, from the at least one candidate prediction mode.
- a candidate prediction mode determined among the prediction modes.
- the violent motion parameter includes at least one of the violent motion parameter of the current frame, the violent motion parameter of the current CTU, and the violent motion parameter of the current CU,
- the violent motion parameter of the current frame is used to indicate whether the current frame skips the affine motion compensation prediction mode
- the violent motion parameter of the current CTU is used to indicate whether the current CTU skips the affine motion.
- Compensation prediction mode the violent motion parameter of the current CU is used to indicate whether the current CU skips the affine motion compensation prediction mode.
- the severe motion parameters of the current frame are determined based on the severe motion parameters of K CTUs included in the current frame, for the kth CTU among the K CTUs included in the current frame.
- the violent motion parameter of the k-th CTU is determined based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame, and the K is a positive integer,
- the k is a positive integer less than or equal to K.
- the violent motion parameter of the k-th CTU is determined based on the pixel value of the k-th CTU and the pixel value of the reference CTU.
- the violent motion parameter of the k-th CTU is determined based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU.
- the severe motion parameters of the current frame are determined based on the severe motion parameters of P CTUs among the K CTUs whose severe motion parameters are greater than the first preset value, and the P is less than or equal to K positive integer.
- the severe motion parameter of the current frame is determined based on the sum of the severe motion parameters of the P CTUs and the total area of the P CTUs.
- the violent motion parameter of the current frame is the ratio of the sum of the violent motion parameters of the P CTUs to the total area of the P CTUs.
- the severe motion parameter of the current CTU is determined based on the current CTU and a reference CTU of the current CTU in a frame preceding the current frame.
- the severe motion parameter of the current CTU is determined based on the pixel value of the current CTU and the pixel value of the reference CTU.
- the severe motion parameter of the current CTU is determined based on the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU.
- the violent motion parameter of the current CU is determined based on the current CU and a reference CU of the current CU in a frame preceding the current frame.
- the violent motion parameter of the current CU is determined based on the pixel value of the current CU and the pixel value of the reference CU.
- the violent motion parameter of the current CU is determined based on the absolute difference between the pixel value of the current CU and the pixel value of the reference CU.
- the strenuous exercise parameters are determined under preset conditions.
- the preset condition includes a first flag whose value is a first value and the size of the current CU satisfies at least one of the preset sizes.
- the first flag is used to indicate whether the current sequence
- the affine motion compensation prediction mode is allowed to be used, and the first value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
- the device 10 shown in Figure 8 can execute the decoding method of the embodiment of the present application, and perform the aforementioned and other operations and/or functions of each unit in the device 10 in order to implement the corresponding processes in each method such as the above decoding method.
- the device 10 shown in Figure 8 can execute the decoding method of the embodiment of the present application, and perform the aforementioned and other operations and/or functions of each unit in the device 10 in order to implement the corresponding processes in each method such as the above decoding method.
- the device 10 shown in Figure 8 can execute the decoding method of the embodiment of the present application, and perform the aforementioned and other operations and/or functions of each unit in the device 10 in order to implement the corresponding processes in each method such as the above decoding method.
- Figure 9 is a schematic block diagram of a video encoding device provided by an embodiment of the present application.
- the video encoding device 20 includes:
- the first determination unit 21 is used to determine a violent motion parameter, where the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode;
- the second determination unit 22 is configured to determine the block division method and prediction mode of the current CTU according to the violent motion parameter
- the dividing unit 23 is configured to use the block dividing method of the current CTU to block divide the current CTU to obtain at least one CU;
- the prediction unit 24 is configured to predict the current CU in the at least one CU using the prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction of the current CU. value;
- the second determination unit 22 is specifically configured to determine that at least one candidate prediction mode of the j-th CU includes: The affine motion compensated prediction mode.
- the computer program 34 can be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the tasks provided by this application.
- the one or more units may be a series of computer program instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
- the disclosed systems, devices and methods can be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of the units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented.
- the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
- a unit described as a separate component may or may not be physically separate.
- a component shown as a unit may or may not be a physical unit, that is, it may be located in one place, or it may 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.
- each functional unit in various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Provided in the present application are a video coding method and apparatus, and a device, a system and a storage medium. The method comprises: by means of a fierce motion parameter, determining whether the current video is a translational motion video, and if the current video is the translational motion video, skipping an affine motion compensation prediction mode, such that the waste of computing resources caused when the affine motion compensation prediction mode is used to perform prediction on the translational motion video is avoided, thereby shortening the coding time, improving the video coding efficiency, and saving on computing resources.
Description
本申请涉及视频编解码技术领域,尤其涉及一种视频编码方法、装置、设备、系统、及存储介质。The present application relates to the field of video coding and decoding technology, and in particular, to a video coding method, device, equipment, system, and storage medium.
数字视频技术可以并入多种视频装置中,例如数字电视、智能手机、计算机、电子阅读器或视频播放器等。随着视频技术的发展,视频数据所包括的数据量较大,为了便于视频数据的传输,视频装置执行视频压缩技术,以使视频数据更加有效的传输或存储。Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers, or video players. With the development of video technology, video data includes a larger amount of data. In order to facilitate the transmission of video data, video devices implement video compression technology to make the video data more efficiently transmitted or stored.
在视频传输过程中通过预测来减少冗余,例如通过仿射运动补偿预测(Affine motion compensation prediction,简称AFF)模式,实现对放大或缩小、旋转、透视运动和其他不规则运动的预测。但是,目前在使用仿射运动补偿预测模式时,可能会产生大量不必要的开销,浪费计算资源,增加编码时间。Redundancy is reduced through prediction during video transmission. For example, through the Affine motion compensation prediction (AFF) mode, prediction of enlargement or reduction, rotation, perspective movement and other irregular movements is achieved. However, currently, when using the affine motion compensation prediction mode, a lot of unnecessary overhead may be generated, wasting computing resources, and increasing encoding time.
发明内容Contents of the invention
本申请实施例提供了一种视频编码方法、装置、设备、系统、及存储介质,通过确定剧烈运动参数来判断是否跳过仿射运动补偿预测模式,进而避免计算资源的浪费,降低编码时间。Embodiments of the present application provide a video encoding method, device, equipment, system, and storage medium that determine whether to skip the affine motion compensation prediction mode by determining violent motion parameters, thereby avoiding waste of computing resources and reducing encoding time.
第一方面,本申请实施例提供一种视频解码方法,包括:In a first aspect, embodiments of the present application provide a video decoding method, including:
解码码流,确定当前编码树单元CTU的残差值;Decode the code stream and determine the residual value of the current coding tree unit CTU;
确定当前CTU的块划分方式和预测模式,所述当前CTU的块划分方式和预测模式是基于剧烈运动参数确定的,所述剧烈运动参数用于指示是否跳过仿射运动补偿预测模式;Determine the block division method and prediction mode of the current CTU. The block division method and prediction mode of the current CTU are determined based on the violent motion parameter. The violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode;
使用所述当前CTU的块划分方式对所述当前CTU进行块划分,得到至少一个编码单元CU;Perform block division on the current CTU using the block division method of the current CTU to obtain at least one coding unit CU;
针对所述至少一个CU中的当前CU,使用所述当前CTU的预测模式中所述当前CU对应的预测模式,对所述当前CU进行预测,得到所述当前CU的预测值;For the current CU in the at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU to obtain a prediction value of the current CU;
根据所述当前CTU的残差值,确定所述当前CU的残差值,并根据所述当前CU的残差值和预测值,得到所述当前CU的重建值。According to the residual value of the current CTU, the residual value of the current CU is determined, and based on the residual value and the prediction value of the current CU, the reconstruction value of the current CU is obtained.
第二方面,本申请实施例提供一种视频编码方法,包括:In a second aspect, embodiments of the present application provide a video encoding method, including:
根据所述剧烈运动参数,确定当前编码树单元CTU的块划分方式和预测模式;Determine the block division method and prediction mode of the current coding tree unit CTU according to the violent motion parameter;
使用所述当前CTU的块划分方式对所述当前CTU进行块划分,得到至少一个编码单元CU;Perform block division on the current CTU using the block division method of the current CTU to obtain at least one coding unit CU;
针对所述至少一个CU中的当前CU,使用所述当前CTU的预测模式中所述当前CU对应的预测模式,对所述当前CU进行预测,得到所述当前CU的预测值;For the current CU in the at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU to obtain a prediction value of the current CU;
根据所述当前CU的预测值,确定所述当前CU的残差值,并根据所述当前CU的残差值,得到码流。According to the predicted value of the current CU, the residual value of the current CU is determined, and based on the residual value of the current CU, a code stream is obtained.
第三方面,本申请提供了一种视频解码装置,用于执行上述第一方面或其各实现方式中的方法。具体地,该解码装置包括用于执行上述第一方面或其各实现方式中的方法的功能单元。In a third aspect, the present application provides a video decoding device for performing the method in the above first aspect or its respective implementations. Specifically, the decoding device includes a functional unit for executing the method in the above-mentioned first aspect or its respective implementations.
第四方面,本申请提供了一种视频编码装置,用于执行上述第二方面或其各实现方式中的方法。具体地,该编码装置包括用于执行上述第二方面或其各实现方式中的方法的功能单元。In a fourth aspect, the present application provides a video encoding device for performing the method in the above second aspect or its respective implementations. Specifically, the encoding device includes a functional unit for executing the method in the above-mentioned second aspect or its respective implementations.
第五方面,提供了一种视频解码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第一方面或其各实现方式中的方法。In a fifth aspect, a video decoder is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the above first aspect or its respective implementations.
第六方面,提供了一种视频编码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第二方面或其各实现方式中的方法。A sixth aspect provides a video encoder, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the above second aspect or its respective implementations.
第七方面,提供了一种视频编解码系统,包括视频编码器和视频解码器。视频编码器用于执行上述第二方面或其各实现方式中的方法,视频解码器用于执行上述第一方面或其各实现方式中的方法。A seventh aspect provides a video encoding and decoding system, including a video encoder and a video decoder. The video encoder is used to perform the method in the above-mentioned second aspect or its various implementations, and the video decoder is used to perform the method in the above-mentioned first aspect or its various implementations.
第八方面,提供了一种芯片,用于实现上述第一方面至第二方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第二方面中的任一方面或其各实现方式中的方法。An eighth aspect provides a chip for implementing any one of the above-mentioned first to second aspects or the method in each implementation manner thereof. Specifically, the chip includes: a processor, configured to call and run a computer program from a memory, so that the device installed with the chip executes any one of the above-mentioned first to second aspects or implementations thereof. method.
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。A ninth aspect provides a computer-readable storage medium for storing a computer program that causes a computer to execute any one of the above-mentioned first to second aspects or the method in each implementation thereof.
第十方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In a tenth aspect, a computer program product is provided, including computer program instructions, which enable a computer to execute any one of the above-mentioned first to second aspects or the methods in each implementation thereof.
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。An eleventh aspect provides a computer program that, when run on a computer, causes the computer to execute any one of the above-mentioned first to second aspects or the method in each implementation thereof.
第十二方面,提供了一种码流,该码流是通过上述第一方面中的任一方面或其各实现方式生成的。A twelfth aspect provides a code stream, which is generated by any one of the above-mentioned first aspects or implementations thereof.
基于以上技术方案,通过确定剧烈运动参数,来判断当前视频是否为平移运动类视频,若当前视频为平移运动类视频时,则跳过仿射运动补偿预测模式,进而避免了对平移运动类视频使用仿射运动补偿预测模式预测时所造成的计算资源浪费,从而减少编码时间,提高视频的编码效率,节约计算资源。Based on the above technical solution, by determining the violent motion parameters, it is determined whether the current video is a translational motion video. If the current video is a translational motion video, the affine motion compensation prediction mode is skipped, thereby avoiding the need for translational motion videos. The waste of computing resources caused by using affine motion compensation prediction mode prediction can reduce encoding time, improve video encoding efficiency, and save computing resources.
图1为本申请实施例涉及的一种视频编解码系统的示意性框图;Figure 1 is a schematic block diagram of a video encoding and decoding system related to an embodiment of the present application;
图2是本申请实施例涉及的视频编码器的示意性框图;Figure 2 is a schematic block diagram of a video encoder involved in an embodiment of the present application;
图3是本申请实施例涉及的视频解码器的示意性框图;Figure 3 is a schematic block diagram of a video decoder involved in an embodiment of the present application;
图4A和图4B为本申请实施例涉及的仿射运动补偿预测模式中控制点的选取示意图;Figures 4A and 4B are schematic diagrams of control point selection in the affine motion compensation prediction mode according to embodiments of the present application;
图5为使用仿射运动补偿预测模式确定出的每个子块的运动向量示意图;Figure 5 is a schematic diagram of the motion vector of each sub-block determined using the affine motion compensation prediction mode;
图6为本申请一实施例提供的视频解码方法流程示意图;Figure 6 is a schematic flow chart of a video decoding method provided by an embodiment of the present application;
图7为本申请一实施例提供的视频编码方法流程示意图;Figure 7 is a schematic flow chart of a video encoding method provided by an embodiment of the present application;
图8是本申请一实施例提供的视频解码装置的示意性框图;Figure 8 is a schematic block diagram of a video decoding device provided by an embodiment of the present application;
图9是本申请一实施例提供的视频编码装置的示意性框图;Figure 9 is a schematic block diagram of a video encoding device provided by an embodiment of the present application;
图10是本申请实施例提供的电子设备的示意性框图;Figure 10 is a schematic block diagram of an electronic device provided by an embodiment of the present application;
图11是本申请实施例提供的视频编解码系统的示意性框图。Figure 11 is a schematic block diagram of a video encoding and decoding system provided by an embodiment of the present application.
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域等。例如,本申请的方案可结合至音视频编码标准(audio video coding standard,简称AVS),例如,H.264/音视频编码(audio video coding,简称AVC)标准,H.265/高效视频编码(high efficiency video coding,简称HEVC)标准以及H.266/多功能视频编码(versatile video coding,简称VVC)标准。或者,本申请的方案可结合至其它专属或行业标准而操作,所述标准包含ITU-TH.261、ISO/IECMPEG-1Visual、ITU-TH.262或ISO/IECMPEG-2Visual、ITU-TH.263、ISO/IECMPEG-4Visual,ITU-TH.264(还称为ISO/IECMPEG-4AVC),包含可分级视频编解码(SVC)及多视图视频编解码(MVC)扩展。应理解,本申请的技术不限于任何特定编解码标准或技术。This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, real-time video encoding and decoding, etc. For example, the solution of this application can be combined with the audio and video coding standard (AVS for short), such as H.264/audio video coding (AVC for short) standard, H.265/high-efficiency video coding (AVS for short) high efficiency video coding (HEVC) standard and H.266/versatile video coding (VVC) standard. Alternatively, the solution of this application can be operated in conjunction with other proprietary or industry standards, including ITU-TH.261, ISO/IECMPEG-1Visual, ITU-TH.262 or ISO/IECMPEG-2Visual, ITU-TH.263 , ISO/IECMPEG-4Visual, ITU-TH.264 (also known as ISO/IECMPEG-4AVC), including scalable video codec (SVC) and multi-view video codec (MVC) extensions. It should be understood that the technology of this application is not limited to any specific codec standard or technology.
为了便于理解,首先结合图1对本申请实施例涉及的视频编解码系统进行介绍。For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG. 1 .
图1为本申请实施例涉及的一种视频编解码系统的示意性框图。需要说明的是,图1只是一种示例,本申请实施例的视频编解码系统包括但不限于图1所示。如图1所示,该视频编解码系统100包含编码设备110和解码设备120。其中编码设备用于对视频数据进行编码(可以理解成压缩)产生码流,并将码流传输给解码设备。解码设备对编码设备编码产生的码流进行解码,得到解码后的视频数据。Figure 1 is a schematic block diagram of a video encoding and decoding system related to an embodiment of the present application. It should be noted that Figure 1 is only an example, and the video encoding and decoding system in the embodiment of the present application includes but is not limited to what is shown in Figure 1 . As shown in FIG. 1 , the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120 . The encoding device is used to encode the video data (which can be understood as compression) to generate a code stream, and transmit the code stream to the decoding device. The decoding device decodes the code stream generated by the encoding device to obtain decoded video data.
本申请实施例的编码设备110可以理解为具有视频编码功能的设备,解码设备120可以理解为具有视频解码功能的设备,即本申请实施例对编码设备110和解码设备120包括更广泛的装置,例如包含智能手机、台式计算机、移动计算装置、笔记本(例如,膝上型)计算机、平板计算机、机顶盒、电视、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机等。The encoding device 110 in the embodiment of the present application can be understood as a device with a video encoding function, and the decoding device 120 can be understood as a device with a video decoding function. That is, the embodiment of the present application includes a wider range of devices for the encoding device 110 and the decoding device 120. Examples include smartphones, desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, vehicle-mounted computers, and the like.
在一些实施例中,编码设备110可以经由信道130将编码后的视频数据(如码流)传输给解码设备120。信道130可以包括能够将编码后的视频数据从编码设备110传输到解码设备120的一个或多个媒体和/或装置。In some embodiments, the encoding device 110 may transmit the encoded video data (eg, code stream) to the decoding device 120 via the channel 130 . Channel 130 may include one or more media and/or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120 .
在一个实例中,信道130包括使编码设备110能够实时地将编码后的视频数据直接发射到解码设备120的一个或多个通信媒体。在此实例中,编码设备110可根据通信标准来调制编码后的视频数据,且将调制后的视频数据发射到解码设备120。其中通信媒体包含无线通信媒体,例如射频频谱,可选的,通信媒体还可以包含有线通信媒体,例如一根或多根物理传输线。In one example, channel 130 includes one or more communication media that enables encoding device 110 to transmit encoded video data directly to decoding device 120 in real time. In this example, encoding device 110 may modulate the encoded video data according to the communication standard and transmit the modulated video data to decoding device 120. The communication media includes wireless communication media, such as radio frequency spectrum. Optionally, the communication media may also include wired communication media, such as one or more physical transmission lines.
在另一实例中,信道130包括存储介质,该存储介质可以存储编码设备110编码后的视频数据。存储介质包含多种本地存取式数据存储介质,例如光盘、DVD、快闪存储器等。在该实例中,解码设备120可从该存储介质中获取编码后的视频数据。In another example, channel 130 includes a storage medium that can store video data encoded by encoding device 110 . Storage media include a variety of local access data storage media, such as optical disks, DVDs, flash memories, etc. In this example, the decoding device 120 may obtain the encoded video data from the storage medium.
在另一实例中,信道130可包含存储服务器,该存储服务器可以存储编码设备110编码后的视频数据。在此实例中,解码设备120可以从该存储服务器中下载存储的编码后的视频数据。可选的,该存储服务器可以存储编码后的视频数据且可以将该编码后的视频数据发射到解码设备120,例如web服务器(例如,用于网站)、文件传送协议(FTP)服务器等。In another example, channel 130 may include a storage server that may store video data encoded by encoding device 110 . In this example, the decoding device 120 may download the stored encoded video data from the storage server. Optionally, the storage server may store the encoded video data and may transmit the encoded video data to the decoding device 120, such as a web server (eg, for a website), a File Transfer Protocol (FTP) server, etc.
一些实施例中,编码设备110包含视频编码器112及输出接口113。其中,输出接口113可以包含调制器/解调器(调制解调器)和/或发射器。In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113. Among other things, the output interface 113 may include a modulator/demodulator (modem) and/or a transmitter.
在一些实施例中,编码设备110除了包括视频编码器112和输入接口113外,还可以包括视频源111。In some embodiments, the encoding device 110 may include a video source 111 in addition to the video encoder 112 and the input interface 113 .
视频源111可包含视频采集装置(例如,视频相机)、视频存档、视频输入接口、计算机图形系统中的至少一个,其中,视频输入接口用于从视频内容提供者处接收视频数据,计算机图形系统用于产生视频数据。Video source 111 may include at least one of a video capture device (eg, a video camera), a video archive, a video input interface for receiving video data from a video content provider, a computer graphics system Used to generate video data.
视频编码器112对来自视频源111的视频数据进行编码,产生码流。视频数据可包括一个或多个图像(picture)或图像序列(sequence of pictures)。码流以比特流的形式包含了图像或图像序列的编码信息。编码信息可以包含编码图像数据及相关联数据。相关联数据可包含序列参数集(sequence parameter set,简称SPS)、图像参数集(picture parameter set,简称PPS)及其它语法结构。SPS可含有应用于一个或多个序列的参数。PPS可含有应用于一个或多个图像的参数。语法结构是指码流中以指定次序排列的零个或多个语法元素的集合。The video encoder 112 encodes the video data from the video source 111 to generate a code stream. Video data may include one or more images (pictures) or sequence of pictures (sequence of pictures). The code stream contains the encoding information of an image or image sequence in the form of a bit stream. Encoded information may include encoded image data and associated data. The associated data may include sequence parameter set (SPS), picture parameter set (PPS) and other syntax structures. An SPS can contain parameters that apply to one or more sequences. A PPS can contain parameters that apply to one or more images. A syntax structure refers to a collection of zero or more syntax elements arranged in a specified order in a code stream.
视频编码器112经由输出接口113将编码后的视频数据直接传输到解码设备120。编码后的视频数据还可存储于存储介质或存储服务器上,以供解码设备120后续读取。The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113 . The encoded video data can also be stored on a storage medium or storage server for subsequent reading by the decoding device 120 .
在一些实施例中,解码设备120包含输入接口121和视频解码器122。In some embodiments, decoding device 120 includes input interface 121 and video decoder 122.
在一些实施例中,解码设备120除包括输入接口121和视频解码器122外,还可以包括显示装置123。In some embodiments, in addition to the input interface 121 and the video decoder 122, the decoding device 120 may also include a display device 123.
其中,输入接口121包含接收器及/或调制解调器。输入接口121可通过信道130接收编码后的视频数据。The input interface 121 includes a receiver and/or a modem. Input interface 121 may receive encoded video data over channel 130.
视频解码器122用于对编码后的视频数据进行解码,得到解码后的视频数据,并将解码后的视频数据传输至显示装置123。The video decoder 122 is used to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123 .
显示装置123显示解码后的视频数据。显示装置123可与解码设备120整合或在解码设备120外部。显示装置123可包括多种显示装置,例如液晶显示器(LCD)、等离子体显示器、有机发光二极管(OLED)显示器或其它类型的显示装置。The display device 123 displays the decoded video data. Display device 123 may be integrated with decoding device 120 or external to decoding device 120 . Display device 123 may include a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
此外,图1仅为实例,本申请实施例的技术方案不限于图1,例如本申请的技术还可以应用于单侧的视频编码或 单侧的视频解码。In addition, Figure 1 is only an example, and the technical solutions of the embodiments of the present application are not limited to Figure 1. For example, the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding.
下面对本申请实施例涉及的视频编码框架进行介绍。The video coding framework involved in the embodiments of this application is introduced below.
下面对本申请实施例涉及的视频编码器进行介绍。The video encoder involved in the embodiment of the present application is introduced below.
图2是本申请实施例提供的视频编码器的示意性框图。应理解,该视频编码器200可用于对图像进行有损压缩(lossy compression),也可用于对图像进行无损压缩(lossless compression)。该无损压缩可以是视觉无损压缩(visually lossless compression),也可以是数学无损压缩(mathematically lossless compression)。Figure 2 is a schematic block diagram of a video encoder provided by an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression of images (lossy compression), or can also be used to perform lossless compression (lossless compression) of images. The lossless compression can be visually lossless compression (visually lossless compression) or mathematically lossless compression (mathematically lossless compression).
该视频编码器200可应用于亮度色度(YCbCr,YUV)格式的图像数据上。例如,YUV比例可以为4:2:0、4:2:2或者4:4:4,Y表示明亮度(Luma),Cb(U)表示蓝色色度,Cr(V)表示红色色度,U和V表示为色度(Chroma)用于描述色彩及饱和度。例如,在颜色格式上,4:2:0表示每4个像素有4个亮度分量,2个色度分量(YYYYCbCr),4:2:2表示每4个像素有4个亮度分量,4个色度分量(YYYYCbCrCbCr),4:4:4表示全像素显示(YYYYCbCrCbCrCbCrCbCr)。The video encoder 200 can be applied to image data in a luminance-chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents brightness (Luma), Cb(U) represents blue chroma, Cr(V) represents red chroma, U and V represent Chroma, which is used to describe color and saturation. For example, in the color format, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 Chroma component (YYYYCbCrCbCr), 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).
例如,该视频编码器200读取视频数据,针对视频数据中的每帧图像,将一帧图像划分成若干个编码树单元(coding tree unit,CTU),在一些例子中,CTU可被称作“树型块”、“最大编码单元”(Largest Coding unit,简称LCU)或“编码树型块”(coding tree block,简称CTB)。每一个CTU可以与图像内的具有相等大小的像素块相关联。每一像素可对应一个亮度(luminance或luma)采样及两个色度(chrominance或chroma)采样。因此,每一个CTU可与一个亮度采样块及两个色度采样块相关联。一个CTU大小例如为128×128、64×64、32×32等。一个CTU又可以继续被划分成若干个编码单元(Coding Unit,CU)进行编码,CU可以为矩形块也可以为方形块。CU可以进一步划分为预测单元(prediction Unit,简称PU)和变换单元(transform unit,简称TU),进而使得编码、预测、变换分离,处理的时候更灵活。在一种示例中,CTU以四叉树方式划分为CU,CU以四叉树方式划分为TU、PU。For example, the video encoder 200 reads video data, and for each frame of image in the video data, divides one frame of image into several coding tree units (coding tree units, CTU). In some examples, CTU may be called "Tree block", "Largest Coding unit" (LCU for short) or "coding tree block" (CTB for short). Each CTU can be associated with an equal-sized block of pixels within the image. Each pixel can correspond to one luminance (luminance or luma) sample and two chrominance (chrominance or chroma) samples. Therefore, each CTU can be associated with one block of luma samples and two blocks of chroma samples. A CTU size is, for example, 128×128, 64×64, 32×32, etc. A CTU can be further divided into several coding units (Coding Units, CUs) for encoding. CUs can be rectangular blocks or square blocks. CU can be further divided into prediction unit (PU for short) and transform unit (TU for short), thus enabling coding, prediction, and transformation to be separated and processing more flexible. In an example, the CTU is divided into CUs in a quad-tree manner, and the CU is divided into TUs and PUs in a quad-tree manner.
视频编码器及视频解码器可支持各种PU大小。假定特定CU的大小为2N×2N,视频编码器及视频解码器可支持2N×2N或N×N的PU大小以用于帧内预测,且支持2N×2N、2N×N、N×2N、N×N或类似大小的对称PU以用于帧间预测。视频编码器及视频解码器还可支持2N×nU、2N×nD、nL×2N及nR×2N的不对称PU以用于帧间预测。Video encoders and video decoders can support various PU sizes. Assuming that the size of a specific CU is 2N×2N, the video encoder and video decoder can support a PU size of 2N×2N or N×N for intra prediction, and support 2N×2N, 2N×N, N×2N, N×N or similar sized symmetric PU for inter prediction. The video encoder and video decoder can also support 2N×nU, 2N×nD, nL×2N and nR×2N asymmetric PUs for inter prediction.
在一些实施例中,如图2所示,该视频编码器200可包括:预测单元210、残差单元220、变换/量化单元230、反变换/量化单元240、重建单元250、环路滤波单元260、解码图像缓存270和熵编码单元280。需要说明的是,视频编码器200可包含更多、更少或不同的功能组件。In some embodiments, as shown in Figure 2, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform/quantization unit 230, an inverse transform/quantization unit 240, a reconstruction unit 250, and a loop filter unit. 260. Decode the image cache 270 and the entropy encoding unit 280. It should be noted that the video encoder 200 may include more, less, or different functional components.
可选的,在本申请中,当前块可以称为当前编码单元(CU)或当前预测单元(PU)等。预测块也可称为预测图像块或图像预测块,重建图像块也可称为重建块或图像重建图像块。Optionally, in this application, the current block may be called the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block may also be called a predicted image block or an image prediction block, and the reconstructed image block may also be called a reconstruction block or an image reconstructed image block.
在一些实施例中,预测单元210包括帧间预测单元211和帧内预测单元212。由于视频的一个帧中的相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测的方法消除相邻像素之间的空间冗余。由于视频中的相邻帧之间存在着很强的相似性,在视频编解码技术中使用帧间预测方法消除相邻帧之间的时间冗余,从而提高编码效率。In some embodiments, prediction unit 210 includes inter prediction unit 211 and intra prediction unit 212. Since there is a strong correlation between adjacent pixels in a video frame, the intra-frame prediction method is used in video encoding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in the video, the interframe prediction method is used in video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving coding efficiency.
帧间预测单元211可用于帧间预测,帧间预测可以参考不同帧的图像信息,帧间预测使用运动信息从参考帧中找到参考块,根据参考块生成预测块,用于消除时间冗余;帧间预测所使用的帧可以为P帧和/或B帧,P帧指的是向前预测帧,B帧指的是双向预测帧。运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整像素的或者是分像素的,如果运动矢量是分像素的,那么需要再参考帧中使用插值滤波做出所需的分像素的块,这里把根据运动矢量找到的参考帧中的整像素或者分像素的块叫参考块。有的技术会直接把参考块作为预测块,有的技术会在参考块的基础上再处理生成预测块。在参考块的基础上再处理生成预测块也可以理解为把参考块作为预测块然后再在预测块的基础上处理生成新的预测块。The inter-frame prediction unit 211 can be used for inter-frame prediction. Inter-frame prediction can refer to image information of different frames. Inter-frame prediction uses motion information to find reference blocks from reference frames and generate prediction blocks based on the reference blocks to eliminate temporal redundancy; The frames used in inter-frame prediction may be P frames and/or B frames. P frames refer to forward prediction frames, and B frames refer to bidirectional prediction frames. The motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector. The motion vector can be in whole pixels or sub-pixels. If the motion vector is in sub-pixels, then interpolation filtering needs to be used in the reference frame to make the required sub-pixel blocks. Here, the reference frame found based on the motion vector is A block of whole pixels or sub-pixels is called a reference block. Some technologies will directly use the reference block as a prediction block, and some technologies will process the reference block to generate a prediction block. Reprocessing to generate a prediction block based on a reference block can also be understood as using the reference block as a prediction block and then processing to generate a new prediction block based on the prediction block.
帧内预测单元212只参考同一帧图像的信息,预测当前码图像块内的像素信息,用于消除空间冗余。帧内预测所使用的帧可以为I帧。例如图5所示,白色的4×4块是当前块,当前块左边一行和上面一列的灰色的像素为当前块的参考像素,帧内预测使用这些参考像素对当前块进行预测。这些参考像素可能已经全部可得,即全部已经编解码。也可能有部分不可得,比如当前块是整帧的最左侧,那么当前块的左边的参考像素不可得。或者编解码当前块时,当前块左下方的部分还没有编解码,那么左下方的参考像素也不可得。对于参考像素不可得的情况,可以使用可得的参考像素或某些值或某些方法进行填充,或者不进行填充。The intra prediction unit 212 only refers to the information of the same frame image and predicts the pixel information in the current coded image block to eliminate spatial redundancy. The frames used in intra prediction may be I frames. For example, as shown in Figure 5, the white 4×4 block is the current block, and the gray pixels in the left row and the upper column of the current block are the reference pixels of the current block. Intra-frame prediction uses these reference pixels to predict the current block. These reference pixels may all be available, that is, all of them may have been encoded and decoded. There may also be some parts that are unavailable. For example, if the current block is the leftmost part of the entire frame, then the reference pixel on the left side of the current block is unavailable. Or when encoding and decoding the current block, the lower left part of the current block has not been encoded or decoded, so the reference pixels in the lower left are also unavailable. For cases where the reference pixel is not available, the available reference pixels or certain values or certain methods can be used for filling, or no filling can be performed.
在一些实施例中,帧内预测方法还包括多参考行帧内预测方法(multiple reference line,MRL),MRL可以使用更多的参考像素从而提高编码效率。In some embodiments, the intra prediction method also includes a multiple reference line intra prediction method (multiple reference line, MRL). MRL can use more reference pixels to improve coding efficiency.
帧内预测有多种预测模式,H.264中对4×4的块进行帧内预测的9种模式。其中模式0是将当前块上面的像素按竖直方向复制到当前块作为预测值;模式1是将左边的参考像素按水平方向复制到当前块作为预测值;模式2(DC)是将A~D和I~L这8个点的平均值作为所有点的预测值,模式3至模式8是分别按某一个角度将参考像素复制到当前块的对应位置。因为当前块某些位置不能正好对应到参考像素,可能需要使用参考像素的加权平均值,或者说是插值的参考像素的分像素。There are multiple prediction modes for intra prediction. In H.264, there are 9 modes for intra prediction of 4×4 blocks. Among them, mode 0 is to copy the pixels above the current block in the vertical direction to the current block as the prediction value; mode 1 is to copy the reference pixel on the left to the current block in the horizontal direction as the prediction value; mode 2 (DC) is to copy A~ The average value of the eight points D and I~L is used as the predicted value of all points. Mode 3 to mode 8 copy the reference pixel to the corresponding position of the current block at a certain angle. Because some positions of the current block cannot exactly correspond to the reference pixels, it may be necessary to use the weighted average of the reference pixels, or the sub-pixels of the interpolated reference pixels.
HEVC使用的帧内预测模式有平面模式(Planar)、DC和33种角度模式,共35种预测模式。VVC使用的帧内模式有Planar、DC和65种角度模式,共67种预测模式。AVS3使用的帧内模式有DC、Plane、Bilinear和63种角度模式,共66种预测模式。The intra-frame prediction modes used by HEVC include planar mode (Planar), DC and 33 angle modes, for a total of 35 prediction modes. The intra-frame modes used by VVC include Planar, DC and 65 angle modes, for a total of 67 prediction modes. The intra-frame modes used by AVS3 include DC, Plane, Bilinear and 63 angle modes, for a total of 66 prediction modes.
需要说明的是,随着角度模式的增加,帧内预测将会更加精确,也更加符合对高清以及超高清数字视频发展的需求。It should be noted that with the increase of angle modes, intra-frame prediction will be more accurate and more in line with the development needs of high-definition and ultra-high-definition digital videos.
残差单元220可基于CU的像素块及CU的PU的预测块来产生CU的残差块。举例来说,残差单元220可产生CU的残差块,使得残差块中的每一采样具有等于以下两者之间的差的值:CU的像素块中的采样,及CU的PU的预测块中的对应采样。 Residual unit 220 may generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, residual unit 220 may generate a residual block of a CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the PU of the CU. Predict the corresponding sample in the block.
变换/量化单元230可量化变换系数。变换/量化单元230可基于与CU相关联的量化参数(QP)值来量化与CU的 TU相关联的变换系数。视频编码器200可通过调整与CU相关联的QP值来调整应用于与CU相关联的变换系数的量化程度。Transform/quantization unit 230 may quantize the transform coefficients. Transform/quantization unit 230 may quantize transform coefficients associated with a TU of the CU based on a quantization parameter (QP) value associated with the CU. Video encoder 200 may adjust the degree of quantization applied to transform coefficients associated with the CU by adjusting the QP value associated with the CU.
反变换/量化单元240可分别将逆量化及逆变换应用于量化后的变换系数,以从量化后的变换系数重建残差块。Inverse transform/quantization unit 240 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct the residual block from the quantized transform coefficients.
重建单元250可将重建后的残差块的采样加到预测单元210产生的一个或多个预测块的对应采样,以产生与TU相关联的重建图像块。通过此方式重建CU的每一个TU的采样块,视频编码器200可重建CU的像素块。 Reconstruction unit 250 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction unit 210 to produce a reconstructed image block associated with the TU. By reconstructing blocks of samples for each TU of a CU in this manner, video encoder 200 can reconstruct blocks of pixels of the CU.
环路滤波单元260可执行消块滤波操作以减少与CU相关联的像素块的块效应。Loop filtering unit 260 may perform deblocking filtering operations to reduce blocking artifacts for blocks of pixels associated with the CU.
在一些实施例中,环路滤波单元260包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, and an adaptive loop filtering ALF unit.
解码图像缓存270可存储重建后的像素块。帧间预测单元211可使用含有重建后的像素块的参考图像来对其它图像的PU执行帧间预测。另外,帧内预测单元212可使用解码图像缓存270中的重建后的像素块来对在与CU相同的图像中的其它PU执行帧内预测。Decoded image cache 270 may store reconstructed pixel blocks. Inter prediction unit 211 may perform inter prediction on PUs of other images using reference images containing reconstructed pixel blocks. Additionally, intra prediction unit 212 may use the reconstructed pixel blocks in decoded image cache 270 to perform intra prediction on other PUs in the same image as the CU.
熵编码单元280可接收来自变换/量化单元230的量化后的变换系数。熵编码单元280可对量化后的变换系数执行一个或多个熵编码操作以产生熵编码后的数据。 Entropy encoding unit 280 may receive the quantized transform coefficients from transform/quantization unit 230 . Entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy encoded data.
本申请涉及的视频编码的基本流程如下:在编码端,将当前图像划分成块,针对当前块,预测单元210使用帧内预测或帧间预测产生当前块的预测块。残差单元220可基于预测块与当前块的原始块计算残差块,即预测块和当前块的原始块的差值,该残差块也可称为残差信息。该残差块经由变换/量化单元230变换与量化等过程,可以去除人眼不敏感的信息,以消除视觉冗余。可选的,经过变换/量化单元230变换与量化之前的残差块可称为时域残差块,经过变换/量化单元230变换与量化之后的时域残差块可称为频率残差块或频域残差块。熵编码单元280接收到变换量化单元230输出的量化后的变换系数,可对该量化后的变换系数进行熵编码,输出码流。例如,熵编码单元280可根据目标上下文模型以及二进制码流的概率信息消除字符冗余。The basic process of video encoding involved in this application is as follows: at the encoding end, the current image is divided into blocks, and for the current block, the prediction unit 210 uses intra prediction or inter prediction to generate a prediction block of the current block. The residual unit 220 may calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block. The residual block may also be called residual information. The residual block undergoes transformation and quantization processes such as transformation/quantization unit 230 to remove information that is insensitive to human eyes to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transformation/quantization unit 230 may be called a time domain residual block, and the time domain residual block after transformation and quantization by the transformation/quantization unit 230 may be called a frequency residual block. or frequency domain residual block. The entropy encoding unit 280 receives the quantized transform coefficients output by the transform and quantization unit 230, and may perform entropy encoding on the quantized transform coefficients to output a code stream. For example, the entropy encoding unit 280 may eliminate character redundancy according to the target context model and probability information of the binary code stream.
另外,视频编码器对变换量化单元230输出的量化后的变换系数进行反量化和反变换,得到当前块的残差块,再将当前块的残差块与当前块的预测块进行相加,得到当前块的重建块。随着编码的进行,可以得到当前图像中其他图像块对应的重建块,这些重建块进行拼接,得到当前图像的重建图像。由于编码过程中引入误差,为了降低误差,对重建图像进行滤波,例如,使用ALF对重建图像进行滤波,以减小重建图像中像素点的像素值与当前图像中像素点的原始像素值之间差异。将滤波后的重建图像存放在解码图像缓存270中,可以为后续的帧作为帧间预测的参考帧。In addition, the video encoder performs inverse quantization and inverse transformation on the quantized transform coefficients output by the transform and quantization unit 230 to obtain the residual block of the current block, and then adds the residual block of the current block and the prediction block of the current block, Get the reconstructed block of the current block. As the encoding proceeds, reconstruction blocks corresponding to other image blocks in the current image can be obtained, and these reconstruction blocks are spliced to obtain a reconstructed image of the current image. Since errors are introduced during the encoding process, in order to reduce the error, the reconstructed image is filtered. For example, ALF is used to filter the reconstructed image to reduce the difference between the pixel value of the pixel in the reconstructed image and the original pixel value of the pixel in the current image. difference. The filtered reconstructed image is stored in the decoded image cache 270 and can be used as a reference frame for inter-frame prediction for subsequent frames.
需要说明的是,编码端确定的块划分信息,以及预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息等在必要时携带在码流中。解码端通过解析码流及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。It should be noted that the block division information determined by the encoding end, as well as mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., are carried in the code stream when necessary. The decoding end determines the same block division information as the encoding end by parsing the code stream and analyzing the existing information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information, thereby ensuring the decoded image obtained by the encoding end It is the same as the decoded image obtained by the decoding end.
图3是本申请实施例提供的视频解码器的示意性框图。Figure 3 is a schematic block diagram of a video decoder provided by an embodiment of the present application.
如图3所示,视频解码器300包含:熵解码单元310、预测单元320、反量化/变换单元330、重建单元340、环路滤波单元350及解码图像缓存360。需要说明的是,视频解码器300可包含更多、更少或不同的功能组件。As shown in FIG. 3 , the video decoder 300 includes an entropy decoding unit 310 , a prediction unit 320 , an inverse quantization/transformation unit 330 , a reconstruction unit 340 , a loop filtering unit 350 and a decoded image cache 360 . It should be noted that the video decoder 300 may include more, less, or different functional components.
视频解码器300可接收码流。熵解码单元310可解析码流以从码流提取语法元素。作为解析码流的一部分,熵解码单元310可解析码流中的经熵编码后的语法元素。预测单元320、反量化/变换单元330、重建单元340及环路滤波单元350可根据从码流中提取的语法元素来解码视频数据,即产生解码后的视频数据。Video decoder 300 can receive the code stream. Entropy decoding unit 310 may parse the codestream to extract syntax elements from the codestream. As part of parsing the code stream, the entropy decoding unit 310 may parse entropy-encoded syntax elements in the code stream. The prediction unit 320, the inverse quantization/transformation unit 330, the reconstruction unit 340 and the loop filtering unit 350 may decode the video data according to the syntax elements extracted from the code stream, that is, generate decoded video data.
在一些实施例中,预测单元320包括帧间预测单元321和帧内预测单元322。In some embodiments, prediction unit 320 includes inter prediction unit 321 and intra prediction unit 322.
帧间预测单元321可执行帧内预测以产生PU的预测块。帧间预测单元321可使用帧内预测模式以基于空间相邻PU的像素块来产生PU的预测块。帧间预测单元321还可根据从码流解析的一个或多个语法元素来确定PU的帧内预测模式。Inter prediction unit 321 may perform intra prediction to generate predicted blocks for the PU. Inter prediction unit 321 may use an intra prediction mode to generate predicted blocks for a PU based on pixel blocks of spatially neighboring PUs. Inter prediction unit 321 may also determine the intra prediction mode of the PU based on one or more syntax elements parsed from the codestream.
帧内预测单元322可根据从码流解析的语法元素来构造第一参考图像列表(列表0)及第二参考图像列表(列表1)。此外,如果PU使用帧间预测编码,则熵解码单元310可解析PU的运动信息。帧内预测单元322可根据PU的运动信息来确定PU的一个或多个参考块。帧内预测单元322可根据PU的一个或多个参考块来产生PU的预测块。Intra prediction unit 322 may construct a first reference image list (List 0) and a second reference image list (List 1) based on syntax elements parsed from the codestream. Additionally, if the PU uses inter-prediction encoding, entropy decoding unit 310 may parse the motion information of the PU. Intra-prediction unit 322 may determine one or more reference blocks for the PU based on the motion information of the PU. Intra-prediction unit 322 may generate a predicted block for the PU based on one or more reference blocks of the PU.
反量化/变换单元330可逆量化(即,解量化)与TU相关联的变换系数。反量化/变换单元330可使用与TU的CU相关联的QP值来确定量化程度。Inverse quantization/transform unit 330 may inversely quantize (ie, dequantize) transform coefficients associated with a TU. Inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
在逆量化变换系数之后,反量化/变换单元330可将一个或多个逆变换应用于逆量化变换系数,以便产生与TU相关联的残差块。After inversely quantizing the transform coefficients, inverse quantization/transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to produce a residual block associated with the TU.
重建单元340使用与CU的TU相关联的残差块及CU的PU的预测块以重建CU的像素块。例如,重建单元340可将残差块的采样加到预测块的对应采样以重建CU的像素块,得到重建图像块。 Reconstruction unit 340 uses the residual blocks associated with the TU of the CU and the prediction blocks of the PU of the CU to reconstruct the pixel blocks of the CU. For example, reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
环路滤波单元350可执行消块滤波操作以减少与CU相关联的像素块的块效应。Loop filtering unit 350 may perform deblocking filtering operations to reduce blocking artifacts for blocks of pixels associated with the CU.
在一些实施例中,环路滤波单元350包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。In some embodiments, the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, and an adaptive loop filtering ALF unit.
视频解码器300可将CU的重建图像存储于解码图像缓存360中。视频解码器300可将解码图像缓存360中的重建图像作为参考图像用于后续预测,或者,将重建图像传输给显示装置呈现。Video decoder 300 may store the reconstructed image of the CU in decoded image cache 360 . The video decoder 300 may use the reconstructed image in the decoded image cache 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
本申请涉及的视频解码的基本流程如下:熵解码单元310可解析码流得到当前块的预测信息、量化系数矩阵等,预测单元320基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换单元330使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建单元340将预测块和残差块相加得到重建块。重建块组成重建图像,环路滤波单元350基于图像或基于块对重建图像进行环路滤波,得到解码图像。该解码图像也可以称为重建图像,该重建图像一方面可以被显示设备进行显示,另一方面可以存放在解码图像缓存360中,为后续的帧作为帧间预测的参考帧。The basic process of video decoding involved in this application is as follows: the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction unit 320 uses intra prediction or inter prediction for the current block based on the prediction information to generate the current block. Block prediction block. The inverse quantization/transform unit 330 uses the quantization coefficient matrix obtained from the code stream to perform inverse quantization and inverse transformation on the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstruction block. The reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain a decoded image. The decoded image can also be called a reconstructed image. On the one hand, the reconstructed image can be displayed by the display device, and on the other hand, it can be stored in the decoded image buffer 360 and used as a reference frame for inter-frame prediction for subsequent frames.
上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤 可能会被优化,本申请适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. This application is applicable to the block-based hybrid coding framework. The basic process of the video codec, but is not limited to this framework and process.
由上述可知,目前在视频编解码过程中,所使用的预测方法包括帧内预测方法和帧间预测方式,而普通的帧间预测方式主要考虑了平移运动。但是,在现实世界中,除了平移运动,还有很多种其他运动运动,例如放大/缩小、旋转、透视运动和其他不规则运动。因此,在一些实施例中,采用基于块的仿射运动补偿预测模式进行预测。下面对仿射运动补偿预测模式进行介绍。It can be seen from the above that currently in the video encoding and decoding process, the prediction methods used include intra-frame prediction methods and inter-frame prediction methods, and ordinary inter-frame prediction methods mainly consider translational motion. However, in the real world, besides translational motion, there are many kinds of other motion motions, such as zooming in/out, rotation, perspective motion and other irregular motions. Therefore, in some embodiments, a block-based affine motion compensated prediction mode is used for prediction. The affine motion compensation prediction mode is introduced below.
如图4A和图4B所示,块的仿射运动场由两个控制点(4参数)或三个控制点运动矢量(6参数)的运动信息来描述。As shown in Figures 4A and 4B, the affine motion field of a block is described by the motion information of two control points (4 parameters) or three control point motion vectors (6 parameters).
基于块的仿射运动补偿预测模式包括如下步骤:The block-based affine motion compensation prediction mode includes the following steps:
步骤1,首先将块划分为4x4的亮度子块。Step 1, first divide the block into 4x4 luma sub-blocks.
步骤2,每个亮度子块由仿射向量计算其中心像素的运动向量,然后四舍五入到1/16精度。其中,4参数仿射运动模型和6参数仿射运动模型按照不同的计算方式导出运动矢量。Step 2, each brightness sub-block calculates the motion vector of its center pixel from the affine vector, and then rounds it to 1/16 accuracy. Among them, the 4-parameter affine motion model and the 6-parameter affine motion model derive motion vectors according to different calculation methods.
示例性的,对于4参数仿射运动模型,中心像素为(x,y)的子块的运动向量计算如公式(1)所示:For example, for a 4-parameter affine motion model, the motion vector calculation of the sub-block whose central pixel is (x, y) is as shown in formula (1):
示例性的,对于6参数仿射运动模型,中心像素为(x,y)的子块的运动向量计算如公式(2)所示:For example, for a 6-parameter affine motion model, the motion vector calculation of the sub-block whose central pixel is (x, y) is as shown in formula (2):
其中,(mv0x,mv0y),(mv1x,mv1y),(mv2x,mv2y)分别是左上角、右上角和左下角的控制点的运动向量。Among them, (mv0x, mv0y), (mv1x, mv1y), (mv2x, mv2y) are the motion vectors of the control points in the upper left corner, upper right corner and lower left corner respectively.
步骤3,每个子块计算出运动向量后(如图5所示),根据运动向量进行运动补偿插值滤波得到每个子块的预测值。Step 3: After calculating the motion vector for each sub-block (as shown in Figure 5), motion compensation interpolation filtering is performed based on the motion vector to obtain the predicted value of each sub-block.
步骤4,对于色度分量同样是划分为4x4的子块,其运动向量等于与其相关的4个4x4的亮度子块运动向量的平均值。Step 4: The chroma component is also divided into 4x4 sub-blocks, and its motion vector is equal to the average of the motion vectors of the four 4x4 luma sub-blocks related to it.
和传统的帧间运动向量预测方式一样,仿射运动向量也有两种预测方式:仿射merge模式、仿射AMVP模式。Like the traditional inter-frame motion vector prediction method, there are two prediction methods for affine motion vectors: affine merge mode and affine AMVP mode.
仿射merge预测(affine merge prediction),对于宽和高都大于等于8的CU可以使用AF_MERGE模式。在这种模式下当前CU的控制点运动向量(control point motion vector,CPMV)由其空域相邻的CU的运动信息生成。至多生成5个CPMV的预测候选项,且需要传输一个索引表示最终使用了哪个候选项。Affine merge prediction (affine merge prediction), you can use AF_MERGE mode for CUs whose width and height are greater than or equal to 8. In this mode, the control point motion vector (CPMV) of the current CU is generated from the motion information of its adjacent CUs in the spatial domain. At most 5 CPMV prediction candidates are generated, and an index needs to be transmitted to indicate which candidate was ultimately used.
仿射AMVP预测(affine AMVP prediction),对于宽和高都大于等于16的CU可以使用仿射AMVP模式。在merge模式中直接使用预测CPMV,而在AMVP中需要传输的是当前CU的最优CPMV和预测CPMV的残差。仿射AMVP预测的候选列表有2个候选项。Affine AMVP prediction (affine AMVP prediction), the affine AMVP mode can be used for CUs whose width and height are greater than or equal to 16. In the merge mode, the predicted CPMV is used directly, while in AMVP what needs to be transmitted is the optimal CPMV of the current CU and the residual of the predicted CPMV. The candidate list for affine AMVP prediction has 2 candidates.
在一些实施例中,基于AFF的编码方法为:首先,将输入图像划分成不重叠的多个CTU。然后,按照光栅扫描顺序依次处理每个CTU,将CTU按照不同方式划分成若干个CU,其中,确定最优块划分方式的主要步骤如下:In some embodiments, the AFF-based encoding method is: first, divide the input image into multiple non-overlapping CTUs. Then, each CTU is processed in sequence according to the raster scanning order, and the CTU is divided into several CUs in different ways. Among them, the main steps to determine the optimal block division method are as follows:
步骤11,对于第i个划分方式Split[i],计算帧间预测模式下的最小预测代价CurBestCostInter[i]和最优模式CurBestModeInter[i]。具体地,先利用传统帧间预测方法(无仿射预测)做运动估计,并计算预测代价CurBestCostNoAffine,保存预测模式CurBestModeNoAffine。如果sps_affine_enable_flag=1且块尺寸等固定约束条件满足,则利用仿射运动补偿预测模式做运动估计,并计算预测代价CurBestCostAffine,保存预测模式CurBestModeAffine,将两种代价中较小的一个作为帧间预测模式下的最小预测代价CurBestCostInter[i],并保存对应的模式为最优模式CurBestModeInter[i]。Step 11: For the i-th division Split[i], calculate the minimum prediction cost CurBestCostInter[i] and the optimal mode CurBestModeInter[i] in the inter prediction mode. Specifically, the traditional inter-frame prediction method (without affine prediction) is first used for motion estimation, the prediction cost CurBestCostNoAffine is calculated, and the prediction mode CurBestModeNoAffine is saved. If sps_affine_enable_flag=1 and fixed constraints such as block size are met, use the affine motion compensation prediction mode for motion estimation, calculate the prediction cost CurBestCostAffine, save the prediction mode CurBestModeAffine, and use the smaller of the two costs as the interframe prediction mode The minimum prediction cost under CurBestCostInter[i], and save the corresponding mode as the optimal mode CurBestModeInter[i].
步骤12,计算帧内预测等其他预测模式下的最小预测代价CurBestCostOther[i]和最优预测模式CurBestModeOther[i]。比较CurBestCostInter[i]和CurBestCostOther[i],选出第i个划分方式的最优预测模式bestMode[i]和预测代价bestCost[i]。Step 12: Calculate the minimum prediction cost CurBestCostOther[i] and the optimal prediction mode CurBestModeOther[i] in other prediction modes such as intra prediction. Compare CurBestCostInter[i] and CurBestCostOther[i], and select the optimal prediction mode bestMode[i] and prediction cost bestCost[i] of the i-th division method.
步骤13,遍历预设的所有块划分方式,选出使当前CTU预测代价最小的块划分方式Split[opt]和相应的预测模式bestMode[opt]。Step 13: Traverse all preset block division methods, and select the block division method Split[opt] and the corresponding prediction mode bestMode[opt] that minimize the current CTU prediction cost.
步骤14,按照最优的块划分方式对当前CTU进行划分,得到多个CU,并使用最优块划分方式对应的预测模式对多个CU进行预测,得到预测值,根据预测值和原始值,得到残差值,对残差值进行变换、量化、熵编码,另外,对预测信息,包括CU是否采用AFF的标识符cu.affine和运动矢量等进行编码,输出码流。Step 14: Divide the current CTU according to the optimal block division method to obtain multiple CUs, and use the prediction mode corresponding to the optimal block division method to predict multiple CUs to obtain predicted values. According to the predicted value and the original value, Obtain the residual value, transform, quantize, and entropy encode the residual value. In addition, encode the prediction information, including whether the CU uses the AFF identifier cu.affine and motion vector, etc., and output the code stream.
在一些实施例中,基于AFF的解码方法为:对输入的码流进行熵解码、反量化、反变换、得到残差值Res,另外解码码流,得到块划分信息和预测信息等。接着,按以下步骤重建图像:In some embodiments, the AFF-based decoding method is: performing entropy decoding, inverse quantization, and inverse transformation on the input code stream to obtain the residual value Res, and further decoding the code stream to obtain block division information and prediction information. Next, follow these steps to reconstruct the image:
步骤21,根据块划分信息确定当前CTU的划分树。Step 21: Determine the partition tree of the current CTU according to the block partition information.
步骤22,根据光栅扫描顺序依次处理划分树中的每个CU,利用每个CU的预测信息,如预测模式bestMode[opt]、标识符cu.affine和运动矢量等,计算预测值Pred。Step 22: Process each CU in the partition tree sequentially according to the raster scanning order, and use the prediction information of each CU, such as prediction mode bestMode[opt], identifier cu.affine, motion vector, etc., to calculate the prediction value Pred.
步骤23,将当前CU的残差值Res和预测值Pred叠加,得到重建CU。最后,将重建图像送入DBF/SAO/ALF滤波器,滤波后的图像送入缓冲区,等待视频播放。Step 23: Superpose the residual value Res and the prediction value Pred of the current CU to obtain the reconstructed CU. Finally, the reconstructed image is sent to the DBF/SAO/ALF filter, and the filtered image is sent to the buffer to wait for video playback.
由上述可知,AFF作为帧间预测技术的补充,以更高效地表达放大/缩小、旋转等不规则运动。因此,对于每个预 测单元,AFF需要对其中每个4x4子块做运动估计,从而导致更多的率失真优化计算,大幅增加编码复杂度。据统计,AFF在低延时模式下平均带来2.95%的增益和27%的编码复杂度增加。而,AFF能获得性能提升的根本在于放大/缩小、旋转等不规则运动。也就是说,对于一般的平移运动类视频,AFF带来的性能增益很有限,但依然会大幅增加编码复杂度。As can be seen from the above, AFF serves as a supplement to inter-frame prediction technology to more efficiently express irregular movements such as zooming in/out and rotation. Therefore, for each prediction unit, AFF needs to perform motion estimation on each 4x4 sub-block, which results in more rate-distortion optimization calculations and greatly increases the coding complexity. According to statistics, AFF brings an average gain of 2.95% and an increase in coding complexity of 27% in low-latency mode. However, the fundamental reason why AFF can achieve performance improvement lies in irregular movements such as zooming in/out and rotation. In other words, for general translational motion videos, the performance gain brought by AFF is very limited, but it will still significantly increase the coding complexity.
为了解决上述技术问题,本申请实施例通过确定剧烈运动参数,来判断当前视频是否为平移运动类视频,若当前视频为平移运动类视频时,则跳过仿射运动补偿预测模式,进而避免了对平移运动类视频使用仿射运动补偿预测模式预测时所造成的计算资源浪费,从而降低编码时间,提高了视频的编码效率,节约了计算资源。In order to solve the above technical problem, the embodiment of the present application determines whether the current video is a translational motion video by determining violent motion parameters. If the current video is a translational motion video, the affine motion compensation prediction mode is skipped, thereby avoiding The waste of computing resources caused by using the affine motion compensation prediction mode for prediction of translational motion videos reduces the encoding time, improves the encoding efficiency of the video, and saves computing resources.
下面结合具体的实施例,对本申请实施例提供的视频编解码方法进行介绍。The video encoding and decoding method provided by the embodiment of the present application will be introduced below with reference to specific embodiments.
首先结合图6,以解码端为例,对本申请实施例提供的视频解码方法进行介绍。First, with reference to Figure 6, the video decoding method provided by the embodiment of the present application is introduced, taking the decoding end as an example.
图6为本申请一实施例提供的视频解码方法流程示意图,本申请实施例应用于图1和图3所示视频解码器。FIG. 6 is a schematic flowchart of a video decoding method provided by an embodiment of the present application. The embodiment of the present application is applied to the video decoders shown in FIGS. 1 and 3 .
如图6所示,本申请实施例的方法包括:As shown in Figure 6, the method in the embodiment of this application includes:
S601、解码码流,确定当前CTU的残差值。S601. Decode the code stream and determine the residual value of the current CTU.
在视频解码时,解码端接收码流,并对码流进行解码,确定当前CTU的块划分方式,使用当前CTU的块划分方式对当前CTU进行块划分,得到至少一个CU。解码码流,得到至少一个CU中当前CU的量化系数,对当前CU的量化系数进行反量化,得到当前CU的变换系数,对当前CU的变换系数进行反变换,得到当前CU的残差值。解码码流,确定当前CU的预测模式,使用当前CU的预测模式对当前CU进行预测,得到当前CU的预测值。根据当前CU的预测值和残差值,得到当前CU的重建值。当前帧中各CU的重建值,组成重建图像。During video decoding, the decoder receives the code stream, decodes the code stream, determines the block division method of the current CTU, and divides the current CTU into blocks using the block division method of the current CTU to obtain at least one CU. Decode the code stream to obtain the quantization coefficient of the current CU in at least one CU, perform inverse quantization on the quantization coefficient of the current CU to obtain the transformation coefficient of the current CU, and perform inverse transformation on the transformation coefficient of the current CU to obtain the residual value of the current CU. Decode the code stream, determine the prediction mode of the current CU, use the prediction mode of the current CU to predict the current CU, and obtain the prediction value of the current CU. According to the prediction value and residual value of the current CU, the reconstruction value of the current CU is obtained. The reconstructed values of each CU in the current frame form the reconstructed image.
在一些实施例中,基于图像或基于块对重建图像进行环路滤波,得到解码图像,该解码图像也可以称为重建图像,重建图像可以为后续的帧作为帧间预测的参考帧。In some embodiments, loop filtering is performed on the reconstructed image on an image basis or on a block basis to obtain a decoded image. The decoded image may also be called a reconstructed image, and the reconstructed image may be used as a reference frame for inter-frame prediction for subsequent frames.
在一些实施例中,当前CU也称为当前块、当前图像块、当前解码块、当前编码单元、当前待解码块、当前待解码的图像块等。In some embodiments, the current CU is also called a current block, a current image block, a current decoding block, a current coding unit, a current block to be decoded, a current image block to be decoded, etc.
在一些实施例中,本申请实施例的当前CU只包括色度分量,可以理解为色度块。In some embodiments, the current CU in the embodiment of the present application only includes chrominance components, which can be understood as chrominance blocks.
在一些实施例中,本申请实施例的当前CU只包括亮度分量,可以理解为亮度块。In some embodiments, the current CU in the embodiment of the present application only includes the luminance component, which can be understood as a luminance block.
在一些实施例中,该当前CU即包括亮度分量又包括色度分量。In some embodiments, the current CU includes both luma and chrominance components.
本申请实施例中,解码端确定当前CTU的残差值包括如下两种情况:In the embodiment of this application, the decoder determines the residual value of the current CTU in the following two situations:
情况1,若编码端对当前CTU中各CU的残差值进行变换,得到各CU的变换系数,直接对各CU的变换系数进行编码,得到码流。对应的,解码端解码码流,得到当前CTU的变换系数,对当前CTU的变换系数进行反变换,得到当前CTU的残差值。Case 1: If the encoding end transforms the residual values of each CU in the current CTU to obtain the transformation coefficients of each CU, it directly encodes the transformation coefficients of each CU to obtain a code stream. Correspondingly, the decoder decodes the code stream to obtain the transform coefficient of the current CTU, and performs inverse transformation on the transform coefficient of the current CTU to obtain the residual value of the current CTU.
情况2,若编码端对当前CTU中各CU的残差值进行变换,得到各CU的变换系数,接着,对各CU的变换系数进行量化,得到各CU的量化系数,对各CU的量化系数进行编码,得到码流。对应的,解码端解码码流,得到当前CTU的量化系数,对当前CTU的量化系数进行反量化,得到当前CTU的变换系数,对当前CTU的变换系数进行反变换,得到当前CTU的残差值。Case 2: If the encoding end transforms the residual value of each CU in the current CTU to obtain the transform coefficient of each CU, then quantizes the transform coefficient of each CU to obtain the quantized coefficient of each CU, and the quantized coefficient of each CU is Encode and get the code stream. Correspondingly, the decoding end decodes the code stream to obtain the quantization coefficient of the current CTU, inversely quantizes the quantization coefficient of the current CTU to obtain the transform coefficient of the current CTU, and inversely transforms the transform coefficient of the current CTU to obtain the residual value of the current CTU. .
S602、确定当前CTU的块划分方式和预测模式。S602. Determine the block division method and prediction mode of the current CTU.
其中,当前CTU的块划分方式和预测模式是基于剧烈运动参数确定的,该剧烈运动参数用于指示是否跳过仿射运动补偿预测模式。Among them, the block division method and prediction mode of the current CTU are determined based on the violent motion parameter, and the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode.
需要说明的是,上述S602可以在上述S601之前执行,也可以在上述S602之后执行,或者与上述S602同步执行,本申请实施例对此不做限制。It should be noted that the above-mentioned S602 may be executed before the above-mentioned S601, may be executed after the above-mentioned S602, or may be executed simultaneously with the above-mentioned S602, and the embodiment of the present application does not limit this.
本申请实施例中,由于仿射运动补偿预测模式较复杂,占用较多的计算资源,使得解码效率低。另外,仿射运动补偿预测模式主要用于高效地表达放大/缩小、旋转等不规则运动,对于平移运动类视频,仿射运动补偿预测模式的性能增益有限。由此可知,对于平移运动类视频使用仿射运动补偿预测模式进行预测时,带来的压缩效果不显著,但是会占用大量的计算资源,增加编码时间。因此,本申请实施例在使用仿射运动补偿预测模式进行预测之前,首先确定剧烈运动参数,并根据该剧烈运动参数来指示当前视频是否为平移运动类视频,若确定当前视频为平移运动类视频时,则跳过仿射运动补偿预测模式,进而避免对平移运动类视频使用仿射运动补偿预测模式进行预测时,所造成的计算资源浪费,从而提高了视频的编码效率,节约了计算资源。In the embodiment of the present application, since the affine motion compensation prediction mode is more complex and takes up more computing resources, the decoding efficiency is low. In addition, the affine motion compensation prediction mode is mainly used to efficiently express irregular motions such as zooming in/out and rotation. For translational motion videos, the performance gain of the affine motion compensation prediction mode is limited. It can be seen that when using the affine motion compensation prediction mode for prediction of translational motion videos, the compression effect is not significant, but it will occupy a large amount of computing resources and increase the encoding time. Therefore, before using the affine motion compensation prediction mode for prediction, the embodiment of the present application first determines the violent motion parameter, and uses the violent motion parameter to indicate whether the current video is a translational motion video. If it is determined that the current video is a translational motion video, When , the affine motion compensation prediction mode is skipped, thereby avoiding the waste of computing resources caused by using the affine motion compensation prediction mode for prediction of translational motion videos, thereby improving the coding efficiency of the video and saving computing resources.
本申请实施例的剧烈运动参数用于指示当前视频是否为平移运动移类视频,若为平移运动移类视频运动时,跳过仿射运动补偿预测模式,因此,本申请实施例的剧烈运动参数也可以直接用于指示是否跳过仿射运动补偿预测模式。例如,若剧烈运动参数小于预设数值时,则确定当前视频是平移运动类视频,此时跳过仿射运动补偿预测模式,若剧烈运动参数大于或等于预设数值时,则确定当前视频不是平移运动类视频,此时可以使用仿射运动补偿预测模式进行预测。The violent motion parameter in the embodiment of the present application is used to indicate whether the current video is a translational motion-type video. If it is a translational motion-type video, the affine motion compensation prediction mode is skipped. Therefore, the violent motion parameter in the embodiment of the present application is Can also be used directly to indicate whether to skip affine motion compensation prediction mode. For example, if the violent motion parameter is less than the preset value, it is determined that the current video is a translation motion video, and the affine motion compensation prediction mode is skipped. If the violent motion parameter is greater than or equal to the preset value, it is determined that the current video is not For translational motion videos, affine motion compensation prediction mode can be used for prediction.
在一些实施例中,上述当前CTU的块划分方式可以理解为当前CTU的最优块划分方式,例如当前CTU的块划分方式为预设的多个块划分方式中,代价最小的块划分方式。In some embodiments, the block division method of the current CTU can be understood as the optimal block division method of the current CTU. For example, the block division method of the current CTU is the block division method with the lowest cost among multiple preset block division methods.
在一些实施例中,上述当前CTU的预测模式可以理解为一个集合,包括当前CTU所包括的至少一个CU中每个CU的预测模式,其中CU的预测模式可以理解为CU的最优预测模式。In some embodiments, the above prediction mode of the current CTU can be understood as a set, including the prediction mode of each CU in at least one CU included in the current CTU, where the prediction mode of the CU can be understood as the optimal prediction mode of the CU.
本申请实施例中,当前CTU的预测模式为当前CTU的块划分方式对应的预测模式,例如,使用当前CTU的块划分方式将当前CTU划分为至少一个CU,将这至少一个CU中每个CU的预测模式组成的集合,确定为当前CTU的预测模式。In this embodiment of the present application, the prediction mode of the current CTU is the prediction mode corresponding to the block division method of the current CTU. For example, the current CTU is divided into at least one CU using the block division method of the current CTU, and each CU in the at least one CU is The set of prediction modes is determined as the prediction mode of the current CTU.
本申请实施例中,当前CTU的块划分方式和预测模式是基于剧烈运动参数的,这样根据剧烈运动参数判断当前视频为平移运动类视频时,在确定当前CTU的块划分方式和预测模式时可以跳过仿射运动补偿预测模式,进而降低了确定当前CTU的块划分方式和预测模式时的工作量,节约计算资源,提高当前CTU的块划分方式和预测模式的确定效 率。In the embodiment of the present application, the block division method and prediction mode of the current CTU are based on the violent motion parameters. In this way, when the current video is judged to be a translational motion video based on the violent motion parameters, the block division method and prediction mode of the current CTU can be determined. Skipping the affine motion compensation prediction mode reduces the workload of determining the block division method and prediction mode of the current CTU, saves computing resources, and improves the efficiency of determining the block division method and prediction mode of the current CTU.
上述S602中确定当前CTU的块划分方式和预测模式的具体方式包括但不限于如下几种:The specific methods for determining the block division method and prediction mode of the current CTU in S602 include but are not limited to the following:
方式一,编码端将确定的当前CTU的块划分方式和预测模式指示给解码端,这样解码端可以根据指示信息,确定出当前CTU的块划分方式和预测模式。具体的,上述S602包括如下S602-A1和S602-A2:Method 1: The encoding end indicates the determined block division method and prediction mode of the current CTU to the decoder, so that the decoder can determine the block division method and prediction mode of the current CTU based on the indication information. Specifically, the above-mentioned S602 includes the following S602-A1 and S602-A2:
S602-A1、解码码流,得到第一信息和第二信息中的至少一个,其中,第一信息用于指示当前CTU的块划分方式,第二信息用于指示当前CTU的预测模式;S602-A1. Decode the code stream to obtain at least one of first information and second information, where the first information is used to indicate the block division method of the current CTU, and the second information is used to indicate the prediction mode of the current CTU;
S602-A2、根据第一信息和第二信息中的至少一个,确定当前CTU的块划分方式和预测模式中的至少一个。S602-A2: Determine at least one of the block division method and the prediction mode of the current CTU according to at least one of the first information and the second information.
在该方式一中,编码端在根据剧烈运动参数确定出当前CTU的块划分方式和预测模式后,在码流中写入第一信息和第二信息中的至少一个,其中第一信息用于指示当前CTU的块划分方式,第二信息用于指示当前CTU的预测模式。这样解码端通过解码码流,得到第一信息和第二信息中的至少一个,进而根据第一信息确定出当前CTU的块划分方式,和/或根据第二信息确定出当前CTU的预测模式。In this method one, after determining the block division method and prediction mode of the current CTU based on the violent motion parameters, the encoding end writes at least one of the first information and the second information in the code stream, where the first information is used to Indicates the block division mode of the current CTU, and the second information is used to indicate the prediction mode of the current CTU. In this way, the decoder obtains at least one of the first information and the second information by decoding the code stream, and then determines the block division method of the current CTU based on the first information, and/or determines the prediction mode of the current CTU based on the second information.
本申请实施例对第一信息和第二信息的具体形式不做限制。The embodiments of this application do not limit the specific forms of the first information and the second information.
在一些实施例中,第一信息为当前CTU的块划分方式的索引。In some embodiments, the first information is an index of the block division mode of the current CTU.
在一些实施例中,第二信息为当前CTU的预测模式的索引。In some embodiments, the second information is an index of the prediction mode of the current CTU.
解码端除了使用上述S602-A1和S602-A2的步骤,确定出当前CTU的块划分方式和预测模式外,还可以根据如下的方式二,确定当前CTU的块划分方式和预测模式。In addition to using the above steps of S602-A1 and S602-A2 to determine the block division method and prediction mode of the current CTU, the decoder can also determine the block division method and prediction mode of the current CTU according to the following method 2.
方式二,解码端确定剧烈运动参数,并根据剧烈运动参数确定当前CTU的块划分方式和预测模式。例如,解码端,确定剧烈运动参数,例如码流中携带编码端确定的剧烈运动参数,这样解码端可以通过解码码流,得到剧烈运动参数。接着,解码端根据该剧烈运动参数确定当前CTU的块划分方式和预测模式,例如若剧烈运动参数指示跳过仿射运动补偿预测模式时,则解码端在确定CTU的块划分方式和预测模式时,跳过仿射运动补偿预测模式。再例如,若剧烈运动参数指示不跳过仿射运动补偿预测模式时,则解码端在确定CTU的块划分方式和预测模式时,则可以尝试仿射运动补偿预测模式。需要说明的是,解码端在当前CTU的块划分方式和预测模式时,当前CTU中的CU未重建,在一种可能的实现方式中,可以使用CU的模板来代替CU来确定当前CTU中各CU的预测模式,其中,CU的模板包括CU的上方已解码区域和/或左侧已解码区域。Method 2: The decoder determines the violent motion parameters, and determines the block division method and prediction mode of the current CTU based on the violent motion parameters. For example, the decoding end determines the violent motion parameters. For example, the code stream carries the violent motion parameters determined by the encoding end. In this way, the decoding end can obtain the violent motion parameters by decoding the code stream. Next, the decoder determines the block division method and prediction mode of the current CTU based on the violent motion parameter. For example, if the violent motion parameter indicates to skip the affine motion compensation prediction mode, the decoder determines the block division method and prediction mode of the CTU. , skipping affine motion compensation prediction mode. For another example, if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, the decoder may try the affine motion compensation prediction mode when determining the block division method and prediction mode of the CTU. It should be noted that when the decoder uses the block division method and prediction mode of the current CTU, the CU in the current CTU has not been reconstructed. In a possible implementation, the template of the CU can be used instead of the CU to determine the CU in the current CTU. The prediction mode of the CU, where the template of the CU includes the upper decoded area and/or the left decoded area of the CU.
本申请实施例对根据剧烈运动参数确定当前CTU的块划分方式和预测模式的具体方式不做限制。The embodiments of this application do not limit the specific method of determining the block division method and prediction mode of the current CTU based on the violent motion parameters.
在一些实施例中,当前CTU的块划分方式为预设块划分方式,CTU的预测模式是根据剧烈运动参数确定的,例如,若剧烈运动参数指示跳过仿射运动补偿预测模式时,则将非仿射运动补偿预测模式外的一预测模式确定为CTU的预测模式。若剧烈运动参数指示不跳过仿射运动补偿预测模式时,则将仿射运动补偿预测模式确定为CTU的预测模式。In some embodiments, the block division method of the current CTU is a preset block division method, and the prediction mode of the CTU is determined based on the violent motion parameter. For example, if the violent motion parameter indicates to skip the affine motion compensation prediction mode, then the A prediction mode other than the non-affine motion compensation prediction mode is determined as the prediction mode of the CTU. If the severe motion parameter indicates not to skip the affine motion compensation prediction mode, then the affine motion compensation prediction mode is determined as the prediction mode of the CTU.
在一些实施例中,当前CTU的块划分方式和预测模式是根据N个块划分方式对应的最优预测模式确定的,其中,N个块划分方式中的第i个块划分方式对应的最优预测模式是根据剧烈运动参数确定的。具体的,对于N个块划分方式中的第i个块划分方式,根据剧烈运动参数确定该第i个块划分方式对应的最优预测模式,这样可以确定出N个块划分方式中每个块划分方式对应的最优预测模式,进而根据N个块划分方式对应的最优预测模式,确定当前CTU的块划分方式和预测模式,例如,将N个块划分方式对应的最优预测模式中代价最小的块划分方式,确定为当前CTU的块划分方式,将该当前CTU的块划分方式对应的最优预测模式,确定为当前CTU的预测模式。In some embodiments, the block division method and prediction mode of the current CTU are determined based on the optimal prediction modes corresponding to the N block division methods, where the optimal prediction mode corresponding to the i-th block division method among the N block division methods is Prediction modes are determined based on strenuous exercise parameters. Specifically, for the i-th block division method among the N block division methods, the optimal prediction mode corresponding to the i-th block division method is determined according to the violent motion parameter, so that each block in the N block division methods can be determined The optimal prediction mode corresponding to the division method, and then determine the block division method and prediction mode of the current CTU based on the optimal prediction modes corresponding to the N block division methods. For example, the cost in the optimal prediction mode corresponding to the N block division method is determined. The smallest block division method is determined as the block division method of the current CTU, and the optimal prediction mode corresponding to the block division method of the current CTU is determined as the prediction mode of the current CTU.
本申请实施例,对确定第i个块划分方式对应的最优预测模式的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the optimal prediction mode corresponding to the i-th block division method.
在一些实施例中,若剧烈运动参数指示跳过仿射运动补偿预测模式,则从除仿射运动补偿预测模式之外的预测模式中确定一个或多个预测模式作为该第i个块划分方式对应的最优预测模式。In some embodiments, if the severe motion parameter indicates skipping the affine motion compensation prediction mode, one or more prediction modes are determined as the i-th block partitioning mode from prediction modes other than the affine motion compensation prediction mode. The corresponding optimal prediction mode.
在一些实施例中,若剧烈运动参数指示不跳过仿射运动补偿预测模式,则将仿射运动补偿预测模式确定为该第i个块划分方式对应的最优预测模式。In some embodiments, if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, the affine motion compensation prediction mode is determined to be the optimal prediction mode corresponding to the i-th block division mode.
在一些实施例中,第i个块划分方式对应的最优预测模式是根据M个CU的最优预测模式确定的,其中,M个CU是使用第i个块划分方式对当前CTU进行块划分得到的,M个CU中的第j个CU的最优预测模式是从第j个CU的至少一个候选预测模式中确定的,第j个CU的至少一个候选预测模式是根据剧烈运动参数确定的。In some embodiments, the optimal prediction mode corresponding to the i-th block division method is determined based on the optimal prediction modes of M CUs, where the M CUs use the i-th block division method to perform block division on the current CTU. Obtained, the optimal prediction mode of the j-th CU among the M CUs is determined from at least one candidate prediction mode of the j-th CU, and at least one candidate prediction mode of the j-th CU is determined based on the violent motion parameters. .
具体的,对于N个块划分方式中的第i个块划分方式,使用该第i个块划分方式对当前CTU进行块划分,得到M个CU。接着,根据剧烈运动参数,确定M个CU中每个CU对应的最优预测模式。具体是,针对M个CU中的每个CU,例如第j个CU,根据剧烈运动参数确定确定该第j个CU的至少一个候选预测模式。Specifically, for the i-th block division method among the N block division methods, the current CTU is divided into blocks using the i-th block division method to obtain M CUs. Next, based on the violent motion parameters, the optimal prediction mode corresponding to each of the M CUs is determined. Specifically, for each CU among the M CUs, for example, the j-th CU, at least one candidate prediction mode of the j-th CU is determined based on the violent motion parameter.
在一些实施例中,若剧烈运动参数指示跳过仿射运动补偿预测模式,则第j个CU的至少一个候选预测模式中不包括仿射运动补偿预测模式。In some embodiments, if the severe motion parameter indicates skipping the affine motion compensation prediction mode, the at least one candidate prediction mode of the jth CU does not include the affine motion compensation prediction mode.
在一些实施例中,若剧烈运动参数指示不跳过仿射运动补偿预测模式,则第j个CU的至少一个候选预测模式中包括仿射运动补偿预测模式。In some embodiments, if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, at least one candidate prediction mode of the jth CU includes the affine motion compensation prediction mode.
接着,从第j个CU的至少一个候选预测模式中确定一预测模式,作为该第j个CU的最优预测模式。Next, a prediction mode is determined from at least one candidate prediction mode of the j-th CU as the optimal prediction mode of the j-th CU.
在一些实施例中,将第j个CU的至少一个候选预测模式中一默认预测模式确定为第j个CU的最优预测模式。In some embodiments, a default prediction mode among at least one candidate prediction mode of the j-th CU is determined as the optimal prediction mode of the j-th CU.
在一些实施例中,第j个CU的最优预测模式是根据第j个CU的至少一个候选预测模式对第j个CU进行预测时的代价,从至少一个候选预测模式中确定。In some embodiments, the optimal prediction mode of the j-th CU is a cost when predicting the j-th CU according to at least one candidate prediction mode of the j-th CU, and is determined from at least one candidate prediction mode.
以第j个CU的最优预测模式为第j个CU的至少一个候选预测模式中代价最小的候选预测模式为例,本申请实施例中,确定CTU的块划分方式和预测模式的具体过程为:针对预设的N个块划分方式中的第i个块划分方式,使用该第i个块划分方式对当前CTU进行块划分,得到M个CU,针对这M个CU中的每一个CU,根据剧烈运动参数确定M个CU中每个CU的最优预测模式。具体是,针对M个CU中的第j个CU,若剧烈运动参数指示跳过仿射运动补偿预测模式,则确定该第j个CU的至少一个候选预测模式中不包括仿射运动补偿预测模式,若剧烈运动参数指示不 跳过仿射运动补偿预测模式,则确定该第j个CU的至少一个候选预测模式中包括仿射运动补偿预测模式。接着,使用第j个CU的至少一个候选预测模式中的每个一个候选预测模式对第j个CU进行预测,得到每一个候选预测模式对应的预测值,根据每一个候选预测模式对应的预测值和第j个CU的原始值,确定出第j个CU的每一个候选预测模式的代价,本申请实施例,为了降低代价的计算工作量,可以使用近似代价的方式计算每个候选预测模式的代价,例如根据每一个候选预测模式对应的预测值和第j个CU的原始值,计算绝对误差和(Sum of Absolute Difference,SAD)或adamard变换后再绝对值求和(Sum of Absolute Transformed Difference,SATD)等近似代价。根据第j个CU的至少一个候选预测模式中每一个候选预测模式的代价,从这至少一个候选预测模式中确定出一个候选预测模式作为该第j个CU的最优预测模式,例如将第j个CU的至少一个候选预测模式中代价最小的候选预测模式作为该第j个CU的最优预测模式。参照确定第j个CU的最优预测模式的方法,可以确定出第i个块划分方式下的M个CU中每个CU的最优预测模式,将这M个CU中每个CU的最优预测模式确定为该第i个块划分方式对应的最优预测模式,将这M个CU中每个CU的最优预测模式对应的代价之和,确定为该第i个块划分方式对应的代价。根据上述确定第i个块划分方式对应的最优预测模式和代价的方法,确定出N个块划分方式中每个一个块划分方式对应的最优预测模式和代价。最后,将这N个块划分方式中,代价最小的块划分方式确定为当前CTU的块划分方式,进而将当前CTU的块划分方式对应的最优预测模式,确定为当前CTU的最优预测模式。例如,块划分方式1为N个块划分方式中代价最小的块划分方式,进而将该块划分方式1确定为当前CTU的块划分方式,假设该块划分方式1将当前CTU划分为4个CU,这4个CU中的每个CU的最优预测模式分别为预测模式1、预测模式2、预测模式3和预测模式4,进而将预测模式1、预测模式2、预测模式3和预测模式4确定为该当前CTU的最优预测模式。Taking the optimal prediction mode of the j-th CU as the candidate prediction mode with the smallest cost among at least one candidate prediction mode of the j-th CU as an example, in the embodiment of the present application, the specific process of determining the block division method and prediction mode of the CTU is as follows : For the i-th block division method among the preset N block division methods, use the i-th block division method to perform block division on the current CTU to obtain M CUs. For each CU in these M CUs, The optimal prediction mode for each CU in the M CUs is determined based on the violent motion parameters. Specifically, for the j-th CU among the M CUs, if the severe motion parameter indicates skipping the affine motion compensation prediction mode, it is determined that at least one candidate prediction mode of the j-th CU does not include the affine motion compensation prediction mode. , if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, it is determined that at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode. Next, use each of the candidate prediction modes of at least one candidate prediction mode of the j-th CU to predict the j-th CU, and obtain the prediction value corresponding to each candidate prediction mode. According to the prediction value corresponding to each candidate prediction mode, and the original value of the j-th CU to determine the cost of each candidate prediction mode of the j-th CU. In the embodiment of the present application, in order to reduce the cost calculation workload, an approximate cost method can be used to calculate the cost of each candidate prediction mode. Cost, for example, based on the predicted value corresponding to each candidate prediction mode and the original value of the j-th CU, calculate the sum of absolute errors (Sum of Absolute Difference, SAD) or the sum of absolute values after adamard transformation (Sum of Absolute Transformed Difference, SATD) and other approximate costs. According to the cost of each candidate prediction mode in at least one candidate prediction mode of the jth CU, a candidate prediction mode is determined from the at least one candidate prediction mode as the optimal prediction mode of the jth CU, for example, the jth CU The candidate prediction mode with the smallest cost among at least one candidate prediction mode of the jth CU is regarded as the optimal prediction mode of the j-th CU. Referring to the method of determining the optimal prediction mode of the j-th CU, the optimal prediction mode of each CU in the M CUs under the i-th block division method can be determined, and the optimal prediction mode of each CU in the M CUs can be determined. The prediction mode is determined as the optimal prediction mode corresponding to the i-th block division method, and the sum of the costs corresponding to the optimal prediction modes of each CU in the M CUs is determined as the cost corresponding to the i-th block division method. . According to the above method of determining the optimal prediction mode and cost corresponding to the i-th block division method, the optimal prediction mode and cost corresponding to each of the N block division methods are determined. Finally, among the N block division methods, the block division method with the smallest cost is determined as the block division method of the current CTU, and then the optimal prediction mode corresponding to the block division method of the current CTU is determined as the optimal prediction mode of the current CTU . For example, the block division method 1 is the block division method with the lowest cost among N block division methods, and then the block division method 1 is determined as the block division method of the current CTU. It is assumed that the block division method 1 divides the current CTU into 4 CUs. , the optimal prediction modes of each of these four CUs are prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4, and then prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4 are Determine the optimal prediction mode for the current CTU.
由上述可知,本申请实施例中,在确定当前CTU的块划分方式和预测模式时,对于每一种块划分方式下的每个一个CU中,均基于剧烈运动参数,确定最优预测模式,这样当CU为平移运动类视频时,可以跳过仿射运动补偿预测模式,进而大大节约了计算资源,有效提高当前CTU的块划分方式和预测模式的确定效率,进而提升编码性能。It can be seen from the above that in the embodiment of the present application, when determining the block division method and prediction mode of the current CTU, for each CU under each block division method, the optimal prediction mode is determined based on the violent motion parameters. In this way, when the CU is a translational motion video, the affine motion compensation prediction mode can be skipped, thereby greatly saving computing resources, effectively improving the efficiency of determining the block division method and prediction mode of the current CTU, and thus improving coding performance.
下面对本申请实施例的剧烈运动参数的确定过程进行介绍。The following is an introduction to the determination process of strenuous exercise parameters in the embodiment of the present application.
在一些实施例中,上述剧烈运动参数包括当前帧的剧烈运动参数、当前CTU的剧烈运动参数、当前CU的剧烈运动参数中的至少一个。也就是说,本申请实施例的剧烈运动参数包括帧级剧烈运动参数、CTU级运动平移参数和CU级运动参数中的至少一个。In some embodiments, the above violent motion parameters include at least one of the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU. That is to say, the violent motion parameters in this embodiment of the present application include at least one of frame-level violent motion parameters, CTU-level motion translation parameters, and CU-level motion parameters.
其中,当前帧的剧烈运动参数用于指示当前帧是否跳过仿射运动补偿预测模式。也就是说,若当前帧的剧烈运动参数小于第一阈值时,说明当前帧为平移运动类视频,此时,则确定当前帧中每个CU的预测模式时,跳过仿射运动补偿预测模式,进而提高预测模式的确定效率,降低预测模式的确定计算量。若当前帧的剧烈运动参数大于或等于第一阈值时,说明当前帧不是平移运动类视频,此时,则确定预测模式时,尝试仿射运动补偿预测模式,进而提高预测模式的确定准确性,提升编码效果。Among them, the violent motion parameter of the current frame is used to indicate whether the current frame skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current frame is less than the first threshold, it means that the current frame is a translational motion video. At this time, when determining the prediction mode of each CU in the current frame, the affine motion compensation prediction mode is skipped. , thereby improving the efficiency of determining the prediction model and reducing the calculation amount of determining the prediction model. If the violent motion parameter of the current frame is greater than or equal to the first threshold, it means that the current frame is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
本申请实施例对上述第一阈值的具体取值不做限制。The embodiments of the present application do not limit the specific value of the above-mentioned first threshold.
本申请实施例对确定当前帧的剧烈运动参数的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the violent motion parameters of the current frame.
在一些实施例中,当前帧的剧烈运动参数是根据当前帧和前一帧中像素点的位置变化确定的,例如,根据当前帧中的像素点相对于前一帧中的像素点的平移位移,确定当前帧的剧烈运动参数。In some embodiments, the violent motion parameters of the current frame are determined based on the position changes of the pixels in the current frame and the previous frame, for example, based on the translational displacement of the pixels in the current frame relative to the pixels in the previous frame. , determine the violent motion parameters of the current frame.
在一些实施例中,当前帧的剧烈运动参数是根据当前帧所包括的K个CTU的剧烈运动参数确定的,针对当前帧所包括的K个CTU中的第k个CTU,第k个CTU的剧烈运动参数是根据第k个CTU,以及第k个CTU在当前帧的前一帧中的参考CTU确定的,K为正整数,k为小于或等于K的正整数。In some embodiments, the severe motion parameters of the current frame are determined based on the severe motion parameters of K CTUs included in the current frame. For the k-th CTU among the K CTUs included in the current frame, the k-th CTU The violent motion parameter is determined based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame. K is a positive integer, and k is a positive integer less than or equal to K.
具体的,将当前帧划分为K个CTU,确定K个CTU中每个CTU的剧烈运动参数,根据K个CTU中每个CTU的剧烈运动参数,确定当前帧的剧烈运动参数。具体是,针对K个CTU中的第k个CTU,在当前帧的前一帧中确定该第K个CTU的参考CTU,进而根据该第k个CTU和第k个CTU在前一帧中的参考CTU,确定第k个CTU的剧烈运动参数。参照上述第k个CTU的剧烈运动参数的确定方法,可以确定出当前帧所包括的K个CTU中每个CTU的剧烈运动参数,进而根据K个CTU中每个CTU的剧烈运动参数,确定出当前帧的剧烈运动参数。Specifically, the current frame is divided into K CTUs, the violent motion parameters of each of the K CTUs are determined, and the violent motion parameters of the current frame are determined based on the violent motion parameters of each of the K CTUs. Specifically, for the k-th CTU among K CTUs, the reference CTU of the K-th CTU is determined in the previous frame of the current frame, and then the reference CTU of the k-th CTU and the k-th CTU in the previous frame is determined. Referring to the CTU, determine the strenuous exercise parameters of the k-th CTU. Referring to the above method for determining the violent motion parameters of the k-th CTU, the violent motion parameters of each of the K CTUs included in the current frame can be determined, and then based on the violent motion parameters of each of the K CTUs, the Violent motion parameters of the current frame.
本申请实施例对上述确定第k个CTU的剧烈运动参数的具体方式不做限制。The embodiments of this application do not limit the specific method of determining the strenuous exercise parameters of the k-th CTU.
在一些实施例中,上述第k个CTU的剧烈运动参数是根据第k个CTU的像素值和参考CTU的像素值确定的。即根据第k个CTU的像素值和参考CTU的像素值,确定第k个CTU的剧烈运动参数。In some embodiments, the above violent motion parameter of the k-th CTU is determined based on the pixel value of the k-th CTU and the pixel value of the reference CTU. That is, based on the pixel value of the k-th CTU and the pixel value of the reference CTU, the violent motion parameters of the k-th CTU are determined.
例如,根据第k个CTU中像素点的像素值和参考CTU中像素点的像素值,确定第k个CTU相对于参考CTU的平移位移,进而根据第k个CTU相对于参考CTU的平移位移,确定第k个CTU的剧烈运动参数。For example, based on the pixel value of the pixel point in the k-th CTU and the pixel value of the pixel point in the reference CTU, the translational displacement of the k-th CTU relative to the reference CTU is determined, and then based on the translational displacement of the k-th CTU relative to the reference CTU, Determine the violent motion parameters of the k-th CTU.
再例如,第k个CTU的剧烈运动参数是根据第k个CTU的像素值和参考CTU的像素值的绝对差确定的。即针对第k个CTU中的每一个像素点,确定该像素点在第k个CTU中的像素值和在参考CTU中的像素值的绝对差,进而根据第k个CTU中每个像素点与参考CTU中每个像素点的像素值的绝对差,确定第k个CTU的剧烈运动参数。For another example, the violent motion parameter of the k-th CTU is determined based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU. That is, for each pixel in the k-th CTU, determine the absolute difference between the pixel value of the pixel in the k-th CTU and the pixel value in the reference CTU, and then based on the difference between each pixel in the k-th CTU and Referring to the absolute difference of the pixel value of each pixel in the CTU, determine the violent motion parameters of the k-th CTU.
在一种示例中,根据如下公式(3)确定第k个CTU的剧烈运动参数:In one example, the violent motion parameter of the k-th CTU is determined according to the following formula (3):
其中,MS_CTU
k为第k个CTU的剧烈运动参数,CTU
k
Ori(x,y)是第k个CTU在位置(x,y)处的像素值,而CTU
k
Ref(x,y)是第k个CTU在前一帧中的参考CTU在位置(x,y)处的像素值,CTU
k-H是第k个CTU和参考CTU的高度,CTU
k-W是第k个CTU和参考CTU的宽度。
Among them, MS_CTU k is the violent motion parameter of the k-th CTU, CTU k Ori (x, y) is the pixel value of the k-th CTU at position (x, y), and CTU k Ref (x, y) is the pixel value of the k-th CTU at position (x, y). The pixel value of the reference CTU of k CTU in the previous frame at position (x, y), CTU k -H is the height of the kth CTU and the reference CTU, CTU k -W is the kth CTU and the reference CTU width.
本申请实施例对上述根据当前帧所包括的K个CTU的剧烈运动参数,确定当前帧的剧烈运动参数的具体方式不做限制。The embodiments of the present application do not limit the specific method of determining the violent motion parameters of the current frame based on the violent motion parameters of the K CTUs included in the current frame.
在一些实施例中,将当前帧所包括的K个CTU的剧烈运动参数之和,确定为当前帧的剧烈运动参数。In some embodiments, the sum of violent motion parameters of K CTUs included in the current frame is determined as the violent motion parameter of the current frame.
在一些实施例中,当前帧的剧烈运动参数是根据K个CTU中剧烈运动参数大于第一预设值的P个CTU的剧烈运动参数确定的,其中P为小于或等于K的正整数。具体是,根据当前帧所包括的K个CTU中每个CTU的剧烈运动参数,从这K个CTU中选出剧烈运动参数大于第一预设值的P个CTU,进而根据这P个CTU的剧烈运动参数,确定当前帧的剧烈运动参数。In some embodiments, the violent motion parameter of the current frame is determined based on the violent motion parameters of P CTUs among the K CTUs whose violent motion parameters are greater than the first preset value, where P is a positive integer less than or equal to K. Specifically, according to the violent motion parameters of each CTU among the K CTUs included in the current frame, P CTUs whose violent motion parameters are greater than the first preset value are selected from the K CTUs, and then according to the parameters of the P CTUs Violent motion parameters, determine the violent motion parameters of the current frame.
在一种可能的实现方式中,将这P个CTU的剧烈运动参数之和,确定为当前帧的剧烈运动参数。In one possible implementation, the sum of the violent motion parameters of the P CTUs is determined as the violent motion parameter of the current frame.
在另一种可能的实现方式中,当前帧的剧烈运动参数是根据P个CTU的剧烈运动参数之和,以及P个CTU的总面积确定的。示例性的,当前帧的剧烈运动参数为P个CTU的剧烈运动参数之和,与P个CTU的总面积的比值。例如,根据如下公式(4)确定当前帧的剧烈运动参数:In another possible implementation, the violent motion parameter of the current frame is determined based on the sum of the violent motion parameters of P CTUs and the total area of P CTUs. For example, the violent motion parameter of the current frame is the ratio of the sum of the violent motion parameters of P CTUs to the total area of P CTUs. For example, determine the violent motion parameters of the current frame according to the following formula (4):
其中,MS为当前帧的剧烈运动参数,
为P个CTU的剧烈运动参数之和。
Among them, MS is the violent motion parameter of the current frame, is the sum of the violent motion parameters of P CTUs.
本申请实施例对上述第一预设值的具体取值不做限制。The embodiments of this application do not limit the specific value of the above-mentioned first preset value.
上述对确定当前帧的剧烈运动参数的具体过程进行介绍,下面对确定当前CTU的剧烈运动参数的过程进行介绍。The specific process of determining the violent motion parameters of the current frame is introduced above. The process of determining the violent motion parameters of the current CTU is introduced below.
本申请实施例的当前CTU的剧烈运动参数用于指示当前CTU是否跳过所述仿射运动补偿预测模式。也就是说,若当前CTU的剧烈运动参数小于第二阈值时,说明当前CTU为平移运动类视频,此时,则确定当前CTU中每个CU的预测模式时,跳过仿射运动补偿预测模式,进而提高预测模式的确定效率,降低预测模式的确定计算量。若当前CTU的剧烈运动参数大于或等于第二阈值时,说明当前CTU不是平移运动类视频,此时,则确定预测模式时,尝试仿射运动补偿预测模式,进而提高预测模式的确定准确性,提升编码效果。The severe motion parameter of the current CTU in this embodiment of the present application is used to indicate whether the current CTU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CTU is less than the second threshold, it means that the current CTU is a translational motion video. At this time, when determining the prediction mode of each CU in the current CTU, the affine motion compensation prediction mode is skipped. , thereby improving the efficiency of determining the prediction model and reducing the calculation amount of determining the prediction model. If the violent motion parameter of the current CTU is greater than or equal to the second threshold, it means that the current CTU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
本申请实施例对上述第二阈值的具体取值不做限制。The embodiment of the present application does not limit the specific value of the above-mentioned second threshold.
本申请实施例对确定当前CTU的剧烈运动参数的具体方式不做限制。The embodiments of this application do not limit the specific method of determining the strenuous exercise parameters of the current CTU.
在一些实施例中,当前CTU的剧烈运动参数是根据当前CTU,以及当前CTU在当前帧的前一帧中的参考CTU确定的,例如,根据当前CTU中的像素点相对于当前CTU在前一帧中的参考CTU的像素点的平移位移,确定当前CTU的剧烈运动参数。In some embodiments, the violent motion parameter of the current CTU is determined based on the current CTU and the reference CTU of the current CTU in the previous frame of the current frame. For example, based on the pixel points in the current CTU relative to the current CTU in the previous frame. The translational displacement of the pixel points of the reference CTU in the frame determines the violent motion parameters of the current CTU.
本申请实施例对上述确定当前CTU的剧烈运动参数的具体方式不做限制。The embodiments of this application do not limit the above-mentioned specific method of determining the strenuous exercise parameters of the current CTU.
在一些实施例中,上述当前CTU的剧烈运动参数是根据当前CTU的像素值和参考CTU的像素值确定的。即根据当前CTU的像素值和参考CTU的像素值,确定当前CTU的剧烈运动参数。In some embodiments, the above violent motion parameter of the current CTU is determined based on the pixel value of the current CTU and the pixel value of the reference CTU. That is, based on the pixel value of the current CTU and the pixel value of the reference CTU, the violent motion parameters of the current CTU are determined.
例如,根据当前CTU中像素点的像素值和参考CTU中像素点的像素值,确定当前CTU相对于参考CTU的平移位移,进而根据当前CTU相对于参考CTU的平移位移,确定当前CTU的剧烈运动参数。For example, based on the pixel value of the pixel point in the current CTU and the pixel value of the pixel point in the reference CTU, the translational displacement of the current CTU relative to the reference CTU is determined, and then based on the translational displacement of the current CTU relative to the reference CTU, the violent motion of the current CTU is determined. parameter.
再例如,当前CTU的剧烈运动参数是根据当前CTU的像素值和参考CTU的像素值的绝对差确定的。即针对当前CTU中的每一个像素点,确定该像素点在当前CTU中的像素值和在参考CTU中的像素值的绝对差,进而根据当前CTU中每个像素点与参考CTU中每个像素点的像素值的绝对差,确定当前CTU的剧烈运动参数。For another example, the violent motion parameter of the current CTU is determined based on the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU. That is, for each pixel in the current CTU, determine the absolute difference between the pixel value of the pixel in the current CTU and the pixel value in the reference CTU, and then determine the absolute difference between each pixel in the current CTU and each pixel in the reference CTU. The absolute difference of the pixel values of the points determines the violent motion parameters of the current CTU.
在一种示例中,根据如下公式(5)确定当前CTU的剧烈运动参数:In an example, the strenuous motion parameters of the current CTU are determined according to the following formula (5):
其中,MS_CTU为当前CTU的剧烈运动参数,CTU
Ori(x,y)是当前CTU在位置(x,y)处的像素值,而CTU
Ref(x,y)是当前CTU在前一帧中的参考CTU在位置(x,y)处的像素值,CTU-H是当前CTU和对应参考CTU的高度,CTU-W是当前CTU和对应参考CTU的宽度。
Among them, MS_CTU is the violent motion parameter of the current CTU, CTU Ori (x, y) is the pixel value of the current CTU at position (x, y), and CTU Ref (x, y) is the current CTU in the previous frame. The pixel value of the reference CTU at position (x, y), CTU-H is the height of the current CTU and the corresponding reference CTU, and CTU-W is the width of the current CTU and the corresponding reference CTU.
上述对确定当前CTU的剧烈运动参数的具体过程进行介绍,下面对确定当前CU的剧烈运动参数的过程进行介绍。The specific process of determining the strenuous exercise parameters of the current CTU is introduced above. The process of determining the strenuous exercise parameters of the current CU is introduced below.
本申请实施例的当前CU的剧烈运动参数用于指示当前CU是否跳过仿射运动补偿预测模式。也就是说,若当前CU的剧烈运动参数小于第三阈值时,说明当前CU为平移运动类视频,此时,则确定当前CU的预测模式时,跳过仿射运动补偿预测模式,进而提高预测模式的确定效率,降低预测模式的确定计算量。若当前CU的剧烈运动参数大于或等于第三阈值时,说明当前CU不是平移运动类视频,此时,则确定预测模式时,尝试仿射运动补偿预测模式,进而提高预测模式的确定准确性,提升编码效果。The severe motion parameter of the current CU in this embodiment of the present application is used to indicate whether the current CU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CU is less than the third threshold, it means that the current CU is a translational motion video. At this time, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the prediction The efficiency of determining the model is improved and the calculation amount of determining the prediction model is reduced. If the violent motion parameter of the current CU is greater than or equal to the third threshold, it means that the current CU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
本申请实施例对上述第三阈值的具体取值不做限制。The embodiments of the present application do not limit the specific value of the above third threshold.
本申请实施例对确定当前CU的剧烈运动参数的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the strenuous exercise parameters of the current CU.
在一些实施例中,当前CU的剧烈运动参数是根据当前CU,以及当前CU在当前帧的前一帧中的参考CU确定的,例如,根据当前CU中的像素点相对于当前CU在前一帧中的参考CU的像素点的平移位移,确定当前CU的剧烈运动参数。In some embodiments, the violent motion parameters of the current CU are determined based on the current CU and the reference CU of the current CU in the previous frame of the current frame. For example, based on the pixel points in the current CU relative to the current CU in the previous frame. The translational displacement of the pixel points of the reference CU in the frame determines the violent motion parameters of the current CU.
本申请实施例对上述确定当前CU的剧烈运动参数的具体方式不做限制。The embodiments of this application do not limit the above-mentioned specific method of determining the strenuous exercise parameters of the current CU.
在一些实施例中,上述当前CU的剧烈运动参数是根据当前CU的像素值和参考CU的像素值确定的。即根据当前CU的像素值和参考CU的像素值,确定当前CU的剧烈运动参数。In some embodiments, the above violent motion parameter of the current CU is determined based on the pixel value of the current CU and the pixel value of the reference CU. That is, based on the pixel value of the current CU and the pixel value of the reference CU, the violent motion parameters of the current CU are determined.
例如,根据当前CU中像素点的像素值和参考CU中像素点的像素值,确定当前CU相对于参考CU的平移位移,进而根据当前CU相对于参考CU的平移位移,确定当前CU的剧烈运动参数。For example, based on the pixel values of the pixels in the current CU and the pixel values of the pixels in the reference CU, the translational displacement of the current CU relative to the reference CU is determined, and then based on the translational displacement of the current CU relative to the reference CU, the violent motion of the current CU is determined. parameter.
再例如,当前CU的剧烈运动参数是根据当前CU的像素值和参考CU的像素值的绝对差确定的。即针对当前CU中的每一个像素点,确定该像素点在当前CU中的像素值和在参考CU中的像素值的绝对差,进而根据当前CU中每个像素点与参考CU中每个像素点的像素值的绝对差,确定当前CU的剧烈运动参数。For another example, the violent motion parameter of the current CU is determined based on the absolute difference between the pixel value of the current CU and the pixel value of the reference CU. That is, for each pixel in the current CU, determine the absolute difference between the pixel value of the pixel in the current CU and the pixel value in the reference CU, and then determine the absolute difference between each pixel in the current CU and each pixel in the reference CU. The absolute difference of the pixel values of the points determines the violent motion parameters of the current CU.
在一种示例中,根据如下公式(6)确定当前CU的剧烈运动参数:In an example, the strenuous motion parameters of the current CU are determined according to the following formula (6):
其中,MS_CU为当前CU的剧烈运动参数,CU
Ori(x,y)是当前CU在位置(x,y)处的像素值,而CU
Ref(x,y)是当前CU在前一帧中的参考CU在位置(x,y)处的像素值,CU-H是当前CU和对应参考CU的高度,CU-W是当前CU和对应参考CU的宽度。
Among them, MS_CU is the violent motion parameter of the current CU, CU Ori (x, y) is the pixel value of the current CU at position (x, y), and CU Ref (x, y) is the current CU in the previous frame. The pixel value of the reference CU at position (x, y), CU-H is the height of the current CU and the corresponding reference CU, and CU-W is the width of the current CU and the corresponding reference CU.
上述对本申请实施例的当前帧的剧烈运动参数、当前CTU的剧烈运动参数和当前CU的剧烈运动参数进行详细介绍。这样在预测时,可以根据剧烈运动参数,确定是否跳过仿射运动补偿预测模式,进而节约计算资源,提升预测效率。The above describes in detail the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU in the embodiment of the present application. In this way, during prediction, it can be determined whether to skip the affine motion compensation prediction mode based on the violent motion parameters, thereby saving computing resources and improving prediction efficiency.
在一些实施例中,上述剧烈运动参数是在预设条件下确定的,也就是说,在确定剧烈运动参数之前,首先判断是否满足预设条件,若满足预设条件时,则确定剧烈运动参数。因此,本申请实施例的预设条件可以理解为执行仿射运动补偿预测模式所需要满足的条件。In some embodiments, the above strenuous exercise parameters are determined under preset conditions. That is to say, before determining the strenuous exercise parameters, it is first determined whether the preset conditions are met. If the preset conditions are met, the strenuous exercise parameters are determined. . Therefore, the preset conditions in the embodiments of the present application can be understood as conditions that need to be met to execute the affine motion compensation prediction mode.
本申请实施例对上述预设条件的具体内容不做限制。The embodiments of this application do not limit the specific content of the above preset conditions.
在一种可能的实现方式中,预设条件包括第一标志的取值为第一数值,以及当前CU的尺寸满足预设尺寸中的至少一个。In a possible implementation, the preset conditions include that the value of the first flag is a first numerical value, and the size of the current CU meets at least one of the preset sizes.
其中,第一标志用于指示当前序列是否允许使用仿射运动补偿预测模式,第一数值用于指示当前序列允许使用所述仿射运动补偿预测模式。The first flag is used to indicate whether the current sequence is allowed to use the affine motion compensation prediction mode, and the first value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
例如,第一标志的取值为第一数值时,则指示允许当前序列使用仿射运动补偿预测模式,第一标志的取值为第二数值时,则指示不允许当前序列使用仿射运动补偿预测模式。For example, when the value of the first flag is a first numerical value, it indicates that the current sequence is allowed to use the affine motion compensation prediction mode; when the value of the first flag is a second numerical value, it indicates that the current sequence is not allowed to use the affine motion compensation. Prediction mode.
本申请实施例对上述第一数值和第二数值的具体取值不做限制。The embodiments of the present application do not limit the specific values of the above-mentioned first numerical value and second numerical value.
可选的,第一数值为1。Optional, the first value is 1.
可选的,第二数值为0。Optional, the second value is 0.
上述第一标志可以通过解码码流得到。也就是说,若编码端在确定当前序列不允许使用仿射运动补偿预测模式时,将该第一标志的值置为0,且将置为0的第一标志写入码流,或者,编码端在确定当前序列允许使用仿射运动补偿预测模式时,将该第一标志的值置为1,且将置为1的第一标志写入码流。这样解码端解码码流,得到第一标志,并根据第一标志确定是否允许当前序列使用仿射运动补偿预测模式,例如,若第一标志的取值为0时,则确定当前序列不允许使用仿射运动补偿预测模式,此时,不需要确定剧烈运动参数,而是直接跳过仿射运动补偿预测模式。若第一标志的取值为1时,则确定当前序列允许使用仿射运动补偿预测模式,此时,判断是否满足其他仿射运动补偿预测模式的限定条件,例如判断当前CU的尺寸是否满足预设尺寸,若当前CU的尺寸满足预设尺寸时,则确定剧烈运动参数。The above-mentioned first flag can be obtained by decoding the code stream. That is to say, if the encoding end determines that the current sequence does not allow the use of affine motion compensation prediction mode, the value of the first flag is set to 0, and the first flag set to 0 is written into the code stream, or the encoding When the terminal determines that the current sequence allows the use of the affine motion compensation prediction mode, the value of the first flag is set to 1, and the first flag set to 1 is written into the code stream. In this way, the decoder decodes the code stream to obtain the first flag, and determines whether the current sequence is allowed to use the affine motion compensation prediction mode based on the first flag. For example, if the value of the first flag is 0, it is determined that the current sequence is not allowed to use it. Affine motion compensation prediction mode. At this time, there is no need to determine the violent motion parameters, but the affine motion compensation prediction mode is skipped directly. If the value of the first flag is 1, it is determined that the current sequence is allowed to use the affine motion compensation prediction mode. At this time, it is judged whether the limiting conditions of other affine motion compensation prediction modes are met, for example, whether the size of the current CU meets the predetermined Set the size. If the size of the current CU meets the preset size, determine the violent motion parameters.
本申请实施例对上述当前CU的尺寸所满足的预设尺度的具体取值不做限制,例如,预设尺寸为CU的长和/或宽大于或等于一预设值,例如大于或等于8,或者,预设尺寸为CU的面积大于某一预设值。The embodiment of the present application does not limit the specific value of the preset size that the size of the current CU meets. For example, the preset size is that the length and/or width of the CU is greater than or equal to a preset value, such as greater than or equal to 8. , or the area of the preset size CU is greater than a certain preset value.
在一些实施例中,若上述平移运行参数为当前帧的剧烈运动参数,则上述预设条件包括第一标志的取值为第一数值。也就是说,在第一标志的取值为第一数值时,确定当前帧的剧烈运动参数。In some embodiments, if the translation operation parameter is a violent motion parameter of the current frame, the preset condition includes that the value of the first flag is a first value. That is to say, when the value of the first flag is the first value, the violent motion parameter of the current frame is determined.
在一些实施例中,若上述平移运行参数为当前CTU的剧烈运动参数,则上述预设条件包括第一标志的取值为第一数值。也就是说,在第一标志的取值为第一数值,确定当前CTU的剧烈运动参数。In some embodiments, if the translation operation parameter is a violent motion parameter of the current CTU, the preset condition includes that the value of the first flag is a first value. That is to say, the value of the first flag is the first numerical value, which determines the violent motion parameters of the current CTU.
在一些实施例中,若上述平移运行参数为当前CU的剧烈运动参数,则上述预设条件包括第一标志的取值为第一数值,且当前CU的尺寸满足预设尺寸。也就是说,在第一标志的取值为第一数值,且当前CU的尺寸满足预设尺寸时,确定当前CU的剧烈运动参数。In some embodiments, if the translation operation parameter is a violent motion parameter of the current CU, the preset condition includes that the value of the first flag is a first value, and the size of the current CU meets the preset size. That is to say, when the value of the first flag is the first value and the size of the current CU meets the preset size, the violent motion parameter of the current CU is determined.
示例性的,可以用sps_affine_enable_flag表示第一标志。For example, sps_affine_enable_flag can be used to represent the first flag.
在一些实施例中,当前CU的最优预测模式在确定时,若第一标志的取值为第一数值、且剧烈运动参数指示不跳过仿射运动补偿预测模式,且当前CU的尺寸满足预测尺寸时,则使用仿射运动补偿预测模式对当前CU进行运动估计,得到计算预测代价CurBestCostAffine,保存预测模式CurBestModeAffine。同时,计算当前CU的其他候选预测模式中每个候选预测模式对应的预测代价,将仿射运动补偿预测模式对应的预测代价与其他候选预测模式对应的预测代价进行比较,选择代价最小的预测模式作为当前CU的最优预测模式。In some embodiments, when the optimal prediction mode of the current CU is determined, if the value of the first flag is the first value, the violent motion parameter indicates not to skip the affine motion compensation prediction mode, and the size of the current CU satisfies When predicting the size, use the affine motion compensation prediction mode to perform motion estimation on the current CU, obtain the calculated prediction cost CurBestCostAffine, and save the prediction mode CurBestModeAffine. At the same time, calculate the prediction cost corresponding to each candidate prediction mode in other candidate prediction modes of the current CU, compare the prediction cost corresponding to the affine motion compensation prediction mode with the prediction costs corresponding to other candidate prediction modes, and select the prediction mode with the smallest cost. As the optimal prediction mode of the current CU.
在一些实施例中,若第一标志的取值不等于第一数值,和/或剧烈运动参数指示跳过仿射运动补偿预测模式,和/或当前CU的尺寸不满足预测尺寸时,则跳过仿射运动补偿预测模式,使用除仿射运动补偿预测模式之外的预测模式对当前CU进行预测,得到各预测模式对应的代价,将代价最小的预测模式确定为当前CU的最优预测模式。In some embodiments, if the value of the first flag is not equal to the first value, and/or the severe motion parameter indicates skipping the affine motion compensation prediction mode, and/or the size of the current CU does not meet the prediction size, then skip Through the affine motion compensation prediction mode, use prediction modes other than the affine motion compensation prediction mode to predict the current CU, obtain the cost corresponding to each prediction mode, and determine the prediction mode with the smallest cost as the optimal prediction mode for the current CU .
上述对剧烈运动参数的确定过程,以及当前CTU的块划分方式和预测模式是如何基于剧烈运动参数确定的进行介绍。解码端在确定出当前CTU的块划分方式和预测模式后,根据该当前CTU的块划分方式和预测模式进行重建,具体的,参照如下S603至S605的描述。The above describes the determination process of violent motion parameters and how the current CTU block division method and prediction mode are determined based on violent motion parameters. After determining the block division method and prediction mode of the current CTU, the decoding end performs reconstruction according to the block division method and prediction mode of the current CTU. For details, refer to the following descriptions of S603 to S605.
S603、使用当前CTU的块划分方式对当前CTU进行块划分,得到至少一个CU。S603. Use the block division method of the current CTU to divide the current CTU into blocks to obtain at least one CU.
S604、针对至少一个CU中的当前CU,使用当前CTU的预测模式中当前CU对应的预测模式,对当前CU进行预测,得到当前CU的预测值。S604. For the current CU in at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU to obtain the prediction value of the current CU.
本申请实施例中,解码端根据上述S602确定出当前CTU的块划分方式和预测模式,接着,使用该当前CTU的块划分方式对当前CTU进行块划分,例如将当前CTU划分为至少一个CU。针对这至少一个CU中的当前CU,使用当前CTU的预测模式中当前CU对应的预测模式,对当前CU进行预测,得到当前CU的预测值。也就是说,当前 CTU的预测模式包括上述至少一个CU中每个CU的预测模式,这样在确定这至少一个CU中每个CU的预测值时,可以使用CTU的预测模式中该CU对应的预测模式对该CU进行预测,得到该CU的预测值。In this embodiment of the present application, the decoder determines the block division method and prediction mode of the current CTU based on the above-mentioned S602, and then uses the block division method of the current CTU to perform block division on the current CTU, for example, divides the current CTU into at least one CU. For the current CU in the at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU to obtain the prediction value of the current CU. That is to say, the prediction mode of the current CTU includes the prediction mode of each CU in the above-mentioned at least one CU. In this way, when determining the prediction value of each CU in the at least one CU, the prediction corresponding to the CU in the prediction mode of the CTU can be used. The mode predicts the CU and obtains the predicted value of the CU.
S605、根据当前CTU的残差值,确定当前CU的残差值,并根据当前CU的残差值和预测值,得到当前CU的重建值。S605. Determine the residual value of the current CU based on the residual value of the current CTU, and obtain the reconstruction value of the current CU based on the residual value and predicted value of the current CU.
解码端根据上述S601的步骤,通过解码码流,确定出当前CTU的残差值,这样,根据当前CTU的块划分方式,可以确定出当前CTU中当前CU的残差值。The decoding end determines the residual value of the current CTU by decoding the code stream according to the above steps of S601. In this way, according to the block division method of the current CTU, the residual value of the current CU in the current CTU can be determined.
接着,根据当前CU的残差值和预测值,确定当前CU的重建值,例如将当前CU的残差值和预测值之和,确定为当前CU的重建值。Next, the reconstruction value of the current CU is determined based on the residual value and the prediction value of the current CU. For example, the sum of the residual value and the prediction value of the current CU is determined as the reconstruction value of the current CU.
在一些实施例中,对当前CU的重建值进行滤波,得到滤波后的重建值。例如,对当前CU的重建值进行DBF、SAO、ALF等滤波,将滤波后的图像送入缓冲区,等待视频播放。In some embodiments, the reconstruction value of the current CU is filtered to obtain a filtered reconstruction value. For example, perform DBF, SAO, ALF, etc. filtering on the reconstruction value of the current CU, send the filtered image to the buffer, and wait for video playback.
本申请实施例提供的视频解码方法,解码码流,确定当前编码树单元CTU的残差值;确定当前CTU的块划分方式和预测模式,当前CTU的块划分方式和预测模式是基于剧烈运动参数确定的,剧烈运动参数用于指示是否跳过仿射运动补偿预测模式;使用当前CTU的块划分方式对当前CTU进行块划分,得到至少一个编码单元CU;针对至少一个CU中的当前CU,使用当前CTU的预测模式中当前CU对应的预测模式,对当前CU进行预测,得到当前CU的预测值;根据当前CTU的残差值,确定当前CU的残差值,并根据当前CU的残差值和预测值,得到当前CU的重建值。即本申请实施例中,通过剧烈运动参数来判断当前视频是否为平移运动类视频,若当前视频为平移运动类视频时,则跳过仿射运动补偿预测模式,进而避免了对平移运动类视频使用仿射运动补偿预测模式预测时所造成的计算资源浪费,从而减少编码时间,提高视频的编码效率,节约计算资源。The video decoding method provided by the embodiment of the present application decodes the code stream and determines the residual value of the current coding tree unit CTU; determines the block division method and prediction mode of the current CTU, and the block division method and prediction mode of the current CTU are based on violent motion parameters. It is determined that the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode; use the block division method of the current CTU to block divide the current CTU to obtain at least one coding unit CU; for the current CU in at least one CU, use The prediction mode corresponding to the current CU in the prediction mode of the current CTU is used to predict the current CU to obtain the prediction value of the current CU; based on the residual value of the current CTU, the residual value of the current CU is determined, and based on the residual value of the current CU and the predicted value to obtain the reconstruction value of the current CU. That is, in the embodiment of the present application, the violent motion parameters are used to determine whether the current video is a translational motion video. If the current video is a translational motion video, the affine motion compensation prediction mode is skipped, thereby avoiding the need for translational motion videos. The waste of computing resources caused by using affine motion compensation prediction mode prediction can reduce encoding time, improve video encoding efficiency, and save computing resources.
上文对本申请实施例的解码方法进行介绍,在此基础上,下面对本申请实施例提供的编码方法进行介绍。The decoding method in the embodiment of the present application is introduced above. On this basis, the encoding method provided by the embodiment of the present application is introduced below.
图7为本申请一实施例提供的视频编码方法流程示意图,本申请实施例应用于图1和图2所示编码器。如图7所示,本申请实施例的方法包括:FIG. 7 is a schematic flowchart of a video encoding method provided by an embodiment of the present application. The embodiment of the present application is applied to the encoders shown in FIGS. 1 and 2 . As shown in Figure 7, the method in the embodiment of this application includes:
S701、确定剧烈运动参数。S701. Determine the parameters of strenuous exercise.
其中,剧烈运动参数用于指示是否跳过仿射运动补偿预测模式。Among them, the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode.
在一些实施例中,当前CU也称为当前块、当前图像块、当前解码块、当前编码单元、当前待解码块、当前待解码的图像块等。In some embodiments, the current CU is also called a current block, a current image block, a current decoding block, a current coding unit, a current block to be decoded, a current image block to be decoded, etc.
在一些实施例中,本申请实施例的当前CU只包括色度分量,可以理解为色度块。In some embodiments, the current CU in the embodiment of the present application only includes chrominance components, which can be understood as chrominance blocks.
在一些实施例中,本申请实施例的当前CU只包括亮度分量,可以理解为亮度块。In some embodiments, the current CU in the embodiment of the present application only includes the luminance component, which can be understood as a luminance block.
在一些实施例中,该当前CU即包括亮度分量又包括色度分量。In some embodiments, the current CU includes both luma and chrominance components.
本申请实施例的编码过程为,对当前图像帧进行块划分,得到当前CU,确定当前CU的预测模式,使用当前CU的预测模式对当前CU进行预测,得到当前CU的预测值。当前CU的原始值与预测值相减,得到当前CU的残差值。对当前CU的残差值进行变换,得到变换系数。可选的,对变换系数进行量化,并将量化后的变换系数进行编码,得到码流。The encoding process in this embodiment of the present application is to divide the current image frame into blocks to obtain the current CU, determine the prediction mode of the current CU, use the prediction mode of the current CU to predict the current CU, and obtain the prediction value of the current CU. The original value of the current CU is subtracted from the predicted value to obtain the residual value of the current CU. Transform the residual value of the current CU to obtain the transformation coefficient. Optionally, the transform coefficients are quantized, and the quantized transform coefficients are encoded to obtain a code stream.
本申请实施例涉及的上述编码过程中的预测过程。The embodiment of the present application relates to the prediction process in the above encoding process.
本申请实施例中,由于仿射运动补偿预测模式较复杂,占用较多的计算资源,使得编码效率低。另外,仿射运动补偿预测模式主要用于高效地表达放大/缩小、旋转等不规则运动,对于平移运动类视频,仿射运动补偿预测模式的性能增益有限。由此可知,对于平移运动类视频使用仿射运动补偿预测模式进行预测时,带来的压缩效果不显著,但是会占用大量的计算资源,增加编码时间。因此,本申请实施例在使用仿射运动补偿预测模式进行预测之前,首先确定剧烈运动参数,并根据该剧烈运动参数来指示当前视频是否为平移运动类视频,若确定当前视频为平移运动类视频时,则跳过仿射运动补偿预测模式,进而避免对平移运动类视频使用仿射运动补偿预测模式进行预测时,所造成的计算资源浪费,从而提高了视频的编码效率,节约了计算资源。In the embodiment of the present application, since the affine motion compensation prediction mode is more complex and takes up more computing resources, the coding efficiency is low. In addition, the affine motion compensation prediction mode is mainly used to efficiently express irregular motions such as zooming in/out and rotation. For translational motion videos, the performance gain of the affine motion compensation prediction mode is limited. It can be seen that when using the affine motion compensation prediction mode for prediction of translational motion videos, the compression effect is not significant, but it will occupy a large amount of computing resources and increase the encoding time. Therefore, before using the affine motion compensation prediction mode for prediction, the embodiment of the present application first determines the violent motion parameter, and uses the violent motion parameter to indicate whether the current video is a translational motion video. If it is determined that the current video is a translational motion video, When , the affine motion compensation prediction mode is skipped, thereby avoiding the waste of computing resources caused by using the affine motion compensation prediction mode for prediction of translational motion videos, thereby improving the coding efficiency of the video and saving computing resources.
本申请实施例的剧烈运动参数用于指示当前视频是否为平移运动移类视频,若为平移运动移类视频运动时,跳过仿射运动补偿预测模式,因此,本申请实施例的剧烈运动参数也可以直接用于指示是否跳过仿射运动补偿预测模式。例如,若剧烈运动参数小于预设数值时,则确定当前视频是平移运动类视频,此时跳过仿射运动补偿预测模式,进而避免对平移运动类视频使用仿射运动补偿预测模式进行预测时,所造成的计算资源浪费,从而提高了视频的编码效率,节约了计算资源。The violent motion parameter in the embodiment of the present application is used to indicate whether the current video is a translational motion-type video. If it is a translational motion-type video, the affine motion compensation prediction mode is skipped. Therefore, the violent motion parameter in the embodiment of the present application is Can also be used directly to indicate whether to skip affine motion compensation prediction mode. For example, if the violent motion parameter is less than the preset value, it is determined that the current video is a translational motion video, and the affine motion compensation prediction mode is skipped at this time, thereby avoiding the use of the affine motion compensation prediction mode for prediction of translational motion videos. , resulting in a waste of computing resources, thereby improving the video encoding efficiency and saving computing resources.
若剧烈运动参数大于或等于预设数值时,则确定当前视频不是平移运动类视频,此时可以尝试使用仿射运动补偿预测模式进行预测,进而提高视频的编码效果。If the violent motion parameter is greater than or equal to the preset value, it is determined that the current video is not a translational motion video. At this time, you can try to use the affine motion compensation prediction mode for prediction, thereby improving the coding effect of the video.
下面对上述S701中确定剧烈运动参数的过程进行介绍。The following is an introduction to the process of determining strenuous exercise parameters in S701 mentioned above.
在一些实施例中,上述剧烈运动参数包括当前帧的剧烈运动参数、当前CTU的剧烈运动参数、当前CU的剧烈运动参数中的至少一个。也就是说,本申请实施例的剧烈运动参数包括帧级剧烈运动参数、CTU级运动平移参数和CU级运动参数中的至少一个。In some embodiments, the above violent motion parameters include at least one of the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU. That is to say, the violent motion parameters in this embodiment of the present application include at least one of frame-level violent motion parameters, CTU-level motion translation parameters, and CU-level motion parameters.
其中,当前帧的剧烈运动参数用于指示当前帧是否跳过仿射运动补偿预测模式。也就是说,若当前帧的剧烈运动参数小于第一阈值时,说明当前帧为平移运动类视频,此时,则确定当前帧中每个CU的预测模式时,跳过仿射运动补偿预测模式,进而提高预测模式的确定效率,降低预测模式的确定计算量。若当前帧的剧烈运动参数大于或等于第一阈值时,说明当前帧不是平移运动类视频,此时,则确定预测模式时,尝试仿射运动补偿预测模式,进而提高预测模式的确定准确性,提升编码效果。Among them, the violent motion parameter of the current frame is used to indicate whether the current frame skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current frame is less than the first threshold, it means that the current frame is a translational motion video. At this time, when determining the prediction mode of each CU in the current frame, the affine motion compensation prediction mode is skipped. , thereby improving the efficiency of determining the prediction model and reducing the calculation amount of determining the prediction model. If the violent motion parameter of the current frame is greater than or equal to the first threshold, it means that the current frame is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
本申请实施例对上述第一阈值的具体取值不做限制。The embodiments of the present application do not limit the specific value of the above-mentioned first threshold.
本申请实施例对确定当前帧的剧烈运动参数的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the violent motion parameters of the current frame.
在一些实施例中,若剧烈运动参数包括当前帧的剧烈运动参数时,则编码端根据当前帧中的像素点相对于前一帧 中的像素点的平移位移,确定当前帧的剧烈运动参数。In some embodiments, if the violent motion parameter includes the violent motion parameter of the current frame, the encoding end determines the violent motion parameter of the current frame based on the translational displacement of the pixel point in the current frame relative to the pixel point in the previous frame.
在一些实施例中,若剧烈运动参数包括当前帧的剧烈运动参数时,则编码端根据如下步骤S701-A1和S701-A21确定当前帧的剧烈运动参数:In some embodiments, if the violent motion parameter includes the violent motion parameter of the current frame, the encoding end determines the violent motion parameter of the current frame according to the following steps S701-A1 and S701-A21:
S701-A1、针对当前帧所包括的K个CTU中的第k个CTU,根据第k个CTU,以及第k个CTU在当前帧的前一帧中的参考CTU,确定第k个CTU的剧烈运动参数,K为正整数,k为小于或等于K的正整数;S701-A1. For the k-th CTU among the K CTUs included in the current frame, determine the intensity of the k-th CTU based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame. Motion parameters, K is a positive integer, k is a positive integer less than or equal to K;
S701-A2、根据当前帧所包括的K个CTU的剧烈运动参数,确定当前帧的剧烈运动参数。S701-A2: Determine the violent motion parameters of the current frame according to the violent motion parameters of the K CTUs included in the current frame.
具体的,将当前帧划分为K个CTU,确定K个CTU中每个CTU的剧烈运动参数,根据K个CTU中每个CTU的剧烈运动参数,确定当前帧的剧烈运动参数。具体是,针对K个CTU中的第k个CTU,在当前帧的前一帧中确定该第K个CTU的参考CTU,进而根据该第k个CTU和第k个CTU在前一帧中的参考CTU,确定第k个CTU的剧烈运动参数。参照上述第k个CTU的剧烈运动参数的确定方法,可以确定出当前帧所包括的K个CTU中每个CTU的剧烈运动参数,进而根据K个CTU中每个CTU的剧烈运动参数,确定出当前帧的剧烈运动参数。Specifically, the current frame is divided into K CTUs, the violent motion parameters of each of the K CTUs are determined, and the violent motion parameters of the current frame are determined based on the violent motion parameters of each of the K CTUs. Specifically, for the k-th CTU among K CTUs, the reference CTU of the K-th CTU is determined in the previous frame of the current frame, and then the reference CTU of the k-th CTU and the k-th CTU in the previous frame is determined. Referring to the CTU, determine the strenuous exercise parameters of the k-th CTU. Referring to the above method for determining the violent motion parameters of the k-th CTU, the violent motion parameters of each of the K CTUs included in the current frame can be determined, and then based on the violent motion parameters of each of the K CTUs, the Violent motion parameters of the current frame.
本申请实施例对上述S701-A1中确定第k个CTU的剧烈运动参数的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the strenuous exercise parameters of the k-th CTU in S701-A1.
在一些实施例中,上述S701-A1包括如下S701-A11:In some embodiments, the above S701-A1 includes the following S701-A11:
S701-A11、根据第k个CTU的像素值和参考CTU的像素值,确定第k个CTU的剧烈运动参数。S701-A11. Determine the violent motion parameter of the k-th CTU based on the pixel value of the k-th CTU and the pixel value of the reference CTU.
例如,根据第k个CTU中像素点的像素值和参考CTU中像素点的像素值,确定第k个CTU相对于参考CTU的平移位移,进而根据第k个CTU相对于参考CTU的平移位移,确定第k个CTU的剧烈运动参数。For example, based on the pixel value of the pixel point in the k-th CTU and the pixel value of the pixel point in the reference CTU, the translational displacement of the k-th CTU relative to the reference CTU is determined, and then based on the translational displacement of the k-th CTU relative to the reference CTU, Determine the violent motion parameters of the k-th CTU.
再例如,针对第k个CTU中的每一个像素点,确定该像素点在第k个CTU中的像素值和在参考CTU中的像素值的绝对差,进而根据第k个CTU中每个像素点与参考CTU中每个像素点的像素值的绝对差,确定第k个CTU的剧烈运动参数。For another example, for each pixel in the k-th CTU, determine the absolute difference between the pixel value of the pixel in the k-th CTU and the pixel value in the reference CTU, and then based on each pixel in the k-th CTU The absolute difference between the pixel value of each pixel point in the point and the reference CTU determines the violent motion parameters of the k-th CTU.
在一种示例中,根据上述公式(3)确定第k个CTU的剧烈运动参数。In one example, the violent motion parameter of the k-th CTU is determined according to the above formula (3).
本申请实施例对上述S701-A2中根据当前帧所包括的K个CTU的剧烈运动参数,确定当前帧的剧烈运动参数的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the violent motion parameters of the current frame based on the violent motion parameters of K CTUs included in the current frame in S701-A2.
在一些实施例中,上述S701-A2包括:将当前帧所包括的K个CTU的剧烈运动参数之和,确定为当前帧的剧烈运动参数。In some embodiments, the above-mentioned S701-A2 includes: determining the sum of the violent motion parameters of the K CTUs included in the current frame as the violent motion parameter of the current frame.
在一些实施例中,上述S701-A2包括如下S701-A21和S701-A22的步骤:In some embodiments, the above S701-A2 includes the following steps of S701-A21 and S701-A22:
S701-A21、从K个CTU中选取剧烈运动参数大于第一预设值的P个CTU,P为小于或等于K的正整数;S701-A21. Select P CTUs whose violent motion parameters are greater than the first preset value from K CTUs, where P is a positive integer less than or equal to K;
S701-A22、根据P个CTU的剧烈运动参数,确定当前帧的剧烈运动参数。S701-A22. Determine the violent motion parameters of the current frame based on the violent motion parameters of P CTUs.
本申请实施例对上述第一预设值的具体取值不做限制。The embodiments of this application do not limit the specific value of the above-mentioned first preset value.
在一种示例中,将这P个CTU的剧烈运动参数之和,确定为当前帧的剧烈运动参数。In one example, the sum of the violent motion parameters of the P CTUs is determined as the violent motion parameter of the current frame.
在另一种示例中,根据P个CTU的剧烈运动参数之和,以及P个CTU的总面积,确定当前帧的剧烈运动参数。In another example, the violent motion parameter of the current frame is determined based on the sum of violent motion parameters of P CTUs and the total area of P CTUs.
例如,将P个CTU的剧烈运动参数之和,与P个CTU的总面积的比值确定为当前帧的剧烈运动参数。For example, the ratio of the sum of the violent motion parameters of P CTUs to the total area of P CTUs is determined as the violent motion parameter of the current frame.
示例性的,根据上述公式(4)确定当前帧的剧烈运动参数。For example, the violent motion parameter of the current frame is determined according to the above formula (4).
上述对确定当前帧的剧烈运动参数的具体过程进行介绍,下面对确定当前CTU的剧烈运动参数的过程进行介绍。The specific process of determining the violent motion parameters of the current frame is introduced above. The process of determining the violent motion parameters of the current CTU is introduced below.
本申请实施例的当前CTU的剧烈运动参数用于指示当前CTU是否跳过所述仿射运动补偿预测模式。也就是说,若当前CTU的剧烈运动参数小于第二阈值时,说明当前CTU为平移运动类视频,此时,则确定当前CTU中每个CU的预测模式时,跳过仿射运动补偿预测模式,进而提高预测模式的确定效率,降低预测模式的确定计算量。若当前CTU的剧烈运动参数大于或等于第二阈值时,说明当前CTU不是平移运动类视频,此时,则确定预测模式时,尝试仿射运动补偿预测模式,进而提高预测模式的确定准确性,提升编码效果。The severe motion parameter of the current CTU in this embodiment of the present application is used to indicate whether the current CTU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CTU is less than the second threshold, it means that the current CTU is a translational motion video. At this time, when determining the prediction mode of each CU in the current CTU, the affine motion compensation prediction mode is skipped. , thereby improving the efficiency of determining the prediction model and reducing the calculation amount of determining the prediction model. If the violent motion parameter of the current CTU is greater than or equal to the second threshold, it means that the current CTU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
本申请实施例对上述第二阈值的具体取值不做限制。The embodiment of the present application does not limit the specific value of the above-mentioned second threshold.
本申请实施例对确定当前CTU的剧烈运动参数的具体方式不做限制。The embodiments of this application do not limit the specific method of determining the strenuous exercise parameters of the current CTU.
在一些实施例中,若剧烈运动参数包括当前CTU的剧烈运动参数时,编码端根据当前CTU中的像素点相对于当前CTU在前一帧中的参考CTU的像素点的平移位移,确定当前CTU的剧烈运动参数。In some embodiments, if the violent motion parameter includes the violent motion parameter of the current CTU, the encoding end determines the current CTU based on the translational displacement of the pixels in the current CTU relative to the pixels of the reference CTU in the previous frame. parameters of strenuous exercise.
在一些实施例中,若剧烈运动参数包括当前CTU的剧烈运动参数时,编码端通过如下步骤S701-B确定当前CTU的剧烈运动参数:In some embodiments, if the strenuous motion parameters include the strenuous motion parameters of the current CTU, the encoding end determines the strenuous motion parameters of the current CTU through the following step S701-B:
S701-B、根据当前CTU,以及当前CTU在当前帧的前一帧中的参考CTU,确定当前CTU的剧烈运动参数。S701-B: Determine the violent motion parameters of the current CTU based on the current CTU and the reference CTU of the current CTU in the frame preceding the current frame.
本申请实施例对上述S701-B的具体实现方式不做限制。The embodiments of this application do not limit the specific implementation of the above S701-B.
在一些实施例中,S701-B包括根据当前CTU的像素值和参考CTU的像素值,确定当前CTU的剧烈运动参数。In some embodiments, S701-B includes determining the violent motion parameter of the current CTU according to the pixel value of the current CTU and the pixel value of the reference CTU.
在一种示例中,根据当前CTU中像素点的像素值和参考CTU中像素点的像素值,确定当前CTU相对于参考CTU的平移位移,进而根据当前CTU相对于参考CTU的平移位移,确定当前CTU的剧烈运动参数。In one example, the translational displacement of the current CTU relative to the reference CTU is determined based on the pixel value of the pixel in the current CTU and the pixel value of the pixel in the reference CTU, and then the current CTU is determined based on the translational displacement of the current CTU relative to the reference CTU. Vigorous exercise parameters of CTU.
在另一种示例中,根据当前CTU的像素值和参考CTU的像素值的绝对差,确定当前CTU的剧烈运动参数。In another example, the violent motion parameter of the current CTU is determined based on the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU.
例如,针对当前CTU中的每一个像素点,确定该像素点在当前CTU中的像素值和在参考CTU中的像素值的绝对差,进而根据当前CTU中每个像素点与参考CTU中每个像素点的像素值的绝对差,确定当前CTU的剧烈运动参数。For example, for each pixel in the current CTU, determine the absolute difference between the pixel value of the pixel in the current CTU and the pixel value in the reference CTU, and then determine the absolute difference between each pixel in the current CTU and each pixel in the reference CTU. The absolute difference in pixel values of pixels determines the violent motion parameters of the current CTU.
示例性的,根据上述公式(5)确定当前CTU的剧烈运动参数。For example, the severe motion parameters of the current CTU are determined according to the above formula (5).
上述对确定当前CTU的剧烈运动参数的具体过程进行介绍,下面对确定当前CU的剧烈运动参数的过程进行介绍。The specific process of determining the strenuous exercise parameters of the current CTU is introduced above. The process of determining the strenuous exercise parameters of the current CU is introduced below.
本申请实施例的当前CU的剧烈运动参数用于指示当前CU是否跳过仿射运动补偿预测模式。也就是说,若当前CU的剧烈运动参数小于第三阈值时,说明当前CU为平移运动类视频,此时,则确定当前CU的预测模式时,跳过仿射运动补偿预测模式,进而提高预测模式的确定效率,降低预测模式的确定计算量。若当前CU的剧烈运动参数大于 或等于第三阈值时,说明当前CU不是平移运动类视频,此时,则确定预测模式时,尝试仿射运动补偿预测模式,进而提高预测模式的确定准确性,提升编码效果。The severe motion parameter of the current CU in this embodiment of the present application is used to indicate whether the current CU skips the affine motion compensation prediction mode. That is to say, if the violent motion parameter of the current CU is less than the third threshold, it means that the current CU is a translational motion video. At this time, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the prediction The efficiency of determining the model is improved and the calculation amount of determining the prediction model is reduced. If the violent motion parameter of the current CU is greater than or equal to the third threshold, it means that the current CU is not a translational motion video. At this time, when determining the prediction mode, try the affine motion compensation prediction mode, thereby improving the accuracy of determining the prediction mode. Improve coding performance.
本申请实施例对上述第三阈值的具体取值不做限制。The embodiments of the present application do not limit the specific value of the above third threshold.
本申请实施例对确定当前CU的剧烈运动参数的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the strenuous exercise parameters of the current CU.
在一些实施例中,编码端根据当前CU中的像素点相对于当前CU在前一帧中的参考CU的像素点的平移位移,确定当前CU的剧烈运动参数。In some embodiments, the encoding end determines the violent motion parameter of the current CU based on the translational displacement of the pixels in the current CU relative to the pixels of the reference CU in the previous frame.
在一些实施例中,编码端根据如下步骤S701-C确定当前CU的剧烈运动参数:In some embodiments, the encoding end determines the violent motion parameters of the current CU according to the following step S701-C:
S701-C、根据当前CU的像素值和参考CU的像素值,确定当前CU的剧烈运动参数。S701-C: Determine the violent motion parameters of the current CU according to the pixel value of the current CU and the pixel value of the reference CU.
在一种示例中,根据当前CU中像素点的像素值和参考CU中像素点的像素值,确定当前CU相对于参考CU的平移位移,进而根据当前CU相对于参考CU的平移位移,确定当前CU的剧烈运动参数。In one example, the translational displacement of the current CU relative to the reference CU is determined based on the pixel value of the pixel in the current CU and the pixel value of the pixel in the reference CU, and then the translational displacement of the current CU relative to the reference CU is determined. Vigorous exercise parameters of CU.
在另一种示例中,根据当前CU的像素值和参考CU的像素值的绝对差,确定当前CU的剧烈运动参数。In another example, the violent motion parameter of the current CU is determined based on the absolute difference between the pixel value of the current CU and the pixel value of the reference CU.
例如,针对当前CU中的每一个像素点,确定该像素点在当前CU中的像素值和在参考CU中的像素值的绝对差,进而根据当前CU中每个像素点与参考CU中每个像素点的像素值的绝对差,确定当前CU的剧烈运动参数。For example, for each pixel in the current CU, determine the absolute difference between the pixel value of the pixel in the current CU and the pixel value in the reference CU, and then determine the absolute difference between each pixel in the current CU and each pixel in the reference CU. The absolute difference in pixel values of pixels determines the violent motion parameters of the current CU.
示例性的,根据上述公式(6)确定当前CU的剧烈运动参数。For example, the strenuous motion parameters of the current CU are determined according to the above formula (6).
上述对本申请实施例的当前帧的剧烈运动参数、当前CTU的剧烈运动参数和当前CU的剧烈运动参数进行详细介绍。这样在预测时,可以根据剧烈运动参数,确定是否跳过仿射运动补偿预测模式,进而节约计算资源,提升预测效率。The above describes in detail the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU in the embodiment of the present application. In this way, during prediction, it can be determined whether to skip the affine motion compensation prediction mode based on the violent motion parameters, thereby saving computing resources and improving prediction efficiency.
在一些实施例中,在预设条件下,执行上述S701确定剧烈运动参数。也就是说,在确定剧烈运动参数之前,首先判断是否满足预设条件,若满足预设条件时,则确定剧烈运动参数。因此,本申请实施例的预设条件可以理解为执行仿射运动补偿预测模式所需要满足的条件。In some embodiments, under preset conditions, the above-mentioned S701 is executed to determine strenuous exercise parameters. That is to say, before determining the strenuous exercise parameters, it is first determined whether the preset conditions are met. If the preset conditions are met, the strenuous exercise parameters are determined. Therefore, the preset conditions in the embodiments of the present application can be understood as conditions that need to be met to execute the affine motion compensation prediction mode.
本申请实施例对上述预设条件的具体内容不做限制。The embodiments of this application do not limit the specific content of the above preset conditions.
在一种可能的实现方式中,预设条件包括第一标志的取值为第一数值,以及当前CU的尺寸满足预设尺寸中的至少一个。In a possible implementation, the preset conditions include that the value of the first flag is a first numerical value, and the size of the current CU meets at least one of the preset sizes.
其中,第一标志用于指示当前序列是否允许使用仿射运动补偿预测模式,第一数值用于指示当前序列允许使用所述仿射运动补偿预测模式。The first flag is used to indicate whether the current sequence is allowed to use the affine motion compensation prediction mode, and the first value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
例如,第一标志的取值为第一数值时,则指示允许当前序列使用仿射运动补偿预测模式,第一标志的取值为第二数值时,则指示不允许当前序列使用仿射运动补偿预测模式。For example, when the value of the first flag is a first numerical value, it indicates that the current sequence is allowed to use the affine motion compensation prediction mode; when the value of the first flag is a second numerical value, it indicates that the current sequence is not allowed to use the affine motion compensation. Prediction mode.
本申请实施例对上述第一数值和第二数值的具体取值不做限制。The embodiments of the present application do not limit the specific values of the above-mentioned first numerical value and second numerical value.
可选的,第一数值为1。Optional, the first value is 1.
可选的,第二数值为0。Optional, the second value is 0.
也就是说,编码端在确定当前序列不允许使用仿射运动补偿预测模式时,将该第一标志的值置为0,且将置为0的第一标志写入码流,或者,编码端在确定当前序列允许使用仿射运动补偿预测模式时,将该第一标志的值置为1,且将置为1的第一标志写入码流。这样解码端解码码流,得到第一标志,并根据第一标志确定是否允许当前序列使用仿射运动补偿预测模式,例如,若第一标志的取值为0时,则确定当前序列不允许使用仿射运动补偿预测模式。That is to say, when the encoding end determines that the current sequence does not allow the use of affine motion compensation prediction mode, the value of the first flag is set to 0, and the first flag set to 0 is written into the code stream, or the encoding end When it is determined that the current sequence allows the use of the affine motion compensation prediction mode, the value of the first flag is set to 1, and the first flag set to 1 is written into the code stream. In this way, the decoder decodes the code stream to obtain the first flag, and determines whether the current sequence is allowed to use the affine motion compensation prediction mode based on the first flag. For example, if the value of the first flag is 0, it is determined that the current sequence is not allowed to use it. Affine motion compensated prediction mode.
本申请实施例对上述当前CU的尺寸所满足的预设尺度的具体取值不做限制,例如,预设尺寸为CU的长和/或宽大于或等于一预设值,例如大于或等于16,或者,预设尺寸为CU的面积大于某一预设值。The embodiment of the present application does not limit the specific value of the preset size that the size of the current CU satisfies. For example, the preset size is that the length and/or width of the CU is greater than or equal to a preset value, such as greater than or equal to 16 , or the area of the preset size CU is greater than a certain preset value.
在一些实施例中,若上述平移运行参数为当前帧的剧烈运动参数,则上述预设条件包括第一标志的取值为第一数值。也就是说,在第一标志的取值为第一数值时,确定当前帧的剧烈运动参数。In some embodiments, if the translation operation parameter is a violent motion parameter of the current frame, the preset condition includes that the value of the first flag is a first value. That is to say, when the value of the first flag is the first value, the violent motion parameter of the current frame is determined.
在一些实施例中,若上述平移运行参数为当前CTU的剧烈运动参数,则上述预设条件包括第一标志的取值为第一数值。也就是说,在第一标志的取值为第一数值,确定当前CTU的剧烈运动参数。In some embodiments, if the translation operation parameter is a violent motion parameter of the current CTU, the preset condition includes that the value of the first flag is a first value. That is to say, the value of the first flag is the first numerical value, which determines the violent motion parameters of the current CTU.
在一些实施例中,若上述平移运行参数为当前CU的剧烈运动参数,则上述预设条件包括第一标志的取值为第一数值,且当前CU的尺寸满足预设尺寸。也就是说,在第一标志的取值为第一数值,且当前CU的尺寸满足预设尺寸时,确定当前CU的剧烈运动参数。In some embodiments, if the translation operation parameter is a violent motion parameter of the current CU, the preset condition includes that the value of the first flag is a first value, and the size of the current CU meets the preset size. That is to say, when the value of the first flag is the first value and the size of the current CU meets the preset size, the violent motion parameter of the current CU is determined.
示例性的,可以用sps_affine_enable_flag表示第一标志。For example, sps_affine_enable_flag can be used to represent the first flag.
在一些实施例中,当前CU的最优预测模式在确定时,若第一标志的取值为第一数值、且剧烈运动参数指示不跳过仿射运动补偿预测模式,且当前CU的尺寸满足预测尺寸时,则使用仿射运动补偿预测模式对当前CU进行运动估计,得到计算预测代价CurBestCostAffine,保存预测模式CurBestModeAffine。同时,计算当前CU的其他候选预测模式中每个候选预测模式对应的预测代价,将仿射运动补偿预测模式对应的预测代价与其他候选预测模式对应的预测代价进行比较,选择代价最小的预测模式作为当前CU的最优预测模式。In some embodiments, when the optimal prediction mode of the current CU is determined, if the value of the first flag is the first value, the violent motion parameter indicates not to skip the affine motion compensation prediction mode, and the size of the current CU satisfies When predicting the size, use the affine motion compensation prediction mode to perform motion estimation on the current CU, obtain the calculated prediction cost CurBestCostAffine, and save the prediction mode CurBestModeAffine. At the same time, calculate the prediction cost corresponding to each candidate prediction mode in other candidate prediction modes of the current CU, compare the prediction cost corresponding to the affine motion compensation prediction mode with the prediction costs corresponding to other candidate prediction modes, and select the prediction mode with the smallest cost. As the optimal prediction mode of the current CU.
在一些实施例中,若第一标志的取值不等于第一数值,和/或剧烈运动参数指示跳过仿射运动补偿预测模式,和/或当前CU的尺寸不满足预测尺寸时,则跳过仿射运动补偿预测模式,使用除仿射运动补偿预测模式之外的预测模式对当前CU进行预测,得到各预测模式对应的代价,将代价最小的预测模式确定为当前CU的最优预测模式。In some embodiments, if the value of the first flag is not equal to the first value, and/or the severe motion parameter indicates skipping the affine motion compensation prediction mode, and/or the size of the current CU does not meet the prediction size, then skip Through the affine motion compensation prediction mode, use prediction modes other than the affine motion compensation prediction mode to predict the current CU, obtain the cost corresponding to each prediction mode, and determine the prediction mode with the smallest cost as the optimal prediction mode for the current CU .
上述对剧烈运动参数的确定过程进行介绍,编码端根据上述步骤,确定出剧烈运动参数后,执行如下S702的步骤。The above describes the process of determining the parameters of strenuous exercise. After determining the parameters of strenuous exercise according to the above steps, the encoding end performs the following steps of S702.
S702、根据剧烈运动参数,确定当前CTU的块划分方式和预测模式。S702. Determine the block division method and prediction mode of the current CTU according to the violent motion parameters.
在一些实施例中,上述当前CTU的块划分方式可以理解为当前CTU的最优块划分方式,例如当前CTU的块划分方式为预设的多个块划分方式中,代价最小的块划分方式。In some embodiments, the block division method of the current CTU can be understood as the optimal block division method of the current CTU. For example, the block division method of the current CTU is the block division method with the lowest cost among multiple preset block division methods.
在一些实施例中,上述当前CTU的预测模式可以理解为一个集合,包括当前CTU所包括的至少一个CU中每个CU的预测模式,其中CU的预测模式可以理解为CU的最优预测模式。In some embodiments, the above prediction mode of the current CTU can be understood as a set, including the prediction mode of each CU in at least one CU included in the current CTU, where the prediction mode of the CU can be understood as the optimal prediction mode of the CU.
本申请实施例中,当前CTU的预测模式为当前CTU的块划分方式对应的预测模式,例如,使用当前CTU的块划分方式将当前CTU划分为至少一个CU,将这至少一个CU中每个CU的预测模式组成的集合,确定为当前CTU的预测模式。In this embodiment of the present application, the prediction mode of the current CTU is the prediction mode corresponding to the block division method of the current CTU. For example, the current CTU is divided into at least one CU using the block division method of the current CTU, and each CU in the at least one CU is The set of prediction modes is determined as the prediction mode of the current CTU.
本申请实施例中,根据剧烈运动参数判断当前视频为平移运动类视频时,在确定当前CTU的块划分方式和预测模式时可以跳过仿射运动补偿预测模式,进而降低了确定当前CTU的块划分方式和预测模式时的工作量,节约计算资源,提高当前CTU的块划分方式和预测模式的确定效率。In the embodiment of the present application, when the current video is judged to be a translational motion video based on violent motion parameters, the affine motion compensation prediction mode can be skipped when determining the block division method and prediction mode of the current CTU, thereby reducing the number of blocks required to determine the current CTU. The workload in the division method and prediction mode is reduced, computing resources are saved, and the efficiency of determining the block division method and prediction mode of the current CTU is improved.
本申请实施例对上述S702中根据剧烈运动参数确定当前CTU的块划分方式和预测模式的具体方式不做限制。This embodiment of the present application does not limit the specific method of determining the block division method and prediction mode of the current CTU based on the violent motion parameters in S702.
在一些实施例中,当前CTU的块划分方式为预设块划分方式,CTU的预测模式是根据剧烈运动参数确定的,例如,若剧烈运动参数指示跳过仿射运动补偿预测模式时,则将非仿射运动补偿预测模式外的一个或几个预测模式确定为CTU的预测模式。若剧烈运动参数指示不跳过仿射运动补偿预测模式时,则将仿射运动补偿预测模式确定为CTU的预测模式。In some embodiments, the block division method of the current CTU is a preset block division method, and the prediction mode of the CTU is determined based on the violent motion parameter. For example, if the violent motion parameter indicates to skip the affine motion compensation prediction mode, then the One or several prediction modes other than the non-affine motion compensation prediction mode are determined as the prediction modes of the CTU. If the severe motion parameter indicates not to skip the affine motion compensation prediction mode, then the affine motion compensation prediction mode is determined as the prediction mode of the CTU.
在一些实施例中,上述S702包括如下S702-A1至S702-A2的步骤:In some embodiments, the above-mentioned S702 includes the following steps of S702-A1 to S702-A2:
S702-A1、针对预设的N个块划分方式中的第i个块划分方式,根据剧烈运动参数,确定第i个块划分方式对应的最优预测模式,N为正整数,i小于或等于N的正整数;S702-A1. For the i-th block division method among the preset N block division methods, determine the optimal prediction mode corresponding to the i-th block division method according to the violent motion parameters. N is a positive integer, and i is less than or equal to N is a positive integer;
S702-A2、根据N个块划分方式对应的最优预测模式,确定当前CTU的块划分方式和预测模式。S702-A2: Determine the block division method and prediction mode of the current CTU according to the optimal prediction modes corresponding to the N block division methods.
具体的,针对N个块划分方式中的第i个块划分方式,根据剧烈运动参数确定该第i个块划分方式对应的最优预测模式,这样可以确定出N个块划分方式中每个块划分方式对应的最优预测模式。接着,根据N个块划分方式对应的最优预测模式,确定当前CTU的块划分方式和预测模式,例如,将N个块划分方式对应的最优预测模式中代价最小的块划分方式,确定为当前CTU的块划分方式,将该当前CTU的块划分方式对应的最优预测模式,确定为当前CTU的预测模式。Specifically, for the i-th block division method among the N block division methods, the optimal prediction mode corresponding to the i-th block division method is determined according to the violent motion parameter, so that each block in the N block division methods can be determined The optimal prediction mode corresponding to the partitioning method. Next, the block division method and prediction mode of the current CTU are determined according to the optimal prediction modes corresponding to the N block division methods. For example, the block division method with the smallest cost among the optimal prediction modes corresponding to the N block division methods is determined as The block division method of the current CTU determines the optimal prediction mode corresponding to the block division method of the current CTU as the prediction mode of the current CTU.
本申请实施例,对确定第i个块划分方式对应的最优预测模式的具体方式不做限制。The embodiment of the present application does not limit the specific method of determining the optimal prediction mode corresponding to the i-th block division method.
在一些实施例中,若剧烈运动参数指示跳过仿射运动补偿预测模式,则从除仿射运动补偿预测模式之外的预测模式中确定一个或多个预测模式作为该第i个块划分方式对应的最优预测模式。In some embodiments, if the severe motion parameter indicates skipping the affine motion compensation prediction mode, one or more prediction modes are determined as the i-th block partitioning mode from prediction modes other than the affine motion compensation prediction mode. The corresponding optimal prediction mode.
在一些实施例中,若剧烈运动参数指示不跳过仿射运动补偿预测模式,则将仿射运动补偿预测模式确定为该第i个块划分方式对应的最优预测模式。In some embodiments, if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, the affine motion compensation prediction mode is determined to be the optimal prediction mode corresponding to the i-th block division mode.
在一些实施例中,S702-A1中根据剧烈运动参数,确定第i个块划分方式对应的最优预测模式包括如下步骤:In some embodiments, determining the optimal prediction mode corresponding to the i-th block division method according to the violent motion parameter in S702-A1 includes the following steps:
S702-A11、使用第i个块划分方式对当前CTU进行块划分,得到M个CU,M为正整数;S702-A11. Use the i-th block division method to divide the current CTU into blocks, and obtain M CUs, where M is a positive integer;
S702-A12、对于M个CU中的第j个CU,根据剧烈运动参数,确定第j个CU的至少一个候选预测模式,j为小于或等于M的正整数;S702-A12. For the j-th CU among the M CUs, determine at least one candidate prediction mode of the j-th CU based on the violent motion parameters, where j is a positive integer less than or equal to M;
S702-A13、从第j个CU的至少一个候选预测模式中,确定第j个CU的最优预测模式;S702-A13. Determine the optimal prediction mode of the j-th CU from at least one candidate prediction mode of the j-th CU;
S702-A14、根据M个CU的最优预测模式,确定第i个块划分方式对应的最优预测模式。S702-A14: Determine the optimal prediction mode corresponding to the i-th block division method based on the optimal prediction modes of the M CUs.
具体的,对于N个块划分方式中的第i个块划分方式,使用该第i个块划分方式对当前CTU进行块划分,得到M个CU。接着,根据剧烈运动参数,确定M个CU中每个CU对应的最优预测模式。具体是,针对M个CU中的每个CU,例如第j个CU,根据剧烈运动参数确定确定该第j个CU的至少一个候选预测模式。Specifically, for the i-th block division method among the N block division methods, the current CTU is divided into blocks using the i-th block division method to obtain M CUs. Next, based on the violent motion parameters, the optimal prediction mode corresponding to each of the M CUs is determined. Specifically, for each CU among the M CUs, for example, the j-th CU, at least one candidate prediction mode of the j-th CU is determined based on the violent motion parameter.
在一些实施例中,若剧烈运动参数指示跳过仿射运动补偿预测模式,则确定第j个CU的至少一个候选预测模式中不包括仿射运动补偿预测模式。In some embodiments, if the severe motion parameter indicates skipping the affine motion compensation prediction mode, it is determined that the at least one candidate prediction mode of the jth CU does not include the affine motion compensation prediction mode.
在一些实施例中,若剧烈运动参数指示不跳过仿射运动补偿预测模式,则确定第j个CU的至少一个候选预测模式中包括仿射运动补偿预测模式。In some embodiments, if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, it is determined that at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
接着,从第j个CU的至少一个候选预测模式中确定一预测模式,作为该第j个CU的最优预测模式。Next, a prediction mode is determined from at least one candidate prediction mode of the j-th CU as the optimal prediction mode of the j-th CU.
例如,将第j个CU的至少一个候选预测模式中一默认预测模式确定为第j个CU的最优预测模式。For example, a default prediction mode among at least one candidate prediction mode of the j-th CU is determined as the optimal prediction mode of the j-th CU.
再例如,根据第j个CU的至少一个候选预测模式对第j个CU进行预测时的代价,从至少一个候选预测模式中确定。For another example, the cost when predicting the j-th CU according to at least one candidate prediction mode of the j-th CU is determined from at least one candidate prediction mode.
在一些实施例中,确定当前CTU的块划分方式和预测模式的具体过程为:针对预设的N个块划分方式中的第i个块划分方式,使用该第i个块划分方式对当前CTU进行块划分,得到M个CU,针对这M个CU中的每一个CU,根据剧烈运动参数确定M个CU中每个CU的最优预测模式。具体是,针对M个CU中的第j个CU,若剧烈运动参数指示跳过仿射运动补偿预测模式,则确定该第j个CU的至少一个候选预测模式中不包括仿射运动补偿预测模式,若剧烈运动参数指示不跳过仿射运动补偿预测模式,则确定该第j个CU的至少一个候选预测模式中包括仿射运动补偿预测模式。接着,使用第j个CU的至少一个候选预测模式中的每个一个候选预测模式对第j个CU进行预测,得到每一个候选预测模式对应的预测值,根据每一个候选预测模式对应的预测值和第j个CU的原始值,确定出第j个CU的每一个候选预测模式的代价,本申请实施例,为了降低代价的计算工作量,可以使用近似代价的方式计算每个候选预测模式的代价,例如根据每一个候选预测模式对应的预测值和第j个CU的原始值,计算绝对误差和(Sum of Absolute Difference,SAD)或adamard变换后再绝对值求和(Sum of Absolute Transformed Difference,SATD)等近似代价。根据第j个CU的至少一个候选预测模式中每一个候选预测模式的代价,从这至少一个候选预测模式中确定出一个候选预测模式作为该第j个CU的最优预测模式,例如将第j个CU的至少一个候选预测模式中代价最小的候选预测模式作为该第j个CU的最优预测模式。参照确定第j个CU的最优预测模式的方法,可以确定出第i个块划分方式下的M个CU中每个CU的最优预测模式,将这M个CU中每个CU的最优预测模式确定为该第i个块划分方式对应的最优预测模式,将这M个CU中每个CU的最优预测模式对应的代价之和,确定为该第i个块划分方式对应的代价。根据上述确定第i个块划分方式对应的最优预测模式和代价的方法,确定出N个块划分方式中每个一个块划分方式对应的最优预测模式和代价。最后,将这N个块划分方式中,代价最小的块划分方式确定为当前CTU的块划分方式,进而将当前CTU的块划分方式对应的最优预测模式,确定为当前CTU的最优预测模式。例如,块划分方式1为N个块划分 方式中代价最小的块划分方式,进而将该块划分方式1确定为当前CTU的块划分方式,假设该块划分方式1将当前CTU划分为4个CU,这4个CU中的每个CU的最优预测模式分别为预测模式1、预测模式2、预测模式3和预测模式4,进而将预测模式1、预测模式2、预测模式3和预测模式4确定为该当前CTU的最优预测模式。In some embodiments, the specific process of determining the block division method and prediction mode of the current CTU is: for the i-th block division method among the preset N block division methods, use the i-th block division method to calculate the current CTU Perform block division to obtain M CUs. For each of these M CUs, determine the optimal prediction mode for each of the M CUs based on the violent motion parameters. Specifically, for the j-th CU among the M CUs, if the severe motion parameter indicates skipping the affine motion compensation prediction mode, it is determined that at least one candidate prediction mode of the j-th CU does not include the affine motion compensation prediction mode. , if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, it is determined that at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode. Next, use each of the candidate prediction modes of at least one candidate prediction mode of the j-th CU to predict the j-th CU, and obtain the prediction value corresponding to each candidate prediction mode. According to the prediction value corresponding to each candidate prediction mode, and the original value of the j-th CU to determine the cost of each candidate prediction mode of the j-th CU. In the embodiment of the present application, in order to reduce the cost calculation workload, an approximate cost method can be used to calculate the cost of each candidate prediction mode. Cost, for example, based on the predicted value corresponding to each candidate prediction mode and the original value of the j-th CU, calculate the sum of absolute errors (Sum of Absolute Difference, SAD) or the sum of absolute values after adamard transformation (Sum of Absolute Transformed Difference, SATD) and other approximate costs. According to the cost of each candidate prediction mode in at least one candidate prediction mode of the jth CU, a candidate prediction mode is determined from the at least one candidate prediction mode as the optimal prediction mode of the jth CU, for example, the jth CU The candidate prediction mode with the smallest cost among at least one candidate prediction mode of the jth CU is regarded as the optimal prediction mode of the j-th CU. Referring to the method of determining the optimal prediction mode of the j-th CU, the optimal prediction mode of each CU in the M CUs under the i-th block division method can be determined, and the optimal prediction mode of each CU in the M CUs can be determined. The prediction mode is determined as the optimal prediction mode corresponding to the i-th block division method, and the sum of the costs corresponding to the optimal prediction modes of each CU in the M CUs is determined as the cost corresponding to the i-th block division method. . According to the above method of determining the optimal prediction mode and cost corresponding to the i-th block division method, the optimal prediction mode and cost corresponding to each of the N block division methods are determined. Finally, among the N block division methods, the block division method with the smallest cost is determined as the block division method of the current CTU, and then the optimal prediction mode corresponding to the block division method of the current CTU is determined as the optimal prediction mode of the current CTU . For example, the block division method 1 is the block division method with the lowest cost among N block division methods, and then the block division method 1 is determined as the block division method of the current CTU. It is assumed that the block division method 1 divides the current CTU into 4 CUs. , the optimal prediction modes of each of these four CUs are prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4, and then prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4 are Determine the optimal prediction mode for the current CTU.
由上述可知,本申请实施例中,在确定当前CTU的块划分方式和预测模式时,对于每一种块划分方式下的每个一个CU中,均基于剧烈运动参数,确定最优预测模式,这样当CU为平移运动类视频时,可以跳过仿射运动补偿预测模式,进而大大节约了计算资源,有效提高当前CTU的块划分方式和预测模式的确定效率,进而提升编码性能。It can be seen from the above that in the embodiment of the present application, when determining the block division method and prediction mode of the current CTU, for each CU under each block division method, the optimal prediction mode is determined based on the violent motion parameters. In this way, when the CU is a translational motion video, the affine motion compensation prediction mode can be skipped, thereby greatly saving computing resources, effectively improving the efficiency of determining the block division method and prediction mode of the current CTU, and thus improving coding performance.
在一些实施例中,编码端根据上述步骤,确定出当前CTU的块划分方式和预测模式后,为了保持编解码两端的一种性,则将当前CTU的块划分方式和预测模式指示给解码端。具体是,将第一信息和第二信息中的至少一个,写入码流中,其中,第一信息用于指示当前CTU的块划分方式,第二信息用于指示当前CTU的预测模式。这样解码端通过解码码流,得到第一信息和第二信息中的至少一个,进而根据第一信息确定出当前CTU的块划分方式,和/或根据第二信息确定出当前CTU的预测模式。In some embodiments, after the encoding end determines the block division method and prediction mode of the current CTU according to the above steps, in order to maintain consistency between the encoding and decoding ends, it indicates the block division method and prediction mode of the current CTU to the decoder. . Specifically, at least one of first information and second information is written into the code stream, where the first information is used to indicate the block division mode of the current CTU, and the second information is used to indicate the prediction mode of the current CTU. In this way, the decoder obtains at least one of the first information and the second information by decoding the code stream, and then determines the block division method of the current CTU based on the first information, and/or determines the prediction mode of the current CTU based on the second information.
本申请实施例对第一信息和第二信息的具体形式不做限制。The embodiments of this application do not limit the specific forms of the first information and the second information.
在一些实施例中,第一信息为当前CTU的块划分方式的索引。In some embodiments, the first information is an index of the block division mode of the current CTU.
在一些实施例中,第二信息为当前CTU的预测模式的索引。In some embodiments, the second information is an index of the prediction mode of the current CTU.
编码端根据上述S702的步骤,确定出当前CTU的块划分方式和预测模式后,执行如下S703的步骤。After determining the block division method and prediction mode of the current CTU according to the above steps of S702, the encoding end performs the following steps of S703.
S703、使用当前CTU的块划分方式对当前CTU进行块划分,得到至少一个CU。S703: Use the block division method of the current CTU to divide the current CTU into blocks to obtain at least one CU.
S704、针对至少一个CU中的当前CU,使用当前CTU的预测模式中当前CU对应的预测模式,对当前CU进行预测,得到当前CU的预测值。S704. For the current CU in at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU to obtain the prediction value of the current CU.
本申请实施例中,解码端根据上述S602确定出当前CTU的块划分方式和预测模式,接着,使用该当前CTU的块划分方式对当前CTU进行块划分,例如将当前CTU划分为至少一个CU。针对这至少一个CU中的当前CU,使用当前CTU的预测模式中当前CU对应的预测模式,对当前CU进行预测,得到当前CU的预测值。也就是说,当前CTU的预测模式包括上述至少一个CU中每个CU的预测模式,这样在确定这至少一个CU中每个CU的预测值时,可以使用CTU的预测模式中该CU对应的预测模式对该CU进行预测,得到该CU的预测值。In this embodiment of the present application, the decoder determines the block division method and prediction mode of the current CTU based on the above-mentioned S602, and then uses the block division method of the current CTU to perform block division on the current CTU, for example, divides the current CTU into at least one CU. For the current CU in the at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU to obtain the prediction value of the current CU. That is to say, the prediction mode of the current CTU includes the prediction mode of each CU in the above-mentioned at least one CU. In this way, when determining the prediction value of each CU in the at least one CU, the prediction corresponding to the CU in the prediction mode of the CTU can be used. The mode predicts the CU and obtains the predicted value of the CU.
S705、根据当前CU的预测值,确定当前CU的残差值,并根据当前CU的残差值,得到码流。S705. Determine the residual value of the current CU according to the predicted value of the current CU, and obtain the code stream based on the residual value of the current CU.
具体的,编码端根据当前CU的预测值和当前CU,确定当前CU的残差值,例如将当前CU与当前CU的预测值的差值,确定为当前CU的残差值。Specifically, the encoding end determines the residual value of the current CU based on the predicted value of the current CU and the current CU. For example, the difference between the current CU and the predicted value of the current CU is determined as the residual value of the current CU.
在一些实施例中,对当前CU的残差值进行变换,得到当前CU的变换系数。In some embodiments, the residual value of the current CU is transformed to obtain the transformation coefficient of the current CU.
在一些实施例中,直接对上述当前CU的变换系数进行编码,得到码流。In some embodiments, the above-mentioned transform coefficients of the current CU are directly encoded to obtain a code stream.
在一些实施例中,对当前CU的变换系数进行量化,得到当前CU的量化系数。接着,对当前CU的量化系数进行编码,得到码流。In some embodiments, the transform coefficient of the current CU is quantized to obtain the quantized coefficient of the current CU. Then, the quantization coefficient of the current CU is encoded to obtain a code stream.
为了进一步描述本申请实施例提供的编码方法,以剧烈运动参数包括当前帧的剧烈运动参数为例,对一种使用仿射运动补偿预测模式的视频编码方法的实施过程进行介绍,如下:In order to further describe the encoding method provided by the embodiment of the present application, taking the violent motion parameters including the violent motion parameters of the current frame as an example, the implementation process of a video encoding method using the affine motion compensation prediction mode is introduced, as follows:
首先,根据上述S701的步骤,确定当前帧的剧烈运动参数MS。接着,将当前帧划分成不重叠的多个CTU块。然后,按照光栅扫描顺序依次处理每个CTU,确定每个CTU的块划分方式和预测模式。以确定当前CTU的块划分方式和预测模式为例,确定当前CTU的最优块划分方式主要包括如下步骤:First, according to the above-mentioned step S701, the violent motion parameter MS of the current frame is determined. Next, the current frame is divided into multiple non-overlapping CTU blocks. Then, each CTU is processed sequentially in raster scanning order to determine the block division method and prediction mode of each CTU. Taking determining the block division method and prediction mode of the current CTU as an example, determining the optimal block division method of the current CTU mainly includes the following steps:
步骤31,对于预设的N个块划分方式中的第i个块划分方式Split[i],使用第i个块划分方式对当前CTU进行划分,得到至少一个CU,对于至少一个CU中的当前CU,计算帧间预测模式下当前CU对应的最优预测模式CurBestModeInter[i],以及该最优预测模式对应的最小预测代价CurBestCostInter[i]。具体地,先利用传统帧间预测模式(即无仿射预测)对当前CU做运动估计,并计算预测代价CurBestCostNoAffine,保存预测模式CurBestModeNoAffine。接着,判断当前CU是否满足要求,即如果sps_affine_enable_flag=1且MS≥T1且当前CU的尺寸等固定约束条件满足,则利用仿射运动补偿预测模式对当前CU做运动估计并,计算预测代价CurBestCostAffine,保存预测模式CurBestModeAffine,将上述传统帧间预测模式和仿射运动补偿预测模式中,代价最小的一个预测模式,作为帧间预测模式下的最小预测代价CurBestCostInter[i],并保存对应的模式为最优帧间预测模式CurBestModeInter[i]。Step 31: For the i-th block division method Split[i] among the preset N block division methods, use the i-th block division method to divide the current CTU to obtain at least one CU. For the current CTU in at least one CU CU, calculates the optimal prediction mode CurBestModeInter[i] corresponding to the current CU in inter prediction mode, and the minimum prediction cost CurBestCostInter[i] corresponding to the optimal prediction mode. Specifically, the traditional inter-frame prediction mode (that is, no affine prediction) is first used to perform motion estimation on the current CU, and the prediction cost CurBestCostNoAffine is calculated, and the prediction mode CurBestModeNoAffine is saved. Next, determine whether the current CU meets the requirements, that is, if sps_affine_enable_flag=1 and MS≥T1 and the fixed constraints such as the size of the current CU are met, use the affine motion compensation prediction mode to perform motion estimation on the current CU and calculate the prediction cost CurBestCostAffine, Save the prediction mode CurBestModeAffine, and use the prediction mode with the smallest cost among the traditional inter prediction mode and affine motion compensation prediction mode as the minimum prediction cost CurBestCostInter[i] in the inter prediction mode, and save the corresponding mode as the lowest Best inter prediction mode CurBestModeInter[i].
步骤32,计算帧内预测等其他预测模式下的最小预测代价CurBestCostOther[i]和最优预测模式CurBestModeOther[i]。比较CurBestCostInter[i]和CurBestCostOther[i],选出第i个块划分方式下的最优预测模式bestMode[i]和预测代价bestCost[i]。Step 32: Calculate the minimum prediction cost CurBestCostOther[i] and the optimal prediction mode CurBestModeOther[i] in other prediction modes such as intra prediction. Compare CurBestCostInter[i] and CurBestCostOther[i] to select the optimal prediction mode bestMode[i] and prediction cost bestCost[i] under the i-th block division method.
步骤33,遍历N个块划分方式中的所有块划分方式,选出使当前CTU预测代价最小的块划分方式Split[opt]和相应的预测模式bestMode[opt]。最后,使用当前CTU的块划分方式对当前CTU进行块划分,得到至少一个编码单元CU;针对至少一个CU中的当前CU,使用当前CTU的预测模式中当前CU对应的预测模式,对当前CU进行预测,得到当前CU的预测值。根据当前CU的预测值,确定当前CU的残差值,对残差值进行变换、量化、熵编码,可选的,对预测信息(包括CU是否采用AFF的标识符cu.affine和运动矢量等)进行编码,输出码流。Step 33: Traverse all the block division methods among the N block division methods, and select the block division method Split[opt] and the corresponding prediction mode bestMode[opt] that minimize the current CTU prediction cost. Finally, use the block division method of the current CTU to perform block division on the current CTU to obtain at least one coding unit CU; for the current CU in at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to perform the block division on the current CU. Prediction, get the predicted value of the current CU. According to the predicted value of the current CU, determine the residual value of the current CU, transform, quantize, and entropy encode the residual value. Optionally, perform prediction information (including whether the CU uses the AFF identifier cu.affine and motion vector, etc. ) to encode and output the code stream.
参照上述步骤,本申请实施例对仿射运动补偿预测模式的使用条件进行修改,即对编码单元语法中仿射运动补偿预测模式的使用条件进行修改,修改后Coding unit syntax如表1所示:Referring to the above steps, the embodiment of the present application modifies the usage conditions of the affine motion compensation prediction mode, that is, the usage conditions of the affine motion compensation prediction mode in the coding unit syntax are modified. The modified Coding unit syntax is as shown in Table 1:
表1Table 1
本申请实施例,在仿射运动补偿预测模式的使用条件中增加了剧烈运动参数MS大于或等于T1的条件。也就是说,本申请实施例中,当前第一标志的取值为第一数值,且当前CU的宽度大于或等于16,当前CU的高度大于或等于16,以及剧烈运动参数的取值大于或等于T1时,则可以使用仿射运动补偿预测模式,否则跳过仿射运动补偿预测模式,这样可以避免对平移运动类视频使用仿射运动补偿预测模式预测时所造成的计算资源浪费,从而减少编码时间,提高视频的编码效率,节约计算资源。本申请实施例提供的视频编码方法,确定剧烈运动参数,剧烈运动参数用于指示是否跳过仿射运动补偿预测模式;根据剧烈运动参数,确定当前编码树单元CTU的块划分方式和预测模式;使用当前CTU的块划分方式对当前CTU进行块划分,得到至少一个编码单元CU;针对至少一个CU中的当前CU,使用当前CTU的预测模式中当前CU对应的预测模式,对当前CU进行预测,得到当前CU的预测值;根据当前CU的预测值,确定当前CU的残差值,并根据当前CU的残差值,得到码流。即本申请实施例中,通过剧烈运动参数来判断当前视频是否为平移运动类视频,若当前视频为平移运动类视频时,则跳过仿射运动补偿预测模式,进而避免了对平移运动类视频使用仿射运动补偿预测模式预测时所造成的计算资源浪费,从而减少编码时间,提高视频的编码效率,节约计算资源。In this embodiment of the present application, the condition that the severe motion parameter MS is greater than or equal to T1 is added to the usage conditions of the affine motion compensation prediction mode. That is to say, in the embodiment of the present application, the value of the current first flag is the first value, and the width of the current CU is greater than or equal to 16, the height of the current CU is greater than or equal to 16, and the value of the violent motion parameter is greater than or equal to 16. When equal to T1, the affine motion compensation prediction mode can be used, otherwise the affine motion compensation prediction mode is skipped. This can avoid the waste of computing resources caused by using the affine motion compensation prediction mode to predict translational motion videos, thereby reducing Encoding time, improve video encoding efficiency, and save computing resources. The video coding method provided by the embodiment of the present application determines the violent motion parameters, which are used to indicate whether to skip the affine motion compensation prediction mode; and determines the block division method and prediction mode of the current coding tree unit CTU according to the violent motion parameters; Use the block division method of the current CTU to perform block division on the current CTU to obtain at least one coding unit CU; for the current CU in at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU, Obtain the predicted value of the current CU; determine the residual value of the current CU based on the predicted value of the current CU, and obtain the code stream based on the residual value of the current CU. That is, in the embodiment of the present application, the violent motion parameters are used to determine whether the current video is a translational motion video. If the current video is a translational motion video, the affine motion compensation prediction mode is skipped, thereby avoiding the need for translational motion videos. The waste of computing resources caused by using affine motion compensation prediction mode prediction can reduce encoding time, improve video encoding efficiency, and save computing resources.
应理解,图4至图7仅为本申请的示例,不应理解为对本申请的限制。It should be understood that Figures 4 to 7 are only examples of the present application and should not be understood as limitations of the present application.
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。The preferred embodiments of the present application have been described in detail above with reference to the accompanying drawings. However, the present application is not limited to the specific details of the above-mentioned embodiments. Within the scope of the technical concept of the present application, various simple modifications can be made to the technical solutions of the present application. These simple modifications all belong to the protection scope of this application. For example, each specific technical feature described in the above-mentioned specific embodiments can be combined in any suitable way without conflict. In order to avoid unnecessary repetition, this application will no longer describe various possible combinations. Specify otherwise. For another example, any combination of various embodiments of the present application can be carried out. As long as they do not violate the idea of the present application, they should also be regarded as the contents disclosed in the present application.
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。另外,本申请实施例中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。具体地,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should also be understood that in the various method embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not be used in this application. The implementation of the examples does not constitute any limitations. In addition, in the embodiment of this application, the term "and/or" is only an association relationship describing associated objects, indicating that three relationships can exist. Specifically, A and/or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this article generally indicates that the related objects are an "or" relationship.
上文结合图4至图7,详细描述了本申请的方法实施例,下文结合图8至图11,详细描述本申请的装置实施例。The method embodiment of the present application is described in detail above with reference to FIGS. 4 to 7 , and the device embodiment of the present application is described in detail below with reference to FIGS. 8 to 11 .
图8是本申请一实施例提供的视频解码装置的示意性框图。Figure 8 is a schematic block diagram of a video decoding device provided by an embodiment of the present application.
如图8所示,视频解码装置10包括:As shown in Figure 8, the video decoding device 10 includes:
解码单元11,用于解码码流,确定当前编码树单元CTU的残差值;Decoding unit 11, used to decode the code stream and determine the residual value of the current coding tree unit CTU;
确定单元12,用于确定当前CTU的块划分方式和预测模式,所述当前CTU的块划分方式和预测模式是基于剧烈运动参数确定的,所述剧烈运动参数用于指示是否跳过仿射运动补偿预测模式;Determining unit 12, used to determine the block division method and prediction mode of the current CTU. The block division method and prediction mode of the current CTU are determined based on the violent motion parameter. The violent motion parameter is used to indicate whether to skip affine motion. Compensation prediction mode;
划分单元13,用于使用所述当前CTU的块划分方式对所述当前CTU进行块划分,得到至少一个编码单元CU;The dividing unit 13 is configured to use the block dividing method of the current CTU to block divide the current CTU to obtain at least one coding unit CU;
预测单元14,用于针对所述至少一个CU中的当前CU,使用所述当前CTU的预测模式中所述当前CU对应的预测模式,对所述当前CU进行预测,得到所述当前CU的预测值;The prediction unit 14 is configured to predict the current CU in the at least one CU using the prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction of the current CU. value;
重建单元15,用于根据所述当前CTU的残差值,确定所述当前CU的残差值,并根据所述当前CU的残差值和预测值,得到所述当前CU的重建值。The reconstruction unit 15 is configured to determine the residual value of the current CU according to the residual value of the current CTU, and obtain the reconstruction value of the current CU based on the residual value and the prediction value of the current CU.
在一些实施例中,确定单元12,具体用于解码所述码流,得到第一信息和第二信息中的至少一个,所述第一信息用于指示所述当前CTU的块划分方式,所述第二信息用于指示所述当前CTU的预测模式;根据所述第一信息和第二信息中的至少一个,确定所述当前CTU的块划分方式和预测模式中的至少一个。In some embodiments, the determining unit 12 is specifically configured to decode the code stream to obtain at least one of first information and second information. The first information is used to indicate the block division method of the current CTU, so The second information is used to indicate the prediction mode of the current CTU; at least one of the block division method and the prediction mode of the current CTU is determined based on at least one of the first information and the second information.
在一些实施例中,所述当前CTU的块划分方式和预测模式是根据N个块划分方式对应的最优预测模式确定的,所述N个块划分方式中的第i个块划分方式对应的最优预测模式是根据所述剧烈运动参数确定的,所述i为小于或等于N的正整数。In some embodiments, the block division method and prediction mode of the current CTU are determined based on the optimal prediction modes corresponding to N block division methods, and the i-th block division method among the N block division methods corresponds to The optimal prediction mode is determined based on the violent motion parameter, and the i is a positive integer less than or equal to N.
在一些实施例中,所述第i个块划分方式对应的最优预测模式是根据M个CU的最优预测模式确定的,所述M个CU是使用所述第i个块划分方式对所述当前CTU进行块划分得到的,所述M个CU中的第j个CU的最优预测模式是从所述第j个CU的至少一个候选预测模式中确定的,所述第j个CU的至少一个候选预测模式是根据所述剧烈运动参数确定的。In some embodiments, the optimal prediction mode corresponding to the i-th block division method is determined based on the optimal prediction modes of M CUs, and the M CUs are all predicted using the i-th block division method. The current CTU is obtained by block division. The optimal prediction mode of the j-th CU among the M CUs is determined from at least one candidate prediction mode of the j-th CU. The optimal prediction mode of the j-th CU is At least one candidate prediction mode is determined based on the vigorous motion parameter.
在一些实施例中,若所述剧烈运动参数指示跳过所述仿射运动补偿预测模式,则所述第j个CU的至少一个候选预测模式中不包括所述仿射运动补偿预测模式。In some embodiments, if the severe motion parameter indicates skipping the affine motion compensation prediction mode, the at least one candidate prediction mode of the jth CU does not include the affine motion compensation prediction mode.
在一些实施例中,若所述剧烈运动参数指示不跳过所述仿射运动补偿预测模式,则所述第j个CU的至少一个候选预测模式中包括所述仿射运动补偿预测模式。In some embodiments, if the severe motion parameter indicates not to skip the affine motion compensation prediction mode, at least one candidate prediction mode of the jth CU includes the affine motion compensation prediction mode.
在一些实施例中,所述第j个CU的最优预测模式是根据所述第j个CU的至少一个候选预测模式对所述第j个CU进行预测时的代价,从所述至少一个候选预测模式中确定的一候选预测模式。In some embodiments, the optimal prediction mode of the j-th CU is a cost when predicting the j-th CU according to at least one candidate prediction mode of the j-th CU, from the at least one candidate prediction mode. A candidate prediction mode determined among the prediction modes.
在一些实施例中,所述剧烈运动参数包括所述当前帧的剧烈运动参数、所述当前CTU的剧烈运动参数、所述当前CU的剧烈运动参数中的至少一个,In some embodiments, the violent motion parameter includes at least one of the violent motion parameter of the current frame, the violent motion parameter of the current CTU, and the violent motion parameter of the current CU,
其中,所述当前帧的剧烈运动参数用于指示当前帧是否跳过所述仿射运动补偿预测模式,所述当前CTU的剧烈运动参数用于指示所述当前CTU是否跳过所述仿射运动补偿预测模式,所述当前CU的剧烈运动参数用于指示所述当前CU是否跳过所述仿射运动补偿预测模式。Wherein, the violent motion parameter of the current frame is used to indicate whether the current frame skips the affine motion compensation prediction mode, and the violent motion parameter of the current CTU is used to indicate whether the current CTU skips the affine motion. Compensation prediction mode, the violent motion parameter of the current CU is used to indicate whether the current CU skips the affine motion compensation prediction mode.
在一些实施例中,所述当前帧的剧烈运动参数是根据所述当前帧所包括的K个CTU的剧烈运动参数确定的,针对所述当前帧所包括的K个CTU中的第k个CTU,所述第k个CTU的剧烈运动参数是根据所述第k个CTU,以及所述第k个CTU在所述当前帧的前一帧中的参考CTU确定的,所述K为正整数,所述k为小于或等于K的正整数。In some embodiments, the severe motion parameters of the current frame are determined based on the severe motion parameters of K CTUs included in the current frame, for the kth CTU among the K CTUs included in the current frame. , the violent motion parameter of the k-th CTU is determined based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame, and the K is a positive integer, The k is a positive integer less than or equal to K.
在一些实施例中,所述第k个CTU的剧烈运动参数是根据所述第k个CTU的像素值和所述参考CTU的像素值 确定的。In some embodiments, the violent motion parameter of the k-th CTU is determined based on the pixel value of the k-th CTU and the pixel value of the reference CTU.
在一些实施例中,所述第k个CTU的剧烈运动参数是根据所述第k个CTU的像素值和所述参考CTU的像素值的绝对差确定的。In some embodiments, the violent motion parameter of the k-th CTU is determined based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU.
在一些实施例中,所述当前帧的剧烈运动参数是根据所述K个CTU中剧烈运动参数大于第一预设值的P个CTU的剧烈运动参数确定的,所述P为小于或等于K的正整数。In some embodiments, the severe motion parameters of the current frame are determined based on the severe motion parameters of P CTUs among the K CTUs whose severe motion parameters are greater than the first preset value, and the P is less than or equal to K positive integer.
在一些实施例中,所述当前帧的剧烈运动参数是根据所述P个CTU的剧烈运动参数之和,以及所述P个CTU的总面积确定的。In some embodiments, the severe motion parameter of the current frame is determined based on the sum of the severe motion parameters of the P CTUs and the total area of the P CTUs.
在一些实施例中,所述当前帧的剧烈运动参数为所述P个CTU的剧烈运动参数之和,与所述P个CTU的总面积的比值。In some embodiments, the violent motion parameter of the current frame is the ratio of the sum of the violent motion parameters of the P CTUs to the total area of the P CTUs.
在一些实施例中,所述当前CTU的剧烈运动参数是根据所述当前CTU,以及所述当前CTU在所述当前帧的前一帧中的参考CTU确定的。In some embodiments, the severe motion parameter of the current CTU is determined based on the current CTU and a reference CTU of the current CTU in a frame preceding the current frame.
在一些实施例中,所述当前CTU的剧烈运动参数是根据所述当前CTU的像素值和所述参考CTU的像素值确定的。In some embodiments, the severe motion parameter of the current CTU is determined based on the pixel value of the current CTU and the pixel value of the reference CTU.
在一些实施例中,所述当前CTU的剧烈运动参数是根据所述当前CTU的像素值和所述参考CTU的像素值的绝对差确定的。In some embodiments, the severe motion parameter of the current CTU is determined based on the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU.
在一些实施例中,所述当前CU的剧烈运动参数是根据所述当前CU,以及所述当前CU在所述当前帧的前一帧中的参考CU确定的。In some embodiments, the violent motion parameter of the current CU is determined based on the current CU and a reference CU of the current CU in a frame preceding the current frame.
在一些实施例中,所述当前CU的剧烈运动参数是根据所述当前CU的像素值和所述参考CU的像素值确定的。In some embodiments, the violent motion parameter of the current CU is determined based on the pixel value of the current CU and the pixel value of the reference CU.
在一些实施例中,所述当前CU的剧烈运动参数是根据所述当前CU的像素值和所述参考CU的像素值的绝对差确定的。In some embodiments, the violent motion parameter of the current CU is determined based on the absolute difference between the pixel value of the current CU and the pixel value of the reference CU.
在一些实施例值,所述剧烈运动参数是在预设条件下确定的。In some embodiments, the strenuous exercise parameters are determined under preset conditions.
在一些实施例中,所述预设条件包括第一标志的取值为第一数值,以及所述当前CU的尺寸满足预设尺寸中的至少一个,所述第一标志用于指示当前序列是否允许使用所述仿射运动补偿预测模式,所述第一数值用于指示所述当前序列允许使用所述仿射运动补偿预测模式。In some embodiments, the preset condition includes a first flag whose value is a first value and the size of the current CU satisfies at least one of the preset sizes. The first flag is used to indicate whether the current sequence The affine motion compensation prediction mode is allowed to be used, and the first value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图8所示的装置10可以执行本申请实施例的解码方法,并且转10中的各个单元的前述和其它操作和/或功能分别为了实现上述解码方法等各个方法中的相应流程,为了简洁,在此不再赘述。It should be understood that the device embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device 10 shown in Figure 8 can execute the decoding method of the embodiment of the present application, and perform the aforementioned and other operations and/or functions of each unit in the device 10 in order to implement the corresponding processes in each method such as the above decoding method. For the sake of brevity, no further details will be given here.
图9是本申请一实施例提供的视频编码装置的示意性框图。Figure 9 is a schematic block diagram of a video encoding device provided by an embodiment of the present application.
如图9所示,视频编码装置20包括:As shown in Figure 9, the video encoding device 20 includes:
第一确定单元21,用于确定剧烈运动参数,所述剧烈运动参数用于指示是否跳过仿射运动补偿预测模式;The first determination unit 21 is used to determine a violent motion parameter, where the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode;
第二确定单元22,用于根据所述剧烈运动参数,确定当前CTU的块划分方式和预测模式;The second determination unit 22 is configured to determine the block division method and prediction mode of the current CTU according to the violent motion parameter;
划分单元23,用于使用所述当前CTU的块划分方式对所述当前CTU进行块划分,得到至少一个CU;The dividing unit 23 is configured to use the block dividing method of the current CTU to block divide the current CTU to obtain at least one CU;
预测单元24,用于针对所述至少一个CU中的当前CU,使用所述当前CTU的预测模式中所述当前CU对应的预测模式,对所述当前CU进行预测,得到所述当前CU的预测值;The prediction unit 24 is configured to predict the current CU in the at least one CU using the prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction of the current CU. value;
编码单元25,用于根据所述当前CU的预测值,确定所述当前CU的残差值,并根据所述当前CU的残差值,得到码流。The encoding unit 25 is configured to determine the residual value of the current CU according to the predicted value of the current CU, and obtain a code stream based on the residual value of the current CU.
在一些实施例中,第二确定单元22,具体用于针对预设的N个块划分方式中的第i个块划分方式,根据所述剧烈运动参数,确定所述第i个块划分方式对应的最优预测模式,所述N为正整数,所述i小于或等于N的正整数;根据所述N个块划分方式对应的最优预测模式,确定所述当前CTU的块划分方式和预测模式。In some embodiments, the second determination unit 22 is specifically configured to determine, for the i-th block division method among the preset N block division methods, according to the violent motion parameter, the i-th block division method corresponds to The optimal prediction mode, the N is a positive integer, and the i is a positive integer less than or equal to N; according to the optimal prediction modes corresponding to the N block division methods, determine the block division method and prediction of the current CTU model.
在一些实施例中,第二确定单元22,具体用于使用所述第i个块划分方式对所述当前CTU进行块划分,得到M个CU,所述M为正整数;对于所述M个CU中的第j个CU,根据所述剧烈运动参数,确定所述第j个CU的至少一个候选预测模式,所述j为小于或等于M的正整数;从所述第j个CU的至少一个候选预测模式中,确定所述第j个CU的最优预测模式;根据所述M个CU的最优预测模式,确定所述第i个块划分方式对应的最优预测模式。In some embodiments, the second determination unit 22 is specifically configured to perform block division on the current CTU using the i-th block division method to obtain M CUs, where M is a positive integer; for the M The j-th CU in the CU determines at least one candidate prediction mode of the j-th CU based on the violent motion parameter, where j is a positive integer less than or equal to M; from at least one of the j-th CU In one candidate prediction mode, the optimal prediction mode of the j-th CU is determined; based on the optimal prediction modes of the M CUs, the optimal prediction mode corresponding to the i-th block division method is determined.
在一些实施例中,第二确定单元22,具体用于若所述剧烈运动参数指示跳过所述仿射运动补偿预测模式,则确定所述第j个CU的至少一个候选预测模式中不包括所述仿射运动补偿预测模式。In some embodiments, the second determination unit 22 is specifically configured to determine that at least one candidate prediction mode of the j-th CU does not include: The affine motion compensated prediction mode.
在一些实施例中,第二确定单元22,具体用于若所述剧烈运动参数指示不跳过所述仿射运动补偿预测模式,则确定所述第j个CU的至少一个候选预测模式中包括所述仿射运动补偿预测模式。In some embodiments, the second determination unit 22 is specifically configured to determine that at least one candidate prediction mode of the j-th CU includes: The affine motion compensated prediction mode.
在一些实施例中,第二确定单元22,具体用于确定使用所述第j个CU的至少一个候选预测模式对所述第j个CU进行预测时,所述至少一个候选预测模式对应的代价;根据所述至少一个候选预测模式对应的代价,从所述第j个CU的至少一个候选预测模式中,确定所述第j个CU的最优预测模式。In some embodiments, the second determination unit 22 is specifically configured to determine the cost corresponding to the at least one candidate prediction mode when the jth CU is predicted using at least one candidate prediction mode of the jth CU. ; Determine the optimal prediction mode of the j-th CU from at least one candidate prediction mode of the j-th CU according to the cost corresponding to the at least one candidate prediction mode.
在一些实施例中,所述剧烈运动参数包括所述当前帧的剧烈运动参数、所述当前CTU的剧烈运动参数、所述当前CU的剧烈运动参数中的至少一个,In some embodiments, the violent motion parameter includes at least one of the violent motion parameter of the current frame, the violent motion parameter of the current CTU, and the violent motion parameter of the current CU,
其中,所述当前帧的剧烈运动参数用于指示当前帧是否跳过所述仿射运动补偿预测模式,所述当前CTU的剧烈运动参数用于指示所述当前CTU是否跳过所述仿射运动补偿预测模式,所述当前CU的剧烈运动参数用于指示所述当前CU是否跳过所述仿射运动补偿预测模式。Wherein, the violent motion parameter of the current frame is used to indicate whether the current frame skips the affine motion compensation prediction mode, and the violent motion parameter of the current CTU is used to indicate whether the current CTU skips the affine motion. Compensation prediction mode, the violent motion parameter of the current CU is used to indicate whether the current CU skips the affine motion compensation prediction mode.
在一些实施例中,若所述剧烈运动参数包括所述当前帧的剧烈运动参数,则第一确定单元21,具体用于针对所述当前帧所包括的K个CTU中的第k个CTU,根据所述第k个CTU,以及所述第k个CTU在所述当前帧的前一帧中的参考CTU,确定所述第k个CTU的剧烈运动参数,所述K为正整数,所述k为小于或等于K的正整数;根据所述当前帧所包括的K个CTU的剧烈运动参数,确定所述当前帧的剧烈运动参数。In some embodiments, if the violent motion parameter includes the violent motion parameter of the current frame, the first determining unit 21 is specifically configured to target the k-th CTU among the K CTUs included in the current frame, Determine the violent motion parameter of the k-th CTU according to the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame, where the K is a positive integer, and the k is a positive integer less than or equal to K; the violent motion parameters of the current frame are determined according to the violent motion parameters of K CTUs included in the current frame.
在一些实施例中,第一确定单元21,具体用于根据所述第k个CTU的像素值和所述参考CTU的像素值,确定所述第k个CTU的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the violent motion parameter of the k-th CTU based on the pixel value of the k-th CTU and the pixel value of the reference CTU.
在一些实施例中,第一确定单元21,具体用于根据所述第k个CTU的像素值和所述参考CTU的像素值的绝对差,确定所述第k个CTU的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the violent motion parameter of the k-th CTU based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU.
在一些实施例中,第一确定单元21,具体用于从所述K个CTU中选取剧烈运动参数大于第一预设值的P个CTU,所述P为小于或等于K的正整数;根据所述P个CTU的剧烈运动参数,确定所述当前帧的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to select P CTUs whose violent motion parameters are greater than the first preset value from the K CTUs, where P is a positive integer less than or equal to K; according to The violent motion parameters of the P CTUs determine the violent motion parameters of the current frame.
在一些实施例中,第一确定单元21,具体用于根据所述P个CTU的剧烈运动参数之和,以及所述P个CTU的总面积,确定所述当前帧的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the violent motion parameter of the current frame based on the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs.
在一些实施例中,第一确定单元21,具体用于将所述P个CTU的剧烈运动参数之和,与所述P个CTU的总面积的比值,确定为所述当前帧的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the ratio of the sum of the violent motion parameters of the P CTUs to the total area of the P CTUs as the violent motion parameter of the current frame. .
在一些实施例中,若所述剧烈运动参数包括所述当前CTU的剧烈运动参数,则第一确定单元21,具体用于根据所述当前CTU,以及所述当前CTU在所述当前帧的前一帧中的参考CTU,确定所述当前CTU的剧烈运动参数。In some embodiments, if the violent motion parameter includes the violent motion parameter of the current CTU, the first determining unit 21 is specifically configured to calculate the current CTU according to the current CTU and the current CTU before the current frame. The reference CTU in a frame determines the violent motion parameters of the current CTU.
在一些实施例中,第一确定单元21,具体用于根据所述当前CTU的像素值和所述参考CTU的像素值,确定所述当前CTU的剧烈运动参数。In some embodiments, the first determining unit 21 is specifically configured to determine the violent motion parameter of the current CTU according to the pixel value of the current CTU and the pixel value of the reference CTU.
在一些实施例中,第一确定单元21,具体用于根据所述当前CTU的像素值和所述参考CTU的像素值的绝对差,确定所述当前CTU的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the violent motion parameter of the current CTU based on the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU.
在一些实施例中,若所述剧烈运动参数包括所述当前CU的剧烈运动参数,则第一确定单元21,具体用于根据所述当前CU,以及所述当前CU在所述当前帧的前一帧中的参考CU,确定所述当前CU的剧烈运动参数。In some embodiments, if the violent motion parameter includes the violent motion parameter of the current CU, the first determining unit 21 is specifically configured to determine the current CU according to the current CU and the current CU before the current frame. The reference CU in a frame determines the violent motion parameters of the current CU.
在一些实施例中,第一确定单元21,具体用于根据所述当前CU的像素值和所述参考CU的像素值,确定所述当前CU的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the violent motion parameter of the current CU according to the pixel value of the current CU and the pixel value of the reference CU.
在一些实施例中,第一确定单元21,具体用于根据所述当前CU的像素值和所述参考CU的像素值的绝对差,确定所述当前CU的剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the violent motion parameter of the current CU based on the absolute difference between the pixel value of the current CU and the pixel value of the reference CU.
在一些实施例中,第一确定单元21,具体用于在预设条件下,确定所述剧烈运动参数。In some embodiments, the first determination unit 21 is specifically configured to determine the strenuous exercise parameters under preset conditions.
在一些实施例中,所述预设条件包括第一标志的取值为第一数值,以及所述当前CU的尺寸满足预设尺寸中的至少一个,所述第一标志用于指示当前序列是否允许使用所述仿射运动补偿预测模式,所述第一数值用于指示所述当前序列允许使用所述仿射运动补偿预测模式。In some embodiments, the preset condition includes a first flag whose value is a first value and the size of the current CU satisfies at least one of the preset sizes. The first flag is used to indicate whether the current sequence The affine motion compensation prediction mode is allowed to be used, and the first value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
在一些实施例中,编码单元25还用于在所述码流中写入第一信息和第二信息中的至少一个,所述第一信息用于指示所述当前CTU的块划分方式,所述第二信息用于指示所述当前CTU的预测模式。In some embodiments, the encoding unit 25 is further configured to write at least one of first information and second information in the code stream, where the first information is used to indicate the block division mode of the current CTU, so The second information is used to indicate the prediction mode of the current CTU.
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图9所示的装置20可以对应于执行本申请实施例的编码方法中的相应主体,并且装置20中的各个单元的前述和其它操作和/或功能分别为了实现编码方法等各个方法中的相应流程,为了简洁,在此不再赘述。It should be understood that the device embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device 20 shown in FIG. 9 may correspond to the corresponding subject in executing the encoding method of the embodiment of the present application, and the foregoing and other operations and/or functions of each unit in the device 20 are respectively to implement the encoding method and other methods. The corresponding process in , for the sake of brevity, will not be repeated here.
上文中结合附图从功能单元的角度描述了本申请实施例的装置和系统。应理解,该功能单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件单元组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。可选地,软件单元可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。The device and system of the embodiments of the present application are described above from the perspective of functional units in conjunction with the accompanying drawings. It should be understood that this functional unit can be implemented in the form of hardware, can also be implemented in the form of instructions in the software, or can also be implemented in a combination of hardware and software units. Specifically, each step of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits of hardware in the processor and/or instructions in the form of software. The steps of the methods disclosed in conjunction with the embodiments of the present application can be directly embodied in hardware. The execution of the decoding processor is completed, or the execution is completed using a combination of hardware and software units in the decoding processor. Optionally, the software unit may be located in a mature storage medium in this field such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in combination with its hardware.
图10是本申请实施例提供的电子设备的示意性框图。Figure 10 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
如图32所示,该电子设备30可以为本申请实施例所述的视频编码器,或者视频解码器,该电子设备30可包括:As shown in Figure 32, the electronic device 30 may be the video encoder or video decoder described in the embodiment of the present application. The electronic device 30 may include:
存储器33和处理器32,该存储器33用于存储计算机程序34,并将该程序代码34传输给该处理器32。换言之,该处理器32可以从存储器33中调用并运行计算机程序34,以实现本申请实施例中的方法。 Memory 33 and processor 32, the memory 33 is used to store the computer program 34 and transmit the program code 34 to the processor 32. In other words, the processor 32 can call and run the computer program 34 from the memory 33 to implement the method in the embodiment of the present application.
例如,该处理器32可用于根据该计算机程序34中的指令执行上述方法200中的步骤。For example, the processor 32 may be configured to perform the steps in the above method 200 according to instructions in the computer program 34 .
在本申请的一些实施例中,该处理器32可以包括但不限于:In some embodiments of the present application, the processor 32 may include but is not limited to:
通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等等。General processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates Or transistor logic devices, discrete hardware components, etc.
在本申请的一些实施例中,该存储器33包括但不限于:In some embodiments of the present application, the memory 33 includes but is not limited to:
易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。Volatile memory and/or non-volatile memory. Among them, non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
在本申请的一些实施例中,该计算机程序34可以被分割成一个或多个单元,该一个或者多个单元被存储在该存储器33中,并由该处理器32执行,以完成本申请提供的方法。该一个或多个单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述该计算机程序34在该电子设备30中的执行过程。In some embodiments of the present application, the computer program 34 can be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the tasks provided by this application. Methods. The one or more units may be a series of computer program instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
如图10所示,该电子设备30还可包括:As shown in Figure 10, the electronic device 30 may also include:
收发器33,该收发器33可连接至该处理器32或存储器33。 Transceiver 33 , the transceiver 33 can be connected to the processor 32 or the memory 33 .
其中,处理器32可以控制该收发器33与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器33可以包括发射机和接收机。收发器33还可以进一步包括天线,天线的数量可以为一个或多个。The processor 32 can control the transceiver 33 to communicate with other devices. Specifically, it can send information or data to other devices, or receive information or data sent by other devices. Transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include an antenna, and the number of antennas may be one or more.
应当理解,该电子设备30中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。It should be understood that various components in the electronic device 30 are connected through a bus system, where in addition to the data bus, the bus system also includes a power bus, a control bus and a status signal bus.
图11是本申请实施例提供的视频编解码系统的示意性框图。Figure 11 is a schematic block diagram of a video encoding and decoding system provided by an embodiment of the present application.
如图11所示,该视频编解码系统40可包括:视频编码器41和视频解码器42,其中视频编码器41用于执行本申请实施例涉及的视频编码方法,视频解码器42用于执行本申请实施例涉及的视频解码方法。As shown in Figure 11, the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42, where the video encoder 41 is used to perform the video encoding method involved in the embodiment of the present application, and the video decoder 42 is used to perform The embodiment of the present application relates to a video decoding method.
本申请还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。This application also provides a computer storage medium on which a computer program is stored. When the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, embodiments of the present application also provide a computer program product containing instructions, which when executed by a computer causes the computer to perform the method of the above method embodiments.
本申请还提供了一种码流,该码流是通过上述编码方式生成的。可选的,该码流中包括第一标志。This application also provides a code stream, which is generated by the above encoding method. Optionally, the code stream includes a first flag.
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。When implemented using software, it may 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. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted over a wired connection from a website, computer, server, or data center (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website, computer, server or data center. 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 or data center integrated with one or more available media. The available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as digital video discs (DVD)), or semiconductor media (such as solid state disks (SSD)), etc.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this 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 only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。A unit described as a separate component may or may not be physically separate. A component shown as a unit may or may not be a physical unit, that is, it may be located in one place, or it may 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. For example, each functional unit in various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。The above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, and should are 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.
Claims (27)
- 一种视频编码方法,其特征在于,包括:A video coding method, characterized by including:确定剧烈运动参数,所述剧烈运动参数用于指示是否跳过仿射运动补偿预测模式;Determine a violent motion parameter, the violent motion parameter being used to indicate whether to skip the affine motion compensation prediction mode;根据所述剧烈运动参数,确定当前编码树单元CTU的块划分方式和预测模式;Determine the block division method and prediction mode of the current coding tree unit CTU according to the violent motion parameter;使用所述当前CTU的块划分方式对所述当前CTU进行块划分,得到至少一个编码单元CU;Perform block division on the current CTU using the block division method of the current CTU to obtain at least one coding unit CU;针对所述至少一个CU中的当前CU,使用所述当前CTU的预测模式中所述当前CU对应的预测模式,对所述当前CU进行预测,得到所述当前CU的预测值;For the current CU in the at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU to obtain a prediction value of the current CU;根据所述当前CU的预测值,确定所述当前CU的残差值,并根据所述当前CU的残差值,得到码流。According to the predicted value of the current CU, the residual value of the current CU is determined, and based on the residual value of the current CU, a code stream is obtained.
- 根据权利要求1所述的方法,其特征在于,所述根据所述剧烈运动参数,确定所述当前编码树单元CTU的块划分方式和预测模式,包括:The method according to claim 1, wherein determining the block division method and prediction mode of the current coding tree unit CTU according to the violent motion parameter includes:针对预设的N个块划分方式中的第i个块划分方式,根据所述剧烈运动参数,确定所述第i个块划分方式对应的最优预测模式,所述N为正整数,所述i小于或等于N的正整数;For the i-th block division method among the preset N block division methods, determine the optimal prediction mode corresponding to the i-th block division method according to the violent motion parameter, where the N is a positive integer, and the i is a positive integer less than or equal to N;根据所述N个块划分方式对应的最优预测模式,确定所述当前CTU的块划分方式和预测模式。The block division method and prediction mode of the current CTU are determined according to the optimal prediction modes corresponding to the N block division methods.
- 根据权利要求2所述的方法,其特征在于,所述根据所述剧烈运动参数,确定所述第i个块划分方式对应的最优预测模式,包括:The method of claim 2, wherein determining the optimal prediction mode corresponding to the i-th block division method according to the violent motion parameter includes:使用所述第i个块划分方式对所述当前CTU进行块划分,得到M个CU,所述M为正整数;Use the i-th block division method to perform block division on the current CTU to obtain M CUs, where M is a positive integer;对于所述M个CU中的第j个CU,根据所述剧烈运动参数,确定所述第j个CU的至少一个候选预测模式,所述j为小于或等于M的正整数;For the j-th CU among the M CUs, determine at least one candidate prediction mode of the j-th CU according to the violent motion parameter, where j is a positive integer less than or equal to M;从所述第j个CU的至少一个候选预测模式中,确定所述第j个CU的最优预测模式;Determine the optimal prediction mode of the j-th CU from at least one candidate prediction mode of the j-th CU;根据所述M个CU的最优预测模式,确定所述第i个块划分方式对应的最优预测模式。According to the optimal prediction modes of the M CUs, the optimal prediction mode corresponding to the i-th block division mode is determined.
- 根据权利要求3所述的方法,其特征在于,所述根据所述剧烈运动参数,确定所述第j个CU的至少一个候选预测模式,包括:The method of claim 3, wherein determining at least one candidate prediction mode of the j-th CU according to the violent motion parameter includes:若所述剧烈运动参数指示跳过所述仿射运动补偿预测模式,则确定所述第j个CU的至少一个候选预测模式中不包括所述仿射运动补偿预测模式。If the severe motion parameter indicates skipping the affine motion compensation prediction mode, it is determined that the at least one candidate prediction mode of the j-th CU does not include the affine motion compensation prediction mode.
- 根据权利要求3所述的方法,其特征在于,所述根据所述剧烈运动参数,确定所述第j个CU的至少一个候选预测模式,包括:The method of claim 3, wherein determining at least one candidate prediction mode of the j-th CU according to the violent motion parameter includes:若所述剧烈运动参数指示不跳过所述仿射运动补偿预测模式,则确定所述第j个CU的至少一个候选预测模式中包括所述仿射运动补偿预测模式。If the severe motion parameter indicates not to skip the affine motion compensation prediction mode, it is determined that at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
- 根据权利要求3所述的方法,其特征在于,所述从所述第j个CU的至少一个候选预测模式中,确定所述第j个CU的最优预测模式,包括:The method of claim 3, wherein determining the optimal prediction mode of the j-th CU from at least one candidate prediction mode of the j-th CU includes:确定使用所述第j个CU的至少一个候选预测模式对所述第j个CU进行预测时,所述至少一个候选预测模式对应的代价;Determine the cost corresponding to the at least one candidate prediction mode when predicting the j-th CU using at least one candidate prediction mode of the j-th CU;根据所述至少一个候选预测模式对应的代价,从所述第j个CU的至少一个候选预测模式中,确定所述第j个CU的最优预测模式。According to the cost corresponding to the at least one candidate prediction mode, the optimal prediction mode of the jth CU is determined from the at least one candidate prediction mode of the jth CU.
- 根据权利要求1-6任一项所述的方法,其特征在于,所述剧烈运动参数包括所述当前帧的剧烈运动参数、所述当前CTU的剧烈运动参数、所述当前CU的剧烈运动参数中的至少一个,The method according to any one of claims 1 to 6, characterized in that the violent motion parameters include the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU. at least one of,其中,所述当前帧的剧烈运动参数用于指示当前帧是否跳过所述仿射运动补偿预测模式,所述当前CTU的剧烈运动参数用于指示所述当前CTU是否跳过所述仿射运动补偿预测模式,所述当前CU的剧烈运动参数用于指示所述当前CU是否跳过所述仿射运动补偿预测模式。Wherein, the violent motion parameter of the current frame is used to indicate whether the current frame skips the affine motion compensation prediction mode, and the violent motion parameter of the current CTU is used to indicate whether the current CTU skips the affine motion. Compensation prediction mode, the violent motion parameter of the current CU is used to indicate whether the current CU skips the affine motion compensation prediction mode.
- 根据权利要求7所述的方法,其特征在于,若所述剧烈运动参数包括所述当前帧的剧烈运动参数,则所述确定剧烈运动参数,包括:The method according to claim 7, wherein if the violent motion parameter includes the violent motion parameter of the current frame, then determining the violent motion parameter includes:针对所述当前帧所包括的K个CTU中的第k个CTU,根据所述第k个CTU,以及所述第k个CTU在所述当前帧的前一帧中的参考CTU,确定所述第k个CTU的剧烈运动参数,所述K为正整数,所述k为小于或等于K的正整数;For the k-th CTU among the K CTUs included in the current frame, determine the k-th CTU according to the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame. The violent motion parameter of the k-th CTU, the K is a positive integer, and the k is a positive integer less than or equal to K;根据所述当前帧所包括的K个CTU的剧烈运动参数,确定所述当前帧的剧烈运动参数。The violent motion parameters of the current frame are determined according to the violent motion parameters of K CTUs included in the current frame.
- 根据权利要求8所述的方法,其特征在于,所述根据所述第k个CTU,以及所述第k个CTU在所述当前帧的前一帧中的参考CTU,确定所述第k个CTU的剧烈运动参数,包括:The method according to claim 8, characterized in that the k-th CTU is determined based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame of the current frame. CTU’s strenuous exercise parameters include:根据所述第k个CTU的像素值和所述参考CTU的像素值,确定所述第k个CTU的剧烈运动参数。According to the pixel value of the k-th CTU and the pixel value of the reference CTU, the violent motion parameter of the k-th CTU is determined.
- 根据权利要求9所述的方法,其特征在于,所述根据所述第k个CTU的像素值和所述参考CTU的像素值,确定所述第k个CTU的剧烈运动参数,包括:The method of claim 9, wherein determining the violent motion parameter of the k-th CTU based on the pixel value of the k-th CTU and the pixel value of the reference CTU includes:根据所述第k个CTU的像素值和所述参考CTU的像素值的绝对差,确定所述第k个CTU的剧烈运动参数。The violent motion parameter of the k-th CTU is determined based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU.
- 根据权利要求8所述的方法,其特征在于,所述根据所述当前帧所包括的K个CTU的剧烈运动参数,确定所述当前帧的剧烈运动参数,包括:The method of claim 8, wherein determining the violent motion parameters of the current frame based on the violent motion parameters of K CTUs included in the current frame includes:从所述K个CTU中选取剧烈运动参数大于第一预设值的P个CTU,所述P为小于或等于K的正整数;Select P CTUs whose violent motion parameters are greater than the first preset value from the K CTUs, where P is a positive integer less than or equal to K;根据所述P个CTU的剧烈运动参数,确定所述当前帧的剧烈运动参数。According to the violent motion parameters of the P CTUs, the violent motion parameters of the current frame are determined.
- 根据权利要求11所述的方法,其特征在于,所述根据所述P个CTU的剧烈运动参数,确定所述当前帧的剧烈运动参数,包括:The method according to claim 11, wherein determining the violent motion parameters of the current frame based on the violent motion parameters of the P CTUs includes:根据所述P个CTU的剧烈运动参数之和,以及所述P个CTU的总面积,确定所述当前帧的剧烈运动参数。The violent motion parameter of the current frame is determined according to the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs.
- 根据权利要求12所述的方法,其特征在于,所述根据所述P个CTU的剧烈运动参数之和,以及所述P个CTU的总面积,确定所述当前帧的剧烈运动参数,包括:The method according to claim 12, wherein determining the violent motion parameters of the current frame based on the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs includes:将所述P个CTU的剧烈运动参数之和,与所述P个CTU的总面积的比值,确定为所述当前帧的剧烈运动参数。The ratio of the sum of the violent motion parameters of the P CTUs to the total area of the P CTUs is determined as the violent motion parameter of the current frame.
- 根据权利要求7所述的方法,其特征在于,若所述剧烈运动参数包括所述当前CTU的剧烈运动参数,所述确定剧烈运动参数,包括:The method according to claim 7, characterized in that, if the strenuous exercise parameters include the strenuous exercise parameters of the current CTU, the determining of the strenuous exercise parameters includes:根据所述当前CTU,以及所述当前CTU在所述当前帧的前一帧中的参考CTU,确定所述当前CTU的剧烈运动参数。According to the current CTU and the reference CTU of the current CTU in the previous frame of the current frame, the violent motion parameter of the current CTU is determined.
- 根据权利要求14所述的方法,其特征在于,所述根据所述当前CTU,以及所述当前CTU在所述当前帧的前一帧中的参考CTU,确定所述当前CTU的剧烈运动参数,包括:The method according to claim 14, characterized in that the violent motion parameters of the current CTU are determined based on the current CTU and the reference CTU of the current CTU in the frame preceding the current frame, include:根据所述当前CTU的像素值和所述参考CTU的像素值,确定所述当前CTU的剧烈运动参数。According to the pixel value of the current CTU and the pixel value of the reference CTU, the violent motion parameter of the current CTU is determined.
- 根据权利要求15所述的方法,其特征在于,所述根据所述当前CTU的像素值和所述参考CTU的像素值,确定所述当前CTU的剧烈运动参数,包括:The method of claim 15, wherein determining the violent motion parameters of the current CTU based on the pixel values of the current CTU and the pixel values of the reference CTU includes:根据所述当前CTU的像素值和所述参考CTU的像素值的绝对差,确定所述当前CTU的剧烈运动参数。According to the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU, the violent motion parameter of the current CTU is determined.
- 根据权利要求7所述的方法,其特征在于,若所述剧烈运动参数包括所述当前CU的剧烈运动参数,所述确定剧烈运动参数,包括:The method according to claim 7, characterized in that, if the strenuous motion parameters include the strenuous motion parameters of the current CU, the determining of the strenuous motion parameters includes:根据所述当前CU,以及所述当前CU在所述当前帧的前一帧中的参考CU,确定所述当前CU的剧烈运动参数。According to the current CU and the reference CU of the current CU in the previous frame of the current frame, the violent motion parameter of the current CU is determined.
- 根据权利要求17所述的方法,其特征在于,所述根据所述当前CU,以及所述当前CU在所述当前帧的前一帧中的参考CU,确定所述当前CU的剧烈运动参数,包括:The method of claim 17, wherein the violent motion parameters of the current CU are determined based on the current CU and a reference CU of the current CU in a frame preceding the current frame, include:根据所述当前CU的像素值和所述参考CU的像素值,确定所述当前CU的剧烈运动参数。According to the pixel value of the current CU and the pixel value of the reference CU, the violent motion parameter of the current CU is determined.
- 根据权利要求18所述的方法,其特征在于,所述根据所述当前CU的像素值和所述参考CU的像素值,确定所述当前CU的剧烈运动参数,包括:The method of claim 18, wherein determining the violent motion parameters of the current CU based on the pixel values of the current CU and the pixel values of the reference CU includes:根据所述当前CU的像素值和所述参考CU的像素值的绝对差,确定所述当前CU的剧烈运动参数。According to the absolute difference between the pixel value of the current CU and the pixel value of the reference CU, the violent motion parameter of the current CU is determined.
- 根据权利要求1-6任一项所述的方法,其特征在于,所述确定剧烈运动参数,包括:The method according to any one of claims 1 to 6, characterized in that determining the parameters of strenuous exercise includes:在预设条件下,确定所述剧烈运动参数。Under preset conditions, the strenuous exercise parameters are determined.
- 根据权利要求20所述的方法,其特征在于,所述预设条件包括第一标志的取值为第一数值,以及所述当前CU的尺寸满足预设尺寸中的至少一个,所述第一标志用于指示当前序列是否允许使用所述仿射运动补偿预测模式,所述第一数值用于指示所述当前序列允许使用所述仿射运动补偿预测模式。The method according to claim 20, wherein the preset condition includes that the value of the first flag is a first numerical value, and the size of the current CU satisfies at least one of the preset sizes, and the first The flag is used to indicate whether the current sequence is allowed to use the affine motion compensation prediction mode, and the first value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
- 根据权利要求1-6任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-6, characterized in that the method further includes:在所述码流中写入第一信息和第二信息中的至少一个,所述第一信息用于指示所述当前CTU的块划分方式,所述第二信息用于指示所述当前CTU的预测模式。At least one of first information and second information is written in the code stream, the first information is used to indicate the block division method of the current CTU, and the second information is used to indicate the block division method of the current CTU. Prediction mode.
- 一种视频编码装置,其特征在于,包括:A video encoding device, characterized by including:第一确定单元,用于确定剧烈运动参数,所述剧烈运动参数用于指示是否跳过仿射运动补偿预测模式;A first determination unit configured to determine a violent motion parameter, where the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode;第二确定单元,用于根据所述剧烈运动参数,确定当前CTU的块划分方式和预测模式;A second determination unit, configured to determine the block division method and prediction mode of the current CTU according to the violent motion parameter;划分单元,用于使用所述当前CTU的块划分方式对所述当前CTU进行块划分,得到至少一个CU;A dividing unit, configured to divide the current CTU into blocks using the block dividing method of the current CTU to obtain at least one CU;预测单元,用于针对所述至少一个CU中的当前CU,使用所述当前CTU的预测模式中所述当前CU对应的预测模式,对所述当前CU进行预测,得到所述当前CU的预测值;A prediction unit configured to predict the current CU in the at least one CU using the prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction value of the current CU. ;编码单元,用于根据所述当前CU的预测值,确定所述当前CU的残差值,并根据所述当前CU的残差值,得到码流。A coding unit, configured to determine the residual value of the current CU based on the predicted value of the current CU, and obtain a code stream based on the residual value of the current CU.
- 一种视频编码器,其特征在于,包括处理器和存储器;A video encoder, characterized by including a processor and a memory;所示存储器用于存储计算机程序;The memory shown is used to store computer programs;所述处理器用于调用并运行所述存储器中存储的计算机程序,以实现如上述权利要求1至22任一项所述的方法。The processor is configured to call and run the computer program stored in the memory to implement the method as described in any one of claims 1 to 22 above.
- 一种编解码系统,其特征在于,包括:A coding and decoding system, characterized by including:权利要求24所述的视频编码器。The video encoder of claim 24.
- 一种计算机可读存储介质,其特征在于,用于存储计算机程序;A computer-readable storage medium, characterized in that it is used to store a computer program;所述计算机程序使得计算机执行如上述权利要求1至22任一项所述的方法。The computer program causes the computer to perform the method as claimed in any one of claims 1 to 22 above.
- 一种码流,其特征在于,所述码流是通过如上述权利要求1至22任一项所述的方法生成的。A code stream, characterized in that the code stream is generated by the method described in any one of claims 1 to 22.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/093582 WO2023220970A1 (en) | 2022-05-18 | 2022-05-18 | Video coding method and apparatus, and device, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/093582 WO2023220970A1 (en) | 2022-05-18 | 2022-05-18 | Video coding method and apparatus, and device, system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023220970A1 true WO2023220970A1 (en) | 2023-11-23 |
Family
ID=88834164
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/093582 WO2023220970A1 (en) | 2022-05-18 | 2022-05-18 | Video coding method and apparatus, and device, system and storage medium |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2023220970A1 (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109429064A (en) * | 2017-08-22 | 2019-03-05 | 华为技术有限公司 | A kind of method and apparatus handling video data |
CN110753222A (en) * | 2018-08-14 | 2020-02-04 | 北京达佳互联信息技术有限公司 | Video coding method and equipment for determining adoption of interframe coding mode |
WO2020180155A1 (en) * | 2019-03-07 | 2020-09-10 | 엘지전자 주식회사 | Method and apparatus for processing video signal |
CN112235581A (en) * | 2019-06-30 | 2021-01-15 | 腾讯美国有限责任公司 | Video decoding method and device |
CN112789860A (en) * | 2019-04-17 | 2021-05-11 | 株式会社 Xris | Method for encoding/decoding image signal and apparatus therefor |
CN112840647A (en) * | 2018-09-21 | 2021-05-25 | Oppo广东移动通信有限公司 | Video signal encoding/decoding method and apparatus for the same |
CN113170189A (en) * | 2018-12-07 | 2021-07-23 | 三星电子株式会社 | Video decoding method and apparatus, and video encoding method and apparatus |
CN113906750A (en) * | 2019-04-30 | 2022-01-07 | 韦勒斯标准与技术协会公司 | Method and apparatus for processing video signal using adaptive motion vector resolution |
WO2022032028A1 (en) * | 2020-08-06 | 2022-02-10 | Beijing Dajia Internet Information Technology Co., Ltd. | Methods and apparatuses for affine motion-compensated prediction refinement |
-
2022
- 2022-05-18 WO PCT/CN2022/093582 patent/WO2023220970A1/en unknown
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109429064A (en) * | 2017-08-22 | 2019-03-05 | 华为技术有限公司 | A kind of method and apparatus handling video data |
CN110753222A (en) * | 2018-08-14 | 2020-02-04 | 北京达佳互联信息技术有限公司 | Video coding method and equipment for determining adoption of interframe coding mode |
CN112840647A (en) * | 2018-09-21 | 2021-05-25 | Oppo广东移动通信有限公司 | Video signal encoding/decoding method and apparatus for the same |
CN113170189A (en) * | 2018-12-07 | 2021-07-23 | 三星电子株式会社 | Video decoding method and apparatus, and video encoding method and apparatus |
WO2020180155A1 (en) * | 2019-03-07 | 2020-09-10 | 엘지전자 주식회사 | Method and apparatus for processing video signal |
CN112789860A (en) * | 2019-04-17 | 2021-05-11 | 株式会社 Xris | Method for encoding/decoding image signal and apparatus therefor |
CN113906750A (en) * | 2019-04-30 | 2022-01-07 | 韦勒斯标准与技术协会公司 | Method and apparatus for processing video signal using adaptive motion vector resolution |
CN112235581A (en) * | 2019-06-30 | 2021-01-15 | 腾讯美国有限责任公司 | Video decoding method and device |
WO2022032028A1 (en) * | 2020-08-06 | 2022-02-10 | Beijing Dajia Internet Information Technology Co., Ltd. | Methods and apparatuses for affine motion-compensated prediction refinement |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114173114B (en) | Image prediction method, device, equipment, system and storage medium | |
WO2024212735A1 (en) | Picture filtering method and apparatus, and device and storage medium | |
US20230319267A1 (en) | Video coding method and video decoder | |
WO2024050723A1 (en) | Image prediction method and apparatus, and computer readable storage medium | |
WO2023044868A1 (en) | Video encoding method, video decoding method, device, system, and storage medium | |
WO2023220970A1 (en) | Video coding method and apparatus, and device, system and storage medium | |
WO2022174475A1 (en) | Video encoding method and system, video decoding method and system, video encoder, and video decoder | |
WO2023197229A1 (en) | Video coding/decoding method, apparatus, device and system and storage medium | |
WO2024092425A1 (en) | Video encoding/decoding method and apparatus, and device and storage medium | |
WO2023122968A1 (en) | Intra-frame prediction method, device and system, and storage medium | |
WO2024007128A1 (en) | Video encoding and decoding methods, apparatus, and devices, system, and storage medium | |
WO2023173255A1 (en) | Image encoding and decoding methods and apparatuses, device, system, and storage medium | |
WO2023197183A1 (en) | Video encoding method and apparatus, video decoding method and apparatus, and device, system and storage medium | |
WO2024192733A1 (en) | Video coding method and apparatus, video decoding method and apparatus, devices, system, and storage medium | |
WO2024216632A1 (en) | Video encoding method and apparatus, video decoding method and apparatus, and device, system and storage medium | |
WO2023122969A1 (en) | Intra-frame prediction method, device, system, and storage medium | |
WO2023236113A1 (en) | Video encoding and decoding methods, apparatuses and devices, system, and storage medium | |
WO2023184250A1 (en) | Video coding/decoding method, apparatus and system, device and storage medium | |
CN111669583A (en) | Image prediction method, device, equipment, system and storage medium | |
WO2024183007A1 (en) | Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium | |
WO2024077553A1 (en) | Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium | |
WO2023220969A1 (en) | Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium | |
WO2024152254A1 (en) | Video encoding method, apparatus and device, video decoding method, apparatus and device, and system and storage medium | |
WO2024108391A1 (en) | Video encoding method and apparatus, video decoding method and apparatus, and devices, system and storage medium | |
WO2023123736A1 (en) | Communication method, apparatus, device, system, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22942012 Country of ref document: EP Kind code of ref document: A1 |