Video coding method and device
By designing a multi-grained rate distortion search architecture in video encoding technology, the problem of high search complexity in the CU encoding process in the prior art is solved, and more efficient coding speed and performance are achieved.
Patent Information
- Application Number
- CN202411823845.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The existing video encoding technology needs to traverse a large number of prediction, transformation and quantization modes during the CU encoding process, resulting in high encoder complexity and slow encoding speed.
Design a multi-grained rate distortion search architecture, split the encoding mode into coarse-grained search and fine-grained search, first perform a fast coarse screen between the encoding modes, and then perform fine-grained screening to reduce search time.
Through the multi-grained search architecture, the RDO search time is reduced, the encoding speed is improved, and the context information between various modes can be flexibly utilized, which improves encoding performance.
Smart Images

Figure CN119629334A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to video coding and compression. More specifically, the present disclosure relates to a video coding method and apparatus, an electronic device, a non-transitory computer-readable storage medium, and a computer program product. Background Art
[0002] Various electronic devices (e.g., digital televisions, laptop or desktop computers, tablet computers, digital cameras, digital recording devices, digital media players, video game consoles, smart phones, video teleconferencing devices, video streaming devices, etc.) support digital video. Electronic devices send and receive or otherwise transmit digital video data through a communication network, and / or store digital video data on a storage device. Due to the limited bandwidth capacity of the communication network and the limited storage resources of the storage device, before the video data is transmitted or stored, the video data can be compressed using a video codec according to one or more video codec standards. For example, video codec standards include general video codec (VVC), joint exploration test model (JEM), high efficiency video codec (HEVC / H.265), advanced video codec (AVC / H.264), moving picture expert group (MPEG) codec, etc. Video codecs generally use prediction methods (e.g., inter-frame prediction, intra-frame prediction, etc.) that utilize the inherent redundancy in video data. Video codecs are intended to compress video data into a form that uses a lower bit rate while avoiding or minimizing the degradation of video quality. Summary of the invention
[0003] Examples of the present disclosure provide a video encoding method and apparatus, an electronic device, a non-transitory computer-readable storage medium, and a computer program product.
[0004] According to a first aspect of the present disclosure, a video encoding method is provided, comprising: selecting a first number of candidate prediction modes from multiple prediction modes under multiple encoding modes, wherein each encoding mode includes at least one prediction mode; for each candidate prediction mode in the first number of candidate prediction modes, combining the candidate prediction mode with each transform mode and each quantization mode under the encoding mode corresponding to the candidate prediction mode to obtain multiple candidate modes; obtaining multiple reconstructed blocks of a current coding unit CU based on the multiple candidate modes under the multiple encoding modes respectively; and selecting an optimal mode for encoding the current CU from the multiple candidate modes under the multiple encoding modes based on rate-distortion values between the current CU and the multiple reconstructed blocks.
[0005] Optionally, selecting a first number of candidate prediction modes from multiple prediction modes under multiple coding modes includes: for each of the coding modes, using at least one prediction mode under the coding mode to predict the current CU to obtain at least one prediction block of the current CU; based on rate-distortion values between multiple prediction blocks corresponding to the multiple coding modes and the current CU, selecting the first number of candidate prediction modes from the multiple prediction modes.
[0006] Optionally, based on the rate-distortion values between the multiple prediction blocks corresponding to the multiple coding modes and the current CU, the first number of candidate prediction modes are selected from the multiple prediction modes, including: for each coding mode, based on the rate-distortion value between at least one prediction block corresponding to the coding mode and the current CU, a second number of candidate prediction modes are selected from at least one prediction mode in the coding mode; based on the rate-distortion value between the prediction block obtained under the second number of candidate prediction modes corresponding to each coding mode and the current CU, the first number of candidate prediction modes are selected from the second number of candidate prediction modes in the multiple coding modes.
[0007] Optionally, multiple reconstructed blocks of the current coding unit CU are respectively obtained based on the multiple candidate modes under the multiple encoding modes, including: for each candidate mode, performing a transform operation on a residual block between the current CU and a prediction block obtained under a candidate prediction mode corresponding to the candidate mode based on the transform mode under the candidate mode to obtain a transform coefficient; performing a quantization operation on the transform coefficient based on the quantization mode under the candidate mode to obtain a quantization coefficient; and reconstructing the current CU based on the quantization coefficient to obtain a reconstructed block of the current CU.
[0008] Optionally, the first number and the second number are pre-set or determined based on context information of the current CU.
[0009] Optionally, the rate-distortion value is a sum of absolute errors or a sum of absolute transformed errors.
[0010] According to a second aspect of the present disclosure, a video encoding device is provided, comprising: a prediction mode search module, configured to: select a first number of candidate prediction modes from multiple prediction modes in multiple encoding modes, wherein each encoding mode includes at least one prediction mode; a candidate mode search module, configured to: for each candidate prediction mode in the first number of candidate prediction modes, combine the candidate prediction mode with each transform mode and each quantization mode in the encoding mode corresponding to the candidate prediction mode to obtain multiple candidate modes; and an optimal mode determination module, configured to: obtain multiple reconstructed blocks of a current coding unit CU based on the multiple candidate modes in the multiple encoding modes respectively; and select an optimal mode for encoding the current CU from the multiple candidate modes in the multiple encoding modes based on rate-distortion values between the current CU and the multiple reconstructed blocks.
[0011] Optionally, the prediction mode search module is configured to: for each of the coding modes, use at least one prediction mode in the coding mode to predict the current CU to obtain at least one prediction block of the current CU; based on the rate-distortion values between the multiple prediction blocks corresponding to the multiple coding modes and the current CU, select the first number of candidate prediction modes from the multiple prediction modes.
[0012] Optionally, the prediction mode search module is configured to: for each of the coding modes, based on the rate-distortion value between at least one prediction block corresponding to the coding mode and the current CU, select a second number of candidate prediction modes from at least one prediction mode in the coding mode; based on the rate-distortion value between the prediction block obtained under the second number of candidate prediction modes corresponding to each of the coding modes and the current CU, select the first number of candidate prediction modes from the second number of candidate prediction modes in the multiple coding modes.
[0013] Optionally, the optimal mode determination module is configured to: for each candidate mode, perform a transform operation on a residual block between a current CU and a prediction block obtained under a candidate prediction mode corresponding to the candidate mode based on the transform mode under the candidate mode to obtain a transform coefficient; perform a quantization operation on the transform coefficient based on the quantization mode under the candidate mode to obtain a quantization coefficient; and reconstruct the current CU based on the quantization coefficient to obtain a reconstructed block of the current CU.
[0014] Optionally, the first number and the second number are pre-set or determined based on context information of the current CU.
[0015] Optionally, the rate-distortion value is a sum of absolute errors or a sum of absolute transformed errors.
[0016] According to a third aspect of the present disclosure, a device for video encoding is provided, comprising: one or more processors; and a memory, coupled to the one or more processors and configured to store instructions that can be executed by the one or more processors, wherein the one or more processors are configured to execute the method according to the present disclosure when executing the instructions.
[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium for storing computer-executable instructions is provided, wherein the computer-executable instructions, when executed by one or more computer processors, cause the one or more computer processors to perform a method according to the present disclosure.
[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, having instructions for storing a bit stream, wherein when the instructions are executed by one or more processors, the one or more processors cause the one or more processors to perform the method according to the present disclosure.
[0019] It is to be understood that both the foregoing general description and the following detailed description are examples only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate examples according to the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0021] Figure 1 is a block diagram illustrating an exemplary system for encoding and decoding video blocks according to some embodiments of the present disclosure.
[0022] Figure 2 is a block diagram illustrating an exemplary video encoder according to some embodiments of the present disclosure.
[0023] Figure 3 is a block diagram illustrating an exemplary video decoder according to some embodiments of the present disclosure.
[0024] Figure 4 A schematic diagram of rate-distortion search is shown.
[0025] Figure 5 An RDO search architecture is shown.
[0026] Figure 6 is a flowchart of a video encoding method according to an embodiment of the present disclosure.
[0027] Figure 7 is a schematic diagram of a multi-granularity rate-distortion pattern search architecture according to an embodiment of the present disclosure.
[0028] Figure 8 is a block diagram of a video encoding apparatus according to an embodiment of the present disclosure.
[0029] Fig. 9 is a diagram illustrating a computing environment coupled with a user interface according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0030] Reference will now be made in detail to specific embodiments, examples of which are shown in the accompanying drawings. In the following detailed description, a number of non-limiting specific details are set forth to aid in understanding the subject matter presented herein. However, various alternatives may be used without departing from the scope of the claims, and the subject matter may be practiced without these specific details. For example, the subject matter presented herein may be implemented on many types of electronic devices having digital video capabilities.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the drawings are used to distinguish objects, but not to describe any specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those shown in the drawings or described in the present disclosure.
[0032] Figure 1 is a block diagram illustrating an exemplary system 10 for encoding and decoding video blocks in parallel according to some embodiments of the present disclosure. Figure 1 As shown in , system 10 includes a source device 12 that generates and encodes video data to be later decoded by a target device 14. Source device 12 and target device 14 may include any of a wide variety of electronic devices, including cloud servers, server computers, desktop or laptop computers, tablet computers, smart phones, set-top boxes, digital televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc. In some implementations, source device 12 and target device 14 are equipped with wireless communication capabilities.
[0033] In some implementations, target device 14 may receive the encoded video data to be decoded via link 16. Link 16 may include any type of communication medium or device capable of moving the encoded video data from source device 12 to target device 14.
[0034] In some other embodiments, the encoded video data may be sent from the output interface 22 to the storage device 32. The encoded video data in the storage device 32 may then be accessed by the target device 14 via the input interface 28.
[0035] like Figure 1, source device 12 includes a video source 18, a video encoder 20, and an output interface 22. Video source 18 may include sources such as, or a combination of such sources: a video capture device (e.g., a camera), a video archive containing previously captured video, a video feed interface for receiving video from a video content provider, and / or a computer graphics system for generating computer graphics data as source video.
[0036] The captured, pre-captured, or computer-generated video may be encoded by video encoder 20. The encoded video data may be sent directly to target device 14 via output interface 22 of source device 12. The encoded video data may also (or alternatively) be stored on storage device 32 for later access by target device 14 or other devices for decoding and / or playback.
[0037] Target device 14 includes input interface 28, video decoder 30, and display device 34. Input interface 28 may include a receiver and / or a modem and receives encoded video data via link 16. The encoded video data transmitted via link 16 or provided on storage device 32 may include various syntax elements generated by video encoder 20 for use by video decoder 30 in decoding the video data. Such syntax elements may be included within the encoded video data sent over a communication medium, stored on a storage medium, or stored on a file server.
[0038] The video encoder 20 and the video decoder 30 can operate according to a proprietary standard or an industry standard (e.g., VVC, HEVC, Part 10 of MPEG-4, AVC) or an extension of such a standard. It should be understood that the present application is not limited to a specific video encoding / decoding standard and can be applied to other video encoding / decoding standards. It is generally believed that the video encoder 20 of the source device 12 can be configured to encode the video data according to any of these current standards or future standards. Similarly, it is also generally believed that the video decoder 30 of the target device 14 can be configured to decode the video data according to any of these current standards or future standards.
[0039] The video encoder 20 and the video decoder 30 may be implemented as any of a variety of suitable encoder and / or decoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic devices, software, hardware, firmware, or any combination thereof. When partially implemented in software, the electronic device may store instructions for the software in a suitable non-transitory computer-readable medium, and use one or more processors to execute the instructions in the hardware to perform the video encoding / decoding operations disclosed in the present disclosure. Each of the video encoder 20 and the video decoder 30 may be included in one or more encoders or decoders, and either of the encoders or decoders may be integrated as part of a combined encoder / decoder (CODEC) in the corresponding device.
[0040] Figure 2 is a block diagram illustrating an exemplary video encoder 20 according to some embodiments described in the present application. The video encoder 20 can perform intra-frame prediction coding and inter-frame prediction coding on video blocks within a video frame. Intra-frame prediction coding relies on spatial prediction to reduce or remove spatial redundancy in video data within a given video frame or picture. Inter-frame prediction coding relies on temporal prediction to reduce or remove temporal redundancy in video data within adjacent video frames or pictures of a video sequence. It should be noted that in the field of video coding and decoding, the term "frame" can be used as a synonym for the term "image" or "picture".
[0041] like Figure 2As shown in , the video encoder 20 includes a video data memory 40, a prediction processing unit 41, a decoded picture buffer (DPB) 64, an adder 50, a transform processing unit 52, a quantization unit 54, and an entropy coding unit 56. The prediction processing unit 41 further includes a motion estimation unit 42, a motion compensation unit 44, a partition unit 45, an intra-frame prediction processing unit 46, and an intra-frame block copy (BC) unit 48. In some embodiments, the video encoder 20 also includes an inverse quantization unit 58, an inverse transform processing unit 60, and an adder 62 for video block reconstruction. A loop filter 63 such as a deblocking filter can be located between the adder 62 and the DPB 64 to filter the block boundary to remove the block effect from the reconstructed video. In addition to the deblocking filter, another loop filter (e.g., a sample adaptive offset (SAO) filter, a cross-component sample adaptive offset (CCSAO) filter, and / or an adaptive loop filter (ALF)) can also be used to filter the output of the adder 62. In some examples, the loop filter may be omitted, and the decoded video blocks may be provided directly by adder 62 to DPB 64. Video encoder 20 may take the form of a fixed or programmable hardware unit, or may be distributed among one or more of the illustrated fixed or programmable hardware units.
[0042] Video data memory 40 may store video data to be encoded by components of video encoder 20. Figure 1 Video source 18 is shown obtaining video data in video data memory 40. DPB 64 is a buffer that stores reference video data (eg, reference frames or pictures) for use by video encoder 20 in encoding the video data (eg, in intra or inter prediction coding modes).
[0043] like Figure 2 As shown in , after receiving the video data, the partitioning unit 45 within the prediction processing unit 41 partitions the video data into video blocks. This partitioning may also include partitioning the video frame into strips, tiles (e.g., a set of video blocks), or other larger coding units (CUs) according to a predefined splitting structure associated with the video data, such as a quadtree (QT) structure. It should be noted that the terms "block" or "video block" used herein may be a portion of a frame or picture, in particular a rectangular (square or non-square) portion. With reference to, for example, HEVC and VVC, a block or video block may be or correspond to a coding tree unit (CTU), a CU, a prediction unit (PU), or a transform unit (TU) and / or may be or correspond to a corresponding block (e.g., a coding tree block (CTB), a coding block (CB), a prediction block (PB), or a transform block (TB)) and / or a sub-block.
[0044] The prediction processing unit 41 may select one of a plurality of feasible prediction coding modes for the current video block based on the error results (e.g., coding rate and rate-distortion level), such as one of one or more inter-frame prediction coding modes in a plurality of intra-frame prediction coding modes. The prediction processing unit 41 may provide the resulting intra-frame prediction coding block or inter-frame prediction coding block to the adder 50 to generate a residual block, and to the adder 62 to reconstruct the coding block for subsequent use as part of a reference frame. The prediction processing unit 41 also provides syntax elements (e.g., motion vectors, intra-frame mode indicators, partition information, and other such syntax information) to the entropy coding unit 56.
[0045] To select an appropriate intra-prediction coding mode for the current video block, intra-prediction processing unit 46 within prediction processing unit 41 may perform intra-prediction coding of the current video block in relation to one or more neighboring blocks in the same frame as the current block to be encoded to provide spatial prediction. Motion estimation unit 42 and motion compensation unit 44 within prediction processing unit 41 may perform inter-prediction coding of the current video block in relation to one or more prediction blocks in one or more reference frames to provide temporal prediction. Video encoder 20 may perform multiple encoding passes, for example, to select an appropriate coding mode for each block of video data.
[0046] In some embodiments, motion estimation unit 42 determines an inter-prediction mode for a current video frame by generating a motion vector according to a predetermined pattern within a sequence of video frames, the motion vector indicating the displacement of a video block within the current video frame relative to a prediction block within a reference video frame. Motion estimation performed by motion estimation unit 42 is the process of generating a motion vector that estimates the motion of a video block. For example, a motion vector may indicate the displacement of a video block within a current video frame or picture relative to a prediction block within a reference frame associated with a current block being encoded within the current frame. The predetermined pattern may designate a video frame in a sequence as a P frame or a B frame. Intra BC unit 48 may determine a vector (e.g., a block vector) for intra BC coding in a manner similar to the motion vector determined by motion estimation unit 42 for inter prediction, or may utilize motion estimation unit 42 to determine a block vector.
[0047] Regardless of whether the prediction block is from the same frame according to intra-frame prediction or from a different frame according to inter-frame prediction, the video encoder 20 can form a residual video block by subtracting the pixel values of the prediction block from the pixel values of the current video block being encoded. The pixel difference values forming the residual video block may include both luma component differences and chroma component differences.
[0048] Intra-prediction processing unit 46 may encode the current block using various intra-prediction modes, for example, during separate encoding passes, and intra-prediction processing unit 46 (or, in some examples, mode selection unit) may select an appropriate intra-prediction mode to use from the tested intra-prediction modes. Intra-prediction processing unit 46 may provide information indicating the intra-prediction mode selected for the block to entropy encoding unit 56. Entropy encoding unit 56 may encode the information indicating the selected intra-prediction mode into the bitstream.
[0049] After prediction processing unit 41 determines a prediction block for the current video block via inter-prediction or intra-prediction, adder 50 forms a residual video block by subtracting the prediction block from the current video block. The residual video data in the residual block may be included in one or more TUs and provided to transform processing unit 52. Transform processing unit 52 transforms the residual video data into residual transform coefficients using a transform (e.g., a discrete cosine transform (DCT) or a conceptually similar transform).
[0050] The transform processing unit 52 may send the resulting transform coefficients to a quantization unit 54. The quantization unit 54 quantizes the transform coefficients to further reduce the bit rate. The quantization process may also reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be modified by adjusting a quantization parameter. In some examples, the quantization unit 54 may then perform a scan on the matrix including the quantized transform coefficients. Alternatively, the entropy coding unit 56 may perform the scan.
[0051] After quantization, entropy coding unit 56 entropy encodes the quantized transform coefficients into a video bitstream using, for example, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy coding method or technique. The encoded bitstream may then be sent to a video bitstream such as a Figure 1 The video decoder 30 shown, or archived as Figure 1 The video frame may be stored in storage device 32 as shown for later transmission to or retrieval by video decoder 30. Entropy encoding unit 56 may also entropy encode motion vectors and other syntax elements for the current video frame being encoded.
[0052] Inverse quantization unit 58 and inverse transform processing unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct the residual video block in the pixel domain for use in generating reference blocks for predicting other video blocks. As noted above, motion compensation unit 44 may generate a motion compensated prediction block from one or more reference blocks of a frame stored in DPB 64. Motion compensation unit 44 may also apply one or more interpolation filters to the prediction block to calculate sub-integer pixel values for use in motion estimation.
[0053] Adder 62 adds the reconstructed residual block to the motion compensated prediction block generated by motion compensation unit 44 to generate a reference block for storage in DPB 64. The reference block may then be used as a prediction block by intra BC unit 48, motion estimation unit 42, and motion compensation unit 44 to inter-predict another video block in a subsequent video frame.
[0054] Figure 3 1 is a block diagram showing an exemplary video decoder 30 according to some embodiments of the present application. The video decoder 30 includes a video data memory 79, an entropy decoding unit 80, a prediction processing unit 81, an inverse quantization unit 86, an inverse transform processing unit 88, an adder 90, and a DPB 92. The prediction processing unit 81 further includes a motion compensation unit 82, an intra-frame prediction unit 84, and an intra-frame BC unit 85. The video decoder 30 may perform the above-mentioned Figure 2 The encoding process is substantially the inverse of the decoding process described with respect to video encoder 20. For example, motion compensation unit 82 may generate prediction data based on motion vectors received from entropy decoding unit 80, and intra-prediction unit 84 may generate prediction data based on intra-prediction mode indicators received from entropy decoding unit 80.
[0055] Furthermore, in some examples, embodiments of the present disclosure may be dispersed in one or more of the units of the video decoder 30. For example, the intra BC unit 85 may perform embodiments of the present application alone or in combination with other units of the video decoder 30, such as the motion compensation unit 82, the intra prediction unit 84, and the entropy decoding unit 80. In some examples, the video decoder 30 may not include the intra BC unit 85, and the functions of the intra BC unit 85 may be performed by other components of the prediction processing unit 81, such as the motion compensation unit 82.
[0056] Video data memory 79 may store video data, such as an encoded video bitstream, to be decoded by other components of video decoder 30. Video data stored in video data memory 79 may be obtained, for example, from storage device 32, from a local video source (e.g., a camera), via wired or wireless network communication of video data, or by accessing a physical data storage medium (e.g., a flash drive or hard disk).
[0057] During the decoding process, the video decoder 30 receives an encoded video bitstream representing video blocks of an encoded video frame and associated syntax elements. The entropy decoding unit 80 of the video decoder 30 entropy decodes the bitstream to generate quantization coefficients, motion vectors or intra-frame prediction mode indicators, and other syntax elements. The entropy decoding unit 80 then forwards the motion vectors or intra-frame prediction mode indicators, and other syntax elements to the prediction processing unit 81.
[0058] When a video frame is encoded as an intra-prediction coded (I) frame or for intra-coded prediction blocks in other types of frames, the intra-prediction unit 84 of the prediction processing unit 81 can generate prediction data for a video block of the current video frame based on the intra-prediction mode transmitted by the signal and reference data from a previously decoded block of the current frame.
[0059] When the video frame is encoded as an inter-frame prediction coding (i.e., B or P) frame, the motion compensation unit 82 of the prediction processing unit 81 generates one or more prediction blocks for the video block of the current video frame based on the motion vector and other syntax elements received from the entropy decoding unit 80. Each of the prediction blocks can be generated from a reference frame in one of the reference frame lists. The video decoder 30 can construct the reference frame lists, i.e., List 0 and List 1, based on the reference frames stored in the DPB 92 using a default construction technique.
[0060] In some examples, when a video block is encoded according to the intra BC mode described herein, intra BC unit 85 of prediction processing unit 81 generates a prediction block for the current video block based on the block vector and other syntax elements received from entropy decoding unit 80. The prediction block may be within a reconstructed region of the same picture as the current video block as defined by video encoder 20.
[0061] Motion compensation unit 82 and / or intra BC unit 85 determine prediction information for a video block of the current video frame by parsing motion vectors and other syntax elements, and then use the prediction information to generate a prediction block for the current video block being decoded.
[0062] Motion compensation unit 82 may also perform interpolation using interpolation filters as used by video encoder 20 during encoding of the video blocks to calculate interpolated values for sub-integer pixels of reference blocks. In this case, motion compensation unit 82 may determine the interpolation filters used by video encoder 20 based on the received syntax elements and use these interpolation filters to produce the prediction blocks.
[0063] Inverse quantization unit 86 inverse quantizes the quantized transform coefficients provided in the bitstream and entropy decoded by entropy decoding unit 80, using the same quantization parameters calculated by video encoder 20 for each video block in the video frame to determine the degree of quantization. Inverse transform processing unit 88 applies an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients to reconstruct the residual block in the pixel domain.
[0064] After the motion compensation unit 82 or the intra BC unit 85 generates a prediction block for the current video block based on the vector and other syntax elements, the adder 90 reconstructs the decoded video block for the current video block by adding the residual block from the inverse transform processing unit 88 to the corresponding prediction block generated by the motion compensation unit 82 and the intra BC unit 85. A loop filter 91 (e.g., a deblocking filter, an SAO filter, a CCSAO filter, and / or an ALF) may be located between the adder 90 and the DPB 92 to further process the decoded video block. In some examples, the loop filter 91 may be omitted, and the decoded video block may be provided directly to the DPB 92 by the adder 90. The decoded video blocks in a given frame are then stored in the DPB 92, which stores reference frames for subsequent motion compensation of the next video block. The DPB 92 or a memory device separate from the DPB 92 may also store the decoded video for later presentation on a display device (e.g., Figure 1 on a display device 34).
[0065] The H.266 / VVC video coding standard was released in 2020. Its compression performance has been greatly improved compared to the H.265 / HEVC coding standard. This is mainly due to the addition of a large number of complex prediction, transformation and quantization tools with high performance benefits in VVC. In the video hybrid coding framework adopted in VVC, the encoding process of each CU in the video needs to go through steps such as prediction coding, transform coding, quantization, and reconstruction. In order to obtain the best encoding result, each CU needs to traverse and search through a large number of prediction, transformation and quantization tools, and select the optimal prediction mode, transformation mode and quantization mode through rate-distortion optimization (RDO). This process is called rate-distortion search.
[0066] Figure 4 A schematic diagram of rate-distortion search is shown.
[0067] Reference Figure 4 In the current CU encoding process, each encoding mode may be searched sequentially (such as in a fixed order). Each encoding mode may include multiple prediction modes (prediction tools), multiple transform modes (transform tools), and multiple quantization modes (quantization tools).
[0068] exist Figure 4 In the search, you can search for coding mode 1 first, then search for coding mode 2, and so on. When searching for coding mode 1, use the various prediction modes, various transform modes, and various quantization modes under coding mode 1 to encode the current CU to obtain multiple reconstructed blocks, and use the obtained reconstructed blocks and the current original CU to calculate the rate-distortion value. Each coding mode is traversed and searched in the above manner. After obtaining the rate-distortion values under each coding mode, by comparing the rate-distortion values under each coding mode, select the coding mode with the minimum rate-distortion value as the optimal coding mode for the current CU.
[0069] However, since each CU needs to traverse and search in a large number of prediction, transformation and quantization modes, this will greatly increase the complexity of the encoder. According to statistics, RDO search takes up an average of more than 80% of the total encoder time, which is the core of the encoder speed bottleneck.
[0070] In order to reduce the search time as much as possible, existing solutions have designed various fast algorithms, such as skipping the search of some coding modes based on context information. However, with the continuous optimization, simply designing fast algorithms can no longer guarantee the minimum loss of coding performance while accelerating, so a more flexible encoder search architecture is needed to release the acceleration potential.
[0071] Figure 5 An RDO search architecture is shown.
[0072] exist Figure 5 Under the search architecture shown, the pattern search order of each CU is fixed, and the specific operations are described as follows.
[0073] Reference Figure 5 , first search within the coding mode. For each coding mode, it is necessary to traverse various prediction modes, transform modes, and quantization modes. Taking the conventional merge mode as an example, it is necessary to first traverse and search among many prediction modes to obtain a candidate list of the optimal prediction mode, and then traverse this candidate list. For each prediction mode, further traverse and search among many transform modes and quantization modes, and calculate the rate-distortion value based on the results obtained after prediction, transformation, quantization, and reconstruction. Finally, a combination with the smallest rate-distortion value is selected from the numerous combinations of prediction, transformation, quantization, and reconstruction as the optimal conventional merge mode.
[0074] After searching within the coding mode, search between coding modes is performed. For example, after obtaining the optimal conventional Merge mode in the above manner, continue to traverse other coding modes in the same manner. The traversal order of the coding modes is: conventional Merge mode, affine Merge mode, geometric partitioning mode, normal inter-frame mode (normal AMVP), affine inter-frame mode (Affine AMVP), adaptive precision inter-frame mode (AMVR), intra-frame block copy mode (IBC), intra-frame prediction mode, etc. Finally, the mode with the smallest rate-distortion value is selected as the optimal coding mode for the current CU.
[0075] This CU coding mode search architecture will first traverse and search all the prediction modes, transform modes, quantization modes, etc. of the previous coding mode before traversing and searching the next coding mode. It is essentially a single-granularity, depth-first search. However, a single-granularity search will lead to a rigid and inflexible search order, and will not be able to flexibly utilize the context information between modes. Since one coding mode is always searched before the next one, and the coding modes are searched in a fixed order, each coding mode cannot flexibly apply the context information of each mode during the specific search process; in addition, the depth-first search leads to a large cost of wasted time caused by erroneous searches. Since each coding mode needs to go through a complete prediction, transformation, quantization, and reconstruction search, once a coding mode is not the final optimal mode, a lot of search time will be wasted in it.
[0076] Therefore, the present disclosure designs a multi-granularity rate-distortion search architecture, which greatly reduces the RDO search time and improves the encoding speed by splitting the encoder search architecture into a multi-granularity architecture combining a fast coarse-grained search and a slow fine-grained search. Figures 6 to 8 Embodiments of the present disclosure are described in detail.
[0077] Figure 6 is a flowchart of a video encoding method according to an embodiment of the present disclosure.
[0078] Reference Figure 6 In step S601, a first number of candidate prediction modes are selected from a plurality of prediction modes in a plurality of coding modes, wherein each coding mode includes at least one prediction mode. In each coding mode, a plurality of prediction modes (prediction tools), a plurality of transform modes (transform tools), and a plurality of quantization modes (quantization tools) may be included. For example, the prediction modes in the conventional Merge mode may include the conventional Merge prediction mode, the Merge with Motion Vector Difference (MMVD) prediction mode, and the Joint Intra-Inter-Frame (CIIP) prediction mode.
[0079] A prediction mode traversal search operation may be performed first. The prediction mode traversal search operation may include generating prediction blocks of the current CU based on each prediction mode in each coding mode and calculating the rate-distortion value of the current CU based on the prediction blocks of each prediction mode. Then, based on the prediction mode traversal search operation, a prediction mode candidate list is obtained. The prediction mode candidate list may include several prediction modes selected based on the rate-distortion value. The rate-distortion value may be, for example, an absolute error and SAD or an absolute transform error and SATD, etc.
[0080] As an example, for each coding mode, at least one prediction mode in the coding mode may be used to predict the current CU, obtain at least one prediction block of the current CU, and select a first number of candidate prediction modes from multiple prediction modes based on rate-distortion values between multiple prediction blocks corresponding to multiple coding modes and the current CU. The first number may be preset or determined based on context information of the current CU. The context information of the current CU may include encoding information of neighboring CUs of the current CU, encoding requirements (such as encoding quality and encoding speed), and actual encoding conditions. A prediction mode candidate list may be formed based on the first number of candidate prediction modes.
[0081] When selecting a first number of candidate prediction modes, a second number of candidate prediction modes may be first selected from at least one prediction mode in the coding mode for each coding mode based on the rate-distortion value between at least one prediction block corresponding to the coding mode and the current CU. That is, a second number of candidate prediction modes are selected for each coding mode. The second number may be pre-set or determined based on the context information of the current CU. For example, for scenarios with high speed requirements (such as live broadcast scenarios), the second number may be set to 2 or 3; for scenarios such as on-demand slow gears, the second number may be set to 4-5.
[0082] Next, based on the rate-distortion values between the prediction block and the current CU obtained in the second number of candidate prediction modes corresponding to each encoding mode, a first number of candidate prediction modes are selected from the second number of candidate prediction modes in multiple encoding modes.
[0083] For example, assuming that the number of coding modes that need to be traversed and searched is N, and the second number is M, that is, M candidate prediction modes are selected under each coding mode, then a total of N×M candidate prediction modes are selected first, and then the rate-distortion values under these N×M candidate prediction modes are compared, and then the first number of candidate prediction modes are selected from the N×M candidate prediction modes and a prediction mode candidate list is generated.
[0084] In step S602, for each candidate prediction mode, the candidate prediction mode and each transform mode and each quantization mode in the encoding mode corresponding to the candidate prediction mode are combined to obtain multiple candidate modes.
[0085] For each candidate prediction mode, a transform and quantization mode traversal search operation is performed, wherein the transform and quantization mode traversal search operation may include combining the candidate prediction mode with each transform mode and quantization mode in the encoding mode corresponding to the candidate prediction mode to obtain multiple candidate modes. For example, for a candidate mode corresponding to a candidate prediction mode, the candidate mode may include the candidate prediction mode, a transform mode, and a quantization mode. In a candidate prediction mode, different candidate modes may include the same prediction mode and different transform and / or quantization modes.
[0086] In step S603, multiple reconstructed blocks of the current coding unit CU are respectively obtained based on multiple candidate modes under multiple coding modes.
[0087] For each candidate mode, the candidate mode may be used to perform a complete prediction, transformation, quantization, and reconstruction process on the current CU to obtain a reconstructed block of the current CU under the candidate mode.
[0088] For example, for each candidate mode, when the prediction block of the current CU can be obtained in step S602, the prediction block obtained in the prediction mode in the candidate mode can be transformed, quantized, and reconstructed to obtain the reconstructed block of the current CU.
[0089] As an example, for each candidate mode, a transform operation is performed on the residual block between the current CU and the prediction block obtained in the candidate prediction mode corresponding to the candidate mode based on the transform mode in the candidate mode to obtain a transform coefficient; a quantization operation is performed on the transform coefficient based on the quantization mode in the candidate mode to obtain a quantization coefficient; and the current CU is reconstructed based on the quantization coefficient to obtain a reconstructed block of the current CU. Figure 1 and Figure 2 to obtain the reconstructed block.
[0090] In step S604, based on the rate-distortion values between the current CU and the multiple reconstructed blocks, an optimal mode for encoding the current CU is selected from multiple candidate modes in the multiple encoding modes.
[0091] For example, the SAD may be calculated based on each pixel in the current CU and each pixel in the reconstructed block, and then a candidate mode with the smallest SAD is selected from the candidate modes as the optimal encoding mode of the current CU.
[0092] The present disclosure designs a flexible multi-granularity, breadth-first RDO search architecture, so that the encoder can support rapid coarse screening between coding modes first, and then further fine-grained screening. In this way, the problem of the inability to flexibly use the context information of each mode and the excessive time waste caused by erroneous search under the search architecture of the existing solution is solved, which greatly improves the flexibility of the encoder rate-distortion search architecture and improves the encoding speed.
[0093] Figure 7 is a schematic diagram of a multi-granularity rate-distortion pattern search architecture according to an embodiment of the present disclosure.
[0094] The search framework of the present disclosure divides each coding mode into two steps: a coarse-grained search that only searches for prediction modes and a fine-grained search that requires a complete coding process, so that a multi-granularity, breadth-first search architecture can be supported.
[0095] Reference Figure 7 In the coarse-grained search, in each coding mode, only the prediction mode is traversed and searched, and the distortion value (such as SAD or SATD) between each prediction block obtained in each prediction mode and the original block is calculated, and for each coding mode, a second number of candidate prediction modes are selected from each prediction mode in the coding mode. At this time, the selected candidate prediction modes in each coding mode can be stored in the candidate list.
[0096] For example, for the normal Merge mode, the normal Merge prediction mode, MMVD prediction mode, CIIP prediction mode, etc. under it are traversed, and the second number of candidate prediction modes are selected based on the rate-distortion value. For the intra prediction mode, the angle mode, planar mode, DC mode, matrix-based intra prediction (MIP) mode, multiple reference line (MRL) prediction mode, MPM prediction mode, etc. under it are traversed, and the second number of candidate prediction modes are selected based on the rate-distortion value.
[0097] Regarding the second number, the smaller the number, the smaller the number of subsequent fine screenings, which means faster encoding time, but it may also bring more encoding losses. Therefore, it is generally necessary to comprehensively consider the requirements for encoding quality and encoding speed during the application process to set the second number. For example, for live broadcasts that require high speed, the second number can be set to 2-3; for on-demand slow gears, the second number can be set to 4-5.
[0098] Next, the second number of candidate prediction modes in each coding mode selected above are searched sequentially, and then these candidate modes are sorted according to SAD or SATD, and the first number of candidate prediction modes are selected from them. Finally, a global optimal prediction mode candidate list in all coding modes can be obtained. The number of candidates in the list can be freely set according to needs and actual conditions.
[0099] Assume that the number of coding modes that need to be traversed and searched is N, and the second number is M, that is, M candidate prediction modes are selected under each coding mode. At this time, a total of N×M candidate prediction modes are selected first, and then the rate-distortion values under these N×M candidate prediction modes are compared and sorted in ascending order. Then, the first number of candidate prediction modes are selected from the N×M candidate prediction modes to form the final prediction mode candidate list.
[0100] like Figure 7 As shown, when performing a coding mode search (i.e., a coarse-grained search), each coding mode can be traversed and searched in a preset order, such as traversing and searching each coding mode in the order of conventional Merge mode, Affine Merge mode, geometric partitioning mode, ordinary AMVP, Affine AMVP, AMVR, intra-frame block copy mode, intra-frame prediction mode, etc.
[0101] In addition, according to an embodiment of the present disclosure, during a coarse-grained search, each coding mode may be searched randomly or according to context information. For example, a coding mode pool may be constructed, in which the above-mentioned coding modes may be included, and then the search order for each coding mode may be determined according to the coding information of the neighboring CUs of the current CU or the coding requirements (such as coding quality requirements and / or coding speed requirements).
[0102] During fine-grained search, the global optimal prediction mode candidate list obtained above is traversed and searched. For each prediction mode, a complete fine-grained coding search is performed (i.e., a complete transformation, quantization, reconstruction, calculation of rate-distortion values, etc.) to obtain the final rate-distortion value of each mode, and the optimal coding mode combination (i.e., a combination of prediction, transformation, and quantization modes) is selected based on the rate-distortion value. For example, for a prediction mode, this prediction mode can be combined with different transformation modes and different quantization modes, and then the optimal combination is selected as the coding mode of the current CU based on the rate-distortion cost (RDCost) between the reconstructed block and the original block obtained under various combinations.
[0103] The search framework shown in the present disclosure can support breadth-first search, that is, first quickly and extensively search the prediction modes of all coding modes, and then conduct in-depth searches for transform, quantization mode, etc. This allows the encoder to quickly obtain context information such as prediction information of all coding modes, helping the encoder to more efficiently improve encoding speed and performance.
[0104] The multi-granularity search method of first quickly screening and then carefully screening a limited number of optimal candidates can quickly screen out redundant patterns based on prediction information, so that the encoder will not waste too much time on the detailed screening of these redundant patterns, greatly reducing the time waste cost caused by wrong selection and improving encoding speed.
[0105] Figure 8 is a block diagram of a video encoding apparatus according to an embodiment of the present disclosure.
[0106] Reference Figure 8 , the video encoding device 800 may include a prediction mode search module 801, a candidate mode search module 802 and an optimal mode determination module 803.
[0107] The prediction mode search module 801 may be configured to select a first number of candidate prediction modes from a plurality of prediction modes in a plurality of encoding modes, wherein each encoding mode includes at least one prediction mode.
[0108] The candidate mode search module 802 may be configured to: for each candidate prediction mode among the first number of candidate prediction modes, combine the candidate prediction mode with each transform mode and each quantization mode in the encoding mode corresponding to the candidate prediction mode to obtain multiple candidate modes.
[0109] The optimal mode determination module 803 can be configured to: obtain multiple reconstructed blocks of the current coding unit CU respectively based on the multiple candidate modes under the multiple encoding modes; and based on the rate-distortion value between the current CU and the multiple reconstructed blocks, select the optimal mode for encoding the current CU from the multiple candidate modes under the multiple encoding modes.
[0110] According to another example, the prediction mode search module 801 can be configured to: for each of the coding modes, use at least one prediction mode under the coding mode to predict the current CU to obtain at least one prediction block of the current CU; based on the rate-distortion values between the multiple prediction blocks corresponding to the multiple coding modes and the current CU, select the first number of candidate prediction modes from the multiple prediction modes.
[0111] According to another example, the prediction mode search module 801 may be configured to: for each of the coding modes, based on the rate-distortion value between at least one prediction block corresponding to the coding mode and the current CU, select a second number of candidate prediction modes from at least one prediction mode in the coding mode; based on the rate-distortion value between the prediction block obtained under the second number of candidate prediction modes corresponding to each of the coding modes and the current CU, select the first number of candidate prediction modes from the second number of candidate prediction modes in the multiple coding modes.
[0112] According to another example, the optimal mode determination module 803 can be configured as: for each candidate mode, performing a transform operation on the residual block between the current CU and the prediction block obtained in the candidate prediction mode corresponding to the candidate mode based on the transform mode under the candidate mode to obtain a transform coefficient; performing a quantization operation on the transform coefficient based on the quantization mode under the candidate mode to obtain a quantization coefficient; and reconstructing the current CU based on the quantization coefficient to obtain a reconstructed block of the current CU.
[0113] The first number and the second number may be preset or determined based on context information of the current CU.
[0114] The rate-distortion value may be a sum of absolute errors or a sum of absolute transformed errors.
[0115] According to the above embodiments, the present disclosure designs a multi-granularity rate-distortion mode search architecture that supports breadth-first search, so that the encoder can greatly reduce the time waste cost caused by erroneous screening by combining fast coarse screening and slow fine screening. At the same time, through fast coarse screening between all coding modes, the encoder can use more effective context information, thereby helping to improve the speed and performance of the encoder. The present disclosure greatly improves the flexibility of the encoder mode search architecture and effectively reduces the coding complexity.
[0116] In addition, the above method can be implemented using an apparatus including one or more circuits, including an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components. The apparatus can use the circuit in combination with other hardware or software components to perform the above method. Each module, submodule, unit or subunit disclosed above can be implemented at least in part using one or more circuits.
[0117] Fig. 9A computing environment 1610 is shown coupled to a user interface 1650. The computing environment 1610 may be part of a data processing server. The computing environment 1610 includes a processor 1620, a memory 1630, and an input / output (I / O) interface 1640.
[0118] The processor 1620 generally controls the overall operation of the computing environment 1610, such as operations associated with display, data acquisition, data communication, and image processing. The processor 1620 may include one or more processors for executing instructions to perform all or some of the steps in the above method. In addition, the processor 1620 may include one or more modules that facilitate the interaction between the processor 1620 and other components. The processor may be a central processing unit (CPU), a microprocessor, a single-chip microcomputer, a graphics processing unit (GPU), etc.
[0119] The memory 1630 is configured to store various types of data to support the operation of the computing environment 1610. The memory 1630 may include predetermined software 1632. Examples of such data include instructions for any application or method operating on the computing environment 1610, video data sets, image data, etc. The memory 1630 may be implemented by using any type of volatile or non-volatile memory device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.
[0120] I / O interface 1640 provides an interface between processor 1620 and peripheral interface modules (e.g., keyboard, click wheel, buttons, etc.). Buttons may include, but are not limited to, a home button, a start scan button, and a stop scan button. I / O interface 1640 may be coupled to an encoder and a decoder.
[0121] In an embodiment, a non-transitory computer-readable storage medium including, for example, a plurality of programs in a memory 1630 and / or storing a bit stream generated by the above encoding method or a bit stream to be decoded by the above decoding method is also provided, wherein the plurality of programs can be executed by a processor 1620 in a computing environment 1610 to perform the above method. In one example, the plurality of programs can be executed by a processor 1620 in a computing environment 1610 to (for example, from Figure 2The video encoder 20 in the computing environment 1610 receives a bit stream or data stream including encoded video information (e.g., video blocks representing encoded video frames, and / or one or more associated syntax elements, etc.), and can also be executed by the processor 1620 in the computing environment 1610 to perform the above-mentioned decoding method according to the received bit stream or data stream. In another example, the multiple programs can be executed by the processor 1620 in the computing environment 1610 to perform the above-mentioned encoding method to encode the video information (e.g., video blocks representing video frames, and / or one or more associated syntax elements, etc.) into a bit stream or data stream, and can also be executed by the processor 1620 in the computing environment 1610 to (e.g., to Figure 3 Alternatively, a non-transitory computer-readable storage medium may store the bit stream or data stream generated by the encoder (e.g., Figure 2 The video encoder 20 in FIG. 1 generates a video signal for a decoder (eg, Figure 3 A bitstream or data stream including encoded video information (e.g., video blocks representing encoded video frames, and / or associated one or more syntax elements, etc.) used by the video decoder 30 in the video decoder 30 when decoding video data. The non-transitory computer-readable storage medium can be, for example, a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0122] In an embodiment, a bit stream generated by the above encoding method or a bit stream to be decoded by the above decoding method is provided. In an embodiment, a bit stream including encoded video information generated by the above encoding method or encoded video information to be decoded by the above decoding method is provided.
[0123] In an embodiment, a computing device is also provided, which includes: one or more processors (e.g., processor 1620); and a non-transitory computer-readable storage medium or memory 1630 in which multiple programs that can be executed by the one or more processors are stored, wherein the one or more processors are configured to perform the above-mentioned method when executing the multiple programs.
[0124] In an embodiment, a computer program product having instructions for storing or transmitting a bitstream is also provided, wherein the bitstream includes the encoded video information generated by the above encoding method or the encoded video information to be decoded by the above decoding method. In an embodiment, a computer program product including, for example, a plurality of programs in a memory 1630 is also provided, wherein the plurality of programs can be executed by a processor 1620 in a computing environment 1610 for performing the above method. For example, the computer program product may include a non-transitory computer-readable storage medium.
[0125] In an embodiment, the computing environment 1610 may be implemented by one or more ASICs, DSPs, digital signal processing devices (DSPDs), programmable logic devices (PLDs), FPGAs, GPUs, controllers, microcontrollers, microprocessors, or other electronic components for performing the above methods.
[0126] In an embodiment, a method for storing a bit stream is also provided, comprising: storing the bit stream on a digital storage medium, wherein the bit stream comprises encoded video information generated by the above encoding method or encoded video information to be decoded by the above decoding method.
[0127] In an embodiment, a method for transmitting a bit stream generated by the above encoder is also provided. In an embodiment, a method for receiving a bit stream to be decoded by the above decoder is also provided.
[0128] The description of the present disclosure has been presented for purposes of illustration and is not intended to be exhaustive or limited to the present disclosure. Many modifications, variations, and alternative embodiments will be apparent to one of ordinary skill in the art having the benefit of the teachings presented in the foregoing description and the associated drawings.
[0129] Unless otherwise specifically stated, the order of steps of the method according to the present disclosure is intended to be illustrative only, and the steps of the method according to the present disclosure are not limited to the order specifically described above, but can be changed according to actual conditions. In addition, at least one of the steps of the method according to the present disclosure can be adjusted, combined or deleted according to actual needs.
[0130] The examples are chosen and described in order to explain the principles of the present disclosure and to enable other persons skilled in the art to understand the various embodiments of the present disclosure and to best utilize the basic principles and various embodiments with various modifications suitable for the specific use contemplated. Therefore, it will be understood that the scope of the present disclosure is not limited to the specific examples of the disclosed embodiments, and modifications and other embodiments are intended to be included within the scope of the present disclosure.
Claims
1. A video encoding method, comprising: selecting a first number of candidate prediction modes from a plurality of prediction modes in a plurality of coding modes, wherein each coding mode includes at least one prediction mode; For each candidate prediction mode among the first number of candidate prediction modes, combining the candidate prediction mode with each transform mode and each quantization mode in the encoding mode corresponding to the candidate prediction mode to obtain a plurality of candidate modes; Obtaining a plurality of reconstructed blocks of a current coding unit CU respectively based on the plurality of candidate modes under the plurality of coding modes; and Based on rate-distortion values between the current CU and the plurality of reconstructed blocks, an optimal mode for encoding the current CU is selected from the plurality of candidate modes in the plurality of encoding modes.
2. The method according to claim 1, wherein: Selecting a first number of candidate prediction modes from a plurality of prediction modes in a plurality of coding modes comprises: For each of the coding modes, predict the current CU using at least one prediction mode in the coding mode to obtain at least one prediction block of the current CU; The first number of candidate prediction modes is selected from the multiple prediction modes based on rate-distortion values between multiple prediction blocks corresponding to the multiple coding modes and a current CU.
3. The method according to claim 2, wherein: The method further comprises: selecting the first number of candidate prediction modes from the plurality of prediction modes based on rate-distortion values between the plurality of prediction blocks corresponding to the plurality of coding modes and the current CU, comprising: For each of the coding modes, selecting a second number of candidate prediction modes from at least one prediction mode in the coding mode based on a rate-distortion value between at least one prediction block corresponding to the coding mode and a current CU; The first number of candidate prediction modes are selected from the second number of candidate prediction modes in the multiple encoding modes based on rate-distortion values between the prediction block and the current CU obtained in the second number of candidate prediction modes corresponding to the each encoding mode.
4. The method according to claim 2, wherein: Obtaining a plurality of reconstructed blocks of a current coding unit CU respectively based on the plurality of candidate modes under the plurality of coding modes, including: For each candidate mode, performing a transform operation on a residual block between a current CU and a prediction block obtained in a candidate prediction mode corresponding to the candidate mode based on a transform mode in the candidate mode to obtain a transform coefficient; Performing a quantization operation on the transform coefficient based on the quantization mode under the candidate mode to obtain a quantization coefficient; The current CU is reconstructed based on the quantization coefficient to obtain a reconstructed block of the current CU.
5. The method according to any one of claims 1 to 4, wherein: The first number and the second number are preset or determined based on context information of the current CU.
6. The method according to any one of claims 1 to 4, wherein: The rate-distortion value is the sum of absolute errors or the sum of absolute transformed errors.
7. A video encoding device, comprising: A prediction mode search module is configured to: select a first number of candidate prediction modes from a plurality of prediction modes in a plurality of encoding modes, wherein each encoding mode includes at least one prediction mode; a candidate mode search module configured to: for each candidate prediction mode among the first number of candidate prediction modes, combine the candidate prediction mode with each transform mode and each quantization mode in the encoding mode corresponding to the candidate prediction mode to obtain a plurality of candidate modes; as well as The optimal mode determination module is configured to: obtain multiple reconstructed blocks of the current coding unit CU respectively based on the multiple candidate modes under the multiple encoding modes; and select the optimal mode for encoding the current CU from the multiple candidate modes under the multiple encoding modes based on the rate-distortion value between the current CU and the multiple reconstructed blocks.
8. A device for video encoding, comprising: one or more processors; as well as a memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, Wherein, when executing the instructions, the one or more processors are configured to perform the method according to any one of claims 1-6.
9. A non-transitory computer-readable storage medium for storing computer-executable instructions, which when executed by one or more computer processors cause the one or more computer processors to perform the method according to any one of claims 1-6.
10. A computer program product having instructions for storing a bitstream, which instructions, when executed by one or more processors, cause the one or more processors to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intra-frame coding mode selection method and device for video coding
CN110062237A
Inter-frame prediction method based on triangular mode, video coding method and equipment
CN110312130A
Video coding method and device, electronic equipment and storage medium
CN112165617A
Video coding method and device
CN114071137A
Selection method and device of rate distortion coding mode and coding method and system
CN116033162A