Video coding method, device, equipment, system and storage medium
Patent Information
- Application Number
- CN202280095646.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-18
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-05-18
AI Technical Summary
In the video encoding and decoding process, using affine motion compensation prediction mode will generate a lot of unnecessary overhead, waste computing resources, and increase encoding time.
By determining the violent motion parameters to determine whether to skip the affine motion compensation prediction mode, avoid using the affine motion compensation prediction mode for translational motion videos, thereby reducing encoding time and improving encoding efficiency.
It effectively avoids the waste of computing resources when using affine motion compensation prediction mode for translational motion videos, reduces encoding time, improves video encoding efficiency and saves computing resources.
Smart Images

Figure CN119137938A_ABST
Abstract
Description
Video encoding method, device, equipment, system, and storage medium Technical Field
[0001] The present application relates to the field of video coding and decoding technology, and in particular to a video coding method, apparatus, device, system, and storage medium. Background Art
[0002] 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, the amount of video data included has increased. To facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
[0003] During video transmission, redundancy is reduced through prediction, such as through affine motion compensation (AFF) prediction, which can predict zooming in or out, rotation, perspective motion, and other irregular motions. However, currently, using affine motion compensation prediction can generate a significant amount of unnecessary overhead, waste computing resources, and increase encoding time.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a video encoding method, apparatus, device, system, and storage medium, which determine whether to skip the affine motion compensation prediction mode by determining the violent motion parameters, thereby avoiding the waste of computing resources and reducing the encoding time.
[0006] In a first aspect, an embodiment of the present application provides a video decoding method, comprising:
[0007] Decode the code stream and determine the residual value of the current coding tree unit CTU;
[0008] Determining a block partitioning mode and a prediction mode of a current CTU, wherein the block partitioning mode and the prediction mode of the current CTU are determined based on a severe motion parameter, wherein the severe motion parameter is used to indicate whether to skip an affine motion compensation prediction mode;
[0009] Divide the current CTU into blocks using the block division method of the current CTU to obtain at least one coding unit CU;
[0010] For a current CU in the at least one CU, using a prediction mode corresponding to the current CU in the prediction mode of the current CTU, predicting the current CU to obtain a prediction value of the current CU;
[0011] The residual value of the current CU is determined according to the residual value of the current CTU, and the reconstructed value of the current CU is obtained according to the residual value and the predicted value of the current CU.
[0012] In a second aspect, an embodiment of the present application provides a video encoding method, including:
[0013] Determining a block partitioning method and a prediction mode of a current coding tree unit (CTU) according to the severe motion parameter;
[0014] Divide the current CTU into blocks using the block division method of the current CTU to obtain at least one coding unit CU;
[0015] For a current CU in the at least one CU, using a prediction mode corresponding to the current CU in the prediction mode of the current CTU, predicting the current CU to obtain a prediction value of the current CU;
[0016] A residual value of the current CU is determined according to the prediction value of the current CU, and a code stream is obtained according to the residual value of the current CU.
[0017] In a third aspect, the present application provides a video decoding device for executing the method of the first aspect or its respective implementations. Specifically, the decoding device includes a functional unit for executing the method of the first aspect or its respective implementations.
[0018] In a fourth aspect, the present application provides a video encoding device for executing the method of the second aspect or its respective implementations. Specifically, the encoding device includes a functional unit for executing the method of the second aspect or its respective implementations.
[0019] In a fifth aspect, a video decoder is provided, comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to call and execute the computer program stored in the memory to perform the method of the first aspect or its respective implementations.
[0020] In a sixth aspect, a video encoder is provided, comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to call and execute the computer program stored in the memory to perform the method of the second aspect or its respective implementations.
[0021] In a seventh aspect, a video encoding and decoding system is provided, comprising a video encoder and a video decoder. The video encoder is configured to execute the method of the second aspect or its respective implementations, and the video decoder is configured to execute the method of the first aspect or its respective implementations.
[0022] In an eighth aspect, a chip is provided for implementing the method described in any one of the first and second aspects above, or their respective implementations. Specifically, the chip includes a processor configured to load and execute a computer program from a memory, causing a device equipped with the chip to perform the method described in any one of the first and second aspects above, or their respective implementations.
[0023] In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, which enables a computer to execute the method of any one of the first to second aspects or their respective implementations.
[0024] In a tenth aspect, a computer program product is provided, comprising computer program instructions, which enable a computer to execute the method of any one of the first to second aspects or their respective implementations.
[0025] In an eleventh aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method in any one of the first to second aspects or their respective implementations.
[0026] In a twelfth aspect, a code stream is provided, which is generated by any aspect or its implementation methods of the above-mentioned first aspect.
[0027] Based on the above technical solution, by determining the violent motion parameters, it is judged 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 waste of computing resources caused by using the affine motion compensation prediction mode to predict translational motion videos, thereby reducing encoding time, improving video encoding efficiency, and saving computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] FIG1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application;
[0029] FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application;
[0030] FIG3 is a schematic block diagram of a video decoder according to an embodiment of the present application;
[0031] 4A and 4B are schematic diagrams of selecting control points in an affine motion compensation prediction mode according to an embodiment of the present application;
[0032] FIG5 is a schematic diagram of a motion vector of each sub-block determined using an affine motion compensation prediction mode;
[0033] FIG6 is a flow chart of a video decoding method according to an embodiment of the present application;
[0034] FIG7 is a schematic diagram of a video encoding method according to an embodiment of the present application;
[0035] FIG8 is a schematic block diagram of a video decoding device provided in an embodiment of the present application;
[0036] FIG9 is a schematic block diagram of a video encoding apparatus according to an embodiment of the present application;
[0037] FIG10 is a schematic block diagram of an electronic device provided in an embodiment of the present application;
[0038] FIG11 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The present application can be applied to the field of image coding and decoding, the field of video coding and decoding, the field of hardware video coding and decoding, the field of dedicated circuit video coding and decoding, the field of real-time video coding and decoding, etc. For example, the solution of the present application can be combined with an audio and video coding standard (AVS), such as the H.264 / audio and video coding (AVC) standard, the H.265 / high efficiency video coding (HEVC) standard, and the H.266 / versatile video coding (VVC) standard. Alternatively, the solution of the present application can be combined with other proprietary or industry standards and operated, and the standards include ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262 or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO / IEC MPEG-4 AVC), including scalable video coding (SVC) and multi-view video coding (MVC) extensions. It should be understood that the technology of this application is not limited to any specific coding standard or technology.
[0040] For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG1 .
[0041] FIG1 is a schematic block diagram of a video encoding and decoding system involved in an embodiment of the present application. It should be noted that FIG1 is only an example, and the video encoding and decoding system of the embodiment of the present application includes but is not limited to that shown in FIG1. As shown in FIG1, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is used to encode (which can be understood as compressing) the video data 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.
[0042] The encoding device 110 of 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, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, car computers, etc.
[0043] In some embodiments, the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via a channel 130. The channel 130 may include one or more media and / or devices capable of transmitting the encoded video data from the encoding device 110 to the decoding device 120.
[0044] In one example, the channel 130 includes one or more communication media that enable the encoding device 110 to transmit the encoded video data directly to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to the 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.
[0045] In another example, channel 130 includes a storage medium that can store the video data encoded by encoding device 110. The storage medium includes various locally accessible data storage media, such as optical disks, DVDs, and flash memories. In this example, decoding device 120 can retrieve the encoded video data from the storage medium.
[0046] In another example, the channel 130 may include a storage server that can store the video data encoded by the encoding device 110. In this example, the decoding device 120 can download the stored encoded video data from the storage server. Alternatively, the storage server can store the encoded video data and transmit the encoded video data to the decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.
[0047] In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113. The output interface 113 may include a modulator / demodulator (modem) and / or a transmitter.
[0048] In some embodiments, the encoding device 110 may further include a video source 111 in addition to the video encoder 112 and the input interface 113 .
[0049] The video source 111 may include at least one of a video acquisition device (eg, a video camera), a video archive, a video input interface, and a computer graphics system, wherein the video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data.
[0050] The video encoder 112 encodes the video data from the video source 111 to generate a bitstream. The video data may include one or more pictures or a sequence of pictures. The bitstream contains the coding information of the picture or picture sequence in the form of a bitstream. The coding information may include the coded picture data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures. The SPS may contain parameters that apply to one or more sequences. The PPS may contain parameters that apply to one or more pictures. The syntax structure refers to a set of zero or more syntax elements arranged in a specified order in the bitstream.
[0051] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data may also be stored in a storage medium or a storage server for subsequent reading by the decoding device 120.
[0052] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122 .
[0053] In some embodiments, the decoding device 120 may further include a display device 123 in addition to the input interface 121 and the video decoder 122 .
[0054] The input interface 121 includes a receiver and / or a modem and can receive the encoded video data via the channel 130 .
[0055] The video decoder 122 is configured to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123 .
[0056] The decoded video data is displayed on the display device 123. The display device 123 may be integrated with the decoding device 120 or external to the decoding device 120. The display device 123 may include various 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.
[0057] In addition, Figure 1 is only an example, and the technical solution of the embodiment of the present application is 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.
[0058] The following is an introduction to the video encoding framework involved in the embodiments of the present application.
[0059] The following is an introduction to the video encoder involved in the embodiments of the present application.
[0060] FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression or lossless compression on an image. The lossless compression can be visually lossless or mathematically lossless.
[0061] The video encoder 200 can be applied to image data in a luminance and chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) for describing color and saturation. For example, in terms of 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 chrominance components (YYYYCbCrCbCr), and 4:4:4 represents full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0062] For example, the video encoder 200 reads video data, and for each frame of the video data, divides the frame into a number of coding tree units (CTUs). In some examples, CTUs may be referred to as "tree blocks", "largest coding units" (LCUs) or "coding tree blocks" (CTBs). Each CTU may be associated with a pixel block of equal size within the image. Each pixel may correspond to one luminance (luminance or luma) sample and two chrominance (chroma) samples. Therefore, each CTU may be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU may be further divided into a number of coding units (CUs) for encoding. A CU may be a rectangular block or a square block. A CU can be further divided into prediction units (PUs) and transform units (TUs), allowing for separation of coding, prediction, and transform, and greater flexibility in processing. In one example, a CTU is divided into CUs using a quadtree, and a CU is divided into TUs and PUs using a quadtree.
[0063] The video encoder and video decoder can support various PU sizes. Assuming that the size of a particular CU is 2N×2N, the video encoder and video decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and video decoder can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.
[0064] In some embodiments, as shown in FIG2 , 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, a loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may include more, fewer, or different functional components.
[0065] Optionally, in this application, the current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), etc. A prediction block may also be referred to as a predicted image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.
[0066] In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Because there is a strong correlation between adjacent pixels in a video frame, intra-frame prediction is used in video coding and decoding technologies to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in a video, inter-frame prediction is used in video coding and decoding technologies to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.
[0067] The inter-frame prediction unit 211 can be used for inter-frame prediction. Inter-frame prediction can refer to image information from different frames. Inter-frame prediction uses motion information to find a reference block from a reference frame and generate a prediction block based on the reference block to eliminate temporal redundancy. The frames used for inter-frame prediction can be P frames and / or B frames. P frames refer to forward-predicted frames, and B frames refer to bidirectionally predicted frames. Motion information includes the reference frame list in which the reference frame is located, the reference frame index, and the motion vector. The motion vector can be integer pixel or fractional pixel. If the motion vector is fractional pixel, interpolation filtering is required to generate the required fractional pixel block in the reference frame. Here, the integer pixel or fractional pixel block in the reference frame found based on the motion vector is called a reference block. Some technologies directly use the reference block as the prediction block, while others further process the reference block to generate a prediction block. Reprocessing the reference block to generate a prediction block can also be understood as using the reference block as the prediction block and then processing the prediction block to generate a new prediction block.
[0068] The intra-frame prediction unit 212 only refers to the information of the same frame image to predict the pixel information within the current code image block to eliminate spatial redundancy. The frame used for intra-frame prediction can be an I frame. 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 have been encoded and decoded. Some may also be unavailable, for example, if the current block is the leftmost part of the entire frame, then the reference pixels on the left of the current block are unavailable. Or when encoding and decoding the current block, the lower left part of the current block has not been encoded and decoded, then the reference pixels on the lower left are also unavailable. For the case where reference pixels are unavailable, available reference pixels or certain values or certain methods can be used for filling, or no filling can be performed.
[0069] In some embodiments, the intra prediction method further includes a multiple reference line (MRL) intra prediction method. MRL can use more reference pixels to improve coding efficiency.
[0070] There are multiple intra-frame prediction modes. H.264 uses nine intra-frame prediction modes for 4×4 blocks. Mode 0 copies the pixels above the current block vertically to the current block as the prediction value; Mode 1 copies the reference pixels to the left horizontally to the current block as the prediction value; Mode 2 (DC) uses the average of the eight points A to D and I to L as the prediction value for all points; Modes 3 to 8 copy the reference pixels to the corresponding positions in the current block at a specific angle. Because some positions in the current block cannot correspond exactly to the reference pixels, it may be necessary to use a weighted average of the reference pixels, or interpolated sub-pixels of the reference pixels.
[0071] HEVC uses planar, DC, and 33 angle modes for intra-frame prediction, for a total of 35 prediction modes. VVC uses planar, DC, and 65 angle modes for intra-frame prediction, for a total of 67 prediction modes. AVS3 uses DC, Plane, Bilinear, and 63 angle modes for intra-frame prediction, for a total of 66 prediction modes.
[0072] It should be noted that with the increase of angle modes, intra-frame prediction will be more accurate and more in line with the needs of high-definition and ultra-high-definition digital video development.
[0073] The residual unit 220 may generate a residual block for the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate the residual block for the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel blocks of the CU and the corresponding sample in the prediction blocks of the PUs of the CU.
[0074] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of a CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.
[0075] The inverse transform / quantization unit 240 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.
[0076] 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 generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of a CU in this manner, video encoder 200 can reconstruct the pixel blocks of the CU.
[0077] Loop filtering unit 260 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.
[0078] In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive offset (SAO) unit, and an adaptive loop filtering (ALF) unit.
[0079] The decoded image buffer 270 may store the reconstructed pixel blocks. The inter-prediction unit 211 may use a reference image containing the reconstructed pixel blocks to perform inter-prediction on PUs of other images. In addition, the intra-prediction unit 212 may use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra-prediction on other PUs in the same image as the CU.
[0080] The entropy coding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy coding unit 280 may perform one or more entropy coding operations on the quantized transform coefficients to generate entropy-coded data.
[0081] The basic process of video coding involved in this application is as follows: At the encoding end, the current image is divided into blocks. For the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. The residual unit 220 calculates a residual block based on the predicted block and the original block of the current block. This residual block is the difference between the predicted block and the original block of the current block. This residual block can also be referred to as residual information. This residual block undergoes transformation and quantization by the transform / quantization unit 230, removing information that is insensitive to the human eye and eliminating visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization unit 230 can be referred to as a time-domain residual block, and the time-domain residual block after transformation and quantization by the transform / quantization unit 230 can be referred to as a frequency residual block or a frequency-domain residual block. The entropy coding unit 280 receives the quantized transform coefficients output by the transform and quantization unit 230, performs entropy coding on the quantized transform coefficients, and outputs a bitstream. For example, the entropy coding unit 280 can eliminate character redundancy based on the target context model and probability information of the binary bitstream.
[0082] In addition, the video encoder dequantizes and inverse transforms the quantized transform coefficients output by the transform and quantization unit 230 to obtain a residual block for the current block. This residual block is then added to the prediction block for the current block to obtain a reconstructed block for the current block. As encoding progresses, reconstructed blocks corresponding to other image blocks in the current image are obtained. These reconstructed blocks are then spliced together to obtain a reconstructed image of the current image. Because errors are introduced during the encoding process, the reconstructed image is filtered to reduce them. For example, ALF filtering is used to reduce the difference between the pixel values of the reconstructed image and the original pixel values of the pixels in the current image. The filtered reconstructed image is stored in the decoded image buffer 270 and can be used as a reference frame for inter-frame prediction for subsequent frames.
[0083] It should be noted that the block division information determined by the encoder, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and analyzes the existing information to determine the same block division information, prediction, transform, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder, thereby ensuring that the decoded image obtained by the encoder and the decoder are identical.
[0084] FIG3 is a schematic block diagram of a video decoder provided in an embodiment of the present application.
[0085] 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 filter unit 350, and a decoded picture buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.
[0086] The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / transform unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data based on the syntax elements extracted from the bitstream, thereby generating decoded video data.
[0087] In some embodiments, the prediction unit 320 includes an inter-frame prediction unit 321 and an intra-frame prediction unit 322 .
[0088] The inter-frame prediction unit 321 may perform intra-frame prediction to generate a prediction block for the PU. The inter-frame prediction unit 321 may use an intra-frame prediction mode to generate a prediction block for the PU based on the pixel blocks of spatially neighboring PUs. The inter-frame prediction unit 321 may also determine the intra-frame prediction mode of the PU based on one or more syntax elements parsed from the codestream.
[0089] The intra-frame prediction unit 322 may construct a first reference picture list (List 0) and a second reference picture list (List 1) based on syntax elements parsed from the codestream. In addition, if the PU is encoded using inter-frame prediction, the entropy decoding unit 310 may parse the motion information of the PU. The intra-frame prediction unit 322 may determine one or more reference blocks for the PU based on the motion information of the PU. The intra-frame prediction unit 322 may generate a prediction block for the PU based on the one or more reference blocks of the PU.
[0090] The inverse quantization / transform unit 330 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
[0091] After inverse quantizing the transform coefficients, the inverse quantization / transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients in order to generate a residual block associated with the TU.
[0092] The reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 340 can 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.
[0093] The loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.
[0094] In some embodiments, the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive offset (SAO) unit, and an adaptive loop filtering (ALF) unit.
[0095] The video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
[0096] 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, and the prediction unit 320 uses intra-frame prediction or inter-frame prediction for the current block based on the prediction information to generate a prediction block of the current block. The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed 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 block 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 a display device, and on the other hand, it can be stored in the decoded image cache 360 as a reference frame for inter-frame prediction for subsequent frames.
[0097] 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 basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
[0098] As can be seen from the above, the prediction methods currently used in video encoding and decoding include intra-frame prediction and inter-frame prediction. Conventional inter-frame prediction primarily considers translational motion. However, in the real world, in addition to translational motion, there are many other types of motion, such as zooming in / out, rotation, perspective motion, and other irregular motion. Therefore, in some embodiments, a block-based affine motion compensation prediction mode is used for prediction. The following describes the affine motion compensation prediction mode.
[0099] As shown in FIG. 4A and FIG. 4B , the affine motion field of a block is described by motion information of two control points (4 parameters) or three control point motion vectors (6 parameters).
[0100] The block-based affine motion compensation prediction mode includes the following steps:
[0101] Step 1: First, divide the block into 4x4 luminance sub-blocks.
[0102] Step 2: For each luminance sub-block, the motion vector of its central pixel is calculated from the affine vector and then rounded to 1 / 16 precision. The 4-parameter affine motion model and the 6-parameter affine motion model derive motion vectors using different calculation methods.
[0103] For example, for a 4-parameter affine motion model, the motion vector of a sub-block with a central pixel (x, y) is calculated as shown in formula (1):
[0104]
[0105] For example, for a 6-parameter affine motion model, the motion vector of a sub-block with a central pixel (x, y) is calculated as shown in formula (2):
[0106]
[0107] 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.
[0108] Step 3: After the motion vector of each sub-block is calculated (as shown in FIG5 ), motion compensation interpolation filtering is performed according to the motion vector to obtain the predicted value of each sub-block.
[0109] In step 4, the chrominance component is also divided into 4x4 sub-blocks, and its motion vector is equal to the average value of the motion vectors of the four 4x4 luminance sub-blocks associated with it.
[0110] Like the traditional inter-frame motion vector prediction method, affine motion vector also has two prediction methods: affine merge mode and affine AMVP mode.
[0111] Affine merge prediction uses AF_MERGE mode for CUs with a width and height 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 spatially adjacent CUs. Up to five CPMV prediction candidates are generated, and an index is transmitted to indicate which candidate is ultimately used.
[0112] Affine AMVP prediction can be used for CUs with width and height greater than or equal to 16. In merge mode, the predicted CPMV is used directly, while in AMVP mode, the optimal CPMV of the current CU and the residual of the predicted CPMV must be transmitted. The candidate list for affine AMVP prediction contains two candidates.
[0113] In some embodiments, an AFF-based encoding method is as follows: first, the input image is divided into multiple non-overlapping CTUs. Then, each CTU is processed in sequence in raster scan order, and the CTU is divided into several CUs in different ways. The main steps for determining the optimal block division method are as follows:
[0114] Step 11: For the i-th split mode Split[i], calculate the minimum prediction cost CurBestCostInter[i] and the optimal mode CurBestModeInter[i] in the inter prediction mode. Specifically, first use the traditional inter prediction method (without affine prediction) for motion estimation, calculate the prediction cost CurBestCostNoAffine, and save the prediction mode CurBestModeNoAffine. 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 minimum prediction cost CurBestCostInter[i] in the inter prediction mode, and save the corresponding mode as the optimal mode CurBestModeInter[i].
[0115] Step 12: Calculate the minimum prediction cost CurBestCostOther[i] and the optimal prediction mode CurBestModeOther[i] for 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] for the i-th partitioning method.
[0116] Step 13: traverse all preset block partitioning modes and select the block partitioning mode Split[opt] and the corresponding prediction mode bestMode[opt] that minimizes the current CTU prediction cost.
[0117] Step 14: Divide the current CTU according to the optimal block partitioning method to obtain multiple CUs, and use the prediction mode corresponding to the optimal block partitioning method to predict the multiple CUs to obtain predicted values. According to the predicted values and the original values, residual values are obtained, and the residual values are transformed, quantized, and entropy encoded. In addition, the prediction information, including whether the CU uses the AFF identifier cu.affine and the motion vector, is encoded to output the code stream.
[0118] In some embodiments, the decoding method based on AFF is: entropy decoding, inverse quantization, inverse transformation of the input bitstream to obtain the residual value Res, and decoding the bitstream to obtain block division information and prediction information. Then, the image is reconstructed according to the following steps:
[0119] Step 21: Determine the partition tree of the current CTU according to the block partition information.
[0120] Step 22: Process each CU in the partition tree in sequence according to the raster scan order, and calculate the prediction value Pred using the prediction information of each CU, such as the prediction mode bestMode[opt], the identifier cu.affine, and the motion vector.
[0121] In step 23, the residual value Res of the current CU is superimposed with the predicted value Pred 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 and waits for the video to be played.
[0122] As can be seen from the above, AFF complements inter-frame prediction technology to more efficiently express irregular motions such as zooming in / out, rotation, etc. Therefore, for each prediction unit, AFF needs to perform motion estimation on each 4x4 sub-block, resulting in more rate-distortion optimization calculations and a significant increase in encoding complexity. According to statistics, AFF brings an average gain of 2.95% and a 27% increase in encoding complexity in low-latency mode. However, the fundamental reason for AFF's performance improvement lies in irregular motions such as zooming in / out, rotation, etc. In other words, for general translational motion videos, the performance gain brought by AFF is very limited, but it still significantly increases encoding complexity.
[0123] In order to solve the above technical problems, the embodiment of the present application determines whether the current video is a translational motion video by determining the 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 to predict the translational motion video, thereby reducing the encoding time, improving the video encoding efficiency, and saving computing resources.
[0124] The following describes the video encoding and decoding method provided by the embodiments of the present application in conjunction with specific embodiments.
[0125] First, with reference to FIG6 , the video decoding method provided in the embodiment of the present application is introduced by taking the decoding end as an example.
[0126] FIG6 is a flow chart of a video decoding method provided in an embodiment of the present application, which is applied to the video decoders shown in FIG1 and FIG3 .
[0127] As shown in FIG6 , the method of the embodiment of the present application includes:
[0128] S601: Decode the code stream and determine the residual value of the current CTU.
[0129] During video decoding, the decoder receives and decodes the bitstream, determines the block partitioning scheme for the current CTU, and then uses the block partitioning scheme to partition the current CTU into blocks, resulting in at least one CU. The decoder then obtains the quantization coefficients for the current CU within the at least one CU. These coefficients are then dequantized to obtain the transform coefficients for the current CU. These transform coefficients are then detransformed to obtain the residual values for the current CU. The decoder then determines the prediction mode for the current CU and uses the prediction mode to predict the current CU, obtaining the predicted value for the current CU. Based on the predicted value and the residual value for the current CU, the reconstructed value for the current CU is obtained. The reconstructed values for each CU in the current frame form the reconstructed image.
[0130] In some embodiments, loop filtering is performed on the reconstructed image based on an image or a block to obtain a decoded image, which may also be referred to as a reconstructed image. The reconstructed image may be used as a reference frame for inter-frame prediction of subsequent frames.
[0131] In some embodiments, the current CU is also referred to as 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.
[0132] In some embodiments, the current CU of the embodiment of the present application only includes chroma components and can be understood as a chroma block.
[0133] In some embodiments, the current CU of the embodiment of the present application only includes a luminance component, which can be understood as a luminance block.
[0134] In some embodiments, the current CU includes both luma and chroma components.
[0135] In the embodiment of the present application, the decoding end determines the residual value of the current CTU in the following two cases:
[0136] In case 1, if the encoder transforms the residual values of each CU in the current CTU to obtain the transform coefficients of each CU, then directly encodes the transform coefficients of each CU to obtain the bitstream. Correspondingly, the decoder decodes the bitstream to obtain the transform coefficients of the current CTU, and performs an inverse transform on the transform coefficients of the current CTU to obtain the residual values of the current CTU.
[0137] In case 2, if the encoder transforms the residual values of each CU in the current CTU to obtain the transform coefficients of each CU, then quantizes the transform coefficients of each CU to obtain the quantized coefficients of each CU, and encodes the quantized coefficients of each CU to obtain the bitstream. Correspondingly, the decoder decodes the bitstream to obtain the quantized coefficients of the current CTU, dequantizes the quantized coefficients of the current CTU to obtain the transform coefficients of the current CTU, and de-transforms the transform coefficients of the current CTU to obtain the residual values of the current CTU.
[0138] S602: Determine a block partitioning method and a prediction mode for the current CTU.
[0139] The block partitioning method and prediction mode of the current CTU are determined based on a severe motion parameter, and the severe motion parameter is used to indicate whether to skip the affine motion compensation prediction mode.
[0140] It should be noted that the above S602 can be executed before the above S601, or after the above S602, or simultaneously with the above S602, and the embodiment of the present application does not limit this.
[0141] In the embodiment of the present application, since the affine motion compensation prediction mode is relatively complex and occupies 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, rotation, etc. For translational motion videos, the performance gain of the affine motion compensation prediction mode is limited. It can be seen that when the affine motion compensation prediction mode is used to predict 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 parameters and indicates whether the current video is a translational motion video based on the violent motion parameters. If it is determined that 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, thereby improving the encoding efficiency of the video and saving computing resources.
[0142] The violent motion parameter of the embodiment of the present application is used to indicate whether the current video is a translational motion video. If the video is a translational motion video, the affine motion compensation prediction mode is skipped. Therefore, the violent motion parameter of the embodiment of the present application can also be directly used to indicate whether to skip the affine motion compensation prediction mode. For example, if the violent motion parameter is less than a preset value, it is determined that the current video is a translational 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 a translational motion video, and the affine motion compensation prediction mode can be used for prediction.
[0143] In some embodiments, the block division method of the current CTU may 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.
[0144] In some embodiments, the prediction mode of the current CTU may be understood as a set including the prediction mode of each CU in at least one CU included in the current CTU, wherein the prediction mode of the CU may be understood as the optimal prediction mode of the CU.
[0145] In an embodiment of the present application, the prediction mode of the current CTU is a 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 a set consisting of the prediction modes of each CU in the at least one CU is determined as the prediction mode of the current CTU.
[0146] In an 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 as a translational motion video based on the 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 workload when determining the block division method and prediction mode of the current CTU, saving computing resources, and improving the efficiency of determining the block division method and prediction mode of the current CTU.
[0147] Specific methods for determining the block partitioning method and prediction mode of the current CTU in S602 include but are not limited to the following:
[0148] In the first mode, the encoder indicates the block partitioning mode and prediction mode of the current CTU to the decoder, so that the decoder can determine the block partitioning mode and prediction mode of the current CTU based on the indication information. Specifically, the above S602 includes the following S602-A1 and S602-A2:
[0149] S602-A1. Decode the bitstream to obtain at least one of first information and second information, wherein the first information is used to indicate a block partitioning method of the current CTU, and the second information is used to indicate a prediction mode of the current CTU;
[0150] S602-A2: Determine at least one of a block partitioning method and a prediction mode of a current CTU according to at least one of the first information and the second information.
[0151] In this first approach, after determining the block partitioning method and prediction mode for the current CTU based on the severe motion parameter, the encoder writes at least one of first information and second information into the bitstream, where the first information indicates the block partitioning method for the current CTU and the second information indicates the prediction mode for the current CTU. The decoder then decodes the bitstream to obtain at least one of the first and second information, and then determines the block partitioning method for the current CTU based on the first information and / or the prediction mode for the current CTU based on the second information.
[0152] The embodiments of the present application do not limit the specific forms of the first information and the second information.
[0153] In some embodiments, the first information is an index of a block partitioning method of the current CTU.
[0154] In some embodiments, the second information is an index of the prediction mode of the current CTU.
[0155] In addition to using the above steps S602-A1 and S602-A2 to determine the block partitioning method and prediction mode of the current CTU, the decoding end may also determine the block partitioning method and prediction mode of the current CTU according to the following method 2.
[0156] Method 2: The decoding end 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, such as the violent motion parameters determined by the encoding end carried in the bitstream, so that the decoding end can obtain the violent motion parameters by decoding the bitstream. Then, the decoding end determines the block division method and prediction mode of the current CTU based on the violent motion parameters. For example, if the violent motion parameters indicate that the affine motion compensation prediction mode is skipped, the decoding end skips the affine motion compensation prediction mode when determining the block division method and prediction mode of the CTU. For another example, if the violent motion parameters indicate that the affine motion compensation prediction mode is not skipped, the decoding end 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 decoding end determines the block division method and prediction mode of the current CTU, the CU in the current CTU is not reconstructed. In one possible implementation method, the CU template can be used instead of the CU to determine the prediction mode of each CU in the current CTU, wherein the CU template includes the decoded area above the CU and / or the decoded area on the left.
[0157] The embodiment of the present application does not limit the specific method of determining the block division method and prediction mode of the current CTU according to the severe motion parameters.
[0158] In some embodiments, the block partitioning mode of the current CTU is a preset block partitioning mode, and the prediction mode of the CTU is determined based on a severe motion parameter. For example, if the severe motion parameter indicates that the affine motion compensation prediction mode is skipped, 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 that the affine motion compensation prediction mode is not skipped, the affine motion compensation prediction mode is determined as the prediction mode of the CTU.
[0159] In some embodiments, the block division mode and prediction mode of the current CTU are determined based on the optimal prediction mode corresponding to N block division modes, wherein the optimal prediction mode corresponding to the i-th block division mode among the N block division modes is determined based on the violent motion parameter. Specifically, for the i-th block division mode among the N block division modes, the optimal prediction mode corresponding to the i-th block division mode is determined based on the violent motion parameter, so that the optimal prediction mode corresponding to each block division mode among the N block division modes can be determined, and then the block division mode and prediction mode of the current CTU are determined based on the optimal prediction mode corresponding to the N block division modes. For example, the block division mode with the lowest cost among the optimal prediction modes corresponding to the N block division modes is determined as the block division mode of the current CTU, and the optimal prediction mode corresponding to the block division mode of the current CTU is determined as the prediction mode of the current CTU.
[0160] In the embodiment of the present application, there is no limitation on the specific method of determining the optimal prediction mode corresponding to the i-th block division method.
[0161] In some embodiments, if the severe motion parameter indicates to skip the affine motion compensation prediction mode, one or more prediction modes are determined from prediction modes other than the affine motion compensation prediction mode as the optimal prediction mode corresponding to the i-th block partitioning method.
[0162] In some embodiments, if the severe motion parameter indicates that the affine motion compensation prediction mode should not be skipped, the affine motion compensation prediction mode is determined as the optimal prediction mode corresponding to the i-th block partitioning mode.
[0163] In some embodiments, the optimal prediction mode corresponding to the i-th block partitioning method is determined based on the optimal prediction mode of M CUs, wherein the M CUs are obtained by block partitioning the current CTU using the i-th block partitioning method, and the optimal prediction mode of the j-th CU in 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 severe motion parameter.
[0164] Specifically, for the i-th block partitioning method among the N block partitioning methods, the current CTU is partitioned using the i-th block partitioning method to obtain M CUs. Then, based on the severe motion parameter, the optimal prediction mode corresponding to each CU in the M CUs is determined. Specifically, for each CU in the M CUs, for example, the j-th CU, at least one candidate prediction mode for the j-th CU is determined based on the severe motion parameter.
[0165] In some embodiments, if the severe motion parameter indicates to skip the affine motion compensated prediction mode, the at least one candidate prediction mode for the j-th CU does not include the affine motion compensated prediction mode.
[0166] In some embodiments, if the severe motion parameter indicates that the affine motion compensation prediction mode is not skipped, the at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
[0167] 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.
[0168] 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.
[0169] In some embodiments, the optimal prediction mode of the j-th CU is determined from at least one candidate prediction mode according to a cost when predicting the j-th CU by at least one candidate prediction mode of the j-th CU.
[0170] Taking the optimal prediction mode of the j-th CU as the candidate prediction mode with the lowest cost among at least one candidate prediction mode of the j-th CU as an example, in an 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, and for each CU in the M CUs, determine the optimal prediction mode for each CU in the M CUs according to the violent motion parameter. Specifically, for the j-th CU in the M CUs, if the violent motion parameter indicates to skip the affine motion compensation prediction mode, it is determined that the affine motion compensation prediction mode is not included in the at least one candidate prediction mode of the j-th CU; if the violent motion parameter indicates not to skip the affine motion compensation prediction mode, it is determined that the affine motion compensation prediction mode is included in the at least one candidate prediction mode of the j-th CU. Next, each of the at least one candidate prediction mode of the j-th CU is used to predict the j-th CU, obtaining a prediction value corresponding to each candidate prediction mode. Based on the prediction value corresponding to each candidate prediction mode and the original value of the j-th CU, a cost of each candidate prediction mode of the j-th CU is determined. In an embodiment of the present application, to reduce the workload of cost calculation, an approximate cost method can be used to calculate the cost of each candidate prediction mode. For example, an approximate cost such as a sum of absolute differences (SAD) or a sum of absolute transformed differences (SATD) after an adamant transformation is calculated based on the prediction value corresponding to each candidate prediction mode and the original value of the j-th CU. Based on the cost of each candidate prediction mode of the at least one candidate prediction mode of the j-th CU, a candidate prediction mode is determined from the at least one candidate prediction mode as the optimal prediction mode of the j-th CU. For example, the candidate prediction mode with the lowest cost among the at least one candidate prediction mode of the j-th CU is determined as the optimal prediction mode of the j-th CU. By referring to the method for determining the optimal prediction mode for the j-th CU, the optimal prediction mode for each of the M CUs under the i-th block partitioning method can be determined. The optimal prediction mode for each of the M CUs is determined as the optimal prediction mode corresponding to the i-th block partitioning method. The sum of the costs corresponding to the optimal prediction mode for each of the M CUs is determined as the cost corresponding to the i-th block partitioning method. According to the above method for determining the optimal prediction mode and cost corresponding to the i-th block partitioning method, the optimal prediction mode and cost corresponding to each of the N block partitioning methods are determined. Finally, the block partitioning method with the lowest cost among the N block partitioning methods is determined as the block partitioning method of the current CTU, and the optimal prediction mode corresponding to the block partitioning method of the current CTU is then determined as the optimal prediction mode of the current CTU.For example, block partitioning mode 1 is the block partitioning mode with the lowest cost among N block partitioning modes, and thus block partitioning mode 1 is determined as the block partitioning mode of the current CTU. Assuming that block partitioning mode 1 divides the current CTU into 4 CUs, the optimal prediction modes of each CU in these 4 CUs are prediction mode 1, prediction mode 2, prediction mode 3, and prediction mode 4, respectively, and thus prediction mode 1, prediction mode 2, prediction mode 3, and prediction mode 4 are determined as the optimal prediction modes of the current CTU.
[0171] From the above, it can be seen 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 severe 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 the encoding performance.
[0172] The following is an introduction to the process of determining the intense exercise parameters of the embodiment of the present application.
[0173] In some embodiments, the above-mentioned severe motion parameter includes at least one of a severe motion parameter of the current frame, a severe motion parameter of the current CTU, and a severe motion parameter of the current CU. In other words, the severe motion parameter in the embodiment of the present application includes at least one of a frame-level severe motion parameter, a CTU-level motion translation parameter, and a CU-level motion parameter.
[0174] 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 value, 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 mode and reducing the amount of calculation for determining the prediction mode. If the violent motion parameter of the current frame is greater than or equal to the first threshold value, it means that the current frame is not a translational motion video. At this time, when determining the prediction mode, the affine motion compensation prediction mode is tried, thereby improving the accuracy of determining the prediction mode and improving the encoding effect.
[0175] The embodiment of the present application does not limit the specific value of the first threshold.
[0176] The embodiment of the present application does not limit the specific method of determining the violent motion parameters of the current frame.
[0177] 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, the violent motion parameters of the current frame are determined based on the translation displacement of the pixels in the current frame relative to the pixels in the previous frame.
[0178] In some embodiments, the violent motion parameter of the current frame is determined based on the violent motion parameters of the 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 kth CTU is determined based on the kth CTU and the reference CTU of the kth 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.
[0179] Specifically, the current frame is divided into K CTUs, the violent motion parameters of each CTU in the K CTUs are determined, and the violent motion parameters of the current frame are determined based on the violent motion parameters of each CTU in the K CTUs. Specifically, for the k-th CTU in the K CTUs, the reference CTU of the K-th CTU is determined in the frame before the current frame, and then the violent motion parameters of the k-th CTU are determined based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame. With reference to the above-mentioned method for determining the violent motion parameters of the k-th CTU, the violent motion parameters of each CTU in the K CTUs included in the current frame can be determined, and then the violent motion parameters of the current frame can be determined based on the violent motion parameters of each CTU in the K CTUs.
[0180] The embodiment of the present application does not limit the specific method of determining the violent motion parameter of the k-th CTU.
[0181] In some embodiments, the severe motion parameter of the kth CTU is determined based on the pixel values of the kth CTU and the pixel values of the reference CTU. That is, the severe motion parameter of the kth CTU is determined based on the pixel values of the kth CTU and the pixel values of the reference CTU.
[0182] For example, based on the pixel values of the pixels in the kth CTU and the pixel values of the pixels in the reference CTU, the translation displacement of the kth CTU relative to the reference CTU is determined, and then based on the translation displacement of the kth CTU relative to the reference CTU, the violent motion parameter of the kth CTU is determined.
[0183] For another example, the severe motion parameter of the kth CTU is determined based on the absolute difference between the pixel values of the kth CTU and the pixel values of the reference CTU. That is, for each pixel in the kth CTU, the absolute difference between the pixel value of the pixel in the kth CTU and the pixel value in the reference CTU is determined. Then, the severe motion parameter of the kth CTU is determined based on the absolute difference between the pixel values of each pixel in the kth CTU and each pixel in the reference CTU.
[0184] In one example, the severe motion parameter of the kth CTU is determined according to the following formula (3):
[0185]
[0186] Among them, MS_CTU k is the violent motion parameter of the kth CTU, CTU k Ori (x,y) is the pixel value of the kth CTU at position (x,y), and CTU k Ref (x, y) is the pixel value of the k-th CTU at the reference CTU in the previous frame at position (x, y). k -H is the height of the kth CTU and the reference CTU, CTU k -W is the width of the k-th CTU and the reference CTU.
[0187] 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 the K CTUs included in the current frame.
[0188] In some embodiments, the sum of the severe motion parameters of the K CTUs included in the current frame is determined as the severe motion parameter of the current frame.
[0189] In some embodiments, the severe motion parameter of the current frame is determined based on the severe motion parameters of P CTUs among the K CTUs whose severe motion parameters are greater than a first preset value, where P is a positive integer less than or equal to K. Specifically, based on the severe motion parameter of each CTU among the K CTUs included in the current frame, P CTUs whose severe motion parameters are greater than the first preset value are selected from the K CTUs, and the severe motion parameter of the current frame is determined based on the severe motion parameters of the P CTUs.
[0190] In a possible implementation, the sum of the severe motion parameters of the P CTUs is determined as the severe motion parameter of the current frame.
[0191] 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 the P CTUs. Exemplarily, 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. For example, the violent motion parameter of the current frame is determined according to the following formula (4):
[0192]
[0193] Among them, MS is the severe motion parameter of the current frame, is the sum of the violent motion parameters of P CTUs.
[0194] The embodiment of the present application does not limit the specific value of the above-mentioned first preset value.
[0195] The above describes the specific process of determining the violent motion parameters of the current frame. The following describes the process of determining the violent motion parameters of the current CTU.
[0196] The violent motion parameter of the current CTU in the 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 value, it means that the current CTU is a translational motion type 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 mode and reducing the amount of calculation for determining the prediction mode. If the violent motion parameter of the current CTU is greater than or equal to the second threshold value, it means that the current CTU is not a translational motion type video. At this time, when determining the prediction mode, the affine motion compensation prediction mode is tried, thereby improving the accuracy of determining the prediction mode and improving the encoding effect.
[0197] The embodiment of the present application does not limit the specific value of the second threshold.
[0198] The embodiment of the present application does not limit the specific method of determining the intense exercise parameters of the current CTU.
[0199] 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 previous to the current frame. For example, the severe motion parameter of the current CTU is determined based on the translation displacement of a pixel point in the current CTU relative to a pixel point of a reference CTU of the current CTU in a frame previous to the current frame.
[0200] The embodiment of the present application does not limit the specific method of determining the strenuous exercise parameters of the current CTU.
[0201] In some embodiments, the severe motion parameter of the current CTU is determined based on the pixel values of the current CTU and the pixel values of the reference CTU. That is, the severe motion parameter of the current CTU is determined based on the pixel values of the current CTU and the pixel values of the reference CTU.
[0202] For example, the translation displacement of the current CTU relative to the reference CTU is determined based on the pixel values of the pixels in the current CTU and the pixel values of the pixels in the reference CTU, and then the severe motion parameter of the current CTU is determined based on the translation displacement of the current CTU relative to the reference CTU.
[0203] For another example, the severe motion parameter of the current CTU is determined based on the absolute difference between the pixel values of the current CTU and the pixel values of the reference CTU. That is, for each pixel in the current CTU, the absolute difference between the pixel value in the current CTU and the pixel value in the reference CTU is determined. Then, the severe motion parameter of the current CTU is determined based on the absolute difference between the pixel values of each pixel in the current CTU and each pixel in the reference CTU.
[0204] In one example, the strenuous exercise parameter of the current CTU is determined according to the following formula (5):
[0205]
[0206] Among them, MS_CTU is the intense 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 pixel value of the reference CTU at position (x, y) of the current CTU in the previous frame, 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.
[0207] The above describes the specific process of determining the severe motion parameters of the current CTU. The following describes the process of determining the severe motion parameters of the current CU.
[0208] In the embodiment of the present application, the violent motion parameter of the current CU 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 value, it means that the current CU is a translational motion type video. At this time, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of determining the prediction mode and reducing the amount of calculation for determining the prediction mode. If the violent motion parameter of the current CU is greater than or equal to the third threshold value, it means that the current CU is not a translational motion type video. At this time, when determining the prediction mode, the affine motion compensation prediction mode is tried, thereby improving the accuracy of determining the prediction mode and improving the encoding effect.
[0209] The embodiment of the present application does not limit the specific value of the third threshold.
[0210] The embodiment of the present application does not limit the specific method of determining the severe motion parameters of the current CU.
[0211] 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, the violent motion parameters of the current CU are determined based on the translation displacement of the pixel points in the current CU relative to the pixel points of the reference CU of the current CU in the previous frame.
[0212] The embodiment of the present application does not limit the specific method of determining the severe motion parameters of the current CU.
[0213] In some embodiments, the severe motion parameter of the current CU is determined based on the pixel values of the current CU and the pixel values of the reference CU, that is, the severe motion parameter of the current CU is determined based on the pixel values of the current CU and the pixel values of the reference CU.
[0214] For example, the translation displacement of the current CU relative to the reference CU is determined based on the pixel values of the pixels in the current CU and the pixel values of the pixels in the reference CU, and then the violent motion parameters of the current CU are determined based on the translation displacement of the current CU relative to the reference CU.
[0215] For another example, the violent motion parameter of the current CU is determined based on the absolute difference between the pixel values of the current CU and the pixel values of the reference CU. That is, for each pixel in the current CU, the absolute difference between the pixel value in the current CU and the pixel value in the reference CU is determined, and then the violent motion parameter of the current CU is determined based on the absolute difference between the pixel values of each pixel in the current CU and each pixel in the reference CU.
[0216] In one example, the severe motion parameter of the current CU is determined according to the following formula (6):
[0217]
[0218] Among them, MS_CU is the severe 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 pixel value of the reference CU of the current CU in the previous frame 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.
[0219] The above describes in detail the violent motion parameters of the current frame, the current CTU, and the current CU in the embodiment of the present application. In this way, during prediction, it is possible to determine whether to skip the affine motion compensation prediction mode based on the violent motion parameters, thereby saving computing resources and improving prediction efficiency.
[0220] In some embodiments, the above-mentioned intense motion parameters are determined under preset conditions. That is, before determining the intense motion parameters, it is first determined whether the preset conditions are met. If the preset conditions are met, the intense motion parameters are determined. Therefore, the preset conditions in the embodiments of the present application can be understood as the conditions that need to be met in order to execute the affine motion compensation prediction mode.
[0221] The embodiments of the present application do not limit the specific content of the above-mentioned preset conditions.
[0222] In a possible implementation, the preset condition includes that the value of the first flag is a first value, and the size of the current CU satisfies at least one of the preset sizes.
[0223] The first flag is used to indicate whether the current sequence allows the use of the affine motion compensation prediction mode, and the first value is used to indicate that the current sequence allows the use of the affine motion compensation prediction mode.
[0224] For example, when the value of the first flag is a first 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 value, it indicates that the current sequence is not allowed to use the affine motion compensation prediction mode.
[0225] The embodiment of the present application does not limit the specific values of the first and second values.
[0226] Optionally, the first value is 1.
[0227] Optionally, the second value is 0.
[0228] The above-mentioned first flag can be obtained by decoding the code stream. That is, if the encoding end determines that the current sequence does not allow the use of the 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, if the encoding end 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 decoding end decodes the code stream, obtains 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 does not allow the use of the 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 directly skipped. If the value of the first flag is 1, it is determined that the current sequence allows the use of the affine motion compensation prediction mode. At this time, it is determined whether the limiting conditions of other affine motion compensation prediction modes are met, such as whether the size of the current CU meets the preset size. If the size of the current CU meets the preset size, the violent motion parameters are determined.
[0229] The embodiment of the present application does not limit the specific value of the preset scale satisfied by the size of the current CU. 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 preset size is that the area of the CU is greater than a certain preset value.
[0230] In some embodiments, if the translation operation parameter is a violent motion parameter of the current frame, the preset condition includes the first flag being a first value. That is, when the first flag is a first value, the violent motion parameter of the current frame is determined.
[0231] In some embodiments, if the translation operation parameter is a severe motion parameter of the current CTU, the preset condition includes the first flag being a first value. In other words, the severe motion parameter of the current CTU is determined when the first flag is a first value.
[0232] In some embodiments, if the translation operation parameter is a severe motion parameter of the current CU, the preset condition includes the first flag having a first value and the current CU size meeting a preset size. In other words, the severe motion parameter of the current CU is determined when the first flag has a first value and the current CU size meets the preset size.
[0233] Exemplarily, the first flag may be represented by sps_affine_enable_flag.
[0234] In some embodiments, when determining the optimal prediction mode of the current CU, if the value of the first flag is the first numerical value, the severe motion parameter indicates that the affine motion compensation prediction mode is not skipped, and the size of the current CU meets the prediction size, the affine motion compensation prediction mode is used to perform motion estimation on the current CU, and the prediction cost CurBestCostAffine is calculated, and the prediction mode CurBestModeAffine is saved. At the same time, the prediction cost corresponding to each candidate prediction mode of the current CU is calculated, the prediction cost corresponding to the affine motion compensation prediction mode is compared with the prediction costs corresponding to the other candidate prediction modes, and the prediction mode with the smallest cost is selected as the optimal prediction mode for the current CU.
[0235] In some embodiments, if the value of the first flag is not equal to the first numerical value, and / or the violent motion parameter indicates to skip the affine motion compensation prediction mode, and / or the size of the current CU does not meet the prediction size, the affine motion compensation prediction mode is skipped, and a prediction mode other than the affine motion compensation prediction mode is used to predict the current CU, and the cost corresponding to each prediction mode is obtained, and the prediction mode with the lowest cost is determined as the optimal prediction mode of the current CU.
[0236] The above describes the process of determining the severe motion parameters and how the block partitioning scheme and prediction mode of the current CTU are determined based on the severe motion parameters. After determining the block partitioning scheme and prediction mode of the current CTU, the decoder performs reconstruction based on the block partitioning scheme and prediction mode of the current CTU. For details, refer to the description of S603 to S605 below.
[0237] S603: Divide the current CTU into blocks using the block division method of the current CTU to obtain at least one CU.
[0238] S604 : For a current CU in the at least one CU, use a prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU and obtain a prediction value of the current CU.
[0239] In an embodiment of the present application, the decoding end determines the block partitioning method and prediction mode of the current CTU according to the above S602, and then uses the block partitioning method of the current CTU to block the current CTU, for example, dividing the current CTU into at least one CU. For the current CU in the at least one CU, 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 a prediction value of the current CU. In other words, the prediction mode of the current CTU includes the prediction mode of each CU in the at least one CU. In this way, when determining the prediction value of each CU in the at least one CU, the prediction mode corresponding to the CU in the prediction mode of the CTU can be used to predict the CU to obtain the prediction value of the CU.
[0240] S605 : Determine the residual value of the current CU according to the residual value of the current CTU, and obtain the reconstructed value of the current CU according to the residual value and the predicted value of the current CU.
[0241] The decoding end determines the residual value of the current CTU by decoding the bitstream according to the above step S601. In this way, the residual value of the current CU in the current CTU can be determined according to the block division method of the current CTU.
[0242] Next, the reconstructed value of the current CU is determined according to the residual value and the predicted value of the current CU. For example, the sum of the residual value and the predicted value of the current CU is determined as the reconstructed value of the current CU.
[0243] In some embodiments, the reconstructed value of the current CU is filtered to obtain a filtered reconstructed value. For example, the reconstructed value of the current CU is filtered using DBF, SAO, ALF, etc., and the filtered image is sent to a buffer for waiting for video playback.
[0244] The video decoding method provided in 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, the block division method and prediction mode of the current CTU are determined based on the severe motion parameter, and the severe motion parameter is used to indicate whether to skip the affine motion compensation prediction mode; uses 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, uses 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; determines the residual value of the current CU based on the residual value of the current CTU, and obtains the reconstructed value of the current CU based on the residual value and prediction value of the current CU. That is, in the embodiment of the present application, the severe motion parameter is 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 waste of computing resources caused by using the affine motion compensation prediction mode to predict the translational motion video, thereby reducing encoding time, improving video encoding efficiency, and saving computing resources.
[0245] The above describes the decoding method according to the embodiment of the present application. Based on this, the following describes the encoding method provided by the embodiment of the present application.
[0246] FIG7 is a flow chart of a video encoding method according to an embodiment of the present application, which is applied to the encoders shown in FIG1 and FIG2. As shown in FIG7, the method according to the embodiment of the present application includes:
[0247] S701. Determine intense exercise parameters.
[0248] The severe motion parameter is used to indicate whether to skip the affine motion compensation prediction mode.
[0249] In some embodiments, the current CU is also referred to as 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.
[0250] In some embodiments, the current CU of the embodiment of the present application only includes chroma components and can be understood as a chroma block.
[0251] In some embodiments, the current CU of the embodiment of the present application only includes a luminance component, which can be understood as a luminance block.
[0252] In some embodiments, the current CU includes both luma and chroma components.
[0253] The encoding process of the embodiment of the present application is as follows: the current image frame is divided into blocks to obtain the current CU, the prediction mode of the current CU is determined, and the current CU is predicted using the prediction mode of the current CU to obtain the predicted 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 residual value of the current CU is transformed to obtain a transform coefficient. Optionally, the transform coefficient is quantized and the quantized transform coefficient is encoded to obtain a bitstream.
[0254] The embodiment of the present application involves the prediction process in the above-mentioned encoding process.
[0255] In the embodiment of the present application, since the affine motion compensation prediction mode is relatively complex and occupies more computing resources, the encoding efficiency is low. In addition, the affine motion compensation prediction mode is mainly used to efficiently express irregular motions such as zooming in / out, rotation, etc. For translational motion videos, the performance gain of the affine motion compensation prediction mode is limited. It can be seen that when the affine motion compensation prediction mode is used to predict 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 parameters and indicates whether the current video is a translational motion video based on the violent motion parameters. If it is determined that 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, thereby improving the encoding efficiency of the video and saving computing resources.
[0256] The violent motion parameter of the embodiment of the present application is used to indicate whether the current video is a translational motion video. If the video is a translational motion video, the affine motion compensation prediction mode is skipped. Therefore, the violent motion parameter of the embodiment of the present application can also be directly used to indicate whether to skip the affine motion compensation prediction mode. For example, if the violent motion parameter is less than a preset value, it is determined that the current video is a translational motion video. In this case, the affine motion compensation prediction mode is skipped, thereby avoiding the waste of computing resources caused by using the affine motion compensation prediction mode to predict the translational motion video, thereby improving the video encoding efficiency and saving computing resources.
[0257] If the violent motion parameter is greater than or equal to a preset value, it is determined that the current video is not a translational motion video. At this time, an affine motion compensation prediction mode can be tried for prediction to improve the encoding effect of the video.
[0258] The process of determining the intense exercise parameters in S701 is described below.
[0259] In some embodiments, the above-mentioned severe motion parameter includes at least one of a severe motion parameter of the current frame, a severe motion parameter of the current CTU, and a severe motion parameter of the current CU. In other words, the severe motion parameter in the embodiment of the present application includes at least one of a frame-level severe motion parameter, a CTU-level motion translation parameter, and a CU-level motion parameter.
[0260] 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 value, 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 mode and reducing the amount of calculation for determining the prediction mode. If the violent motion parameter of the current frame is greater than or equal to the first threshold value, it means that the current frame is not a translational motion video. At this time, when determining the prediction mode, the affine motion compensation prediction mode is tried, thereby improving the accuracy of determining the prediction mode and improving the encoding effect.
[0261] The embodiment of the present application does not limit the specific value of the first threshold.
[0262] The embodiment of the present application does not limit the specific method of determining the violent motion parameters of the current frame.
[0263] In some embodiments, if the violent motion parameter includes a violent motion parameter of the current frame, the encoder determines the violent motion parameter of the current frame based on the translation displacement of pixels in the current frame relative to pixels in the previous frame.
[0264] In some embodiments, if the severe motion parameter includes the severe motion parameter of the current frame, the encoder determines the severe motion parameter of the current frame according to the following steps S701-A1 and S701-A21:
[0265] S701-A1. For a k-th CTU among K CTUs included in a current frame, determine a severe motion parameter of the k-th CTU based on the k-th CTU and a reference CTU of the k-th CTU in a frame previous to the current frame, where K is a positive integer and k is a positive integer less than or equal to K.
[0266] S701-A2: Determine the severe motion parameter of the current frame according to the severe motion parameters of the K CTUs included in the current frame.
[0267] Specifically, the current frame is divided into K CTUs, the violent motion parameters of each CTU in the K CTUs are determined, and the violent motion parameters of the current frame are determined based on the violent motion parameters of each CTU in the K CTUs. Specifically, for the k-th CTU in the K CTUs, the reference CTU of the K-th CTU is determined in the frame before the current frame, and then the violent motion parameters of the k-th CTU are determined based on the k-th CTU and the reference CTU of the k-th CTU in the previous frame. With reference to the above-mentioned method for determining the violent motion parameters of the k-th CTU, the violent motion parameters of each CTU in the K CTUs included in the current frame can be determined, and then the violent motion parameters of the current frame can be determined based on the violent motion parameters of each CTU in the K CTUs.
[0268] The embodiment of the present application does not limit the specific method of determining the violent motion parameter of the kth CTU in the above S701-A1.
[0269] In some embodiments, the above S701-A1 includes the following S701-A11:
[0270] S701-A11. Determine a severe motion parameter of the k-th CTU according to the pixel value of the k-th CTU and the pixel value of the reference CTU.
[0271] For example, based on the pixel values of the pixels in the kth CTU and the pixel values of the pixels in the reference CTU, the translation displacement of the kth CTU relative to the reference CTU is determined, and then based on the translation displacement of the kth CTU relative to the reference CTU, the violent motion parameter of the kth CTU is determined.
[0272] For another example, for each pixel in the kth CTU, the absolute difference between the pixel value of the pixel in the kth CTU and the pixel value in the reference CTU is determined, and then the violent motion parameter of the kth CTU is determined based on the absolute difference between the pixel values of each pixel in the kth CTU and each pixel in the reference CTU.
[0273] In one example, the severe motion parameter of the kth CTU is determined according to the above formula (3).
[0274] 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 the K CTUs included in the current frame in the above S701-A2.
[0275] In some embodiments, the above S701-A2 includes: determining the sum of the severe motion parameters of the K CTUs included in the current frame as the severe motion parameter of the current frame.
[0276] In some embodiments, the above S701-A2 includes the following steps S701-A21 and S701-A22:
[0277] S701-A21. Select P CTUs whose severe exercise parameters are greater than a first preset value from K CTUs, where P is a positive integer less than or equal to K.
[0278] S701-A22. Determine the severe motion parameters of the current frame according to the severe motion parameters of the P CTUs.
[0279] The embodiment of the present application does not limit the specific value of the above-mentioned first preset value.
[0280] 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.
[0281] In another example, the severe motion parameter of the current frame is determined according to the sum of the severe motion parameters of the P CTUs and the total area of the P CTUs.
[0282] For example, the ratio of the sum of the violent motion parameters of P CTUs to the total area of the P CTUs is determined as the violent motion parameter of the current frame.
[0283] Exemplarily, the violent motion parameter of the current frame is determined according to the above formula (4).
[0284] The above describes the specific process of determining the violent motion parameters of the current frame. The following describes the process of determining the violent motion parameters of the current CTU.
[0285] The violent motion parameter of the current CTU in the 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 value, it means that the current CTU is a translational motion type 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 mode and reducing the amount of calculation for determining the prediction mode. If the violent motion parameter of the current CTU is greater than or equal to the second threshold value, it means that the current CTU is not a translational motion type video. At this time, when determining the prediction mode, the affine motion compensation prediction mode is tried, thereby improving the accuracy of determining the prediction mode and improving the encoding effect.
[0286] The embodiment of the present application does not limit the specific value of the second threshold.
[0287] The embodiment of the present application does not limit the specific method of determining the intense exercise parameters of the current CTU.
[0288] In some embodiments, if the severe motion parameter includes the severe motion parameter of the current CTU, the encoder determines the severe motion parameter of the current CTU based on the translation displacement of the pixel points in the current CTU relative to the pixel points of the reference CTU of the current CTU in the previous frame.
[0289] In some embodiments, if the severe motion parameter includes the severe motion parameter of the current CTU, the encoder determines the severe motion parameter of the current CTU through the following step S701-B:
[0290] S701-B: Determine a severe motion parameter of the current CTU according to the current CTU and a reference CTU of the current CTU in a frame previous to the current frame.
[0291] The embodiment of the present application does not limit the specific implementation method of the above S701-B.
[0292] In some embodiments, S701 -B includes determining a severe motion parameter of the current CTU based on pixel values of the current CTU and pixel values of a reference CTU.
[0293] In one example, a translation displacement of the current CTU relative to the reference CTU is determined based on pixel values of pixels in the current CTU and pixel values of pixels in the reference CTU, and then a severe motion parameter of the current CTU is determined based on the translation displacement of the current CTU relative to the reference CTU.
[0294] In another example, the severe motion parameter of the current CTU is determined according to the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU.
[0295] For example, for each pixel in the current CTU, the absolute difference between the pixel value in the current CTU and the pixel value in the reference CTU is determined. Then, based on the absolute difference between the pixel values of each pixel in the current CTU and each pixel in the reference CTU, the violent motion parameter of the current CTU is determined.
[0296] Exemplarily, the severe motion parameter of the current CTU is determined according to the above formula (5).
[0297] The above describes the specific process of determining the severe motion parameters of the current CTU. The following describes the process of determining the severe motion parameters of the current CU.
[0298] In the embodiment of the present application, the violent motion parameter of the current CU 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 value, it means that the current CU is a translational motion type video. At this time, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of determining the prediction mode and reducing the amount of calculation for determining the prediction mode. If the violent motion parameter of the current CU is greater than or equal to the third threshold value, it means that the current CU is not a translational motion type video. At this time, when determining the prediction mode, the affine motion compensation prediction mode is tried, thereby improving the accuracy of determining the prediction mode and improving the encoding effect.
[0299] The embodiment of the present application does not limit the specific value of the third threshold.
[0300] The embodiment of the present application does not limit the specific method of determining the severe motion parameters of the current CU.
[0301] In some embodiments, the encoder determines the severe motion parameter of the current CU based on the translation displacement of pixels in the current CU relative to pixels of a reference CU of the current CU in a previous frame.
[0302] In some embodiments, the encoder determines the severe motion parameter of the current CU according to the following step S701-C:
[0303] S701-C. Determine a severe motion parameter of the current CU according to the pixel values of the current CU and the pixel values of the reference CU.
[0304] In one example, the translation displacement of the current CU relative to the reference CU is determined based on the pixel values of the pixels in the current CU and the pixel values of the pixels in the reference CU, and then the violent motion parameters of the current CU are determined based on the translation displacement of the current CU relative to the reference CU.
[0305] In another example, the severe motion parameter of the current CU is determined according to the absolute difference between the pixel value of the current CU and the pixel value of the reference CU.
[0306] 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 violent motion parameter of the current CU based on the absolute difference between the pixel values of each pixel in the current CU and each pixel in the reference CU.
[0307] Exemplarily, the severe motion parameter of the current CU is determined according to the above formula (6).
[0308] The above describes in detail the violent motion parameters of the current frame, the current CTU, and the current CU in the embodiment of the present application. In this way, during prediction, it is possible to determine whether to skip the affine motion compensation prediction mode based on the violent motion parameters, thereby saving computing resources and improving prediction efficiency.
[0309] In some embodiments, under preset conditions, the above-mentioned step S701 is executed to determine the severe motion parameter. That is, before determining the severe motion parameter, it is first determined whether the preset condition is met. If the preset condition is met, the severe motion parameter is determined. Therefore, the preset condition in the embodiment of the present application can be understood as the condition that needs to be met for executing the affine motion compensation prediction mode.
[0310] The embodiments of the present application do not limit the specific content of the above-mentioned preset conditions.
[0311] In a possible implementation, the preset condition includes that the value of the first flag is a first value, and the size of the current CU satisfies at least one of the preset sizes.
[0312] The first flag is used to indicate whether the current sequence allows the use of the affine motion compensation prediction mode, and the first value is used to indicate that the current sequence allows the use of the affine motion compensation prediction mode.
[0313] For example, when the value of the first flag is a first 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 value, it indicates that the current sequence is not allowed to use the affine motion compensation prediction mode.
[0314] The embodiment of the present application does not limit the specific values of the first and second values.
[0315] Optionally, the first value is 1.
[0316] Optionally, the second value is 0.
[0317] That is, when the encoder determines that the affine motion compensation prediction mode is not allowed to be used in the current sequence, the encoder sets the value of the first flag to 0 and writes the first flag set to 0 into the bitstream. Alternatively, when the encoder determines that the affine motion compensation prediction mode is allowed to be used in the current sequence, the encoder sets the value of the first flag to 1 and writes the first flag set to 1 into the bitstream. In this way, the decoder decodes the bitstream to obtain the first flag and determines whether the affine motion compensation prediction mode is allowed to be used in the current sequence based on the first flag. For example, if the value of the first flag is 0, it is determined that the affine motion compensation prediction mode is not allowed to be used in the current sequence.
[0318] The embodiment of the present application does not limit the specific value of the preset scale satisfied by the size of the current CU. 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 preset size is that the area of the CU is greater than a certain preset value.
[0319] In some embodiments, if the translation operation parameter is a violent motion parameter of the current frame, the preset condition includes the first flag being a first value. That is, when the first flag is a first value, the violent motion parameter of the current frame is determined.
[0320] In some embodiments, if the translation operation parameter is a severe motion parameter of the current CTU, the preset condition includes the first flag being a first value. In other words, the severe motion parameter of the current CTU is determined when the first flag is a first value.
[0321] In some embodiments, if the translation operation parameter is a severe motion parameter of the current CU, the preset condition includes the first flag having a first value and the current CU size meeting a preset size. In other words, the severe motion parameter of the current CU is determined when the first flag has a first value and the current CU size meets the preset size.
[0322] Exemplarily, the first flag may be represented by sps_affine_enable_flag.
[0323] In some embodiments, when determining the optimal prediction mode of the current CU, if the value of the first flag is the first numerical value, the severe motion parameter indicates that the affine motion compensation prediction mode is not skipped, and the size of the current CU meets the prediction size, the affine motion compensation prediction mode is used to perform motion estimation on the current CU, and the prediction cost CurBestCostAffine is calculated, and the prediction mode CurBestModeAffine is saved. At the same time, the prediction cost corresponding to each candidate prediction mode of the current CU is calculated, the prediction cost corresponding to the affine motion compensation prediction mode is compared with the prediction costs corresponding to the other candidate prediction modes, and the prediction mode with the smallest cost is selected as the optimal prediction mode for the current CU.
[0324] In some embodiments, if the value of the first flag is not equal to the first numerical value, and / or the violent motion parameter indicates to skip the affine motion compensation prediction mode, and / or the size of the current CU does not meet the prediction size, the affine motion compensation prediction mode is skipped, and a prediction mode other than the affine motion compensation prediction mode is used to predict the current CU, and the cost corresponding to each prediction mode is obtained, and the prediction mode with the lowest cost is determined as the optimal prediction mode of the current CU.
[0325] The above describes the process of determining the violent motion parameters. After the encoder determines the violent motion parameters according to the above steps, it executes the following step S702.
[0326] S702: Determine a block partitioning method and a prediction mode for the current CTU according to the violent motion parameter.
[0327] In some embodiments, the block division method of the current CTU may 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.
[0328] In some embodiments, the prediction mode of the current CTU may be understood as a set including the prediction mode of each CU in at least one CU included in the current CTU, wherein the prediction mode of the CU may be understood as the optimal prediction mode of the CU.
[0329] In an embodiment of the present application, the prediction mode of the current CTU is a 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 a set consisting of the prediction modes of each CU in the at least one CU is determined as the prediction mode of the current CTU.
[0330] In an embodiment of the present application, when the current video is judged to be a translational motion video based on the intense 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 workload when determining the block division method and prediction mode of the current CTU, saving computing resources, and improving the efficiency of determining the block division method and prediction mode of the current CTU.
[0331] The embodiment of the present application does not limit the specific method of determining the block division method and prediction mode of the current CTU according to the severe motion parameter in the above S702.
[0332] In some embodiments, the block partitioning mode of the current CTU is a preset block partitioning mode, and the prediction mode of the CTU is determined based on a severe motion parameter. For example, if the severe motion parameter indicates that the affine motion compensation prediction mode is skipped, one or more prediction modes other than the non-affine motion compensation prediction mode are determined as the prediction mode of the CTU. If the severe motion parameter indicates that the affine motion compensation prediction mode is not skipped, the affine motion compensation prediction mode is determined as the prediction mode of the CTU.
[0333] In some embodiments, the above S702 includes the following steps S702-A1 to S702-A2:
[0334] S702-A1. For an i-th block division method among N preset block division methods, determine an optimal prediction mode corresponding to the i-th block division method according to the intense motion parameter, where N is a positive integer and i is a positive integer less than or equal to N.
[0335] S702-A2: Determine the block partitioning mode and prediction mode of the current CTU according to the optimal prediction mode corresponding to the N block partitioning modes.
[0336] 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 based on the severe motion parameter. In this way, the optimal prediction mode corresponding to each of the N block division methods can be determined. Next, based on the optimal prediction modes corresponding to the N block division methods, the block division method and prediction mode of the current CTU are determined. For example, the block division method with the lowest cost among the optimal prediction modes corresponding to the N block division methods 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.
[0337] In the embodiment of the present application, there is no limitation on the specific method of determining the optimal prediction mode corresponding to the i-th block division method.
[0338] In some embodiments, if the severe motion parameter indicates to skip the affine motion compensation prediction mode, one or more prediction modes are determined from prediction modes other than the affine motion compensation prediction mode as the optimal prediction mode corresponding to the i-th block partitioning method.
[0339] In some embodiments, if the severe motion parameter indicates that the affine motion compensation prediction mode should not be skipped, the affine motion compensation prediction mode is determined as the optimal prediction mode corresponding to the i-th block partitioning mode.
[0340] In some embodiments, determining the optimal prediction mode corresponding to the i-th block division method according to the severe motion parameter in S702-A1 includes the following steps:
[0341] S702-A11. Divide the current CTU into blocks using the i-th block division method to obtain M CUs, where M is a positive integer.
[0342] S702-A12: For a j-th CU among the M CUs, determine at least one candidate prediction mode for the j-th CU according to the severe motion parameter, where j is a positive integer less than or equal to M.
[0343] S702-A13, determining an optimal prediction mode for the j-th CU from at least one candidate prediction mode for the j-th CU;
[0344] S702-A14. Determine the optimal prediction mode corresponding to the i-th block partitioning mode according to the optimal prediction modes of the M CUs.
[0345] Specifically, for the i-th block partitioning method among the N block partitioning methods, the current CTU is partitioned using the i-th block partitioning method to obtain M CUs. Then, based on the severe motion parameter, the optimal prediction mode corresponding to each CU in the M CUs is determined. Specifically, for each CU in the M CUs, for example, the j-th CU, at least one candidate prediction mode for the j-th CU is determined based on the severe motion parameter.
[0346] In some embodiments, if the severe motion parameter indicates to skip 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.
[0347] In some embodiments, if the severe motion parameter indicates that the affine motion compensation prediction mode is not skipped, it is determined that the at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
[0348] 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.
[0349] 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.
[0350] For another example, the cost of predicting the j-th CU according to at least one candidate prediction mode of the j-th CU is determined from the at least one candidate prediction mode.
[0351] In some embodiments, the specific process of determining the block division method and prediction mode of the current CTU is as follows: for the i-th block division method among the preset N block division methods, the i-th block division method is used to perform block division on the current CTU to obtain M CUs, and for each CU in the M CUs, the optimal prediction mode of each CU in the M CUs is determined according to the violent motion parameter. Specifically, for the j-th CU in the M CUs, if the violent motion parameter indicates to skip 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 violent 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, each of the at least one candidate prediction mode of the j-th CU is used to predict the j-th CU, obtaining a prediction value corresponding to each candidate prediction mode. Based on the prediction value corresponding to each candidate prediction mode and the original value of the j-th CU, a cost of each candidate prediction mode of the j-th CU is determined. In an embodiment of the present application, to reduce the workload of cost calculation, an approximate cost method can be used to calculate the cost of each candidate prediction mode. For example, an approximate cost such as a sum of absolute differences (SAD) or a sum of absolute transformed differences (SATD) after an adamant transformation is calculated based on the prediction value corresponding to each candidate prediction mode and the original value of the j-th CU. Based on the cost of each candidate prediction mode of the at least one candidate prediction mode of the j-th CU, a candidate prediction mode is determined from the at least one candidate prediction mode as the optimal prediction mode of the j-th CU. For example, the candidate prediction mode with the lowest cost among the at least one candidate prediction mode of the j-th CU is determined as the optimal prediction mode of the j-th CU. By referring to the method for determining the optimal prediction mode for the j-th CU, the optimal prediction mode for each of the M CUs under the i-th block partitioning method can be determined. The optimal prediction mode for each of the M CUs is determined as the optimal prediction mode corresponding to the i-th block partitioning method. The sum of the costs corresponding to the optimal prediction mode for each of the M CUs is determined as the cost corresponding to the i-th block partitioning method. According to the above method for determining the optimal prediction mode and cost corresponding to the i-th block partitioning method, the optimal prediction mode and cost corresponding to each of the N block partitioning methods are determined. Finally, the block partitioning method with the lowest cost among the N block partitioning methods is determined as the block partitioning method of the current CTU, and the optimal prediction mode corresponding to the block partitioning method of the current CTU is then determined as the optimal prediction mode of the current CTU.For example, block partitioning mode 1 is the block partitioning mode with the lowest cost among N block partitioning modes, and thus block partitioning mode 1 is determined as the block partitioning mode of the current CTU. Assuming that block partitioning mode 1 divides the current CTU into 4 CUs, the optimal prediction modes of each CU in these 4 CUs are prediction mode 1, prediction mode 2, prediction mode 3, and prediction mode 4, respectively, and thus prediction mode 1, prediction mode 2, prediction mode 3, and prediction mode 4 are determined as the optimal prediction modes of the current CTU.
[0352] From the above, it can be seen 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 severe 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 the encoding performance.
[0353] In some embodiments, after the encoder determines the block partitioning method and prediction mode of the current CTU according to the above steps, in order to maintain consistency between the encoder and decoder, the encoder indicates the block partitioning method and prediction mode of the current CTU to the decoder. Specifically, at least one of the first information and the second information is written into the bitstream, wherein the first information is used to indicate the block partitioning method 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 bitstream, and then determines the block partitioning 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.
[0354] The embodiments of the present application do not limit the specific forms of the first information and the second information.
[0355] In some embodiments, the first information is an index of a block partitioning method of the current CTU.
[0356] In some embodiments, the second information is an index of the prediction mode of the current CTU.
[0357] After the encoder determines the block division method and prediction mode of the current CTU according to the above step S702, it performs the following step S703.
[0358] S703: Divide the current CTU into blocks using the block division method of the current CTU to obtain at least one CU.
[0359] S704 . For a current CU in the at least one CU, use a prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU and obtain a prediction value of the current CU.
[0360] In an embodiment of the present application, the decoding end determines the block partitioning method and prediction mode of the current CTU according to the above S602, and then uses the block partitioning method of the current CTU to block the current CTU, for example, dividing the current CTU into at least one CU. For the current CU in the at least one CU, 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 a prediction value of the current CU. In other words, the prediction mode of the current CTU includes the prediction mode of each CU in the at least one CU. In this way, when determining the prediction value of each CU in the at least one CU, the prediction mode corresponding to the CU in the prediction mode of the CTU can be used to predict the CU to obtain the prediction value of the CU.
[0361] S705 : Determine a residual value of the current CU according to the prediction value of the current CU, and obtain a bitstream according to the residual value of the current CU.
[0362] Specifically, the encoder determines the residual value of the current CU based on the prediction value of the current CU and the current CU. For example, the difference between the current CU and the prediction value of the current CU is determined as the residual value of the current CU.
[0363] In some embodiments, the residual value of the current CU is transformed to obtain the transform coefficient of the current CU.
[0364] In some embodiments, the transform coefficients of the current CU are directly encoded to obtain a bitstream.
[0365] In some embodiments, the transform coefficients of the current CU are quantized to obtain the quantized coefficients of the current CU. Then, the quantized coefficients of the current CU are encoded to obtain a bitstream.
[0366] To further describe the encoding method provided in the embodiments of the present application, taking the severe motion parameters including the severe motion parameters of the current frame as an example, an implementation process of a video encoding method using an affine motion compensation prediction mode is introduced as follows:
[0367] First, according to step S701 above, the severe motion parameter MS of the current frame is determined. Next, the current frame is divided into multiple non-overlapping CTU blocks. Each CTU is then processed in sequence according to the raster scan order to determine the block partitioning method and prediction mode for each CTU. Taking the determination of the block partitioning method and prediction mode of the current CTU as an example, determining the optimal block partitioning method for the current CTU mainly includes the following steps:
[0368] Step 31: For the i-th block partitioning method Split[i] among the preset N block partitioning methods, the current CTU is divided using the i-th block partitioning method to obtain at least one CU. For the current CU in the at least one CU, the optimal prediction mode CurBestModeInter[i] corresponding to the current CU in the inter prediction mode and the minimum prediction cost CurBestCostInter[i] corresponding to the optimal prediction mode are calculated. Specifically, motion estimation is first performed on the current CU using the traditional inter prediction mode (i.e., without affine prediction), 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, then 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 lowest cost among the above-mentioned traditional inter-frame prediction mode and affine motion compensation prediction mode as the minimum prediction cost CurBestCostInter[i] in the inter-frame prediction mode, and save the corresponding mode as the optimal inter-frame prediction mode CurBestModeInter[i].
[0369] Step 32: Calculate the minimum prediction cost CurBestCostOther[i] and the optimal prediction mode CurBestModeOther[i] for 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] for the i-th block partitioning method.
[0370] Step 33, traverse all the block partitioning methods in the N block partitioning methods, and select the block partitioning method Split[opt] and the corresponding prediction mode bestMode[opt] that minimizes the prediction cost of the current CTU. Finally, use the block partitioning method of the current CTU to block divide the current CTU to obtain at least one coding unit 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 and obtain the prediction value of the current CU. Based on the prediction value of the current CU, determine the residual value of the current CU, transform, quantize, and entropy encode the residual value. Optionally, encode the prediction information (including whether the CU uses the AFF identifier cu.affine and motion vector, etc.) and output the bitstream.
[0371] Referring to the above steps, the embodiment of the present application modifies the use conditions of the affine motion compensation prediction mode, that is, the use conditions of the affine motion compensation prediction mode in the coding unit syntax are modified. The modified coding unit syntax is shown in Table 1:
[0372] Table 1
[0373]
[0374]
[0375] In the embodiment of the present application, the condition that the severe motion parameter MS is greater than or equal to T1 is added to the conditions for using the affine motion compensation prediction mode. That is, in the embodiment of the present application, when the value of the current first flag is the first value, 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 severe motion parameter is greater than or 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 for prediction of translational motion videos, thereby reducing encoding time, improving video encoding efficiency, and saving computing resources. The video encoding method provided in the embodiment of the present application determines a violent motion parameter, which is used to indicate whether to skip the affine motion compensation prediction mode; determines the block division method and prediction mode of the current coding tree unit CTU according to the violent motion parameter; uses 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, uses 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; determines the residual value of the current CU according to the prediction value of the current CU, and obtains the code stream according to the residual value of the current CU. That is, in the embodiment of the present application, the violent motion parameter is 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 waste of computing resources caused by using the affine motion compensation prediction mode to predict the translational motion video, thereby reducing the encoding time, improving the encoding efficiency of the video, and saving computing resources.
[0376] It should be understood that Figures 4 to 7 are merely examples of the present application and should not be construed as limiting the present application.
[0377] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, a variety of simple modifications can be made to the technical solution of the present application, and these simple modifications all fall within the scope of protection of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner unless there is any contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, and as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.
[0378] 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, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three types of relationships can exist. Specifically, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the related objects before and after are in an "or" relationship.
[0379] The method embodiment of the present application is described in detail above in conjunction with Figures 4 to 7 , and the device embodiment of the present application is described in detail below in conjunction with Figures 8 to 11 .
[0380] FIG8 is a schematic block diagram of a video decoding device provided in an embodiment of the present application.
[0381] As shown in FIG8 , the video decoding apparatus 10 includes:
[0382] The decoding unit 11 is used to decode the code stream and determine the residual value of the current coding tree unit CTU;
[0383] a determination unit 12, configured to determine a block partitioning mode and a prediction mode of a current CTU, wherein the block partitioning mode and the prediction mode of the current CTU are determined based on a severe motion parameter, wherein the severe motion parameter is used to indicate whether to skip an affine motion compensation prediction mode;
[0384] A dividing unit 13 is configured to divide the current CTU into blocks using the block division method of the current CTU to obtain at least one coding unit CU;
[0385] The prediction unit 14 is configured to predict a current CU in the at least one CU by using a prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction value of the current CU;
[0386] The reconstruction unit 15 is configured to determine a residual value of the current CU according to the residual value of the current CTU, and obtain a reconstructed value of the current CU according to the residual value and the predicted value of the current CU.
[0387] In some embodiments, the determination unit 12 is specifically used to 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 partitioning method of the current CTU, and the second information is used to indicate the prediction mode of the current CTU; and determine at least one of the block partitioning method and the prediction mode of the current CTU based on at least one of the first information and the second information.
[0388] In some embodiments, the block division method and prediction mode of the current CTU are determined based on the optimal prediction mode corresponding to N block division methods, and the optimal prediction mode corresponding to the i-th block division method among the N block division methods is determined based on the violent motion parameter, where i is a positive integer less than or equal to N.
[0389] In some embodiments, the optimal prediction mode corresponding to the i-th block partitioning method is determined based on the optimal prediction mode of M CUs, and the M CUs are obtained by block partitioning the current CTU using the i-th block partitioning method. The optimal prediction mode of the j-th CU in the M CUs is determined from at least one candidate prediction mode of the j-th CU, and the at least one candidate prediction mode of the j-th CU is determined based on the severe motion parameter.
[0390] In some embodiments, if the severe motion parameter indicates to skip the affine motion compensation prediction mode, the at least one candidate prediction mode of the j-th CU does not include the affine motion compensation prediction mode.
[0391] In some embodiments, if the severe motion parameter indicates that the affine motion compensation prediction mode is not skipped, the at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
[0392] In some embodiments, the optimal prediction mode of the j-th CU is a candidate prediction mode determined from the at least one candidate prediction mode according to a cost when predicting the j-th CU using at least one candidate prediction mode of the j-th CU.
[0393] In some embodiments, the severe motion parameter includes at least one of the severe motion parameter of the current frame, the severe motion parameter of the current CTU, and the severe motion parameter of the current CU.
[0394] 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, the violent motion parameter of the current CTU is used to indicate whether the current CTU skips the affine motion compensation prediction mode, and the violent motion parameter of the current CU is used to indicate whether the current CU skips the affine motion compensation prediction mode.
[0395] In some embodiments, the violent motion parameters of the current frame are determined based on the violent motion parameters of the K CTUs included in the current frame. For the kth CTU among the K CTUs included in the current frame, the violent motion parameters of the kth CTU are determined based on the kth CTU and the reference CTU of the kth CTU in the previous frame of the current frame, where K is a positive integer and k is a positive integer less than or equal to K.
[0396] In some embodiments, the severe motion parameter of the kth CTU is determined based on a pixel value of the kth CTU and a pixel value of the reference CTU.
[0397] In some embodiments, the severe motion parameter of the kth CTU is determined based on an absolute difference between a pixel value of the kth CTU and a pixel value of the reference CTU.
[0398] In some embodiments, the violent motion parameter of the current frame is determined based on violent motion parameters of P CTUs among the K CTUs whose violent motion parameters are greater than a first preset value, where P is a positive integer less than or equal to K.
[0399] 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.
[0400] In some embodiments, the violent motion parameter of the current frame is a ratio of the sum of the violent motion parameters of the P CTUs to the total area of the P CTUs.
[0401] 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 previous to the current frame.
[0402] In some embodiments, the severe motion parameter of the current CTU is determined based on pixel values of the current CTU and pixel values of the reference CTU.
[0403] In some embodiments, the severe motion parameter of the current CTU is determined based on an absolute difference between a pixel value of the current CTU and a pixel value of the reference CTU.
[0404] In some embodiments, the severe motion parameter of the current CU is determined based on the current CU and a reference CU of the current CU in a frame previous to the current frame.
[0405] In some embodiments, the severe motion parameter of the current CU is determined based on pixel values of the current CU and pixel values of the reference CU.
[0406] In some embodiments, the severe motion parameter of the current CU is determined according to an absolute difference between a pixel value of the current CU and a pixel value of the reference CU.
[0407] In some embodiments, the strenuous exercise parameter is determined under preset conditions.
[0408] In some embodiments, the preset condition includes the value of the first flag being a first numerical value, and the size of the current CU satisfying at least one of the preset sizes, the first flag being used to indicate whether the current sequence allows the use of the affine motion compensation prediction mode, and the first numerical value being used to indicate that the current sequence allows the use of the affine motion compensation prediction mode.
[0409] It should be understood that the device embodiment and the method embodiment can correspond to each other, and similar descriptions can refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device 10 shown in Figure 8 can perform the decoding method of the embodiment of the present application, and the aforementioned and other operations and / or functions of each unit in Figure 10 are respectively for implementing the corresponding processes in each method such as the above-mentioned decoding method. For the sake of brevity, no further description is given here.
[0410] FIG9 is a schematic block diagram of a video encoding device provided in an embodiment of the present application.
[0411] As shown in FIG9 , the video encoding apparatus 20 includes:
[0412] A first determining unit 21 is configured to determine a severe motion parameter, wherein the severe motion parameter is used to indicate whether to skip the affine motion compensation prediction mode;
[0413] A second determining unit 22 is configured to determine a block partitioning method and a prediction mode of a current CTU according to the severe motion parameter;
[0414] A partitioning unit 23 is configured to perform block partitioning on the current CTU using the block partitioning method of the current CTU to obtain at least one CU;
[0415] The prediction unit 24 is configured to predict a current CU in the at least one CU by using a prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction value of the current CU;
[0416] The encoding unit 25 is configured to determine a residual value of the current CU according to the prediction value of the current CU, and obtain a code stream according to the residual value of the current CU.
[0417] In some embodiments, the second determination unit 22 is specifically used to determine, for the i-th block division method among the preset N block division methods, the optimal prediction mode corresponding to the i-th block division method according to the violent motion parameter, where N is a positive integer and i is a positive integer less than or equal to N; and determine the block division method and prediction mode of the current CTU according to the optimal prediction mode corresponding to the N block division methods.
[0418] In some embodiments, the second determination unit 22 is specifically used to use the i-th block division method to block divide the current CTU to obtain M CUs, where M is a positive integer; for the j-th CU among the M CUs, according to the violent motion parameter, determine at least one candidate prediction mode of the j-th CU, where j is a positive integer less than or equal to M; determine the optimal prediction mode of the j-th CU from the at least one candidate prediction mode of the j-th CU; and determine the optimal prediction mode corresponding to the i-th block division method according to the optimal prediction mode of the M CUs.
[0419] In some embodiments, the second determining unit 22 is specifically configured to determine that the 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 to skip the affine motion compensation prediction mode.
[0420] In some embodiments, the second determining unit 22 is specifically configured to determine that at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode if the severe motion parameter indicates not to skip the affine motion compensation prediction mode.
[0421] In some embodiments, the second determination unit 22 is specifically used to determine the cost corresponding to the at least one candidate prediction mode when using the at least one candidate prediction mode of the j-th CU to predict the j-th CU; based on the cost corresponding to the at least one candidate prediction mode, determine the optimal prediction mode of the j-th CU from the at least one candidate prediction mode of the j-th CU.
[0422] In some embodiments, the severe motion parameter includes at least one of the severe motion parameter of the current frame, the severe motion parameter of the current CTU, and the severe motion parameter of the current CU.
[0423] 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, the violent motion parameter of the current CTU is used to indicate whether the current CTU skips the affine motion compensation prediction mode, and the violent motion parameter of the current CU is used to indicate whether the current CU skips the affine motion compensation prediction mode.
[0424] In some embodiments, if the violent motion parameters include violent motion parameters of the current frame, the first determination unit 21 is specifically used to determine the violent motion parameters of the kth CTU among the K CTUs included in the current frame based on the kth CTU and the reference CTU of the kth CTU in the previous frame of the current frame, where K is a positive integer and k is a positive integer less than or equal to K; the violent motion parameters of the current frame are determined based on the violent motion parameters of the K CTUs included in the current frame.
[0425] In some embodiments, the first determining unit 21 is specifically configured to determine the severe motion parameter of the k-th CTU according to the pixel value of the k-th CTU and the pixel value of the reference CTU.
[0426] In some embodiments, the first determining unit 21 is specifically configured to determine the severe motion parameter of the k-th CTU according to an absolute difference between a pixel value of the k-th CTU and a pixel value of the reference CTU.
[0427] In some embodiments, the first determination unit 21 is specifically used to select P CTUs whose violent motion parameters are greater than a first preset value from the K CTUs, where P is a positive integer less than or equal to K; and determine the violent motion parameters of the current frame based on the violent motion parameters of the P CTUs.
[0428] In some embodiments, the first determining unit 21 is specifically configured to determine the violent motion parameter of the current frame according to the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs.
[0429] In some embodiments, the first determining unit 21 is specifically configured to determine a ratio of a sum of the violent motion parameters of the P CTUs to a total area of the P CTUs as the violent motion parameter of the current frame.
[0430] In some embodiments, if the violent motion parameters include violent motion parameters of the current CTU, the first determination unit 21 is specifically used to determine the violent motion parameters of the current CTU based on the current CTU and the reference CTU of the current CTU in the previous frame of the current frame.
[0431] In some embodiments, the first determining unit 21 is specifically configured to determine the severe motion parameter of the current CTU according to the pixel value of the current CTU and the pixel value of the reference CTU.
[0432] In some embodiments, the first determining unit 21 is specifically configured to determine the severe motion parameter of the current CTU according to an absolute difference between a pixel value of the current CTU and a pixel value of the reference CTU.
[0433] In some embodiments, if the violent motion parameters include violent motion parameters of the current CU, the first determination unit 21 is specifically used to determine the violent motion parameters of the current CU based on the current CU and the reference CU of the current CU in the previous frame of the current frame.
[0434] In some embodiments, the first determining unit 21 is specifically configured to determine the severe motion parameter of the current CU according to the pixel values of the current CU and the pixel values of the reference CU.
[0435] In some embodiments, the first determining unit 21 is specifically configured to determine the severe motion parameter of the current CU according to an absolute difference between a pixel value of the current CU and a pixel value of the reference CU.
[0436] In some embodiments, the first determining unit 21 is specifically configured to determine the intense exercise parameter under preset conditions.
[0437] In some embodiments, the preset condition includes the value of the first flag being a first numerical value, and the size of the current CU satisfying at least one of the preset sizes, the first flag being used to indicate whether the current sequence allows the use of the affine motion compensation prediction mode, and the first numerical value being used to indicate that the current sequence allows the use of the affine motion compensation prediction mode.
[0438] In some embodiments, the encoding unit 25 is further used to write at least one of first information and second information into the code stream, wherein the first information is used to indicate the block partitioning method of the current CTU, and the second information is used to indicate the prediction mode of the current CTU.
[0439] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further details are given here. Specifically, the device 20 shown in FIG9 may correspond to the corresponding subject in the encoding method of the embodiment of the present application, and the aforementioned and other operations and / or functions of each unit in the device 20 are respectively for implementing the corresponding processes in each method such as the encoding method. For the sake of brevity, no further details are given here.
[0440] The above describes the apparatus and system of the embodiment of the present application from the perspective of functional units in conjunction with the accompanying drawings. It should be understood that the functional unit can be implemented in the form of hardware, can be implemented by instructions in the form of software, or can be implemented by a combination of hardware and software units. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software units in the decoding processor. Optionally, the software unit can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a 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 conjunction with its hardware.
[0441] FIG10 is a schematic block diagram of an electronic device provided in an embodiment of the present application.
[0442] As shown in FIG32 , the electronic device 30 may be a video encoder or a video decoder as described in an embodiment of the present application. The electronic device 30 may include:
[0443] The memory 33 and the processor 32 are configured to store a 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.
[0444] For example, the processor 32 may be configured to execute the steps of the method 200 according to the instructions in the computer program 34 .
[0445] In some embodiments of the present application, the processor 32 may include but is not limited to:
[0446] General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0447] In some embodiments of the present application, the memory 33 includes but is not limited to:
[0448] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0449] In some embodiments of the present application, the computer program 34 may be divided into one or more units, which are stored in the memory 33 and executed by the processor 32 to implement the method provided by the present application. The one or more units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30.
[0450] As shown in FIG10 , the electronic device 30 may further include:
[0451] The transceiver 33 may be connected to the processor 32 or the memory 33 .
[0452] 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. The 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.
[0453] It should be understood that the various components in the electronic device 30 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0454] FIG11 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application.
[0455] As shown in FIG11 , the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42 , wherein the video encoder 41 is used to execute the video encoding method involved in the embodiment of the present application, and the video decoder 42 is used to execute the video decoding method involved in the embodiment of the present application.
[0456] The present application also provides a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to perform the method of the above-mentioned method embodiment. In other words, the present application also provides a computer program product containing instructions, which, when executed by a computer, enables the computer to perform the method of the above-mentioned method embodiment.
[0457] The present application also provides a code stream, which is generated by the above encoding method. Optionally, the code stream includes a first flag.
[0458] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0459] Those skilled 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 in 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. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0460] 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 merely schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0461] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment. For example, the functional units in the various embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0462] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A video encoding method, characterized in that: include: determining a severe motion parameter, the severe motion parameter being used to indicate whether to skip an affine motion compensation prediction mode; Determining a block partitioning method and a prediction mode of a current coding tree unit (CTU) according to the severe motion parameter; Divide the current CTU into blocks using the block division method of the current CTU to obtain at least one coding unit CU; For a current CU in the at least one CU, using a prediction mode corresponding to the current CU in the prediction mode of the current CTU, predicting the current CU to obtain a prediction value of the current CU; A residual value of the current CU is determined according to the prediction value of the current CU, and a code stream is obtained according to the residual value of the current CU.
2. The method according to claim 1, characterized in that The determining, according to the severe motion parameter, a block partitioning method and a prediction mode of the current coding tree unit CTU includes: For an i-th block division method among N preset block division methods, determining an optimal prediction mode corresponding to the i-th block division method according to the violent motion parameter, where N is a positive integer and i is a positive integer less than or equal to N; Determine a block partitioning mode and a prediction mode of the current CTU according to the optimal prediction modes corresponding to the N block partitioning modes.
3. The method according to claim 2, characterized in that The determining, based on the violent motion parameter, the optimal prediction mode corresponding to the i-th block division method includes: Using the i-th block partitioning method to divide the current CTU into blocks, obtaining M CUs, where M is a positive integer; For a j-th CU among the M CUs, determining at least one candidate prediction mode for the j-th CU according to the severe motion parameter, where j is a positive integer less than or equal to M; Determining an optimal prediction mode for the j-th CU from at least one candidate prediction mode for the j-th CU; According to the optimal prediction modes of the M CUs, the optimal prediction mode corresponding to the i-th block partitioning mode is determined.
4. The method according to claim 3, characterized in that The determining, according to the severe motion parameter, at least one candidate prediction mode of the j-th CU includes: If the severe motion parameter indicates to skip the affine motion compensation prediction mode, it is determined that the affine motion compensation prediction mode is not included in the at least one candidate prediction mode of the j-th CU.
5. The method according to claim 3, characterized in that The determining, according to the severe motion parameter, at least one candidate prediction mode of the j-th CU includes: If the severe motion parameter indicates that the affine motion compensation prediction mode is not skipped, it is determined that at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
6. The method according to claim 3, characterized in that The determining, from at least one candidate prediction mode of the j-th CU, an optimal prediction mode of the j-th CU includes: Determine a cost corresponding to the at least one candidate prediction mode when predicting the j-th CU using the at least one candidate prediction mode of the j-th CU; Determine, according to a cost corresponding to the at least one candidate prediction mode, an optimal prediction mode of the j-th CU from the at least one candidate prediction mode of the j-th CU.
7. The method according to any one of claims 1 to 6, characterized in that The severe motion parameter includes at least one of the severe motion parameter of the current frame, the severe motion parameter of the current CTU, and the severe motion parameter of the current 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, the violent motion parameter of the current CTU is used to indicate whether the current CTU skips the affine motion compensation prediction mode, and the violent motion parameter of the current CU is used to indicate whether the current CU skips the affine motion compensation prediction mode.
8. The method according to claim 7, characterized in that If the violent motion parameter includes the violent motion parameter of the current frame, then determining the violent motion parameter includes: For a kth CTU among K CTUs included in the current frame, determining a severe motion parameter of the kth CTU based on the kth CTU and a reference CTU of the kth CTU in a frame previous to the current frame, where K is a positive integer and k is a positive integer less than or equal to K; The severe motion parameter of the current frame is determined according to the severe motion parameters of the K CTUs included in the current frame.
9. The method according to claim 8, characterized in that The determining, based on the k-th CTU and a reference CTU of the k-th CTU in a frame previous to the current frame, a severe motion parameter of the k-th CTU includes: Determine a severe motion parameter of the k-th CTU according to the pixel value of the k-th CTU and the pixel value of the reference CTU.
10. The method according to claim 9, characterized in that The determining, according to the pixel value of the k-th CTU and the pixel value of the reference CTU, a severe motion parameter of the k-th CTU includes: Determine a severe motion parameter of the k-th CTU according to an absolute difference between a pixel value of the k-th CTU and a pixel value of the reference CTU.
11. The method according to claim 8, characterized in that The determining, according to the violent motion parameters of the K CTUs included in the current frame, the violent motion parameter of the current frame includes: Selecting P CTUs whose severe motion parameters are greater than a first preset value from the K CTUs, where P is a positive integer less than or equal to K; The severe motion parameters of the current frame are determined according to the severe motion parameters of the P CTUs.
12. The method according to claim 11, characterized in that The determining the severe motion parameter of the current frame according to the severe motion parameters of the P CTUs includes: The severe motion parameter of the current frame is determined according to the sum of the severe motion parameters of the P CTUs and the total area of the P CTUs.
13. The method according to claim 12, characterized in that Determining the severe motion parameter of the current frame according to the sum of the severe motion parameters of the P CTUs and the total area of the P CTUs includes: 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.
14. The method according to claim 7, wherein: If the strenuous exercise parameter includes the strenuous exercise parameter of the current CTU, determining the strenuous exercise parameter includes: Determine a severe motion parameter of the current CTU according to the current CTU and a reference CTU of the current CTU in a frame previous to the current frame.
15. The method according to claim 14, characterized in that The determining, according to the current CTU and a reference CTU of the current CTU in a frame previous to the current frame, a severe motion parameter of the current CTU includes: Determine a severe motion parameter of the current CTU according to the pixel value of the current CTU and the pixel value of the reference CTU.
16. The method according to claim 15, characterized in that The determining, according to the pixel value of the current CTU and the pixel value of the reference CTU, a severe motion parameter of the current CTU includes: Determine a severe motion parameter of the current CTU according to an absolute difference between a pixel value of the current CTU and a pixel value of the reference CTU.
17. The method according to claim 7, characterized in that If the severe motion parameter includes the severe motion parameter of the current CU, determining the severe motion parameter includes: Determine a severe motion parameter of the current CU according to the current CU and a reference CU of the current CU in a frame previous to the current frame.
18. The method according to claim 17, characterized in that The determining, according to the current CU and a reference CU of the current CU in a frame previous to the current frame, a severe motion parameter of the current CU includes: Determine a severe motion parameter of the current CU according to the pixel value of the current CU and the pixel value of the reference CU.
19. The method according to claim 18, characterized in that The determining, according to the pixel values of the current CU and the pixel values of the reference CU, a severe motion parameter of the current CU, includes: Determine a severe motion parameter of the current CU according to an absolute difference between a pixel value of the current CU and a pixel value of the reference CU.
20. The method according to any one of claims 1 to 6, characterized in that: Determining the strenuous exercise parameters includes: Under preset conditions, the strenuous exercise parameters are determined.
21. The method according to claim 20, characterized in that 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, the first flag is used to indicate whether the current sequence allows the use of the affine motion compensation prediction mode, and the first numerical value is used to indicate that the current sequence allows the use of the affine motion compensation prediction mode.
22. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: At least one of first information and second information is written into the code stream, where the first information is used to indicate a block partitioning method of the current CTU, and the second information is used to indicate a prediction mode of the current CTU.
23. A video encoding device, characterized in that: include: a first determining unit, configured to determine a severe motion parameter, wherein the severe motion parameter is used to indicate whether to skip an affine motion compensation prediction mode; a second determining unit, configured to determine a block partitioning method and a prediction mode of a current CTU according to the violent motion parameter; a partitioning unit, configured to perform block partitioning on the current CTU using the block partitioning method of the current CTU to obtain at least one CU; a prediction unit, configured to predict a current CU in the at least one CU by using a prediction mode corresponding to the current CU in the prediction mode of the current CTU to obtain a prediction value of the current CU; The encoding unit is configured to determine a residual value of the current CU according to a prediction value of the current CU, and obtain a code stream according to the residual value of the current CU.
24. A video encoder, characterized in that including processor and memory; The memory shown is used to store computer programs; The processor is configured to call and execute the computer program stored in the memory to implement the method according to any one of claims 1 to 22.
25. A coding and decoding system, characterized in that: include: The video encoder of claim 24.
26. A computer-readable storage medium, characterized in that For storing computer programs; The computer program enables a computer to execute the method according to any one of claims 1 to 22.
27. A code stream, characterized in that The code stream is generated by the method according to any one of claims 1 to 22.
Citation Information
Patent Citations
Video image prediction method and device
CN110868587A
Method for encoding / decoding image signal, and device for same
CN112789860A
Affine motion prediction for video coding
US20170332095A1
Affine prediction improvements for video coding
WO2021249375A1
