Video encoding method, apparatus, device, system, and storage medium
By determining the type of video motion and skipping the affine motion compensation prediction mode, the problem of wasted computational resources in video coding is solved, thereby improving coding efficiency and saving time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-18
- Publication Date
- 2026-03-24
AI Technical Summary
In the video encoding process, using the affine motion compensation prediction mode may lead to a waste of computing resources and an increase in encoding time, especially for translational videos, where the computational complexity of the affine motion compensation prediction mode is too high.
By determining the parameters of violent motion, it can be determined whether the current video is a translational motion video, and if it is determined to be a translational motion video, the affine motion compensation prediction mode is skipped to avoid unnecessary calculations.
It reduces the encoding time for translational motion videos, saves computing resources, and improves encoding efficiency.
Smart Images

Figure CN119137938B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video encoding and decoding technology, and in particular to a video encoding method, apparatus, device, system, and storage medium. Background Technology
[0002] Digital video technology can be integrated into various video devices, such as digital televisions, smartphones, computers, e-readers, and video players. With the development of video technology, the amount of data contained in video data has become increasingly large. To facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
[0003] In video transmission, prediction is used to reduce redundancy. For example, affine motion compensation prediction (AFF) can predict zooming in or out, rotation, perspective motion, and other irregular motions. However, currently, using affine motion compensation prediction can generate a lot of unnecessary overhead, waste computing resources, and increase encoding time. Summary of the Invention
[0004] This application provides a video encoding method, apparatus, device, system, and storage medium that determines whether to skip the affine motion compensation prediction mode by determining the parameters of violent motion, thereby avoiding the waste of computing resources and reducing encoding time.
[0005] In a first aspect, embodiments of this application provide a video decoding method, including:
[0006] Decode the bitstream and determine the residual value of the current coding tree unit (CTU);
[0007] The current block partitioning method and prediction mode of the CTU are determined based on the violent motion parameters, which are used to indicate whether to skip the affine motion compensation prediction mode.
[0008] The current CTU is divided into blocks using the current CTU's block partitioning method to obtain at least one coding unit (CU);
[0009] 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 and obtain the predicted value of the current CU.
[0010] Based on the residual value of the current CTU, the residual value of the current CU is determined, and based on the residual value of the current CU and the predicted value, the reconstructed value of the current CU is obtained.
[0011] Secondly, embodiments of this application provide a video encoding method, including:
[0012] Based on the violent motion parameters, determine the block partitioning method and prediction mode of the current coding tree unit (CTU);
[0013] The current CTU is divided into blocks using the current CTU's block partitioning method to obtain at least one coding unit (CU);
[0014] 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 and obtain the predicted value of the current CU.
[0015] Based on the predicted value of the current CU, the residual value of the current CU is determined, and the bitstream is obtained based on the residual value of the current CU.
[0016] Thirdly, this application provides a video decoding apparatus for performing the methods described in the first aspect or its various implementations. Specifically, the decoding apparatus includes functional units for performing the methods described in the first aspect or its various implementations.
[0017] Fourthly, this application provides a video encoding apparatus for performing the methods described in the second aspect or its various implementations. Specifically, the encoding apparatus includes functional units for performing the methods described in the second aspect or its various implementations.
[0018] Fifthly, a video decoder is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the methods in the first aspect or its implementations described above.
[0019] In a sixth aspect, a video encoder is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the methods in the second aspect or its implementations described above.
[0020] In a seventh aspect, a video encoding and decoding system is provided, including a video encoder and a video decoder. The video encoder is used to execute the methods in the second aspect or its implementations described above, and the video decoder is used to execute the methods in the first aspect or its implementations described above.
[0021] Eighthly, a chip is provided for implementing the methods of any one of the first to second aspects or their respective implementations. Specifically, the chip includes a processor for calling and running a computer program from a memory, causing a device on which the chip is mounted to perform the methods of any one of the first to second aspects or their respective implementations.
[0022] Ninthly, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the methods of any one of the first to second aspects or their respective implementations.
[0023] In a tenth aspect, a computer program product is provided, including computer program instructions that cause a computer to perform the methods of any one of the first to second aspects or their respective implementations.
[0024] Eleventhly, a computer program is provided that, when run on a computer, causes the computer to perform the methods of any one of the first to second aspects or their respective implementations.
[0025] In the twelfth aspect, a bitstream is provided that is generated by any one of the first aspects or their implementations.
[0026] Based on the above technical solution, by determining the parameters of violent motion, it is determined whether the current video is a translational motion video. If the current video is a translational motion video, the affine motion compensation prediction mode is skipped, thereby avoiding the 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. Attached Figure Description
[0027] Figure 1 This is a schematic block diagram of a video encoding and decoding system according to an embodiment of this application;
[0028] Figure 2 This is a schematic block diagram of a video encoder involved in an embodiment of this application;
[0029] Figure 3 This is a schematic block diagram of a video decoder involved in an embodiment of this application;
[0030] Figure 4A and Figure 4B This is a schematic diagram illustrating the selection of control points in the affine motion compensation prediction mode involved in the embodiments of this application.
[0031] Figure 5 A schematic diagram of the motion vectors for each sub-block determined using the affine motion compensation prediction model;
[0032] Figure 6 This is a schematic flowchart of a video decoding method provided in an embodiment of this application;
[0033] Figure 7 This is a schematic flowchart of a video encoding method provided in an embodiment of this application;
[0034] Figure 8 This is a schematic block diagram of a video decoding apparatus provided in an embodiment of this application;
[0035] Figure 9 This is a schematic block diagram of a video encoding apparatus provided in an embodiment of this application;
[0036] Figure 10 This is a schematic block diagram of the electronic device provided in the embodiments of this application;
[0037] Figure 11 This is a schematic block diagram of the video encoding and decoding system provided in the embodiments of this application. Detailed Implementation
[0038] This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, and real-time video encoding and decoding. For example, the solution of this application can be combined with audio video coding standards (AVS), such as H.264 / Audio Video Coding (AVC) standard, H.265 / High Efficiency Video Coding (HEVC) standard, and H.266 / Versatile Video Coding (VVC) standard. Alternatively, the solution of this application can be combined with other proprietary or industry standards, including 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), which include Scalable Video Coding (SVC) and Multi-View Video Coding (MVC) extensions. It should be understood that the technology in this application is not limited to any particular codec standard or technology.
[0039] To facilitate understanding, let's first combine... Figure 1 The video encoding and decoding system involved in the embodiments of this application will be described.
[0040] Figure 1This is a schematic block diagram of a video encoding and decoding system according to an embodiment of this application. It should be noted that... Figure 1 This is merely an example; the video encoding and decoding system in this application includes, but is not limited to, [other systems]. Figure 1 As shown. Figure 1 As shown, the video encoding / decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device encodes (can be understood as compressing) video data to generate a bitstream and transmits the bitstream to the decoding device. The decoding device decodes the bitstream generated by the encoding device to obtain the decoded video data.
[0041] The encoding device 110 in this application embodiment can be understood as a device with video encoding function, and the decoding device 120 can be understood as a device with video decoding function. That is, the encoding device 110 and the decoding device 120 in this application embodiment include a wider range of devices, such as smartphones, desktop computers, mobile computing devices, laptops (e.g., laptop computers), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, etc.
[0042] In some embodiments, encoding device 110 may transmit encoded video data (such as a bitstream) to decoding device 120 via channel 130. Channel 130 may include one or more media and / or means capable of transmitting encoded video data from encoding device 110 to decoding device 120.
[0043] In one example, channel 130 includes one or more communication media that enable encoding device 110 to transmit encoded video data directly to decoding device 120 in real time. In this example, encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding device 120. The communication media includes wireless communication media, such as radio frequency spectrum; optionally, the communication media may also include wired communication media, such as one or more physical transmission lines.
[0044] In another example, channel 130 includes a storage medium that can store video data encoded by encoding device 110. The storage medium includes various local access data storage media, such as optical discs, DVDs, flash memory, etc. In this example, decoding device 120 can retrieve the encoded video data from the storage medium.
[0045] In another example, channel 130 may include a storage server that can store the video data encoded by encoding device 110. In this example, decoding device 120 can download the stored encoded video data from the storage server. Optionally, the storage server can store and transmit the encoded video data to decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.
[0046] 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.
[0047] In some embodiments, the encoding device 110 may include a video source 111 in addition to the video encoder 112 and the input interface 113.
[0048] The video source 111 may include at least one of a video capture device (e.g., 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.
[0049] Video encoder 112 encodes video data from 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 encoding information of the pictures or picture sequences in the form of a bitstream. The encoding information may include encoded image 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 applied to one or more sequences. The PPS may contain parameters applied to one or more pictures. A syntax structure refers to a set of zero or more syntax elements arranged in a specified order within the bitstream.
[0050] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored on a storage medium or a storage server for subsequent retrieval by the decoding device 120.
[0051] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122.
[0052] In some embodiments, in addition to the input interface 121 and the video decoder 122, the decoding device 120 may also include a display device 123.
[0053] The input interface 121 includes a receiver and / or a modem. The input interface 121 can receive encoded video data through channel 130.
[0054] The video decoder 122 is used to decode the encoded video data to obtain the decoded video data, and transmit the decoded video data to the display device 123.
[0055] Display device 123 displays the decoded video data. Display device 123 may be integrated with decoding device 120 or external to decoding device 120. Display device 123 may include various display devices, such as liquid crystal display (LCD), plasma display, organic light-emitting diode (OLED) display, or other types of display devices.
[0056] also, Figure 1 This is merely an example; the technical solutions in the embodiments of this application are not limited to... Figure 1 For example, the technology of this application can also be applied to one-sided video encoding or one-sided video decoding.
[0057] The video coding framework involved in the embodiments of this application is described below.
[0058] The video encoder involved in the embodiments of this application is described below.
[0059] Figure 2 This is a schematic block diagram of a video encoder provided in an embodiment of this application. It should be understood that the video encoder 200 can be used for lossy compression of images or lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression.
[0060] This video encoder 200 can be applied to image data in luminance / chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) per 4 pixels; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0061] For example, the video encoder 200 reads video data and divides each frame into several coding tree units (CTUs). In some examples, CTUs may be called "tree blocks," "largest coding unit" (LCU), or "coding treeblock" (CTB). Each CTU can be associated with a pixel block of equal size within the image. Each pixel can correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU can 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 can be further divided into several coding units (CUs) for encoding. CUs can be rectangular or square blocks. The CU can be further divided into prediction units (PUs) and transform units (TUs), thus separating encoding, prediction, and transformation for more flexible processing. In one example, the CTU is divided into CUs using a quadtree structure, and the CUs are further divided into TUs and PUs using a quadtree structure.
[0062] The video encoder and decoder support various PU sizes. Assuming a specific CU size of 2N×2N, the video encoder and decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and also support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and decoder can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.
[0063] In some embodiments, such as Figure 2 As shown, 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 filtering unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may contain more, fewer, or different functional components.
[0064] Optionally, in this application, the current block may be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block may also be referred to as the predicted image block or the image prediction block, and the reconstructed image block may also be referred to as the reconstruction block or the image reconstruction block.
[0065] 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 frame of a video, intra-frame prediction is used in video encoding and decoding techniques 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 encoding and decoding techniques to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.
[0066] 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 reference blocks from reference frames and generates prediction blocks based on the reference blocks to eliminate temporal redundancy. The frames used for inter-frame prediction can be P-frames and / or B-frames. P-frames refer to forward prediction frames, and B-frames refer to bidirectional prediction frames. Motion information includes a list of reference frames, the reference frame index, and motion vectors. Motion vectors can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering needs to be used in the reference frame to create the required fractional-pixel blocks. Here, the integer-pixel or fractional-pixel blocks in the reference frame found based on the motion vectors are called reference blocks. Some techniques directly use the reference blocks as prediction blocks, while others process the reference blocks to generate prediction blocks. Processing the reference blocks to generate prediction blocks can also be understood as using the reference blocks as prediction blocks and then processing them to generate new prediction blocks.
[0067] Intra-prediction unit 212 refers only to information from the same frame image to predict pixel information within the current code image block, thus eliminating spatial redundancy. The frame used for intra-prediction can be an I-frame. For example... Figure 5As shown, the white 4x4 block is the current block. The gray pixels in the left row and top column of the current block are the reference pixels for the current block. Intra-frame prediction uses these reference pixels to predict the current block. These reference pixels may all be available, meaning they have all been encoded and decoded. Alternatively, some may be unavailable. For example, if the current block is the leftmost part of the frame, then the reference pixels to the left of the current block are unavailable. Or, if the lower left portion of the current block has not yet been encoded and decoded, then the lower left reference pixels are also unavailable. In cases where reference pixels are unavailable, they can be filled using available reference pixels, certain values, or certain methods, or no filling may be performed.
[0068] In some embodiments, the intra-frame prediction method further includes a multiple reference line (MRL) intra-frame prediction method, which can use more reference pixels to improve coding efficiency.
[0069] Intra-frame prediction has several modes. H.264 provides nine modes for intra-frame prediction of 4×4 blocks. Mode 0 copies the pixels above the current block vertically as the prediction value; Mode 1 copies the reference pixels on the left horizontally as the prediction value; Mode 2 (DC) uses the average of points A-D and I-L as the prediction value for all points; and Modes 3 through 8 copy the reference pixels to their corresponding positions in the current block at a specific angle. Because some positions in the current block may not correspond exactly to the reference pixels, a weighted average of the reference pixels, or interpolated sub-pixels of the reference pixels, may be needed.
[0070] HEVC uses 35 intra-frame prediction modes: Planar, DC, and 33 angle modes. VVC uses 67 intra-frame prediction modes: Planar, DC, and 65 angle modes. AVS3 uses 66 intra-frame prediction modes: DC, Plane, Bilinear, and 63 angle modes.
[0071] It should be noted that with the increase in angle modes, intra-frame prediction will be more accurate and better meet the needs of the development of high-definition and ultra-high-definition digital video.
[0072] The residual unit 220 can generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, the residual unit 220 can generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the PU of the CU.
[0073] Transform / quantization unit 230 can quantize transform coefficients. Transform / quantization unit 230 can quantize transform coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. Video encoder 200 can adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.
[0074] The inverse transform / quantization unit 240 can apply inverse quantization and inverse transform to the quantized transform coefficients to reconstruct the residual block from the quantized transform coefficients.
[0075] The reconstruction unit 250 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by the prediction unit 210 to produce a reconstructed image block associated with the TU. By reconstructing the sampled blocks of each TU of the CU in this way, the video encoder 200 can reconstruct the pixel blocks of the CU.
[0076] The loop filtering unit 260 can perform deblocking filtering operations to reduce the block effect of pixel blocks associated with the CU.
[0077] In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive compensation (SAO) unit, and an adaptive loop filtering (ALF) unit.
[0078] The decoded image buffer 270 can store reconstructed pixel blocks. The inter-frame prediction unit 211 can use a reference image containing the reconstructed pixel blocks to perform inter-frame prediction on PUs of other images. In addition, the intra-frame prediction unit 212 can use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra-frame prediction on other PUs in the same image as the CU.
[0079] Entropy coding unit 280 can receive quantized transform coefficients from transform / quantization unit 230. Entropy coding unit 280 can perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data.
[0080] The basic process of video encoding 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 can calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block. This residual block can also be called residual information. The residual block is transformed and quantized by the transform / quantization unit 230 to remove information that is not sensitive to the human eye, thereby eliminating visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization unit 230 can be called a temporal residual block, and the temporal residual block after transformation and quantization by the transform / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 280 receives the quantized transform coefficients output by the transform / quantization unit 230 and can perform entropy coding on the quantized transform coefficients to output a bitstream. For example, the entropy coding unit 280 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.
[0081] Additionally, the video encoder performs inverse quantization and inverse transform on the quantized transform coefficients output by the transform quantization unit 230 to obtain the residual block of the current block. Then, the residual block of the current block is added to the prediction block of the current block to obtain the reconstructed block of the current block. As encoding progresses, reconstructed blocks corresponding to other image blocks in the current image are obtained. These reconstructed blocks are then stitched together to obtain the reconstructed image of the current image. Due to errors introduced during encoding, the reconstructed image is filtered to reduce these errors. For example, ALF is used to filter the reconstructed image to reduce the difference between the pixel values of the pixels in 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, which can serve as a reference frame for inter-frame prediction in subsequent frames.
[0082] It should be noted that the block partitioning information determined at the encoding end, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, are carried in the bitstream when necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding end by parsing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.
[0083] Figure 3 This is a schematic block diagram of the video decoder provided in the embodiments of this application.
[0084] like Figure 3As shown, the video decoder 300 includes: an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transformation unit 330, a reconstruction unit 340, a loop filtering unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may contain more, fewer, or different functional components.
[0085] The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can parse the bitstream to extract syntax elements from it. As part of parsing the bitstream, the entropy decoding unit 310 can parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the dequantization / transform unit 330, the reconstruction unit 340, and the loop filtering unit 350 can decode the video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.
[0086] In some embodiments, the prediction unit 320 includes an inter-frame prediction unit 321 and an intra-frame prediction unit 322.
[0087] Inter-frame prediction unit 321 can perform intra-frame prediction to generate prediction blocks for PUs. Inter-frame prediction unit 321 can use an intra-frame prediction mode to generate prediction blocks for PUs based on pixel blocks of spatially adjacent PUs. Inter-frame prediction unit 321 can also determine the intra-frame prediction mode for PUs based on one or more syntax elements parsed from the bitstream.
[0088] Intra-frame prediction unit 322 can construct a first reference image list (list 0) and a second reference image list (list 1) based on the syntax elements parsed from the bitstream. Furthermore, if the PU uses inter-frame predictive coding, entropy decoding unit 310 can parse the motion information of the PU. Intra-frame prediction unit 322 can determine one or more reference blocks of the PU based on the motion information of the PU. Intra-frame prediction unit 322 can generate prediction blocks for the PU based on one or more reference blocks of the PU.
[0089] The dequantization / transformation unit 330 reversibly quantizes (i.e., dequantizes) the transform coefficients associated with the TU. The dequantization / transformation unit 330 can use the QP value associated with the CU of the TU to determine the degree of quantization.
[0090] After the inverse quantization transform coefficients, the inverse quantization / transformation unit 330 can apply one or more inverse transforms to the inverse quantization transform coefficients to generate a residual block associated with the TU.
[0091] 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 the sample of the residual block to the corresponding sample of the prediction block to reconstruct the pixel block of the CU, thereby obtaining the reconstructed image block.
[0092] The loop filter unit 350 can perform deblocking filtering operations to reduce the block effect of pixel blocks associated with the CU.
[0093] In some embodiments, the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive compensation (SAO) unit, and an adaptive loop filtering (ALF) unit.
[0094] The video decoder 300 can store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 can 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.
[0095] The basic video decoding process involved in this application is as follows: Entropy decoding unit 310 parses the bitstream to obtain prediction information and quantization coefficient matrix for the current block. Prediction unit 320 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block based on the prediction information. Inverse quantization / transform unit 330 uses the quantization coefficient matrix obtained from the bitstream to perform inverse quantization and inverse transform on the quantization coefficient matrix to obtain a residual block. Reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks form a reconstructed image. Loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain a decoded image. This decoded image can also be called a reconstructed image. This reconstructed image can be displayed by a display device and stored in the decoded image buffer 360 as a reference frame for inter-frame prediction in subsequent frames.
[0096] The above describes the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. This application is applicable to the basic flow of a video codec under this block-based hybrid coding framework, but is not limited to this framework and flow.
[0097] As mentioned above, current prediction methods used in video encoding and decoding include intra-frame prediction and inter-frame prediction, with ordinary inter-frame prediction primarily considering translational motion. However, in the real world, besides translational motion, there are many other types of motion, such as zooming in / out, rotation, perspective motion, and other irregular motions. Therefore, in some embodiments, a block-based affine motion compensation prediction mode is used for prediction. The affine motion compensation prediction mode is described below.
[0098] like Figure 4A and Figure 4B As shown, the affine motion field of a block is described by motion information from two control points (4 parameters) or three control point motion vectors (6 parameters).
[0099] The block-based affine motion compensation prediction model includes the following steps:
[0100] Step 1: First, divide the block into 4x4 brightness sub-blocks.
[0101] Step 2: For each luma sub-block, the motion vector of its center pixel is calculated using affine vectors and then rounded to 1 / 16 precision. The 4-parameter affine motion model and the 6-parameter affine motion model derive the motion vectors using different calculation methods.
[0102] For example, for a 4-parameter affine motion model, the motion vector of the sub-block with center pixel (x,y) is calculated as shown in formula (1):
[0103]
[0104] For example, for a 6-parameter affine motion model, the motion vector of the sub-block with center pixel (x,y) is calculated as shown in formula (2):
[0105]
[0106] Where (mv0x,mv0y), (mv1x,mv1y), and (mv2x,mv2y) are the motion vectors of the control points at the top left, top right, and bottom left corners, respectively.
[0107] Step 3, after calculating the motion vector for each sub-block (e.g.) Figure 5 As shown in the figure, motion compensation interpolation filtering is performed based on the motion vector to obtain the predicted value of each sub-block.
[0108] Step 4: The chroma component is also divided into 4x4 sub-blocks, and its motion vector is equal to the average of the motion vectors of the four 4x4 luminance sub-blocks associated with it.
[0109] Similar to traditional inter-frame motion vector prediction methods, affine motion vector prediction also has two prediction methods: affine merge mode and affine AMVP mode.
[0110] Affine merge prediction can be performed using the 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. At most five CPMV prediction candidates are generated, and an index indicating which candidate was ultimately used must be transmitted.
[0111] Affine AMVP prediction can be used for CUs with a width and height greater than or equal to 16. While merge mode directly uses the predicted CPMV, AMVP requires transmitting the optimal CPMV of the current CU and the residual of the predicted CPMV. The candidate list for affine AMVP prediction has two options.
[0112] In some embodiments, the AFF-based encoding method is as follows: First, the input image is divided into multiple non-overlapping CTUs. Then, each CTU is processed sequentially according to the raster scan order, and the CTU is divided into several CUs in different ways. The main steps for determining the optimal block partitioning method are as follows:
[0113] Step 11: For the i-th partitioning method Split[i], calculate the minimum prediction cost CurBestCostInter[i] and the optimal mode CurBestModeInter[i] in the inter-frame prediction mode. Specifically, first, use the traditional inter-frame prediction method (without affine prediction) to perform motion estimation and 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, then use the affine motion compensation prediction mode to perform motion estimation and calculate the prediction cost CurBestCostAffine, save the prediction mode CurBestModeAffine, and take the smaller of the two costs as the minimum prediction cost CurBestCostInter[i] in the inter-frame prediction mode, and save the corresponding mode as the optimal mode CurBestModeInter[i].
[0114] Step 12: Calculate the minimum prediction cost CurBestCostOther[i] and the optimal prediction mode CurBestModeOther[i] for other prediction modes such as intra-frame prediction. Compare CurBestCostInter[i] and CurBestCostOther[i], and select the optimal prediction mode bestMode[i] and prediction cost bestCost[i] for the i-th partitioning method.
[0115] Step 13: Iterate through all preset block partitioning methods and select the block partitioning method Split[opt] that minimizes the current CTU prediction cost and the corresponding prediction mode bestMode[opt].
[0116] 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. Based on the predicted values and the original values, obtain the residual values, and perform transformation, quantization, and entropy coding on the residual values. In addition, the prediction information, including the identifier cu.affine of whether the CU uses AFF and motion vectors, is encoded, and the bit stream is output.
[0117] In some embodiments, the AFF-based decoding method involves: entropy decoding, inverse quantization, and inverse transform of the input bitstream to obtain the residual value Res; further decoding of the bitstream to obtain block partitioning information and prediction information, etc. Then, the image is reconstructed according to the following steps:
[0118] Step 21: Determine the partition tree of the current CTU based on the block partitioning information.
[0119] Step 22: Process each CU in the partition tree sequentially according to the raster scanning order, and calculate the predicted value Pred using the prediction information of each CU, such as the prediction mode bestMode[opt], the identifier cu.affine, and the motion vector.
[0120] Step 23: The residual value Res and the predicted value Pred of the current CU are superimposed to obtain the reconstructed CU. Finally, the reconstructed image is fed into a DBF / SAO / ALF filter, and the filtered image is sent to a buffer to await video playback.
[0121] As mentioned above, AFF (Adaptive Frame Prediction) serves as a supplement to inter-frame prediction techniques to more efficiently represent irregular motions such as zooming in / out and rotation. Therefore, for each prediction unit, AFF needs to perform motion estimation on each 4x4 sub-block, leading to more rate-distortion optimization calculations and significantly increasing coding complexity. Statistics show that AFF brings an average performance gain of 2.95% and a 27% increase in coding complexity in low-latency mode. The fundamental reason for AFF's performance improvement lies in handling irregular motions such as zooming in / out and rotation. In other words, for typical translational motion videos, the performance gain from AFF is limited, but it still significantly increases coding complexity.
[0122] To address the aforementioned technical issues, this application embodiment determines whether the current video is a translational motion video by identifying the parameters of violent motion. If the current video is a translational motion video, the affine motion compensation prediction mode is skipped, thereby avoiding the waste of computational resources caused by using the affine motion compensation prediction mode to predict translational motion videos, thus reducing encoding time, improving video encoding efficiency, and saving computational resources.
[0123] The video encoding and decoding method provided in this application will be described below with reference to specific embodiments.
[0124] First, combine Figure 6 Taking the decoding end as an example, the video decoding method provided in the embodiments of this application will be introduced.
[0125] Figure 6 This is a schematic flowchart of a video decoding method provided in an embodiment of this application. This embodiment of the application is applied to... Figure 1 and Figure 3 The video decoder shown.
[0126] like Figure 6 As shown, the method in this application embodiment includes:
[0127] S601, decode the bitstream and determine the residual value of the current CTU.
[0128] During video decoding, the decoding end receives the bitstream and decodes it to determine the block partitioning method of the current CTU. It then partitions the current CTU into blocks using this method, obtaining at least one CU. The bitstream is decoded to obtain the quantization coefficients of the current CU within each CU. These coefficients are then inversely quantized to obtain the transform coefficients. Finally, the transform coefficients are inversely transformed to obtain the residual value of the current CU. The bitstream is then decoded again to determine the prediction mode of the current CU. This prediction mode is used to predict the current CU's value. Based on the predicted and residual values, the reconstructed value of the current CU is obtained. The reconstructed values of each CU in the current frame are then combined to form the reconstructed image.
[0129] In some embodiments, a loop filter is performed on the reconstructed image based on the image or on the block to obtain a decoded image, which may also be called a reconstructed image. The reconstructed image can serve as a reference frame for inter-frame prediction of subsequent frames.
[0130] In some embodiments, the current CU is also referred to as the current block, current image block, current decoding block, current encoding unit, current block to be decoded, current image block to be decoded, etc.
[0131] In some embodiments of this application, the current CU only includes chroma components, which can be understood as chroma blocks.
[0132] In some embodiments of this application, the current CU only includes a luminance component, which can be understood as a luminance block.
[0133] In some embodiments, the current CU includes both a luminance component and a chrominance component.
[0134] In this embodiment of the application, the decoding end determines the residual value of the current CTU in the following two cases:
[0135] Scenario 1: If the encoder transforms the residual values of each CU in the current CTU to obtain the transform coefficients of each CU, and directly encodes the transform coefficients of each CU to obtain the bitstream, then 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.
[0136] Scenario 2: The encoding end transforms the residual values of each CU in the current CTU to obtain the transform coefficients of each CU. Then, it quantizes the transform coefficients of each CU to obtain the quantized coefficients of each CU. Finally, it encodes the quantized coefficients of each CU to obtain the bitstream. Correspondingly, the decoding end 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 then performs an inverse transform on the transform coefficients of the current CTU to obtain the residual values of the current CTU.
[0137] S602. Determine the current block partitioning method and prediction mode of the CTU.
[0138] The current CTU's block partitioning method and prediction mode are determined based on the violent motion parameter, which is used to indicate whether to skip the affine motion compensation prediction mode.
[0139] It should be noted that S602 can be executed before S601, after S602, or synchronously with S602. This application embodiment does not impose any restrictions on this.
[0140] In this embodiment, the affine motion compensation prediction mode is complex and consumes significant computational resources, resulting in low decoding efficiency. Furthermore, the affine motion compensation prediction mode is primarily used to efficiently represent irregular movements such as zooming in / out and rotation. For translational motion videos, the performance gain of the affine motion compensation prediction mode is limited. Therefore, when using the affine motion compensation prediction mode for translational motion videos, the compression effect is not significant, but it consumes a large amount of computational resources and increases encoding time. Therefore, in this embodiment, before using the affine motion compensation prediction mode for prediction, a drastic motion parameter is first determined. This parameter indicates whether the current video is a translational motion video. If the current video is determined to be a translational motion video, the affine motion compensation prediction mode is skipped. This avoids the waste of computational resources caused by using the affine motion compensation prediction mode for translational motion videos, thereby improving video encoding efficiency and saving computational resources.
[0141] The drastic motion parameter in this embodiment is used to indicate whether the current video is a translational motion video. If it is a translational motion video, the affine motion compensation prediction mode is skipped. Therefore, the drastic motion parameter in this embodiment can also be directly used to indicate whether to skip the affine motion compensation prediction mode. For example, if the drastic motion parameter is less than a preset value, the current video is determined to be a translational motion video, and the affine motion compensation prediction mode is skipped. If the drastic motion parameter is greater than or equal to the preset value, the current video is determined not to be a translational motion video, and the affine motion compensation prediction mode can be used for prediction.
[0142] In some embodiments, the block partitioning method of the current CTU can be understood as the optimal block partitioning method of the current CTU. For example, the block partitioning method of the current CTU is the block partitioning method with the lowest cost among a number of preset block partitioning methods.
[0143] In some embodiments, the prediction modes of the current CTU can be understood as a set, including the prediction modes of each CU in at least one CU included in the current CTU, wherein the prediction mode of a CU can be understood as the optimal prediction mode of the CU.
[0144] In this embodiment of the application, the prediction mode of the current CTU is the prediction mode corresponding to the block partitioning method of the current CTU. For example, the current CTU is divided into at least one CU using the block partitioning method of the current CTU, and the set of prediction modes of each CU in the at least one CU is determined as the prediction mode of the current CTU.
[0145] In this embodiment, the current CTU's block partitioning method and prediction mode are based on violent motion parameters. Thus, when the current video is determined to be a translational motion video based on violent motion parameters, the affine motion compensation prediction mode can be skipped when determining the current CTU's block partitioning method and prediction mode. This reduces the workload in determining the current CTU's block partitioning method and prediction mode, saves computing resources, and improves the efficiency of determining the current CTU's block partitioning method and prediction mode.
[0146] The specific methods for determining the current CTU's block partitioning method and prediction mode in S602 above include, but are not limited to, the following:
[0147] In method one, the encoding end indicates the determined block partitioning method and prediction mode of the current CTU to the decoding end. The decoding end can then determine the block partitioning method and prediction mode of the current CTU based on this indication. Specifically, S602 includes the following S602-A1 and S602-A2:
[0148] S602-A1, Decode the bitstream to obtain at least one of the first information and the second information, wherein the first information is used to indicate the block division method of the current CTU and the second information is used to indicate the prediction mode of the current CTU;
[0149] S602-A2. Based on at least one of the first information and the second information, determine at least one of the current CTU's block partitioning method and prediction mode.
[0150] In this first method, after determining the current CTU's block partitioning method and prediction mode based on the drastic motion parameters, the encoding end writes at least one of first information and second information into the bitstream. The first information indicates the current CTU's block partitioning method, and the second information indicates the current CTU's prediction mode. The decoding end then decodes the bitstream to obtain at least one of the first and second information, and subsequently determines the current CTU's block partitioning method based on the first information, and / or determines the current CTU's prediction mode based on the second information.
[0151] The embodiments of this application do not limit the specific form of the first information and the second information.
[0152] In some embodiments, the first information is an index of the current CTU's block partitioning method.
[0153] In some embodiments, the second information is an index of the current CTU's prediction pattern.
[0154] In addition to using the steps S602-A1 and S602-A2 mentioned above to determine the current CTU's block partitioning method and prediction mode, the decoding end can also determine the current CTU's block partitioning method and prediction mode according to the following method two.
[0155] Method 2: The decoder determines the drastic motion parameters and, based on these parameters, determines the block partitioning method and prediction mode of the current CTU. For example, the decoder determines the drastic motion parameters, such as those carried in the bitstream by the encoder. The decoder can then obtain these parameters by decoding the bitstream. Next, the decoder determines the block partitioning method and prediction mode of the current CTU based on these parameters. For instance, if the drastic motion parameters indicate skipping the affine motion compensation prediction mode, the decoder will skip the affine motion compensation prediction mode when determining the block partitioning method and prediction mode of the CTU. Conversely, if the drastic motion parameters indicate not skipping the affine motion compensation prediction mode, the decoder can attempt the affine motion compensation prediction mode when determining the block partitioning method and prediction mode of the CTU. It should be noted that when determining the block partitioning method and prediction mode of the current CTU, the CUs in the current CTU are not reconstructed. In one possible implementation, a CU template can be used to replace the CUs in determining the prediction mode of each CU in the current CTU. The CU template includes the decoded area above and / or the decoded area to the left of the CU.
[0156] This application does not limit the specific method for determining the block division method and prediction mode of the current CTU based on the parameters of intense motion.
[0157] In some embodiments, the current CTU's block partitioning method is a preset block partitioning method, and the CTU's prediction mode is determined based on the severe motion parameters. For example, if the severe motion parameters indicate that the affine motion compensation prediction mode should be skipped, then a prediction mode other than the affine motion compensation prediction mode is determined as the CTU's prediction mode. If the severe motion parameters indicate that the affine motion compensation prediction mode should not be skipped, then the affine motion compensation prediction mode is determined as the CTU's prediction mode.
[0158] In some embodiments, the current CTU's block partitioning method and prediction mode are determined based on the optimal prediction mode corresponding to N block partitioning methods. The optimal prediction mode corresponding to the i-th block partitioning method among the N block partitioning methods is determined based on drastic motion parameters. Specifically, for the i-th block partitioning method among the N block partitioning methods, the optimal prediction mode corresponding to the i-th block partitioning method is determined based on the drastic motion parameters. This allows the determination of the optimal prediction mode corresponding to each of the N block partitioning methods. Then, based on the optimal prediction modes corresponding to the N block partitioning methods, the current CTU's block partitioning method and prediction mode are determined. For example, the block partitioning method with the lowest cost among the optimal prediction modes corresponding to the N block partitioning methods is determined as the current CTU's block partitioning method, and the optimal prediction mode corresponding to the current CTU's block partitioning method is determined as the current CTU's prediction mode.
[0159] In this embodiment of the application, no restrictions are placed on the specific method for determining the optimal prediction mode corresponding to the i-th block partitioning method.
[0160] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should be skipped, then one or more prediction modes other than the affine motion compensation prediction mode are determined as the optimal prediction mode corresponding to the i-th block partitioning method.
[0161] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should not be skipped, then the affine motion compensation prediction mode is determined as the optimal prediction mode corresponding to the i-th block partitioning method.
[0162] In some embodiments, the optimal prediction mode corresponding to the i-th block partitioning method is determined based on the optimal prediction modes of M CUs, wherein the M CUs are obtained by partitioning the current CTU using the i-th block partitioning method, and the optimal prediction mode of the j-th CU among the M CUs is determined from at least one candidate prediction mode of the j-th CU, wherein at least one candidate prediction mode of the j-th CU is determined based on the violent motion parameters.
[0163] 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 violent motion parameters, the optimal prediction mode corresponding to each of the M CUs is determined. Specifically, for each CU among the M CUs, such as the j-th CU, at least one candidate prediction mode is determined for the j-th CU based on the violent motion parameters.
[0164] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should be skipped, then the affine motion compensation prediction mode is not included in at least one candidate prediction mode of the j-th CU.
[0165] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should not be skipped, then at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
[0166] 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.
[0167] 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.
[0168] In some embodiments, the optimal prediction mode of the j-th CU is determined from at least one candidate prediction mode based on the cost of predicting the j-th CU according to at least one candidate prediction mode of the j-th CU.
[0169] 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 this embodiment of the application, the specific process of determining the block partitioning method and prediction mode of the CTU is as follows: For the i-th block partitioning method among the preset N block partitioning methods, the current CTU is partitioned into M CUs using the i-th block partitioning method. For each of these M CUs, the optimal prediction mode of each CU is determined according to the violent motion parameters. Specifically, for the j-th CU among the M CUs, if the violent motion parameters indicate that the affine motion compensation prediction mode is skipped, then 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; if the violent motion parameters indicate that the affine motion compensation prediction mode is not skipped, then it is determined that the at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode. Next, the j-th CU is predicted using each of the at least one candidate prediction modes from the j-th CU, resulting in a predicted value for each candidate prediction mode. Based on the predicted value of each candidate prediction mode and the original value of the j-th CU, the cost of each candidate prediction mode for the j-th CU is determined. In this embodiment, to reduce the computational workload of the cost, the cost of each candidate prediction mode can be calculated using an approximate cost method. For example, based on the predicted value of each candidate prediction mode and the original value of the j-th CU, an approximate cost such as the sum of absolute differences (SAD) or the sum of absolute differences (SATD) after Adamard transformation can be calculated. Based on the cost of each candidate prediction mode from the at least one candidate prediction mode for the j-th CU, a candidate prediction mode is determined as the optimal prediction mode for the j-th CU. For example, the candidate prediction mode with the lowest cost among the at least one candidate prediction modes for the j-th CU is selected as the optimal prediction mode for the j-th CU. Referring to the method for determining the optimal prediction mode of 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 these M CUs is then defined as the optimal prediction mode corresponding to the i-th block partitioning method. The sum of the costs corresponding to the optimal prediction modes for each of these M CUs is defined as the cost corresponding to the i-th block partitioning method. Based on 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 these N block partitioning methods is defined as the block partitioning method for the current CTU, and thus the optimal prediction mode corresponding to the block partitioning method of the current CTU is defined as the optimal prediction mode for the current CTU.For example, block partitioning method 1 is the block partitioning method with the lowest cost among N block partitioning methods. Therefore, block partitioning method 1 is determined as the block partitioning method of the current CTU. Suppose that block partitioning method 1 divides the current CTU into 4 CUs. The optimal prediction mode of each of these 4 CUs is prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4 respectively. Therefore, prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4 are determined as the optimal prediction mode of the current CTU.
[0170] As can be seen from the above, in the embodiments of this application, when determining the block partitioning method and prediction mode of the current CTU, for each CU under each block partitioning method, the optimal prediction mode is determined based on the violent motion parameters. In this way, when the CU is a translational motion video, the affine motion compensation prediction mode can be skipped, thereby greatly saving computing resources, effectively improving the determination efficiency of the block partitioning method and prediction mode of the current CTU, and thus improving coding performance.
[0171] The process of determining the parameters of intense exercise according to the embodiments of this application will be described below.
[0172] In some embodiments, the aforementioned drastic motion parameters include at least one of the drastic motion parameters of the current frame, the drastic motion parameters of the current CTU, and the drastic motion parameters of the current CU. That is, the drastic motion parameters in this application embodiment include at least one of frame-level drastic motion parameters, CTU-level motion translation parameters, and CU-level motion parameters.
[0173] The motion parameters of the current frame indicate whether to skip the affine motion compensation prediction mode. Specifically, if the motion parameters of the current frame are less than a first threshold, it indicates that the current frame is a translational motion video. In this case, when determining the prediction mode for each CU in the current frame, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of prediction mode determination and reducing the computational load. If the motion parameters of the current frame are greater than or equal to the first threshold, it indicates that the current frame is not a translational motion video. In this case, when determining the prediction mode, the affine motion compensation prediction mode is attempted, thereby improving the accuracy of prediction mode determination and enhancing the coding performance.
[0174] The embodiments of this application do not limit the specific value of the first threshold.
[0175] This application does not limit the specific method for determining the violent motion parameters of the current frame in the embodiments.
[0176] In some embodiments, the drastic motion parameters of the current frame are determined based on the positional changes of pixels in the current frame and the previous frame. For example, the drastic motion parameters of the current frame are determined based on the translational displacement of pixels in the current frame relative to pixels in the previous frame.
[0177] 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.
[0178] Specifically, the current frame is divided into K CTUs, and the drastic motion parameters of each of the K CTUs are determined. Based on the drastic motion parameters of each of the K CTUs, the drastic motion parameters of the current frame are determined. Specifically, for the k-th CTU among the K CTUs, a reference CTU for the k-th CTU is determined in the previous frame. Then, based on the k-th CTU and its reference CTU in the previous frame, the drastic motion parameters of the k-th CTU are determined. Referring to the method for determining the drastic motion parameters of the k-th CTU, the drastic motion parameters of each of the K CTUs included in the current frame can be determined, and then, based on the drastic motion parameters of each of the K CTUs, the drastic motion parameters of the current frame can be determined.
[0179] The embodiments of this application do not limit the specific method for determining the intense motion parameters of the kth CTU as described above.
[0180] In some embodiments, the violent motion parameters of the kth CTU are determined based on the pixel values of the kth CTU and the reference CTU. That is, the violent motion parameters of the kth CTU are determined based on the pixel values of the kth CTU and the reference CTU.
[0181] For example, based on the pixel values of the pixels in the k-th CTU and the pixel values of the pixels in the reference CTU, the translational displacement of the k-th CTU relative to the reference CTU is determined, and then the violent motion parameters of the k-th CTU are determined based on the translational displacement of the k-th CTU relative to the reference CTU.
[0182] For example, the motion parameters of the k-th CTU are determined based on the absolute difference between the pixel values of the k-th CTU and the pixel values of the reference CTU. That is, for each pixel in the k-th CTU, the absolute difference between the pixel value of that pixel in the k-th CTU and the pixel value in the reference CTU is determined, and then the motion parameters of the k-th CTU are determined based on the absolute difference between the pixel values of each pixel in the k-th CTU and each pixel in the reference CTU.
[0183] In one example, the strenuous exercise parameters of the k-th CTU are determined according to the following formula (3):
[0184]
[0185] Among them, MS_CTU k For the intense motion parameters of the k-th CTU, CTU k Ori (x,y) is the pixel value of the k-th CTU at position (x,y), and CTU k Ref (x,y) is the pixel value of the k-th CTU at position (x,y) in the previous frame, representing the reference CTU. k -H represents the height of the k-th CTU and the reference CTU. k -W represents the width of the k-th CTU and the reference CTU.
[0186] This 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 embodiments.
[0187] In some embodiments, the sum of the violent motion parameters of the K CTUs included in the current frame is determined as the violent motion parameters of the current frame.
[0188] In some embodiments, the drastic motion parameters of the current frame are determined based on the drastic motion parameters of P CTUs out of K CTUs, where P is a positive integer less than or equal to K. Specifically, based on the drastic motion parameters of each of the K CTUs included in the current frame, P CTUs with drastic motion parameters greater than the first preset value are selected from these K CTUs, and then the drastic motion parameters of the current frame are determined based on the drastic motion parameters of these P CTUs.
[0189] In one possible implementation, the sum of the violent motion parameters of these P CTUs is determined as the violent motion parameters of the current frame.
[0190] In another possible implementation, the motion parameters of the current frame are determined based on the sum of the motion parameters of the P CTUs and the total area of the P CTUs. For example, the motion parameters of the current frame are the ratio of the sum of the motion parameters of the P CTUs to the total area of the P CTUs. For instance, the motion parameters of the current frame are determined according to the following formula (4):
[0191]
[0192] Where MS represents the motion parameters of the current frame. It is the sum of the violent motion parameters of P CTUs.
[0193] The embodiments of this application do not limit the specific value of the first preset value.
[0194] 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.
[0195] In this embodiment, the drastic motion parameter of the current CTU is used to indicate whether the current CTU should skip the affine motion compensation prediction mode. That is, if the drastic motion parameter of the current CTU is less than a second threshold, it indicates that the current CTU is a translational motion video. In this case, when determining the prediction mode for each CU in the current CTU, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of prediction mode determination and reducing the computational load. If the drastic motion parameter of the current CTU is greater than or equal to the second threshold, it indicates that the current CTU is not a translational motion video. In this case, when determining the prediction mode, the affine motion compensation prediction mode is attempted, thereby improving the accuracy of prediction mode determination and enhancing the coding effect.
[0196] The embodiments of this application do not impose any restrictions on the specific value of the second threshold.
[0197] This application does not limit the specific method for determining the intense motion parameters of the current CTU in the embodiments.
[0198] In some embodiments, the drastic motion parameters of the current CTU are determined based on the current CTU and a reference CTU in the previous frame of the current CTU. For example, the drastic motion parameters of the current CTU are determined based on the translational displacement of the pixels in the current CTU relative to the pixels of the reference CTU in the previous frame.
[0199] This application does not limit the specific method for determining the current CTU's violent motion parameters as described above in the embodiments.
[0200] In some embodiments, the aforementioned drastic motion parameters of the current CTU are determined based on the pixel values of the current CTU and the pixel values of the reference CTU. That is, the drastic motion parameters of the current CTU are determined based on the pixel values of the current CTU and the pixel values of the reference CTU.
[0201] For example, based on the pixel values of the current CTU and the pixel values of the reference CTU, the translational displacement of the current CTU relative to the reference CTU is determined, and then the violent motion parameters of the current CTU are determined based on the translational displacement of the current CTU relative to the reference CTU.
[0202] For example, the motion parameters of the current CTU are 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, and then the motion parameters of the current CTU are determined based on the absolute difference between the pixel values of each pixel in the current CTU and each pixel in the reference CTU.
[0203] In one example, the current CTU's violent motion parameters are determined according to the following formula (5):
[0204]
[0205] Where MS_CTU represents the current CTU's violent motion parameters, and 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 in the previous frame at position (x,y), CTU-H is the height of the current CTU and the corresponding reference CTU, and CTU-W is the width of the current CTU and the corresponding reference CTU.
[0206] The above describes the specific process for determining the current CTU's violent motion parameters. The following describes the process for determining the current CU's violent motion parameters.
[0207] In this embodiment, the drastic motion parameters of the current CU are used to indicate whether the current CU should skip the affine motion compensation prediction mode. That is, if the drastic motion parameters of the current CU are less than a third threshold, it indicates that the current CU is a translational motion video. In this case, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of prediction mode determination and reducing the computational load. If the drastic motion parameters of the current CU are greater than or equal to the third threshold, it indicates that the current CU is not a translational motion video. In this case, when determining the prediction mode, the affine motion compensation prediction mode is attempted, thereby improving the accuracy of prediction mode determination and enhancing the coding effect.
[0208] The embodiments of this application do not impose any restrictions on the specific value of the third threshold mentioned above.
[0209] This application does not limit the specific method for determining the violent motion parameters of the current CU in the embodiments.
[0210] In some embodiments, the violent motion parameters of the current CU are determined based on the current CU and a reference CU in the previous frame of the current frame. For example, the violent motion parameters of the current CU are determined based on the translational displacement of the pixels in the current CU relative to the pixels of the reference CU in the previous frame.
[0211] This application embodiment does not limit the specific method for determining the current CU's violent motion parameters as described above.
[0212] In some embodiments, the aforementioned violent motion parameters of the current CU are determined based on the pixel values of the current CU and the pixel values of the reference CU. That is, the violent motion parameters of the current CU are determined based on the pixel values of the current CU and the pixel values of the reference CU.
[0213] For example, based on the pixel values of the current CU and the pixel values of the reference CU, the translational displacement of the current CU relative to the reference CU is determined, and then the violent motion parameters of the current CU are determined based on the translational displacement of the current CU relative to the reference CU.
[0214] For example, the motion parameters of the current CU are 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 motion parameters of the current CU are determined based on the absolute difference between the pixel values of each pixel in the current CU and each pixel in the reference CU.
[0215] In one example, the violent motion parameters of the current CU are determined according to the following formula (6):
[0216]
[0217] Where MS_CU represents the current CU's violent motion parameters, and CU Ori (x,y) is the pixel value of the current CU at position (x,y), and the CU Ref (x,y) is the pixel value of the reference 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.
[0218] The foregoing provides a detailed description of the drastic motion parameters of the current frame, the current CTU, and the current CU in this embodiment of the application. This allows for the determination of whether to skip the affine motion compensation prediction mode during prediction based on the drastic motion parameters, thereby saving computational resources and improving prediction efficiency.
[0219] In some embodiments, the aforementioned 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, then the intense motion parameters are determined. Therefore, the preset conditions in the embodiments of this application can be understood as the conditions that need to be met to execute the affine motion compensation prediction mode.
[0220] The embodiments of this application do not limit the specific content of the above-mentioned preset conditions.
[0221] In one possible implementation, the preset conditions include the value of the first flag being a first numerical value, and the current CU size satisfying at least one of the preset sizes.
[0222] The first flag indicates whether the current sequence is allowed to use the affine motion compensation prediction mode, and the first value indicates that the current sequence is allowed to use the affine motion compensation prediction mode.
[0223] For example, if the first flag is set to a first value, it indicates that the current sequence is allowed to use the affine motion compensation prediction mode; if the first flag is set to a second value, it indicates that the current sequence is not allowed to use the affine motion compensation prediction mode.
[0224] The embodiments of this application do not limit the specific values of the first and second values mentioned above.
[0225] Optional, the first value is 1.
[0226] Optionally, the second value is 0.
[0227] The aforementioned first flag can be obtained by decoding the bitstream. That is, if the encoder determines that the current sequence does not allow the use of affine motion compensation prediction mode, it sets the value of the first flag to 0 and writes the flag to 0 into the bitstream; or, if the encoder determines that the current sequence allows the use of affine motion compensation prediction mode, it sets the value of the first flag to 1 and writes the flag to 1 into the bitstream. The decoder then decodes the bitstream, obtains the first flag, and determines whether the current sequence is allowed to use 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 affine motion compensation prediction mode. In this case, there is no need to determine the violent motion parameters; instead, the affine motion compensation prediction mode is skipped. If the value of the first flag is 1, it is determined that the current sequence allows the use of affine motion compensation prediction mode. In this case, 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, then the violent motion parameters are determined.
[0228] This application embodiment does not limit the specific value of the preset scale that the current CU size satisfies. For example, the preset size is that the length and / or width of the CU is greater than or equal to a preset value, such as greater than or equal to 8, or the preset size is that the area of the CU is greater than a certain preset value.
[0229] In some embodiments, if the translation parameters are the drastic motion parameters of the current frame, then the preset conditions include the value of the first flag being a first value. That is, when the value of the first flag is the first value, the drastic motion parameters of the current frame are determined.
[0230] In some embodiments, if the aforementioned translational operation parameters are the current CTU's drastic motion parameters, then the aforementioned preset conditions include the value of the first flag being a first value. That is, the drastic motion parameters of the current CTU are determined by the value of the first flag being a first value.
[0231] In some embodiments, if the aforementioned translational operation parameters are the violent motion parameters of the current CU, then the aforementioned preset conditions include the value of the first flag being a first value, and the size of the current CU satisfying a preset size. That is, when the value of the first flag is a first value and the size of the current CU satisfies the preset size, the violent motion parameters of the current CU are determined.
[0232] For example, the first flag can be represented by sps_affine_enable_flag.
[0233] In some embodiments, when determining the optimal prediction mode for the current CU, if the value of the first flag is a first value, the violent motion parameters indicate that the affine motion compensation prediction mode is not skipped, and the size of the current CU meets the prediction size, then the affine motion compensation prediction mode is used to estimate the motion of the current CU, the prediction cost CurBestCostAffine is calculated, and the prediction mode CurBestModeAffine is saved. Simultaneously, the prediction cost corresponding to each of the other candidate prediction modes for 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 lowest cost is selected as the optimal prediction mode for the current CU.
[0234] 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, then 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, the cost corresponding to each prediction mode is obtained, and the prediction mode with the lowest cost is determined as the optimal prediction mode for the current CU.
[0235] The above describes the process of determining the parameters of intense motion, and how the current CTU's block partitioning method and prediction mode are determined based on these parameters. After determining the current CTU's block partitioning method and prediction mode, the decoder performs reconstruction based on these methods, as specifically described in S603 to S605 below.
[0236] S603. Divide the current CTU into blocks using the current CTU's block partitioning method to obtain at least one CU.
[0237] S604. For the current CU in at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU and obtain the predicted value of the current CU.
[0238] In this embodiment, the decoding end determines the block partitioning method and prediction mode of the current CTU according to S602 above. Then, it partitions the current CTU into blocks using the current CTU's block partitioning method, for example, dividing the current CTU into at least one CU. For the current CU among these 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, obtaining the predicted value of the current CU. That is, the prediction mode of the current CTU includes the prediction mode of each CU among the at least one CU. Thus, when determining the predicted value of each CU among these at least one CU, the prediction mode corresponding to that CU in the prediction mode of the CTU can be used to predict the CU, obtaining the predicted value of that CU.
[0239] S605. Based on the residual value of the current CTU, determine the residual value of the current CU, and based on the residual value and the predicted value of the current CU, obtain the reconstructed value of the current CU.
[0240] According to the steps in S601 above, the decoding end determines the residual value of the current CTU by decoding the bitstream. In this way, based on the block division method of the current CTU, the residual value of the current CU in the current CTU can be determined.
[0241] Next, based on the residual value and predicted value of the current CU, the reconstructed value of the current CU is determined. For example, the sum of the residual value and predicted value of the current CU is used as the reconstructed value of the current CU.
[0242] 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 to wait for video playback.
[0243] The video decoding method provided in this application includes decoding the bitstream, determining the residual value of the current coding tree unit (CTU), determining the block partitioning method and prediction mode of the current CTU (based on a drastic motion parameter indicating whether to skip the affine motion compensation prediction mode), partitioning the current CTU into blocks using the current CTU's block partitioning method to obtain at least one coding unit (CU), predicting the current CU using the prediction mode corresponding to the current CU in the current CTU's prediction mode to obtain the predicted value of the current CU, determining the residual value of the current CU based on the residual value of the current CTU, and obtaining the reconstructed value of the current CU based on the residual value and the predicted value. In other words, in this application embodiment, the drastic 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 computational resources caused by using the affine motion compensation prediction mode to predict translational motion videos, thus reducing encoding time, improving video encoding efficiency, and saving computational resources.
[0244] The decoding method of the embodiments of this application has been described above. Based on this, the encoding method provided by the embodiments of this application will be described below.
[0245] Figure 7 This is a schematic flowchart of a video encoding method provided in an embodiment of this application. This embodiment of the application is applied to... Figure 1 and Figure 2 The encoder shown. (As shown) Figure 7 As shown, the method in this application embodiment includes:
[0246] S701, Determine the parameters for strenuous exercise.
[0247] Among them, the violent motion parameter is used to indicate whether to skip the affine motion compensation prediction mode.
[0248] In some embodiments, the current CU is also referred to as the current block, current image block, current decoding block, current encoding unit, current block to be decoded, current image block to be decoded, etc.
[0249] In some embodiments of this application, the current CU only includes chroma components, which can be understood as chroma blocks.
[0250] In some embodiments of this application, the current CU only includes a luminance component, which can be understood as a luminance block.
[0251] In some embodiments, the current CU includes both a luminance component and a chrominance component.
[0252] The encoding process in this embodiment is as follows: The current image frame is divided into blocks to obtain the current control unit (CU); the prediction mode of the current CU is determined; the prediction mode of the current CU is used to predict 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 transform coefficients; optionally, the transform coefficients are quantized, and the quantized transform coefficients are encoded to obtain a bitstream.
[0253] The prediction process in the above-described encoding process involved in the embodiments of this application.
[0254] In this embodiment, the affine motion compensation prediction mode is complex and consumes significant computational resources, resulting in low coding efficiency. Furthermore, the affine motion compensation prediction mode is primarily used to efficiently represent irregular movements such as zooming in / out and rotation. For translational motion videos, the performance gain of the affine motion compensation prediction mode is limited. Therefore, when using the affine motion compensation prediction mode for translational motion videos, the compression effect is not significant, but it consumes a large amount of computational resources and increases coding time. Therefore, in this embodiment, before using the affine motion compensation prediction mode for prediction, a drastic motion parameter is first determined. This parameter indicates whether the current video is a translational motion video. If the current video is determined to be a translational motion video, the affine motion compensation prediction mode is skipped. This avoids wasting computational resources when using the affine motion compensation prediction mode for translational motion videos, thereby improving video coding efficiency and saving computational resources.
[0255] The violent motion parameter in this embodiment is used to indicate whether the current video is a translational motion video. If it is a translational motion video, the affine motion compensation prediction mode is skipped. Therefore, the violent motion parameter in this embodiment 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, the current video is determined to be a translational motion video. In this case, the affine motion compensation prediction mode is skipped, thereby avoiding the waste of computational resources caused by using the affine motion compensation prediction mode to predict translational motion videos, thus improving video encoding efficiency and saving computational resources.
[0256] If the parameters of violent motion are greater than or equal to the preset values, it is determined that the current video is not a translational motion video. In this case, the affine motion compensation prediction mode can be used for prediction to improve the video encoding effect.
[0257] The process of determining the parameters of intense exercise in S701 above is described below.
[0258] In some embodiments, the aforementioned drastic motion parameters include at least one of the drastic motion parameters of the current frame, the drastic motion parameters of the current CTU, and the drastic motion parameters of the current CU. That is, the drastic motion parameters in this application embodiment include at least one of frame-level drastic motion parameters, CTU-level motion translation parameters, and CU-level motion parameters.
[0259] The motion parameters of the current frame indicate whether to skip the affine motion compensation prediction mode. Specifically, if the motion parameters of the current frame are less than a first threshold, it indicates that the current frame is a translational motion video. In this case, when determining the prediction mode for each CU in the current frame, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of prediction mode determination and reducing the computational load. If the motion parameters of the current frame are greater than or equal to the first threshold, it indicates that the current frame is not a translational motion video. In this case, when determining the prediction mode, the affine motion compensation prediction mode is attempted, thereby improving the accuracy of prediction mode determination and enhancing the coding performance.
[0260] The embodiments of this application do not limit the specific value of the first threshold.
[0261] This application does not limit the specific method for determining the violent motion parameters of the current frame in the embodiments.
[0262] In some embodiments, if the violent motion parameters include the violent motion parameters of the current frame, the encoder determines the violent motion parameters of the current frame based on the translational displacement of the pixels in the current frame relative to the pixels in the previous frame.
[0263] In some embodiments, if the violent motion parameters include the violent motion parameters of the current frame, the encoding end determines the violent motion parameters of the current frame according to the following steps S701-A1 and S701-A21:
[0264] S701-A1. For the kth CTU among the K CTUs included in the current frame, determine the violent motion parameters of the kth CTU 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.
[0265] S701-A2: Determine the violent motion parameters of the current frame based on the violent motion parameters of the K CTUs included in the current frame.
[0266] Specifically, the current frame is divided into K CTUs, and the drastic motion parameters of each of the K CTUs are determined. Based on the drastic motion parameters of each of the K CTUs, the drastic motion parameters of the current frame are determined. Specifically, for the k-th CTU among the K CTUs, a reference CTU for the k-th CTU is determined in the previous frame. Then, based on the k-th CTU and its reference CTU in the previous frame, the drastic motion parameters of the k-th CTU are determined. Referring to the method for determining the drastic motion parameters of the k-th CTU, the drastic motion parameters of each of the K CTUs included in the current frame can be determined, and then, based on the drastic motion parameters of each of the K CTUs, the drastic motion parameters of the current frame can be determined.
[0267] This application embodiment does not limit the specific method of determining the violent motion parameters of the kth CTU in S701-A1 above.
[0268] In some embodiments, S701-A1 above includes the following S701-A11:
[0269] S701-A11. Determine the violent motion parameters of the kth CTU based on the pixel value of the kth CTU and the pixel value of the reference CTU.
[0270] For example, based on the pixel values of the pixels in the k-th CTU and the pixel values of the pixels in the reference CTU, the translational displacement of the k-th CTU relative to the reference CTU is determined, and then the violent motion parameters of the k-th CTU are determined based on the translational displacement of the k-th CTU relative to the reference CTU.
[0271] For example, for each pixel in the k-th CTU, the absolute difference between the pixel value in the k-th 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 k-th CTU and each pixel in the reference CTU, the violent motion parameters of the k-th CTU are determined.
[0272] In one example, the violent motion parameters of the kth CTU are determined according to the above formula (3).
[0273] This application embodiment 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.
[0274] In some embodiments, S701-A2 includes: determining the sum of the violent motion parameters of the K CTUs included in the current frame as the violent motion parameters of the current frame.
[0275] In some embodiments, S701-A2 above includes the following steps S701-A21 and S701-A22:
[0276] S701-A21. Select P CTUs from K CTUs whose violent motion parameters are greater than the first preset value, where P is a positive integer less than or equal to K;
[0277] S701-A22. Determine the motion parameters of the current frame based on the motion parameters of P CTUs.
[0278] The embodiments of this application do not limit the specific value of the first preset value.
[0279] In one example, the sum of the violent motion parameters of these P CTUs is determined as the violent motion parameters of the current frame.
[0280] In another example, the motion parameters of the current frame are determined based on the sum of the motion parameters of the P CTUs and the total area of the P CTUs.
[0281] For example, the ratio of the sum of the violent motion parameters of P CTUs to the total area of P CTUs is determined as the violent motion parameter of the current frame.
[0282] For example, the violent motion parameters of the current frame are determined according to the above formula (4).
[0283] 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.
[0284] In this embodiment, the drastic motion parameter of the current CTU is used to indicate whether the current CTU should skip the affine motion compensation prediction mode. That is, if the drastic motion parameter of the current CTU is less than a second threshold, it indicates that the current CTU is a translational motion video. In this case, when determining the prediction mode for each CU in the current CTU, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of prediction mode determination and reducing the computational load. If the drastic motion parameter of the current CTU is greater than or equal to the second threshold, it indicates that the current CTU is not a translational motion video. In this case, when determining the prediction mode, the affine motion compensation prediction mode is attempted, thereby improving the accuracy of prediction mode determination and enhancing the coding effect.
[0285] The embodiments of this application do not impose any restrictions on the specific value of the second threshold.
[0286] This application does not limit the specific method for determining the intense motion parameters of the current CTU in the embodiments.
[0287] In some embodiments, if the violent motion parameters include the violent motion parameters of the current CTU, the encoder determines the violent motion parameters of the current CTU based on the translational displacement of the pixels in the current CTU relative to the pixels of the reference CTU in the previous frame.
[0288] In some embodiments, if the violent motion parameters include the violent motion parameters of the current CTU, the encoding end determines the violent motion parameters of the current CTU through the following steps S701-B:
[0289] S701-B: Determine the violent motion parameters of the current CTU based on the current CTU and the reference CTU in the previous frame of the current CTU.
[0290] The embodiments of this application do not limit the specific implementation of S701-B described above.
[0291] In some embodiments, S701-B includes determining the violent motion parameters of the current CTU based on the pixel values of the current CTU and the pixel values of the reference CTU.
[0292] In one example, the translational 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. Then, the violent motion parameters of the current CTU are determined based on the translational displacement of the current CTU relative to the reference CTU.
[0293] In another example, the violent motion parameters of the current CTU are determined based on the absolute difference between the pixel values of the current CTU and the pixel values of the reference CTU.
[0294] For example, for each pixel in the current CTU, determine the absolute difference between the pixel value in the current CTU and the pixel value in the reference CTU, and then determine the violent motion parameters of the current CTU based on the absolute difference between the pixel values of each pixel in the current CTU and each pixel in the reference CTU.
[0295] For example, the current CTU's violent motion parameters are determined according to the above formula (5).
[0296] The above describes the specific process for determining the current CTU's violent motion parameters. The following describes the process for determining the current CU's violent motion parameters.
[0297] In this embodiment, the drastic motion parameters of the current CU are used to indicate whether the current CU should skip the affine motion compensation prediction mode. That is, if the drastic motion parameters of the current CU are less than a third threshold, it indicates that the current CU is a translational motion video. In this case, when determining the prediction mode of the current CU, the affine motion compensation prediction mode is skipped, thereby improving the efficiency of prediction mode determination and reducing the computational load. If the drastic motion parameters of the current CU are greater than or equal to the third threshold, it indicates that the current CU is not a translational motion video. In this case, when determining the prediction mode, the affine motion compensation prediction mode is attempted, thereby improving the accuracy of prediction mode determination and enhancing the coding effect.
[0298] The embodiments of this application do not impose any restrictions on the specific value of the third threshold mentioned above.
[0299] This application does not limit the specific method for determining the violent motion parameters of the current CU in the embodiments.
[0300] In some embodiments, the encoder determines the drastic motion parameters of the current CU based on the translational displacement of the pixels in the current CU relative to the pixels of the reference CU in the previous frame.
[0301] In some embodiments, the encoding end determines the current CU's violent motion parameters according to the following steps S701-C:
[0302] S701-C: Determine the violent motion parameters of the current CU based on the pixel values of the current CU and the pixel values of the reference CU.
[0303] In one example, the translational 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. Then, the violent motion parameters of the current CU are determined based on the translational displacement of the current CU relative to the reference CU.
[0304] In another example, the violent motion parameters of the current CU are determined based on the absolute difference between the pixel values of the current CU and the pixel values of the reference CU.
[0305] For example, for each pixel in the current CU, determine the absolute difference between the pixel value in the current CU and the pixel value in the reference CU, and then determine the violent motion parameters 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.
[0306] For example, the current CU's violent motion parameters are determined according to the above formula (6).
[0307] The foregoing provides a detailed description of the drastic motion parameters of the current frame, the current CTU, and the current CU in this embodiment of the application. This allows for the determination of whether to skip the affine motion compensation prediction mode during prediction based on the drastic motion parameters, thereby saving computational resources and improving prediction efficiency.
[0308] In some embodiments, under preset conditions, the above-described S701 step is performed to determine the parameters of intense motion. That is, before determining the parameters of intense motion, it is first determined whether the preset conditions are met; if the preset conditions are met, the parameters of intense motion are determined. Therefore, the preset conditions in this embodiment can be understood as the conditions that need to be met to execute the affine motion compensation prediction mode.
[0309] The embodiments of this application do not limit the specific content of the above-mentioned preset conditions.
[0310] In one possible implementation, the preset conditions include the value of the first flag being a first numerical value, and the current CU size satisfying at least one of the preset sizes.
[0311] The first flag indicates whether the current sequence is allowed to use the affine motion compensation prediction mode, and the first value indicates that the current sequence is allowed to use the affine motion compensation prediction mode.
[0312] For example, if the first flag is set to a first value, it indicates that the current sequence is allowed to use the affine motion compensation prediction mode; if the first flag is set to a second value, it indicates that the current sequence is not allowed to use the affine motion compensation prediction mode.
[0313] The embodiments of this application do not limit the specific values of the first and second values mentioned above.
[0314] Optional, the first value is 1.
[0315] Optionally, the second value is 0.
[0316] In other words, when the encoder determines that the current sequence is not allowed to use the affine motion compensation prediction mode, it sets the value of the first flag to 0 and writes the 0-valued first flag into the bitstream. Alternatively, when the encoder determines that the current sequence is allowed to use the affine motion compensation prediction mode, it sets the value of the first flag to 1 and writes the 1-valued first flag into the bitstream. The decoder then decodes the bitstream, 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 is not allowed to use the affine motion compensation prediction mode.
[0317] This application embodiment does not limit the specific value of the preset scale that the current CU size satisfies. For example, the preset size is that the length and / or width of the CU is greater than or equal to a preset value, such as greater than or equal to 16, or the preset size is that the area of the CU is greater than a certain preset value.
[0318] In some embodiments, if the translation parameters are the drastic motion parameters of the current frame, then the preset conditions include the value of the first flag being a first value. That is, when the value of the first flag is the first value, the drastic motion parameters of the current frame are determined.
[0319] In some embodiments, if the aforementioned translational operation parameters are the current CTU's drastic motion parameters, then the aforementioned preset conditions include the value of the first flag being a first value. That is, the drastic motion parameters of the current CTU are determined by the value of the first flag being a first value.
[0320] In some embodiments, if the aforementioned translational operation parameters are the violent motion parameters of the current CU, then the aforementioned preset conditions include the value of the first flag being a first value, and the size of the current CU satisfying a preset size. That is, when the value of the first flag is a first value and the size of the current CU satisfies the preset size, the violent motion parameters of the current CU are determined.
[0321] For example, the first flag can be represented by sps_affine_enable_flag.
[0322] In some embodiments, when determining the optimal prediction mode for the current CU, if the value of the first flag is a first value, the violent motion parameters indicate that the affine motion compensation prediction mode is not skipped, and the size of the current CU meets the prediction size, then the affine motion compensation prediction mode is used to estimate the motion of the current CU, the prediction cost CurBestCostAffine is calculated, and the prediction mode CurBestModeAffine is saved. Simultaneously, the prediction cost corresponding to each of the other candidate prediction modes for 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 lowest cost is selected as the optimal prediction mode for the current CU.
[0323] 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, then 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, the cost corresponding to each prediction mode is obtained, and the prediction mode with the lowest cost is determined as the optimal prediction mode for the current CU.
[0324] The above describes the process of determining the parameters of intense exercise. After determining the parameters of intense exercise according to the above steps, the encoding end executes the following step S702.
[0325] S702. Based on the parameters of intense motion, determine the current block partitioning method and prediction mode of the CTU.
[0326] In some embodiments, the block partitioning method of the current CTU can be understood as the optimal block partitioning method of the current CTU. For example, the block partitioning method of the current CTU is the block partitioning method with the lowest cost among a number of preset block partitioning methods.
[0327] In some embodiments, the prediction modes of the current CTU can be understood as a set, including the prediction modes of each CU in at least one CU included in the current CTU, wherein the prediction mode of a CU can be understood as the optimal prediction mode of the CU.
[0328] In this embodiment of the application, the prediction mode of the current CTU is the prediction mode corresponding to the block partitioning method of the current CTU. For example, the current CTU is divided into at least one CU using the block partitioning method of the current CTU, and the set of prediction modes of each CU in the at least one CU is determined as the prediction mode of the current CTU.
[0329] In this embodiment of the application, when the current video is determined to be a translational motion video based on the violent motion parameters, the affine motion compensation prediction mode can be skipped when determining the block partitioning method and prediction mode of the current CTU. This reduces the workload of determining the block partitioning method and prediction mode of the current CTU, saves computing resources, and improves the efficiency of determining the block partitioning method and prediction mode of the current CTU.
[0330] This application embodiment does not limit the specific method of determining the block division method and prediction mode of the current CTU based on the violent motion parameters in the above-mentioned S702.
[0331] In some embodiments, the current CTU uses a preset block partitioning method, and the CTU's prediction mode is determined based on the severe motion parameters. For example, if the severe motion parameters indicate that the affine motion compensation prediction mode should be skipped, then one or more prediction modes other than the non-affine motion compensation prediction mode are determined as the CTU's prediction mode. If the severe motion parameters indicate that the affine motion compensation prediction mode should not be skipped, then the affine motion compensation prediction mode is determined as the CTU's prediction mode.
[0332] In some embodiments, S702 above includes the following steps S702-A1 to S702-A2:
[0333] S702-A1. For the i-th block partitioning method among the preset N block partitioning methods, determine the optimal prediction mode corresponding to the i-th block partitioning method based on the violent motion parameters, where N is a positive integer and i is a positive integer less than or equal to N.
[0334] S702-A2: Determine the block partitioning method and prediction mode of the current CTU based on the optimal prediction mode corresponding to the N block partitioning methods.
[0335] Specifically, for the i-th block partitioning method among the N block partitioning methods, the optimal prediction mode corresponding to the i-th block partitioning method is determined based on the violent motion parameters. This allows us to determine the optimal prediction mode for each of the N block partitioning methods. Next, based on the optimal prediction modes corresponding to the N block partitioning methods, the block partitioning method and prediction mode for the current CTU are determined. For example, the block partitioning method with the lowest cost among the optimal prediction modes corresponding to the N block partitioning methods is determined as the block partitioning method for the current CTU, and the optimal prediction mode corresponding to the current CTU's block partitioning method is determined as the prediction mode for the current CTU.
[0336] In this embodiment of the application, no restrictions are placed on the specific method for determining the optimal prediction mode corresponding to the i-th block partitioning method.
[0337] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should be skipped, then one or more prediction modes other than the affine motion compensation prediction mode are determined as the optimal prediction mode corresponding to the i-th block partitioning method.
[0338] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should not be skipped, then the affine motion compensation prediction mode is determined as the optimal prediction mode corresponding to the i-th block partitioning method.
[0339] In some embodiments, determining the optimal prediction mode corresponding to the i-th block partitioning method based on the violent motion parameters in S702-A1 includes the following steps:
[0340] S702-A11. Divide the current CTU into blocks using the i-th block partitioning method to obtain M CUs, where M is a positive integer;
[0341] S702-A12. For the j-th CU among M CUs, determine at least one candidate prediction mode for the j-th CU based on the violent motion parameters, where j is a positive integer less than or equal to M.
[0342] S702-A13. Determine the optimal prediction mode for the j-th CU from at least one candidate prediction mode for the j-th CU.
[0343] S702-A14. Based on the optimal prediction modes of the M CUs, determine the optimal prediction mode corresponding to the i-th block partitioning method.
[0344] 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 violent motion parameters, the optimal prediction mode corresponding to each of the M CUs is determined. Specifically, for each CU among the M CUs, such as the j-th CU, at least one candidate prediction mode is determined for the j-th CU based on the violent motion parameters.
[0345] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should be skipped, then it is determined that at least one candidate prediction mode of the j-th CU does not include the affine motion compensation prediction mode.
[0346] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode is not skipped, then it is determined that at least one candidate prediction mode of the j-th CU includes the affine motion compensation prediction mode.
[0347] 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.
[0348] 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.
[0349] For example, the cost of predicting the j-th CU based on at least one candidate prediction mode is determined from at least one candidate prediction mode.
[0350] In some embodiments, the specific process of determining the block partitioning method and prediction mode of the current CTU is as follows: For the i-th block partitioning method among the preset N block partitioning methods, the current CTU is partitioned into M CUs using the i-th block partitioning method. For each of these M CUs, the optimal prediction mode for each of the M CUs is determined based on the severe motion parameters. Specifically, for the j-th CU among the M CUs, if the severe motion parameters indicate that the affine motion compensation prediction mode should be skipped, then it is determined that at least one candidate prediction mode for the j-th CU does not include the affine motion compensation prediction mode; if the severe motion parameters indicate that the affine motion compensation prediction mode should not be skipped, then it is determined that at least one candidate prediction mode for the j-th CU includes the affine motion compensation prediction mode. Next, the j-th CU is predicted using each of the at least one candidate prediction modes from the j-th CU, resulting in a predicted value for each candidate prediction mode. Based on the predicted value of each candidate prediction mode and the original value of the j-th CU, the cost of each candidate prediction mode for the j-th CU is determined. In this embodiment, to reduce the computational workload of the cost, the cost of each candidate prediction mode can be calculated using an approximate cost method. For example, based on the predicted value of each candidate prediction mode and the original value of the j-th CU, an approximate cost such as the sum of absolute differences (SAD) or the sum of absolute differences (SATD) after Adamard transformation can be calculated. Based on the cost of each candidate prediction mode from the at least one candidate prediction mode for the j-th CU, a candidate prediction mode is determined as the optimal prediction mode for the j-th CU. For example, the candidate prediction mode with the lowest cost among the at least one candidate prediction modes for the j-th CU is selected as the optimal prediction mode for the j-th CU. Referring to the method for determining the optimal prediction mode of 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 these M CUs is then defined as the optimal prediction mode corresponding to the i-th block partitioning method. The sum of the costs corresponding to the optimal prediction modes for each of these M CUs is defined as the cost corresponding to the i-th block partitioning method. Based on 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 these N block partitioning methods is defined as the block partitioning method for the current CTU, and thus the optimal prediction mode corresponding to the block partitioning method of the current CTU is defined as the optimal prediction mode for the current CTU.For example, block partitioning method 1 is the block partitioning method with the lowest cost among N block partitioning methods. Therefore, block partitioning method 1 is determined as the block partitioning method of the current CTU. Suppose that block partitioning method 1 divides the current CTU into 4 CUs. The optimal prediction mode of each of these 4 CUs is prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4 respectively. Therefore, prediction mode 1, prediction mode 2, prediction mode 3 and prediction mode 4 are determined as the optimal prediction mode of the current CTU.
[0351] As can be seen from the above, in the embodiments of this application, when determining the block partitioning method and prediction mode of the current CTU, for each CU under each block partitioning method, the optimal prediction mode is determined based on the violent motion parameters. In this way, when the CU is a translational motion video, the affine motion compensation prediction mode can be skipped, thereby greatly saving computing resources, effectively improving the determination efficiency of the block partitioning method and prediction mode of the current CTU, and thus improving coding performance.
[0352] 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 the 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 according to the first information, and / or determines the prediction mode of the current CTU according to the second information.
[0353] The embodiments of this application do not limit the specific form of the first information and the second information.
[0354] In some embodiments, the first information is an index of the current CTU's block partitioning method.
[0355] In some embodiments, the second information is an index of the current CTU's prediction pattern.
[0356] After determining the current CTU block partitioning method and prediction mode according to the steps in S702 above, the encoding end executes the following steps in S703.
[0357] S703. Divide the current CTU into blocks using the current CTU's block partitioning method to obtain at least one CU.
[0358] S704. For the current CU in at least one CU, use the prediction mode corresponding to the current CU in the prediction mode of the current CTU to predict the current CU and obtain the predicted value of the current CU.
[0359] In this embodiment, the decoding end determines the block partitioning method and prediction mode of the current CTU according to S602 above. Then, it partitions the current CTU into blocks using the current CTU's block partitioning method, for example, dividing the current CTU into at least one CU. For the current CU among these 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, obtaining the predicted value of the current CU. That is, the prediction mode of the current CTU includes the prediction mode of each CU among the at least one CU. Thus, when determining the predicted value of each CU among these at least one CU, the prediction mode corresponding to that CU in the prediction mode of the CTU can be used to predict the CU, obtaining the predicted value of that CU.
[0360] S705. Based on the prediction value of the current CU, determine the residual value of the current CU, and obtain the bitstream based on the residual value of the current CU.
[0361] Specifically, the encoder determines the residual value of the current CU based on the predicted value of the current CU and the current CU itself. For example, the difference between the current CU and the predicted value of the current CU is determined as the residual value of the current CU.
[0362] In some embodiments, the residual value of the current CU is transformed to obtain the transformation coefficients of the current CU.
[0363] In some embodiments, the transform coefficients of the current CU are directly encoded to obtain the bitstream.
[0364] 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 the bitstream.
[0365] To further describe the encoding method provided in the embodiments of this application, taking the violent motion parameters including the violent motion parameters of the current frame as an example, the implementation process of a video encoding method using an affine motion compensation prediction mode is introduced as follows:
[0366] First, according to the steps in S701 above, the motion parameters MS of the current frame are determined. Next, the current frame is divided into multiple non-overlapping CTU blocks. Then, each CTU is processed sequentially 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:
[0367] Step 31: For the i-th block partitioning method Split[i] among the preset N block partitioning methods, the current CTU is partitioned using the i-th block partitioning method to obtain at least one CU. For the current CU among the at least one CU, the optimal prediction mode CurBestModeInter[i] corresponding to the current CU in the inter-frame 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-frame prediction mode (i.e., no affine prediction), and the prediction cost CurBestCostNoAffine is calculated and saved. Next, it is determined whether the current CU meets the requirements. That is, if sps_affine_enable_flag=1 and MS≥T1 and the current CU’s size and other fixed constraints are met, then the motion estimation of the current CU is performed using the affine motion compensation prediction mode, and the prediction cost CurBestCostAffine is calculated. The prediction mode CurBestModeAffine is saved. The prediction mode with the smallest cost among the above traditional inter-frame prediction mode and affine motion compensation prediction mode is taken as the minimum prediction cost CurBestCostInter[i] in the inter-frame prediction mode, and the corresponding mode is saved as the optimal inter-frame prediction mode CurBestModeInter[i].
[0368] Step 32: Calculate the minimum prediction cost CurBestCostOther[i] and the optimal prediction mode CurBestModeOther[i] for other prediction modes such as intra-frame prediction. Compare CurBestCostInter[i] and CurBestCostOther[i], and select the optimal prediction mode bestMode[i] and prediction cost bestCost[i] for the i-th block partitioning method.
[0369] Step 33: Iterate through all the block partitioning methods among the N block partitioning methods, and select the block partitioning method Split[opt] that minimizes the prediction cost of the current CTU and the corresponding prediction mode bestMode[opt]. Finally, divide the current CTU into blocks using the current CTU's block partitioning method 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 current CTU's prediction mode to predict the current CU and obtain the predicted value of the current CU. Based on the predicted value of the current CU, determine the residual value of the current CU, and perform transformation, quantization, and entropy coding on the residual value. Optionally, encode the prediction information (including the identifier cu.affine for whether the CU uses AFF and motion vectors, etc.) and output the bitstream.
[0370] Referring to the above steps, this application embodiment modifies the usage conditions of the affine motion compensation prediction mode, that is, modifies the usage conditions of the affine motion compensation prediction mode in the coding unit syntax. The modified Coding unit syntax is shown in Table 1:
[0371] Table 1
[0372]
[0373]
[0374] In this embodiment, the condition that the severe motion parameter MS is greater than or equal to T1 is added to the usage conditions of the affine motion compensation prediction mode. That is, in this embodiment, if the current value of the first flag is a first value, and the current CU width is greater than or equal to 16, the current CU height is greater than or equal to 16, and the severe motion parameter value is greater than or equal to T1, then the affine motion compensation prediction mode can be used; otherwise, the affine motion compensation prediction mode is skipped. This avoids the waste of computational 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 computational resources. The video coding method provided in this application determines a violent motion parameter, which indicates whether to skip the affine motion compensation prediction mode; based on the violent motion parameter, it determines the block partitioning method and prediction mode of the current coding tree unit (CTU); it partitions the current CTU into blocks using the current CTU's block partitioning method to obtain at least one coding unit (CU); for the current CU among the at least one CU, it uses the prediction mode corresponding to the current CU in the current CTU's prediction mode to predict the current CU, obtaining the predicted value of the current CU; based on the predicted value of the current CU, it determines the residual value of the current CU, and obtains the bitstream based on the residual value of the current CU. That is, in this application embodiment, 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 computational resources caused by using the affine motion compensation prediction mode to predict translational motion videos, thus reducing coding time, improving video coding efficiency, and saving computational resources.
[0375] It should be understood that Figure 4 to Figure 7 This is merely an example of what is being done and should not be construed as limiting the scope of this application.
[0376] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.
[0377] It should also be understood that, in the various method embodiments of this application, the sequence number of each process does not imply the order of execution. 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 this application. Furthermore, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. Specifically, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0378] The above text, combined with Figure 4 to... Figure 7 The method embodiments of this application are described in detail below, in conjunction with... Figures 8 to 11 The following describes in detail the device embodiments of this application.
[0379] Figure 8 This is a schematic block diagram of a video decoding apparatus provided in an embodiment of this application.
[0380] like Figure 8 As shown, the video decoding device 10 includes:
[0381] Decoding unit 11 is used to decode the bitstream and determine the residual value of the current coding tree unit (CTU).
[0382] The determining unit 12 is used to determine the block partitioning method and prediction mode of the current CTU. The block partitioning method and prediction mode of the current CTU are determined based on the violent motion parameters, which are used to indicate whether to skip the affine motion compensation prediction mode.
[0383] The partitioning unit 13 is used to partition the current CTU into blocks using the current CTU's block partitioning method to obtain at least one encoding unit CU;
[0384] The prediction unit 14 is used to predict the current CU for the current CU in the at least one CU by using the prediction mode corresponding to the current CU in the prediction mode of the current CTU, and to obtain the predicted value of the current CU.
[0385] The reconstruction unit 15 is used to determine the residual value of the current CU based on the residual value of the current CTU, and to obtain the reconstructed value of the current CU based on the residual value of the current CU and the predicted value.
[0386] In some embodiments, the determining unit 12 is specifically used to decode the bitstream to obtain at least one of first information and second information, 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; and to determine at least one of the block partitioning method and prediction mode of the current CTU based on at least one of the first information and the second information.
[0387] In some embodiments, the current CTU's block partitioning method and prediction mode are determined based on the optimal prediction mode corresponding to N block partitioning methods, and the optimal prediction mode corresponding to the i-th block partitioning method among the N block partitioning methods is determined based on the violent motion parameters, where i is a positive integer less than or equal to N.
[0388] In some embodiments, the optimal prediction mode corresponding to the i-th block partitioning method is determined based on the optimal prediction modes of M CUs. The M CUs are obtained by partitioning the current CTU using the i-th block partitioning method. The optimal prediction mode of the j-th CU among the M CUs is determined from at least one candidate prediction mode of the j-th CU. The at least one candidate prediction mode of the j-th CU is determined based on the violent motion parameters.
[0389] In some embodiments, if the violent motion parameters indicate skipping the affine motion compensation prediction mode, then the affine motion compensation prediction mode is not included in at least one candidate prediction mode of the j-th CU.
[0390] In some embodiments, if the violent motion parameters indicate that the affine motion compensation prediction mode should not be skipped, then the affine motion compensation prediction mode is included in at least one candidate prediction mode of the j-th CU.
[0391] 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 based on the cost of predicting the j-th CU according to at least one candidate prediction mode of the j-th CU.
[0392] In some embodiments, the violent motion parameters include at least one of the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU.
[0393] Wherein, 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.
[0394] 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 a 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.
[0395] In some embodiments, the violent motion parameters of the k-th CTU are determined based on the pixel values of the k-th CTU and the pixel values of the reference CTU.
[0396] In some embodiments, the violent motion parameters of the k-th CTU are determined based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU.
[0397] In some embodiments, the violent motion parameters of the current frame are determined based on the 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.
[0398] In some embodiments, the violent motion parameters of the current frame are determined based on the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs.
[0399] In some embodiments, the violent motion parameter of the current frame is the ratio of the sum of the violent motion parameters of the P CTUs to the total area of the P CTUs.
[0400] In some embodiments, the violent motion parameters of the current CTU are determined based on the current CTU and a reference CTU in the previous frame of the current frame.
[0401] In some embodiments, the violent motion parameters of the current CTU are determined based on the pixel values of the current CTU and the pixel values of the reference CTU.
[0402] In some embodiments, the violent motion parameters of the current CTU are determined based on the absolute difference between the pixel values of the current CTU and the pixel values of the reference CTU.
[0403] In some embodiments, the violent motion parameters of the current CU are determined based on the current CU and a reference CU in the previous frame of the current frame.
[0404] In some embodiments, the violent motion parameters of the current CU are determined based on the pixel values of the current CU and the pixel values of the reference CU.
[0405] In some embodiments, the violent motion parameters of the current CU are determined based on the absolute difference between the pixel values of the current CU and the pixel values of the reference CU.
[0406] In some embodiments, the parameters of the intense exercise are determined under preset conditions.
[0407] In some embodiments, the preset conditions include a first flag valued at a first numerical value, and the current CU size satisfying 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.
[0408] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 8 The apparatus 10 shown can execute the decoding method of the present application embodiment, and the aforementioned and other operations and / or functions of each unit in the apparatus 10 are respectively for implementing the corresponding processes in the above-mentioned decoding method and other methods. For the sake of brevity, they will not be described in detail here.
[0409] Figure 9 This is a schematic block diagram of a video encoding apparatus provided in an embodiment of this application.
[0410] like Figure 9 As shown, the video encoding device 20 includes:
[0411] The first determining unit 21 is used to determine the violent motion parameters, which are used to indicate whether to skip the affine motion compensation prediction mode.
[0412] The second determining unit 22 is used to determine the current CTU block division method and prediction mode based on the violent motion parameters;
[0413] The partitioning unit 23 is used to partition the current CTU into blocks using the current CTU's block partitioning method to obtain at least one CU;
[0414] The prediction unit 24 is used to predict the current CU for the current CU in the at least one CU by using the prediction mode corresponding to the current CU in the prediction mode of the current CTU, and to obtain the predicted value of the current CU.
[0415] The encoding unit 25 is used to determine the residual value of the current CU based on the prediction value of the current CU, and to obtain the bitstream based on the residual value of the current CU.
[0416] In some embodiments, the second determining unit 22 is specifically used to determine the optimal prediction mode corresponding to the i-th block partitioning method among the preset N block partitioning methods, based on the violent motion parameters, where N is a positive integer and i is a positive integer less than or equal to N; and to determine the block partitioning method and prediction mode of the current CTU based on the optimal prediction mode corresponding to the N block partitioning methods.
[0417] In some embodiments, the second determining unit 22 is specifically configured to divide the current CTU into blocks using the i-th block partitioning method to obtain M CUs, where M is a positive integer; for the j-th CU among the M CUs, determine at least one candidate prediction mode for the j-th CU based on the violent motion parameters, where j is a positive integer less than or equal to M; determine the optimal prediction mode for the j-th CU from the at least one candidate prediction mode for the j-th CU; and determine the optimal prediction mode corresponding to the i-th block partitioning method based on the optimal prediction modes of the M CUs.
[0418] In some embodiments, the second determining unit 22 is specifically configured to determine that the affine motion compensation prediction mode is not included in at least one candidate prediction mode of the j-th CU if the violent motion parameters indicate skipping the affine motion compensation prediction mode.
[0419] 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 violent motion parameters indicate that the affine motion compensation prediction mode is not skipped.
[0420] In some embodiments, the second determining unit 22 is specifically configured to determine the cost corresponding to the at least one candidate prediction mode when predicting the j-th CU using at least one candidate prediction mode of the j-th CU; and determine the optimal prediction mode of the j-th CU from the at least one candidate prediction mode of the j-th CU based on the cost corresponding to the at least one candidate prediction mode.
[0421] In some embodiments, the violent motion parameters include at least one of the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU.
[0422] Wherein, 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.
[0423] In some embodiments, if the violent motion parameters include the violent motion parameters of the current frame, then the first determining unit 21 is specifically configured 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 a 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; and determine the violent motion parameters of the current frame based on the violent motion parameters of the K CTUs included in the current frame.
[0424] In some embodiments, the first determining unit 21 is specifically used to determine the violent motion parameters of the kth CTU based on the pixel value of the kth CTU and the pixel value of the reference CTU.
[0425] In some embodiments, the first determining unit 21 is specifically configured to determine the violent motion parameters of the kth CTU based on the absolute difference between the pixel value of the kth CTU and the pixel value of the reference CTU.
[0426] In some embodiments, the first determining unit 21 is specifically used to select P CTUs from 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; and to determine the violent motion parameters of the current frame based on the violent motion parameters of the P CTUs.
[0427] In some embodiments, the first determining unit 21 is specifically used to determine the violent motion parameters of the current frame based on the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs.
[0428] In some embodiments, the first determining unit 21 is specifically used to determine the ratio of the sum of the violent motion parameters of the P CTUs to the total area of the P CTUs as the violent motion parameters of the current frame.
[0429] In some embodiments, if the violent motion parameters include the violent motion parameters of the current CTU, then the first determining 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.
[0430] In some embodiments, the first determining unit 21 is specifically used to determine the violent motion parameters of the current CTU based on the pixel values of the current CTU and the pixel values of the reference CTU.
[0431] In some embodiments, the first determining unit 21 is specifically configured to determine the violent motion parameters of the current CTU based on the absolute difference between the pixel value of the current CTU and the pixel value of the reference CTU.
[0432] In some embodiments, if the violent motion parameters include the violent motion parameters of the current CU, then the first determining 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.
[0433] In some embodiments, the first determining unit 21 is specifically used to determine the violent motion parameters of the current CU based on the pixel values of the current CU and the pixel values of the reference CU.
[0434] In some embodiments, the first determining unit 21 is specifically used to determine the violent motion parameters of the current CU based on the absolute difference between the pixel value of the current CU and the pixel value of the reference CU.
[0435] In some embodiments, the first determining unit 21 is specifically used to determine the violent motion parameters under preset conditions.
[0436] In some embodiments, the preset conditions include a first flag valued at a first numerical value, and the current CU size satisfying 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.
[0437] In some embodiments, the encoding unit 25 is further configured to write at least one of first information and second information into the bitstream, wherein the first information is used to indicate the block division method of the current CTU and the second information is used to indicate the prediction mode of the current CTU.
[0438] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 9 The apparatus 20 shown can correspond to the corresponding subject in the encoding method of the embodiments of this application, and the aforementioned and other operations and / or functions of each unit in the apparatus 20 are respectively for implementing the corresponding process in the encoding method and other methods. For the sake of brevity, they will not be described in detail here.
[0439] The apparatus and system of the embodiments of this application have been described above from the perspective of functional units in conjunction with the accompanying drawings. It should be understood that these functional units can be implemented in hardware, in software instructions, or in a combination of hardware and software units. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the methods disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or 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 random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0440] Figure 10 This is a schematic block diagram of the electronic device provided in the embodiments of this application.
[0441] As shown in Figure 32, the electronic device 30 can be the video encoder or video decoder described in the embodiments of this application. The electronic device 30 may include:
[0442] The system includes a memory 33 for storing a computer program 34 and a processor 32 for transferring the program code 34 to the processor 32. In other words, the processor 32 can retrieve and run the computer program 34 from the memory 33 to implement the methods described in the embodiments of this application.
[0443] For example, the processor 32 can be used to execute the steps in the method 200 described above according to the instructions in the computer program 34.
[0444] In some embodiments of this application, the processor 32 may include, but is not limited to:
[0445] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0446] In some embodiments of this application, the memory 33 includes, but is not limited to:
[0447] 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, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0448] In some embodiments of this 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 perform the method provided in this application. The one or more units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 34 in the electronic device 30.
[0449] like Figure 10 As shown, the electronic device 30 may further include:
[0450] Transceiver 33, which can be connected to processor 32 or memory 33.
[0451] 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 antennas, and the number of antennas may be one or more.
[0452] It should be understood that the various components in the electronic device 30 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0453] Figure 11 This is a schematic block diagram of the video encoding and decoding system provided in the embodiments of this application.
[0454] like Figure 11 As shown, 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 embodiments of this application, and the video decoder 42 is used to execute the video decoding method involved in the embodiments of this application.
[0455] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0456] This application also provides a bitstream generated using the above-described encoding method. Optionally, the bitstream includes a first flag.
[0457] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. 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. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0458] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art 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.
[0459] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0460] The units described as separate components may or may not be physically separate. 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 can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional units in the various embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0461] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A video encoding method, characterized in that, include: Determine the parameters of intense motion, which are used to indicate whether to skip the affine motion compensation prediction mode; Based on the violent motion parameters, determine the block partitioning method and prediction mode of the current coding tree unit (CTU); The current CTU is divided into blocks using the current CTU's block partitioning method to obtain at least one coding unit (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 and obtain the predicted value of the current CU. Based on the predicted value of the current CU, the residual value of the current CU is determined, and the bitstream is obtained based on the residual value of the current CU.
2. The method according to claim 1, characterized in that, The step of determining the block partitioning method and prediction mode of the current coding tree unit (CTU) based on the violent motion parameters includes: For the i-th block partitioning method among the preset N block partitioning methods, the optimal prediction mode corresponding to the i-th block partitioning method is determined according to the violent motion parameters, where N is a positive integer and i is a positive integer less than or equal to N; Based on the optimal prediction mode corresponding to the N block partitioning methods, the block partitioning method and prediction mode of the current CTU are determined.
3. The method according to claim 2, characterized in that, The step of determining the optimal prediction mode corresponding to the i-th block partitioning method based on the violent motion parameters includes: The current CTU is divided into blocks using the i-th block partitioning method to obtain M CUs, where M is a positive integer. For the j-th CU among the M CUs, at least one candidate prediction mode for the j-th CU is determined based on the violent motion parameters, where j is a positive integer less than or equal to M; From at least one candidate prediction mode of the j-th CU, determine the optimal prediction mode of the j-th CU; Based on the optimal prediction modes of the M CUs, determine the optimal prediction mode corresponding to the i-th block partitioning method.
4. The method according to claim 3, characterized in that, Determining at least one candidate prediction mode for the j-th CU based on the violent motion parameters includes: If the violent motion parameters indicate that the affine motion compensation prediction mode should be skipped, then it is determined that the affine motion compensation prediction mode is not included in at least one candidate prediction mode of the j-th CU.
5. The method according to claim 3, characterized in that, Determining at least one candidate prediction mode for the j-th CU based on the violent motion parameters includes: If the violent motion parameters indicate that the affine motion compensation prediction mode is not skipped, then 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, Determining the optimal prediction mode for the j-th CU from at least one candidate prediction mode for the j-th CU includes: Determine the cost corresponding to the at least one candidate prediction mode when using the at least one candidate prediction mode to predict the j-th CU; Based on the cost corresponding to the at least one candidate prediction mode, the optimal prediction mode of the j-th CU is determined from at least one candidate prediction mode of the j-th CU.
7. The method according to any one of claims 1-6, characterized in that, The violent motion parameters include at least one of the violent motion parameters of the current frame, the violent motion parameters of the current CTU, and the violent motion parameters of the current CU. Wherein, 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 parameters include the violent motion parameters of the current frame, then determining the violent motion parameters includes: 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. 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.
9. The method according to claim 8, characterized in that, The step of determining the violent motion parameters of the k-th CTU based on the k-th CTU and a reference CTU in the previous frame of the current frame includes: The violent motion parameters of the kth CTU are determined based on the pixel value of the kth CTU and the pixel value of the reference CTU.
10. The method according to claim 9, characterized in that, The step of determining the violent motion parameters of the k-th CTU based on the pixel value of the k-th CTU and the pixel value of the reference CTU includes: The violent motion parameters of the k-th CTU are determined based on the absolute difference between the pixel value of the k-th CTU and the pixel value of the reference CTU.
11. The method according to claim 8, characterized in that, The step 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 includes: P CTUs with violent motion parameters greater than a first preset value are selected from the K CTUs, where P 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 P CTUs.
12. The method according to claim 11, characterized in that, Determining the violent motion parameters of the current frame based on the violent motion parameters of the P CTUs includes: The violent motion parameters of the current frame are determined based on the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs.
13. The method according to claim 12, characterized in that, The step of determining the violent motion parameters of the current frame based on the sum of the violent motion parameters of the P CTUs and the total area of the P CTUs includes: 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, characterized in that, If the intense motion parameters include the intense motion parameters of the current CTU, determining the intense motion parameters includes: The violent motion parameters of the current CTU are determined based on the current CTU and the reference CTU in the previous frame of the current frame.
15. The method according to claim 14, characterized in that, The step of determining the violent motion parameters of the current CTU based on the current CTU and a reference CTU in the previous frame of the current frame includes: The violent motion parameters of the current CTU are determined based on the pixel values of the current CTU and the pixel values of the reference CTU.
16. The method according to claim 15, characterized in that, The step of determining the violent motion parameters of the current CTU based on the pixel values of the current CTU and the pixel values of the reference CTU includes: The violent motion parameters of the current CTU are determined based on the absolute difference between the pixel values of the current CTU and the pixel values of the reference CTU.
17. The method according to claim 7, characterized in that, If the violent motion parameters include the violent motion parameters of the current CU, determining the violent motion parameters includes: Based on the current CU and the reference CU in the previous frame of the current frame, the violent motion parameters of the current CU are determined.
18. The method according to claim 17, characterized in that, The step of determining the violent motion parameters of the current CU based on the current CU and a reference CU in the previous frame of the current frame includes: The violent motion parameters of the current CU are determined based on the pixel values of the current CU and the pixel values of the reference CU.
19. The method according to claim 18, characterized in that, The step of determining the violent motion parameters of the current CU based on the pixel values of the current CU and the pixel values of the reference CU includes: The violent motion parameters of the current CU are determined based on the absolute difference between the pixel values of the current CU and the pixel values of the reference CU.
20. The method according to any one of claims 1-6, characterized in that, The determination of the parameters for intense exercise includes: Under preset conditions, the parameters of the intense exercise are determined.
21. The method according to claim 20, characterized in that, The preset conditions include a first flag valued at a first numerical value, and the current CU size satisfying at least one of the preset sizes. The first flag is used to indicate whether the current sequence is allowed to use the affine motion compensation prediction mode, and the first numerical value is used to indicate that the current sequence is allowed to use the affine motion compensation prediction mode.
22. The method according to any one of claims 1-6, characterized in that, The method further includes: At least one of first information and second information is written into the bitstream, wherein the first information is used to indicate the block division method of the current CTU, and the second information is used to indicate the prediction mode of the current CTU.
23. A video encoding device, characterized in that, include: The first determining unit is used to determine the violent motion parameters, which are used to indicate whether to skip the affine motion compensation prediction mode. The second determining unit is used to determine the current CTU's block partitioning method and prediction mode based on the violent motion parameters; A partitioning unit is used to partition the current CTU into blocks using the current CTU's block partitioning method to obtain at least one CU; A prediction unit is configured to predict the current CU using the prediction mode corresponding to the current CU in the prediction mode of the current CTU, and obtain the predicted value of the current CU. The encoding unit is used to determine the residual value of the current CU based on the prediction value of the current CU, and to obtain the bitstream based on 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 used to call and run a computer program stored in the memory to implement the method as described in any one of claims 1 to 22.
25. A codec system, characterized in that, include: The video encoder of claim 24.
26. A computer-readable storage medium, characterized in that, Used to store computer programs; The computer program causes the computer to perform the method as described in 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