Symbolization and decoding method, apparatus, and device thereof
By modifying prediction mode lists and using pixel padding techniques, the method addresses coding inefficiencies at block boundaries, enhancing encoding and decoding performance and efficiency.
Patent Information
- Application Number
- JP2025504365
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-07-26
- Filing Date
- 2023-07-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-07-25
AI Technical Summary
Existing video encoding methods suffer from low coding efficiency due to long code lengths and redundancy issues, particularly at block boundaries where reference pixels are unavailable, leading to inefficiencies in both encoding and decoding processes.
The method involves performing a removal process on the initial prediction mode list to generate a target mode list when reference pixels are unavailable, and using padding techniques to derive reconstructed values from available pixels, thereby improving coding efficiency and reducing redundancy.
This approach enhances coding efficiency by reducing redundancy, improving image quality at block boundaries, and enhancing overall encoding and decoding performance.
Smart Images

Figure 2025524120000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of encoding and decoding, and particularly to encoding and decoding methods, apparatuses, and devices thereof.
Background Art
[0002] To save space, all video images are encoded before transmission, and complete video encoding may include processes such as prediction, transformation, quantization, entropy encoding, filtering, etc. Regarding the prediction process, the prediction process may include intra-frame prediction and inter-frame prediction. The inter-frame prediction utilizes the temporal correlation of the video to predict the current pixel using the pixels of adjacent encoded images, thereby achieving the purpose of effectively removing the temporal redundancy of the video. Intra-frame prediction utilizes the spatial correlation of the video to predict the current pixel using the pixels of the encoded blocks of the current frame image, thereby achieving the purpose of removing the spatial redundancy of the video.
[0003] Lossless compression is a technique for compressing redundant information in the original image and reconstructing the original image without distortion. Although there is an error between the reconstructed image and the original image, if the error is suppressed within a certain range, it can be called near-lossless compression. In the compression encoding process, it is necessary to predict the residual value between pixels in the original image, and the residual value is used to indicate the difference between pixels. Semi Fixed-Length Code is used to encode the residual value in order to further shorten the code length. However, semi fixed-length coding still has the problem of a long code length and low coding efficiency.
Summary of the Invention
[0004] In view of this, the present invention provides an encoding and decoding method, apparatus, and device thereof in order to improve encoding performance and decoding performance.
[0005] The present invention provides an encoding and decoding method, including: when a reference pixel of a current block is unavailable, performing a removal process on a target prediction mode in an initial prediction mode list corresponding to the current block to obtain a target prediction mode list; and encoding or decoding the current block based on the target prediction mode list.
[0006] The present invention provides an encoding and decoding method, including: when a reference pixel of a first boundary of a current block is unavailable and a reference pixel of a second boundary of the current block is available, padding the reference pixel of the first boundary based on the reference pixel of the second boundary; and encoding or decoding the current block based on the padded reference pixel of the first boundary and the reference pixel of the second boundary.
[0007] The present invention provides an encoding and decoding method, including: when an intra-block copy prediction mode is valid for a current block, if a reference pixel of a left boundary of the current block is unavailable and a reference pixel of an upper boundary of the current block is available, determining a first search region corresponding to a first sub-block of the current block based on the reconstructed pixel of the upper boundary, and determining a reconstructed pixel of the first sub-block based on the reference pixel of the first search region; after obtaining the reconstructed pixel of the first sub-block, determining a second search region corresponding to a second sub-block of the current block based on the reconstructed pixel of the upper boundary and / or the reconstructed pixel of the first sub-block, and determining a reconstructed pixel of the second sub-block based on the reference pixel of the second search region, wherein the current block is divided into the first sub-block and the second sub-block.
[0008] The present invention is a decoding method applied to the decoding side, which includes the steps of decoding a fixed-length code corresponding to each sub-block in the current block from a bit stream corresponding to the current block; for each sub-block in the current block, decoding a residual value corresponding to each position in the sub-block from the bit stream corresponding to the current block based on the fixed-length code corresponding to the sub-block; determining whether it is necessary to decode the code bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block, and if it is necessary to decode the code bits corresponding to the sub-block, decoding the code bits corresponding to the sub-block from the bit stream corresponding to the current block; and when the residual value corresponding to the target position in the sub-block is a residual boundary value, determining the sign of the residual boundary value based on the code bits, where the target position is an arbitrary position in the sub-block.
[0009] The present invention is configured to perform the following steps: a step of obtaining a target prediction mode list by performing a removal process on a target prediction mode in an initial prediction mode list corresponding to a current block when a reference pixel of the current block is unavailable; a step of encoding or decoding the current block based on the target prediction mode list; or, when a reference pixel of a first boundary of the current block is unavailable and a reference pixel of a second boundary of the current block is available, a step of padding the reference pixel of the first boundary based on the reference pixel of the second boundary; and a step of encoding or decoding the current block based on the padded reference pixel of the first boundary and the reference pixel of the second boundary; or, when an intra-block copy prediction mode is valid for the current block, a step of determining a first search area corresponding to a first sub-block of the current block based on a reconstructed pixel of the upper boundary when a reference pixel of the left boundary of the current block is unavailable and a reference pixel of the upper boundary of the current block is available, and determining a reconstructed pixel of the first sub-block based on a reference pixel of the first search area; and a step of determining a second search area corresponding to a second sub-block of the current block based on the reconstructed pixel of the upper boundary and / or the reconstructed pixel of the first sub-block after obtaining the reconstructed pixel of the first sub-block, and determining a reconstructed pixel of the second sub-block based on a reference pixel of the second search area, wherein the current block is divided into the first sub-block and the second sub-block; or, a step of decoding a fixed-length code corresponding to each sub-block in the current block from a bitstream corresponding to the current block; for each sub-block in the current block, a step of decoding a residual value corresponding to each position in the sub-block from the bitstream corresponding to the current block based on the fixed-length code corresponding to the sub-block; determining whether it is necessary to decode a coded bit corresponding to the sub-block based on a value of the fixed-length code corresponding to the sub-block, and when it is necessary to decode the coded bit corresponding to the sub-block,A step of decoding coded bits corresponding to the sub-block from a bit stream corresponding to the current block, and a step of determining a sign of the residual boundary value based on the coded bits when a residual value corresponding to a target position within the sub-block is the residual boundary value, where the target position is an arbitrary position within the sub-block, and a decoder configured to perform the steps, and an encoding and decoding apparatus including the same are provided.
[0010] The present invention provides a decoding device including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions executable by the processor, and the processor executes the machine-executable instructions to be used for implementing the above encoding and decoding method.
[0011] The present invention provides an encoding device including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions executable by the processor, and the processor executes the machine-executable instructions to be used for implementing the above encoding and decoding method.
[0012] As can be seen from the above technical solutions, in the embodiments of the present invention, for the current block located at the boundary (i.e., the reference pixels of the current block are unavailable), considering that there is redundancy in the mode 1 coding cost, a method for removing coding redundancy is proposed, that is, by performing a removal process on the target prediction mode in the initial prediction mode list, a removal process is performed on the modes not selected at the boundary, and by changing the mode corresponding to the codeword from the code table of mode coding, the coding redundancy is removed. For the current block located at the boundary (i.e., the reference pixels on the left boundary are unavailable or the reference pixels on the upper boundary are unavailable), using the encoded reconstructed block, as many different reference pixels as possible are derived, and based on the reconstructed block, the reconstructed values that cannot be obtained in different prediction modes are derived, and more reference pixel padding methods can be added, so that the modes not selected by the padding with a single default value can be padded with other reference pixels, and then the mode may be selected. By improving the boundary code bits of the fixed-length code with symbols, the compression efficiency is improved, the hardware cost is reduced, and the analysis of the code bits does not depend on the residual value itself. By removing coding redundancy, improving coding efficiency, effectively padding the reference pixels at the boundary, and improving the prediction ability of the prediction mode at the boundary position, the quality at the boundary of the reconstructed image is improved. Since the coding error is transmitted, the improvement in quality is also transmitted, and the overall coding performance and decoding performance can be improved.
Brief Description of the Drawings
[0013]
Figure 1
Figure 2A
Figure 2B
Figure 2C
Figure 3
Figure 4A
Figure 4B
Figure 4C
Figure 4D
Figure 4E
Figure 4F
Figure 5A
Figure 5B
Figure 5C
Figure 6
Figure 7A
Figure 7B
Figure 7C
Figure 7D
Figure 8A
Figure 8B
Figure 8C
Figure 9A
Figure 9B
Figure 9C
Figure 9D
Embodiments for Carrying Out the Invention
[0014] The terms used in the embodiments of the present invention are only for explaining specific embodiments and are not for limiting the present invention. The singular forms "a kind", "the foregoing", and "said" used in the embodiments and claims of the present invention are also intended to include the plural forms unless the context clearly indicates otherwise. Also, it should be understood that the term "and / or" used in the present invention means any or all possible combinations of one or more of the related listed items. The embodiments of the present invention may use terms such as first, second, third, etc. to explain various information, but it should be understood that this information is not limited to these terms. These terms are only used to distinguish the same type of information. For example, without departing from the scope of the embodiments of the present invention, depending on the context, the first information may be called the second information, and similarly, the second information may be called the first information. Also, the word "when..." used here may be interpreted as "when...", "at...", or "in response to a decision".
[0015] The embodiments of the present invention provide encoding and decoding methods, apparatuses, and their devices, and may be related to the following concepts.
[0016] Near-Lossless Compression: Near-lossless compression is a compression technique between lossless compression and lossy compression. The purpose of near-lossless compression is to obtain high image compression quality at a certain compression ratio.
[0017] Quantization and Dequantization: Quantization is a process that maps the continuous values (or a large number of discrete values) of a signal to a finite number of discrete amplitudes, realizing a many-to-one mapping of signal values. In the video image encoding process, after the residual signal is transformed, the transformation coefficients usually have a large dynamic range. Therefore, quantizing the transformation coefficients can effectively reduce the space of signal values and obtain a better compression effect. Due to the many-to-one mapping mechanism, distortion inevitably occurs in the quantization process, which is the fundamental cause of distortion in video image encoding. Dequantization is the inverse process of quantization, which can map the quantized coefficients to the reconstructed signal in the input signal space, and the reconstructed signal is an approximation of the input signal.
[0018] Rate-Distortion Optimization Principle: There are two indicators for evaluating the encoding efficiency, namely the bit rate and the PSNR (Peak Signal to Noise Ratio). The smaller the bitstream, the higher the compression ratio, and the larger the PSNR, the better the quality of the reconstructed image. When making mode selection, the discriminant is essentially a comprehensive evaluation of both. For example, the cost corresponding to a mode: J(mode) = D + λ * R, where D represents Distortion, which can usually be evaluated by the SSE (Sum of the Squared Errors) indicator. SSE refers to the sum of the mean squares of the differences between the reconstructed image block and the source image. To consider the cost, the SAD indicator can also be used. SAD refers to the sum of the absolute values of the differences between the reconstructed image block and the source image. λ is the Lagrange multiplier, and R is the actual number of bits required for encoding the image block in this mode, including the total number of bits required for encoding mode information, motion information, residuals, etc. When making mode selection, using the rate-distortion principle to compare and determine the encoding mode can usually guarantee optimal encoding performance.
[0019] Video Encoding Framework: As shown in FIG. 1, FIG. 1 is a schematic diagram of the video encoding framework on the encoding side. The processing process on the encoding side of the embodiments of the present invention may be realized by the video encoding framework. The schematic diagram of the video decoding framework may be similar to FIG. 1, so the description is omitted here. However, the processing process on the decoding side of the embodiments of the present invention may also be realized by the video decoding framework.
[0020] Exemplarily, as shown in FIG. 1, the video encoding framework may include modules such as prediction, transformation, quantization, entropy encoder, inverse quantization, inverse transformation, reconstruction, filtering, etc. On the encoding side, through the cooperation among these modules, the processing process on the encoding side can be realized. Also, the video decoding framework may include modules such as prediction, transformation, quantization, entropy decoder, inverse quantization, inverse transformation, reconstruction, filtering, etc. On the decoding side, through the cooperation among these modules, the processing process on the decoding side can be realized.
[0021] Regarding each module on the encoding side, a large number of encoding tools have been proposed, and each tool usually has many modes. For different video sequences, the encoding tools that bring the optimal encoding performance are often different. Therefore, in the encoding process, usually, RDO (Rate-Distortion Optimize) is used to compare the encoding performance of different tools or modes and select the optimal mode. After determining the optimal tool or mode, the determination information of the tool or mode is transmitted by a method of encoding mark information into the bitstream. Such a method brings encoding complexity, but for different contents, the optimal mode combination can be adaptively selected to obtain the optimal encoding performance. The decoding side can obtain the relevant mode information by directly analyzing the mark information, and the influence of complexity is small.
[0022] Exemplarily, for modules such as prediction, transformation, quantization, entropy coding, and filtering, the prediction module includes intra-frame prediction and inter-frame prediction. Intra-frame prediction removes spatial redundancy by performing prediction using reconstructed pixels around the current block, and inter-frame prediction removes temporal redundancy by performing prediction using reconstructed pixels in the temporal reference frame. The transformation module linearly maps the residual information in the spatial domain to the transform domain (e.g., frequency domain), and its goal is to concentrate energy more and remove the frequency domain correlation of the signal. The theoretical transformation matrix is invertible and does not cause signal loss. The quantization module is a "many-to-one" mapping process, which is irreversible and causes signal loss. Its advantage is that it can greatly reduce the range of signal values, and the encoder can give a good approximation of the original signal with fewer codes, so as to improve the compression ratio. The entropy coding module is a lossless coding method based on the principle of information entropy, which converts a series of element symbols (e.g., transform coefficients and mode information, etc.) representing the video sequence into a single binary bitstream and removes the statistical redundancy of these video element symbols. The filtering module enhances the reconstructed image, and its goal is to make the reconstructed image closer to the original image and improve the quality of the reconstructed image by suppressing the influence of block effects and ringing effects.
[0023] The structures of the encoding side and the decoding side will be briefly described below. As shown in FIG. 2A, FIG. 2A is a schematic block diagram of an example of the encoding side for implementing an embodiment of the present invention. In FIG. 2A, the encoding side includes a prediction processing unit, a residual calculation unit, a conversion processing unit, a quantization unit, an encoding unit, an inverse quantization unit, an inverse conversion processing unit, a reconstruction unit, and a filter unit. In one example, the encoding side may further include a buffer and a decoded picture buffer (DPB). The buffer is used to buffer the reconstructed image blocks output by the reconstruction unit, and the decoded picture buffer is used to buffer the filtered image blocks output by the filter unit.
[0024] The input of the encoding side (which may also be called an encoder) is an image block of an image (which may also be called the image to be encoded). The image block may also be called the current block or the block to be encoded. The encoding side may further include a splitting unit (not shown) for splitting the image to be encoded into a plurality of image blocks. The encoding side is used to encode the image to be encoded block by block. For example, an encoding process is executed for each image block. The prediction processing unit receives or obtains an image block (which may also be called the current image block to be encoded of the current image to be encoded, and may be understood as the true value of the image block) and the reconstructed image data, and is used to predict the current block based on the relevant data in the reconstructed image data to obtain the predicted block of the current block. In one example, the prediction processing unit may include an inter-frame prediction unit, an intra-frame prediction unit, and a mode selection unit. The mode selection unit is used to select an intra-frame prediction mode or an inter-frame prediction mode. When the intra-frame prediction mode is selected, the prediction process is executed by the intra-frame prediction unit. When the inter-frame prediction mode is selected, the prediction process may be executed by the inter-frame prediction unit.
[0025] The residual calculation unit is used to calculate the residual between the true value of the image block and the predicted block of the image block to obtain a residual block. For example, the residual calculation unit may subtract the pixel value of the predicted block from the pixel value of the image block for each pixel.
[0026] The transformation processing unit is used to perform a transformation such as a discrete cosine transform (DCT) or a discrete sine transform (DST) on the residual block to obtain transformation coefficients in the transformation domain. The transformation coefficients may be called transformation residual coefficients, and the transformation residual coefficients can represent the residual block in the transformation domain.
[0027] The quantization unit is used to apply scalar quantization or vector quantization to quantize the transformation coefficients to obtain quantized transformation coefficients. The quantized transformation coefficients may be called quantized residual coefficients. The quantization process can reduce the bit depth for some or all of the transformation coefficients. For example, during quantization, an n-bit transformation coefficient may be truncated to an m-bit transformation coefficient, where n is greater than m. The degree of quantization can be changed by adjusting the quantization parameter (QP). For example, in the case of scalar quantization, fine quantization or coarse quantization can be achieved by applying different scales. A small quantization step corresponds to fine quantization, and a large quantization step corresponds to coarse quantization. The quantization parameter (QP) may be used to indicate an appropriate quantization step.
[0028] The symbolization unit encodes the quantized residual coefficients, outputs the encoded image data (i.e., the encoding result of the image block to be currently encoded) in the form of an encoded bitstream, and may transmit the encoded bitstream to the decoder, or transmit it to the decoder later, or store it for use in search. The symbolization unit may further be used to encode other syntax elements of the current image block, such as encoding the prediction mode into the bitstream. The encoding algorithms include, but are not limited to, variable length coding (VLC) algorithm, context adaptive VLC (CAVLC) algorithm, arithmetic coding algorithm, context adaptive binary arithmetic coding (CABAC) algorithm, syntax-based context-adaptive binary arithmetic coding (SBAC) algorithm, probability interval partitioning entropy (PIPE) algorithm.
[0029] The inverse quantization unit is used to perform inverse quantization on the quantized coefficients to obtain the inverse quantized coefficients. The inverse quantization may be the inverse application of the quantization unit. For example, based on or using the same quantization step as the quantization unit, an inverse quantization scheme of the quantization scheme applied by the quantization unit may be applied. The inverse quantized coefficients may also be called inverse quantized residual coefficients.
[0030] The inverse transformation processing unit is used to perform an inverse transformation on the above inverse quantized coefficients. The inverse transformation may be an inverse application of the above transformation processing unit. For example, the inverse transformation may include an inverse discrete cosine transform (IDCT) or an inverse discrete sine transform (IDST) for obtaining an inverse transformation block in a pixel region (or a region called a sample region). The inverse transformation block may be referred to as an inverse transformation inverse quantized block or an inverse transformation residual block.
[0031] The reconstruction unit is used to add an inverse transformation block (i.e., an inverse transformation residual block) to a prediction block to obtain a reconstructed block in the sample region. The reconstruction unit may be an adder. For example, the sample values (i.e., pixel values) of the residual block and the sample values of the prediction block are added. The reconstructed block output by the reconstruction unit may be used later to predict other image blocks, such as being used in an intra-frame prediction mode.
[0032] The filter unit (or abbreviated as "filter") is used to filter the reconstructed block to obtain a filtered block so as to perform pixel transformation smoothly or improve the quality of the image. The filter unit may be a loop filter unit intended to represent one or more loop filters. For example, the filter unit may be a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters such as a bilateral filter, an adaptive loop filter (ALF), an edge enhancement or smoothing filter, a collaborative filter, etc. In one example, the filtered block output by the filtering unit may be used later to predict other image blocks, such as being used in an inter-frame prediction mode, and is not limited thereto.
[0033] As shown in FIG. 2B, FIG. 2B is a schematic block diagram of an example of a decoder side (also referred to as a decoder) for implementing an embodiment of the present invention. The decoder is used to receive, for example, encoded image data encoded by an encoder (i.e., an encoded bitstream, for example, including an encoded bitstream of an image block and syntax elements associated therewith) and obtain a decoded image. The decoder may include a decoding unit, an inverse quantization unit, an inverse transformation processing unit, a prediction processing unit, a reconstruction unit, a filter unit, and the like. In some embodiments, the decoder may perform a decoding process that is substantially the reverse of the encoding process described for the encoder in FIG. 2A. In one example, the decoder may further include a buffer and a decoded image buffer. The buffer is used to buffer the reconstructed image blocks output by the reconstruction unit, and the decoded image buffer is used to buffer the filtered image blocks output by the filter unit.
[0034] The decoding unit performs decoding on the encoded image data to obtain quantized coefficients and / or decoded encoding parameters (for example, the encoding parameters may include any one or all of inter-frame prediction parameters, intra-frame prediction parameters, filter parameters, and / or other syntax elements). The decoding unit is further used to transfer the decoded encoding parameters to the prediction processing unit so that the prediction processing unit can perform a prediction process based on the encoding parameters. The function of the inverse quantization unit may be the same as that of the inverse quantization unit of the encoder and is used to inverse-quantize the quantized coefficients decoded by the decoding unit.
[0035] The function of the inverse transformation processing unit may be the same as that of the inverse transformation processing unit of the encoder, and the function of the reconstruction unit (e.g., an adder) may be the same as that of the reconstruction unit of the encoder. It is used to perform an inverse transformation (e.g., inverse DCT, inverse integer transformation, or a conceptually similar inverse transformation process) on the quantized coefficients to obtain an inverse transformation block (also called an inverse transformation residual block), and the inverse transformation block is the residual block of the current image block in the pixel domain.
[0036] The prediction processing unit is used to receive or acquire encoded image data (e.g., the encoded bitstream of the current image block) and the reconstructed image data. The prediction processing unit further receives or acquires, for example, prediction-related parameters and / or information regarding the selected prediction mode (i.e., the decoded encoded parameters) from a decoding unit, and may predict the current image block based on the relevant data in the reconstructed image data and the decoded encoded parameters to obtain a prediction block of the current image block.
[0037] In one example, the prediction processing unit may include an inter-frame prediction unit, an intra-frame prediction unit, and a mode selection unit. The mode selection unit is used to select an intra-frame prediction mode or an inter-frame prediction mode. When the intra-frame prediction mode is selected, the prediction process is executed by the intra-frame prediction unit, and when the inter-frame prediction mode is selected, the prediction process is executed by the inter-frame prediction unit.
[0038] The reconstruction unit is used to add the inverse transformation block (i.e., the inverse transformation residual block) to the prediction block to obtain a reconstructed block in the sample domain. For example, the sample values of the inverse transformation residual block and the sample values of the prediction block may be added.
[0039] The filter unit is used to filter the reconstructed blocks to obtain the filtered blocks, and the filtered blocks are decoded image blocks.
[0040] Note that in the encoder and decoder of the embodiments of the present invention, the processing result of a certain process may be further processed, and the further processed result may be output to the next process. For example, after processes such as interpolation filtering, motion vector derivation, or filtering, further processing such as Clip or shift may be performed on the processing result of the corresponding process.
[0041] Based on the encoder and decoder, the embodiments of the present invention provide an implementable encoding / decoding method. As shown in FIG. 2C, FIG. 2C is a schematic flowchart of encoding and decoding provided by the embodiments of the present invention. The encoding and decoding implementation method includes processes (1)-(5), and processes (1)-(5) may be executed by the above decoder and encoder. Process (1): Divide an image of one frame into one or more non-overlapping parallel encoding units. The one or more parallel encoding units do not depend on each other and can be encoded and decoded completely in parallel and independently of each other, such as the parallel encoding unit 1 and parallel encoding unit 2 shown in FIG. 2C.
[0042]
[0043] Generally, the independent encoding unit may have a fixed size of w_lcu×h_lcu, where both w_lcu and h_lcu are powers of 2 (N≧0). For example, the size of the independent encoding unit can be 128×4, 64×4, 32×4, 16×4, 8×4, 32×2, 16×2, or 8×2, etc.
[0044] As one possible example, the independent encoding unit may have a fixed size of 128×4. When the size of the parallel encoding unit is 256×8, the parallel encoding unit may be evenly divided into four independent encoding units. When the size of the parallel encoding unit is 288×10, the parallel encoding unit may be divided such that the first and second rows each consist of two 128×4 and one 32×4 independent encoding units, and the third row consists of two 128×2 and one 32×2 independent encoding units. Note that the independent encoding unit may include three components of luminance Y, chrominance Cb, and chrominance Cr, three components of red (R), green (G), and blue (B), or three components of luminance Y, chrominance Co, and chrominance Cg, or it may include only any one of these components. When the independent encoding unit includes three components, the sizes of these three components may be exactly the same or different, specifically related to the input format of the image.
[0045] Process (3): For each independent encoding unit, it may be further divided into one or more non-overlapping sub-encoding units. Each sub-encoding unit within the independent encoding unit may be dependent on each other. For example, multiple sub-encoding units may perform pre-encoding and decoding with mutual reference.
[0046] When the sizes of the sub-encoding unit and the independent encoding unit are the same (i.e., when the independent encoding unit is divided into only one sub-encoding unit), the size may be any of the sizes described in Process ■. When the independent encoding unit is divided into a plurality of non-overlapping sub-encoding units, as possible division examples, there are horizontal equal division (the height of the sub-encoding unit is the same as that of the independent encoding unit, but the width is different and may be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), vertical equal division (the width of the sub-encoding unit is the same as that of the independent encoding unit, but the height is different and may be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), horizontal and vertical equal division (quad-tree division), etc., and horizontal equal division is preferred.
[0047] The width of the sub-encoding unit is w_cu, the height is h_cu, and the width must be greater than the height (except for the edge region). Usually, the sub-encoding unit is a fixed w_cu×h_cu, and both w_cu and h_cu are powers of 2 (N is 0 or more), for example, 16×4, 8×4, 16×2, 8×2, 8×1, 4×1, etc. For example, the sub-encoding unit is a fixed 16×4. When the size of the independent encoding unit is 64×4, the independent encoding unit is evenly divided into 4 sub-encoding units. When the size of the independent encoding unit is 72×4, it is divided into 4 sub-encoding units of 16x4 + 1 sub-encoding unit of 8×4. Note that the sub-encoding unit may include three components of luminance Y, chrominance Cb, and chrominance Cr (or three components of red R, green G, and blue B, or luminance Y, chrominance Co, and chrominance Cg), or may include only any one of these components. When including three components, the sizes of these components may be exactly the same or different, specifically related to the input format of the image.
[0048] Note that Process (3) may be an optional step in the encoding and decoding method, and the encoder and decoder may perform encoding and decoding on the residual coefficients (or residual values) of the independent encoding unit obtained in Process (2).
[0049] Process (4): For the sub-encoding unit, it may be further divided into one or more non-overlapping prediction groups (PGs), and PG may be abbreviated as Group. Each PG is encoded and decoded according to the selected prediction mode, the predicted value of the PG is obtained to form the predicted value of the entire sub-encoding unit, and based on the predicted value and the original value of the sub-encoding unit, the residual value of the sub-encoding unit is obtained.
[0050] Process (5): Based on the residual value of the sub-encoding unit, the sub-encoding units are grouped to obtain one or more non-overlapping residual blocks (RBs). The residual coefficients of each RB are encoded and decoded according to the selected mode to form a residual coefficient stream. Specifically, it can be divided into those that perform conversion on the residual coefficients and those that do not perform conversion.
[0051] Here, the selected mode of encoding and decoding the residual coefficient in the process (5) may include, but is not limited to, any of a semi-fixed-length coding mode, an exponential Golomb coding method, a Golomb-Rice coding method, a truncated unary coding method, a run-length coding method, a method of directly encoding the original residual value, etc. For example, the encoder may directly encode the coefficients in the RB. In another example, the encoder may perform a transformation (e.g., DCT, DST, Hadamard transformation, etc.) on the residual block and then encode the transformed coefficients. As one possible example, when the RB is relatively small, the encoder may directly perform uniform quantization on each coefficient in the RB and then perform binary encoding. When the RB is relatively large, it may be further divided into a plurality of coefficient groups (CG), and after performing uniform quantization on each CG, binary encoding may be performed. In some embodiments of the present invention, the coefficient group (CG) and the quantization group (QG) may be the same, and of course, the coefficient group and the quantization group may also be different.
[0052] The following is an exemplary description of the encoding part of the residual coefficient in the semi-fixed length encoding method. First, the maximum value of the absolute value of the residuals within one RB block is defined as the modified maximum (MM). Next, the number of encoding bits for the residual coefficients within the RB block is determined (the number of encoding bits for the residual coefficients within the same RB block is the same). For example, if the critical limit (CL) of the current RB block is 2 and the current residual coefficient is 1, 2 bits are required to encode the residual coefficient 1, which is represented as 01. If the CL of the current RB block is 7, this means encoding an 8-bit residual coefficient and a 1-bit sign bit. The determination of CL is to find the minimum M value that satisfies the condition that all residuals of the current sub-block are within the range of [-2^(M - 1), 2^(M - 1)]. If both of the two boundary values of -2^(M - 1) and 2^(M - 1) exist, M is incremented by 1, that is, M + 1 bits are required to encode all residuals of the current RB block. If only one of the two boundary values of -2^(M - 1) and 2^(M - 1) exists, one Trailing bit is encoded to determine whether the boundary value is -2^(M - 1) or 2^(M - 1). If neither -2^(M - 1) nor 2^(M - 1) exists for all residuals, there is no need to encode the Trailing bit. Also, in some special cases, the encoder may directly encode the original value of the image instead of the residual value.
[0053] In one possible embodiment, when the predicted value cannot be obtained at the boundary, usually, one default value is used as padding. This padding value is usually 1<<(bitdepth - 1) or (1<<(bitdepth - 1)-1). When the image bit width is 8, bitdepth is equal to 8, that is, the padding of the default value is 128 or 127. Due to the padding of a single default value, the predicted values in multiple prediction modes are all the same, so in the encoding process, some modes are not selected, resulting in encoding redundancy.
[0054] In response to the above discovery, embodiments of the present invention provide an encoding and decoding method. For an encoding unit located at the boundary (i.e., the current block), for modes not selected at the boundary, the parsed code table is modified, and the mode corresponding to its codeword is changed, so as to reduce the available modes at the boundary and remove the long codewords in the code table, thereby removing encoding redundancy.
[0055] Hereinafter, in connection with several specific embodiments, the encoding and decoding method in embodiments of the present invention will be described in detail.
[0056] Embodiment 1: Embodiments of the present invention provide an encoding and decoding method, which may be applied to the decoding side (also referred to as a video decoder), and the method may also be applied to the encoding side (also referred to as a video encoder). For the decoding side, the encoding and decoding method may be a decoding method, and for the encoding side, the encoding and decoding method may be an encoding method.
[0057] As shown in FIG. 3, FIG. 3 is a schematic flowchart of the encoding and decoding method, and the method may include the following.
[0058] In step 301, when the reference pixels of the current block are unavailable, a removal process is performed on the target prediction mode in the initial prediction mode list corresponding to the current block to obtain a target prediction mode list. For example, the initial prediction mode list includes a plurality of prediction modes, and the target prediction mode is a prediction mode not used for the current block in the initial prediction mode list when the reference pixels are unavailable.
[0059] In step 302, the current block is encoded or decoded based on the target prediction mode list.
[0060] For example, the decoding side may select one prediction mode from the target prediction mode list as the determined prediction mode, and decode the current block based on the determined prediction mode, and this decoding process is not limited.
[0061] For example, the encoding side may select one prediction mode from the target prediction mode list as the determined prediction mode, and encode the current block based on the determined prediction mode, without limiting this encoding process.
[0062] Exemplarily, the fact that the reference pixels of the current block are unavailable may include that the reference pixels of the upper boundary of the current block are unavailable and the reference pixels of the left boundary of the current block are available, that the reference pixels of the left boundary of the current block are unavailable and the reference pixels of the upper boundary of the current block are available, or that the reference pixels of the upper boundary of the current block are unavailable and the reference pixels of the left boundary of the current block are unavailable.
[0063] The step of performing a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block may include a step of determining a plurality of candidate prediction modes in the initial prediction mode list, where the candidate prediction modes are prediction modes not used for the current block in the initial prediction mode list when the reference pixels are unavailable, and a step of selecting at least one prediction mode as the first target prediction mode from all the candidate prediction modes and performing a removal process on the first target prediction mode in the initial prediction mode list, but is not limited thereto.
[0064] Exemplarily, the step of selecting at least one prediction mode from all candidate prediction modes as the first target prediction mode may include, but is not limited to, the step of selecting K candidate prediction modes from all candidate prediction modes as retained prediction modes based on the codeword length corresponding to each candidate prediction mode, where K is a positive integer, and the step of determining candidate prediction modes other than the retained prediction modes as the first target prediction mode. For example, K is 1, and the retained prediction mode is the candidate prediction mode with the shortest codeword length, that is, the candidate prediction mode with the shortest codeword length is used as the retained prediction mode, and the remaining candidate prediction modes are used as the first target prediction mode. Also, for example, K is 2, and the retained prediction modes are the candidate prediction mode with the shortest codeword length and the candidate prediction mode with the second shortest codeword length. Also, for example, K is 1, and the retained prediction mode is any one of all candidate prediction modes. Also, for example, K is 2, and the retained prediction modes are any two of all candidate prediction modes. Of course, the above methods are only examples and are not limited thereto. The value of K can be set arbitrarily, and the retained prediction mode can also be selected arbitrarily.
[0065] Exemplarily, the step of selecting at least one prediction mode from all candidate prediction modes as the first target prediction mode may include, but is not limited to, the step of selecting L candidate prediction modes from all candidate prediction modes as the first target prediction mode based on the codeword length corresponding to each candidate prediction mode, where L is a positive integer and L is less than the total number of candidate prediction modes. For example, all candidate prediction modes are sorted according to the codeword length, and L candidate prediction modes are selected as the first target prediction mode starting from the candidate prediction mode with the longest codeword length, where L is 1, 2, 3, 4, etc., and L is less than the total number of candidate prediction modes. Also, for example, L candidate prediction modes can be arbitrarily selected from all candidate prediction modes as the first target prediction mode. Of course, the above methods are only examples, and the value of L can be set arbitrarily, and the first target prediction mode can also be selected arbitrarily.
[0066] Exemplarily, the candidate prediction mode may include, but is not limited to, a plurality of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. For example, the candidate prediction mode may simultaneously include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode.
[0067] The first target prediction mode may include at least one of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode, but is not limited thereto. For example, one prediction mode (which may be any prediction mode) is removed from the above prediction modes, and the first target prediction mode simultaneously includes the remaining prediction modes.
[0068] In one possible embodiment, when the reference pixel at the upper boundary of the current block is unavailable and the reference pixel at the left boundary of the current block is available, the candidate prediction modes may include, but are not limited to, a plurality of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode. For example, the candidate prediction modes may simultaneously include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode. The first target prediction mode may include, but is not limited to, at least one of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode. For example, removing one prediction mode (which may be any prediction mode) from the above prediction modes, the first target prediction mode simultaneously includes the remaining prediction modes. For example, when removing the DC prediction mode from the above prediction modes, the first target prediction mode simultaneously includes the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode. When removing the VER prediction mode from the above prediction modes, the first target prediction mode simultaneously includes the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, and the DIAG3 prediction mode. For example, removing two prediction modes (which may be any two prediction modes) from the above prediction modes, the first target prediction mode simultaneously includes the remaining prediction modes. For example, when removing the DC prediction mode and the VER prediction mode from the above prediction modes, the first target prediction mode simultaneously includes the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, and the DIAG3 prediction mode. Of course, the above are only examples of the candidate prediction modes and the first target prediction mode.
[0069] In one possible embodiment, when the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, the candidate prediction mode may include, but is not limited to, a plurality of HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, and IBM2 prediction mode. For example, the candidate prediction mode may simultaneously include HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, and IBM2 prediction mode. The first target prediction mode may include at least one of HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, and IBM2 prediction mode, but is not limited thereto. For example, one prediction mode (which may be any prediction mode) is removed from the above prediction modes, and the first target prediction mode simultaneously includes the remaining prediction modes. For example, when the HOR prediction mode is removed from the above prediction modes, the first target prediction mode simultaneously includes IBM0 prediction mode, IBM1 prediction mode, and IBM2 prediction mode.
[0070] Of course, the above are only examples of the candidate prediction mode and the first target prediction mode, and are not limited thereto.
[0071] a In one possible embodiment, when the reference pixel at the upper boundary of the current block is unavailable and the reference pixel at the left boundary of the current block is unavailable, the candidate prediction mode may include, but is not limited to, a plurality of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. For example, the candidate prediction mode may simultaneously include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. The first target prediction mode may include, but is not limited to, at least one of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. For example, removing one prediction mode (which may be any prediction mode) from the above prediction modes, the first target prediction mode simultaneously includes the remaining prediction modes. For example, when removing the DC prediction mode from the above prediction modes, the first target prediction mode simultaneously includes the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. Also, for example, when removing the HOR prediction mode from the above prediction modes, the first target prediction mode simultaneously includes the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. For example, removing two prediction modes (which may be any two prediction modes) from the above prediction modes, the first target prediction mode simultaneously includes the remaining prediction modes.For example, when removing the DC prediction mode and the HOR prediction mode from the above prediction modes, the first target prediction mode simultaneously includes the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode.
[0072] Of course, the above are only examples of candidate prediction modes and the first target prediction mode, and are not limited thereto.
[0073] In one possible embodiment, the step of performing a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block may include the step of determining a second target prediction mode in the initial prediction mode list, where the second target prediction mode is a prediction mode not used for the current block in the initial prediction mode list when the reference pixel is unavailable, and the step of performing a removal process on the second target prediction mode in the initial prediction mode list, but is not limited thereto. The difference from the above method is that in this embodiment, it is not necessary to select a candidate prediction mode from the initial prediction mode list and then select the first target prediction mode from the candidate prediction modes. Instead, the second target prediction mode is directly selected from the initial prediction mode list. To distinguish it from the above first target prediction mode, the target prediction mode in this embodiment is denoted as the second target prediction mode.
[0074] Exemplarily, the second target prediction mode may include at least one of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode, but is not limited thereto. For example, one prediction mode (any prediction mode) is removed from the above prediction modes, and the second target prediction mode simultaneously includes the remaining prediction modes.
[0075] For example, when the reference pixel at the upper boundary of the current block is unavailable and the reference pixel at the left boundary of the current block is available, the second target prediction mode may include, but is not limited to, at least one of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode. For example, the second target prediction mode may simultaneously include the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode. Alternatively, the second target prediction mode may simultaneously include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, and the DIAG3 prediction mode. Alternatively, the second target prediction mode may simultaneously include the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, and the DIAG3 prediction mode.
[0076] For example, when the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, the second target prediction mode may include, but is not limited to, at least one of the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. For example, the second target prediction mode may simultaneously include the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode.
[0077] For example, the second target prediction mode may include at least one of a DC prediction mode, a DIAG0 prediction mode, a DIAG1 prediction mode, a DIAG2 prediction mode, a DIAG3 prediction mode, a VER prediction mode, a HOR prediction mode, an IBM0 prediction mode, an IBM1 prediction mode, and an IBM2 prediction mode, but is not limited thereto. For example, the second target prediction mode simultaneously includes a DIAG0 prediction mode, a DIAG1 prediction mode, a DIAG2 prediction mode, a DIAG3 prediction mode, a VER prediction mode, a HOR prediction mode, an IBM0 prediction mode, an IBM1 prediction mode, and an IBM2 prediction mode. Alternatively, the second target prediction mode simultaneously includes a DC prediction mode, a DIAG0 prediction mode, a DIAG1 prediction mode, a DIAG2 prediction mode, a DIAG3 prediction mode, a VER prediction mode, an IBM0 prediction mode, an IBM1 prediction mode, and an IBM2 prediction mode. Alternatively, the second target prediction mode simultaneously includes a DIAG0 prediction mode, a DIAG1 prediction mode, a DIAG2 prediction mode, a DIAG3 prediction mode, a VER prediction mode, an IBM0 prediction mode, an IBM1 prediction mode, and an IBM2 prediction mode.
[0078] Exemplarily, the above execution order is merely an example for ease of explanation, and in actual application, the execution order between steps may be changed, and the execution order is not limited thereto. Also, in other embodiments, the steps of the corresponding method are not necessarily executed in the order shown and described in this specification, and the method may include more or fewer steps than those described in this specification. Also, a single step described in this specification may be decomposed and described as multiple steps in other embodiments, and multiple steps described in this specification may be combined and described as a single step in other embodiments.
[0079] As can be seen from the above technical solutions, in the embodiments of the present invention, for the current block located at the boundary (i.e., the reference pixels of the current block are unavailable), considering that there is redundancy in the mode 1 encoding cost, a method for removing encoding redundancy is proposed, that is, by performing a removal process on the target prediction mode in the initial prediction mode list, a removal process is performed on the modes not selected at the boundary, and by changing the mode corresponding to the codeword from the code table of mode encoding, the encoding redundancy is removed, that is, the encoding redundancy is removed, the encoding efficiency is improved, the prediction ability of the prediction mode at the boundary position is improved, the quality at the boundary of the reconstructed image is improved, and the encoding performance and decoding performance can be improved.
[0080] Embodiment 2: For Embodiment 1, when the pixels outside the slice boundary are unavailable, the predicted values of some prediction modes cannot be obtained, so these prediction modes cannot be selected. For such an encoded block, the number of prediction modes decreases, and accordingly, the bit overhead may be saved by adjusting the mode encoding. As described above, for the encoded unit (i.e., the current block) located at the boundary, for the prediction modes not selected at the boundary, the analysis code table is modified, and by changing the mode corresponding to the codeword, the available prediction modes at the boundary are reduced, and by deleting the long codewords in the code table, the encoding redundancy is removed.
[0081] As shown in FIG. 4A, FIG. 4A is a schematic diagram of mode encoding. The initial prediction mode list corresponding to the current block may include, but is not limited to, a DC prediction mode, a DIAG0 prediction mode, a DIAG1 prediction mode, a DIAG2 prediction mode, a DIAG3 prediction mode, a VER prediction mode, a HOR prediction mode, an IBM0 prediction mode, an IBM1 prediction mode, an IBM2 prediction mode, an ORG prediction mode, a PM0 prediction mode, a PM1 prediction mode, a PM2 prediction mode, and a PM3 prediction mode.
[0082] As can be seen from FIG. 4A, the codeword corresponding to the DC prediction mode is 11, the codeword corresponding to the DIAG0 prediction mode is 10011, the codeword corresponding to the DIAG1 prediction mode is 10010, the codeword corresponding to the DIAG2 prediction mode is 100001, the codeword corresponding to the DIAG3 prediction mode is 100000, the codeword corresponding to the VER prediction mode is 1011, the codeword corresponding to the HOR prediction mode is 1010, the codeword corresponding to the IBM0 prediction mode is 011, the codeword corresponding to the IBM1 prediction mode is 0101, the codeword corresponding to the IBM2 prediction mode is 0100, the codeword corresponding to the ORG prediction mode is 10001, the codeword corresponding to the PM0 prediction mode is 0010, the codeword corresponding to the PM1 prediction mode is 0011, the codeword corresponding to the PM2 prediction mode is 0000, and the codeword corresponding to the PM3 prediction mode is 0001. Of course, the above are only examples of the codewords corresponding to each prediction mode, and this embodiment is not limited thereto.
[0083] In one possible embodiment, when the reference pixel of the upper boundary of the current block is unavailable and the reference pixel of the left boundary of the current block is available, the candidate prediction mode in the initial prediction mode list may be determined, and the candidate prediction mode is a prediction mode not used for the current block in the initial prediction mode list when the reference pixel of the upper boundary of the current block is unavailable and the reference pixel of the left boundary of the current block is available. As shown in FIG. 4B, the candidate prediction mode may include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode.
[0084] For example, when the reference pixel of the current block is located at the upper boundary of the slice, that is, when the reference pixel of the upper boundary of the current block is unavailable, the reference pixels in the intra prediction mode (i.e., the INTRA prediction mode) for the DC prediction mode, VER prediction mode, DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, and DIAG3 prediction mode are unavailable, and the predicted values of these reference pixels may be default values, such as 1<<bitdepth-1, etc. FIG. 4B shows these prediction modes.
[0085] In this case, one prediction mode from the DC prediction mode, VER prediction mode, DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, and DIAG3 prediction mode may be selected as the default value mode, that is, when the predicted value of the reference pixel is the default value, prediction is performed using this prediction mode. For example, the DC prediction mode may be used as the default value mode, that is, when the predicted value of the reference pixel is the default value, prediction is performed using the DC prediction mode.
[0086] As described above, the DC prediction mode may be retained and the VER prediction mode, DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, and DIAG3 prediction mode may be removed. In this way, when the reference pixel of the upper boundary is unavailable, the intra prediction mode may retain the DC prediction mode and the HOR prediction mode, and the overflow determination condition defaults to selecting the DC prediction mode.
[0087] For candidate prediction modes such as the DC prediction mode, DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, DIAG3 prediction mode, and VER prediction mode, the DC prediction mode may be used as the retained prediction mode, and the DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, DIAG3 prediction mode, VER prediction mode, etc. may be used as the target prediction modes. When the target prediction modes are removed from the initial prediction mode list, a target prediction mode list can be obtained, and the target prediction mode list may be as shown in FIG. 4C. Obviously, the target prediction mode list corresponding to the current block may include, but is not limited to, the DC prediction mode, HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, IBM2 prediction mode, ORG prediction mode, PM0 prediction mode, PM1 prediction mode, PM2 prediction mode, and PM3 prediction mode.
[0088] As can be seen from FIG. 4C, the code word corresponding to the DC prediction mode is 11, the code word corresponding to the HOR prediction mode is 101, the code word corresponding to the ORG prediction mode is 100, the code word corresponding to the IBM0 prediction mode is 011, the code word corresponding to the IBM1 prediction mode is 0101, the code word corresponding to the IBM2 prediction mode is 0100, the code word corresponding to the PM0 prediction mode is 0010, the code word corresponding to the PM1 prediction mode is 0011, the code word corresponding to the PM2 prediction mode is 0000, and the code word corresponding to the PM3 prediction mode is 0001. Of course, the above are only examples of the code words corresponding to each prediction mode, and this embodiment is not limited thereto.
[0089] As can be seen from FIGS. 4A and 4C, the code word corresponding to the HOR prediction mode changes from 1010 to 101, and the code word corresponding to the ORG prediction mode changes from 10001 to 100. That is, the code word length can be shortened and the bit overhead can be reduced.
[0090] In one possible embodiment, when the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, the candidate prediction mode in the initial prediction mode list may be determined. The candidate prediction mode is a prediction mode not used for the current block in the initial prediction mode list when the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available. As shown in FIG. 4D, the candidate prediction mode may include the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. For example, when the reference pixel of the current block is located at the left boundary of the slice, that is, when the reference pixel at the left boundary of the current block is unavailable, the reference pixels of the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode in the intra-frame prediction mode (i.e., the INTRA prediction mode) are unavailable, and the predicted values of these reference pixels may be default values, such as 1<<bitdepth-1, etc. FIG. 4D shows these prediction modes.
[0091] In this case, one prediction mode may be selected from the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode as the default value mode. That is, when the predicted value of the reference pixel is the default value, prediction may be performed using this prediction mode. For example, the HOR prediction mode may be used as the default value mode. That is, when the predicted value of the reference pixel is the default value, prediction may be performed using the HOR prediction mode. As described above, the HOR prediction mode may be retained and the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode may be removed. In this way, when the reference pixel at the left boundary is unavailable, the intra-frame prediction mode may retain the HOR prediction mode as the default value mode.
[0092] Regarding candidate prediction modes such as the HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, IBM2 prediction mode, etc., the HOR prediction mode may be used as the retained prediction mode, and the IBM0 prediction mode, IBM1 prediction mode, IBM2 prediction mode, etc. may be used as the target prediction modes. When removing the target prediction modes from the initial prediction mode list (which may refer to FIG. 4A), a target prediction mode list can be obtained, and this target prediction mode list may refer to FIG. 4E. Obviously, the target prediction mode list corresponding to the current block may include, but is not limited to, the DC prediction mode, DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, DIAG3 prediction mode, VER prediction mode, HOR prediction mode, ORG prediction mode, PM0 prediction mode, PM1 prediction mode, PM2 prediction mode, PM3 prediction mode.
[0093] As can be seen from FIG. 4E, the code word corresponding to the DC prediction mode is 11, the code word corresponding to the DIAG0 prediction mode is 10011, the code word corresponding to the DIAG1 prediction mode is 10010, the code word corresponding to the DIAG2 prediction mode is 100001, the code word corresponding to the DIAG3 prediction mode is 100000, the code word corresponding to the VER prediction mode is 1011, the code word corresponding to the HOR prediction mode is 1010, the code word corresponding to the ORG prediction mode is 10001, the code word corresponding to the PM0 prediction mode is 010, the code word corresponding to the PM1 prediction mode is 011, the code word corresponding to the PM2 prediction mode is 000, and the code word corresponding to the PM3 prediction mode is 001. Of course, the above are only examples of the code words corresponding to each prediction mode, and this embodiment is not limited thereto. As can be seen from FIGS. 4A and 4E, the code word corresponding to the PM0 prediction mode changes from 0010 to 010, the code word corresponding to the PM1 prediction mode changes from 0011 to 011, and the code word corresponding to the PM2 prediction mode changes from 0000 to 000. That is, the code word length can be shortened and the bit overhead can be reduced.
[0094] In one possible embodiment, when the reference pixel at the upper boundary of the current block is unavailable and the reference pixel at the left boundary of the current block is unavailable, the candidate prediction mode in the initial prediction mode list may be determined. The candidate prediction mode may be a prediction mode not used for the current block in the initial prediction mode list when the reference pixel at the upper boundary of the current block is unavailable and the reference pixel at the left boundary of the current block is unavailable. As shown in FIGS. 4B and 4D, the candidate prediction mode may include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode.
[0095] For example, when the reference pixels of the current block are located at the upper boundary and the left boundary of the slice, that is, when the reference pixel at the upper boundary of the current block is unavailable and the reference pixel at the left boundary of the current block is unavailable, the reference pixels of the DC prediction mode, the VER prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, and the DIAG3 prediction mode in the intra-frame prediction mode (i.e., the INTRA prediction mode) are unavailable, and the reference pixels of the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode are unavailable. The predicted values of these reference pixels may be default values, for example, 1<<bitdepth-1, etc.
[0096] In this case, one prediction mode may be selected as the default value mode from the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. That is, when the predicted value of the reference pixel is the default value, prediction may be performed using this prediction mode. For example, the DC prediction mode may be used as the default value mode. That is, when the predicted value of the reference pixel is the default value, prediction may be performed using the DC prediction mode.
[0097] As described above, it is possible to retain the DC prediction mode and remove the DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, DIAG3 prediction mode, VER prediction mode, HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, and IBM2 prediction mode. Thus, when the reference pixel of the upper boundary is unavailable and the reference pixel of the left boundary is unavailable, the intra-frame prediction mode may retain the DC prediction mode as the default value mode, and the overflow determination condition selects the DC prediction mode by default.
[0098] Regarding candidate prediction modes such as the DC prediction mode, DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, DIAG3 prediction mode, VER prediction mode, HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, and IBM2 prediction mode, the DC prediction mode may be used as the retained prediction mode, and the DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, DIAG3 prediction mode, VER prediction mode, HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, IBM2 prediction mode, etc. may be used as the target prediction modes. When the target prediction modes are removed from the initial prediction mode list, a target prediction mode list can be obtained, and the target prediction mode list may refer to FIG. 4F.
[0099] Obviously, the target prediction mode list corresponding to the current block may include, but is not limited to, the DC prediction mode, ORG prediction mode, PM0 prediction mode, PM1 prediction mode, PM2 prediction mode, and PM3 prediction mode.
[0100] As can be seen from FIG. 4F, the codeword corresponding to the DC prediction mode is 11, the codeword corresponding to the ORG prediction mode is 10, the codeword corresponding to the PM0 prediction mode is 010, the codeword corresponding to the PM1 prediction mode is 011, the codeword corresponding to the PM2 prediction mode is 000, and the codeword corresponding to the PM3 prediction mode is 001. Of course, the above is only an example of the codeword corresponding to each prediction mode, and this embodiment is not limited thereto. As can be seen from FIGS. 4A and 4F, regarding the codeword length corresponding to the ORG prediction mode, the codeword length corresponding to the PM0 prediction mode, the codeword length corresponding to the PM1 prediction mode, the codeword length corresponding to the PM2 prediction mode, the codeword length corresponding to the PM3 prediction mode, etc., the codeword length can be shortened, thereby reducing the bit overhead.
[0101] Embodiment 3: In Embodiments 1 and 2, it may be related to the DC prediction mode, DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, DIAG3 prediction mode, VER prediction mode, HOR prediction mode, IBM0 prediction mode, IBM1 prediction mode, IBM2 prediction mode, ORG prediction mode, PM0 prediction mode, PM1 prediction mode, PM2 prediction mode, PM3 prediction mode. Here, the DIAG0 prediction mode, DIAG1 prediction mode, DIAG2 prediction mode, and DIAG3 prediction modes are all intra-frame angle prediction modes, the VER prediction mode is an intra-frame vertical prediction mode, the HOR prediction mode is an intra-frame horizontal prediction mode, and the IBM0 prediction mode, IBM1 prediction mode, and IBM2 prediction modes are all intra-block copy prediction modes. Hereinafter, these prediction modes will be described in relation to specific application scenarios.
[0102] For a current block of 16×2 (similar for current blocks of other sizes), as shown in FIG. 5A, FIG. 5A is a schematic diagram of the intra-frame prediction mode. The intra-frame prediction mode has seven types of prediction modes, including the DC prediction mode and six types of angular prediction modes. For the DC prediction mode, the reference pixel at each position within the current block is D, and D is the average value of the 16 reference pixels on the upper boundary of the current block. The VER prediction mode is the angular prediction mode 0. FIG. 5A shows the angle corresponding to the angular prediction mode 0. As shown in FIG. 5A, the reference pixels at each position within the current block may be A, B, C, …, D, E, F, etc. The HOR prediction mode is the angular prediction mode 1. FIG. 5A shows the angle corresponding to the angular prediction mode 1. As shown in FIG. 5A, the reference pixel at each position in the first row within the current block may be the left reference pixel A in the first row, and the reference pixel at each position in the second row within the current block may be the left reference pixel in the second row. The DIAG0 prediction mode is the angular prediction mode 2. FIG. 5A shows the angle corresponding to the angular prediction mode 2. As shown in FIG. 5A, based on this angle, the reference pixel at each position within the current block can be known. The DIAG1 prediction mode is the angular prediction mode 3. FIG. 5A shows the angle corresponding to the angular prediction mode 3. As shown in FIG. 5A, based on this angle, the reference pixel at each position within the current block can be known. The DIAG2 prediction mode is the angular prediction mode 4. FIG. 5A shows the angle corresponding to the angular prediction mode 4. As shown in FIG. 5A, based on this angle, the reference pixel at each position within the current block can be known. The DIAG3 prediction mode is the angular prediction mode 5. FIG. 5A shows the angle corresponding to the angular prediction mode 5. As shown in FIG. 5A, based on this angle, the reference pixel at each position within the current block can be known. In FIG. 5(a), XY represents the pixel average value of the reference pixel X and the reference pixel Y.
[0103] For the current block of 16*2 (the current blocks of other sizes are similar), as shown in Figure 5B, Figure 5B is a schematic diagram of the point-by-point prediction mode. The point-by-point prediction mode has four types of prediction modes, including the PM0 prediction mode, the PM1 prediction mode, the PM2 prediction mode, and the PM3 prediction mode. In Figure 5B, the PM0 prediction mode is the point-by-point prediction mode 0, the PM1 prediction mode is the point-by-point prediction mode 1, the PM2 prediction mode is the point-by-point prediction mode 2, and the PM3 prediction mode is the point-by-point prediction mode 3.
[0104] In Figure 5B, ≡ represents obtaining the predicted value of the current pixel by averaging the reconstruction values of the pixels on both the left and right sides, ||| represents obtaining the predicted value of the current pixel by averaging the reconstruction values of the pixels on both the top and bottom sides, > represents directly adopting the reconstruction value of the left pixel as the predicted value of the current pixel, and ∨ represents directly adopting the reconstruction value of the top pixel as the predicted value of the current pixel.
[0105] For the current 16*2 block (similarly for current blocks of other sizes), as shown in Figure 5C, Figure 5C is a schematic diagram of the IBC (Intra Block Copy) prediction mode. The intra block copy prediction mode may have three types of prediction modes, including the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode. In Figure 5C, the IBM0 prediction mode is the intra block copy prediction mode 0. For the intra block copy prediction mode 0, the current 16*2 block may be divided into two 8*2 prediction blocks, and the predicted values of each 8*2 prediction block may be determined based on the reference pixels in the 32*2 search area on the left. The IBM1 prediction mode is the intra block copy prediction mode 1. For the intra block copy prediction mode 1, the current 16*2 block may be divided into four 4*2 prediction blocks, and the predicted values of each 4*2 prediction block may be determined based on the reference pixels in the 32*2 search area on the left. The IBM2 prediction mode is the intra block copy prediction mode 2. For the intra block copy prediction mode 2, the current 16*2 block may be divided into eight 2*2 prediction blocks, and the predicted values of each 2*2 prediction block may be determined based on the reference pixels in the 32*2 search area on the left.
[0106] For the current 16*2 block (similarly for current blocks of other sizes), the ORG prediction mode means using the original pixel values, that is, not referring to the reference pixels on the upper boundary of the current block and not referring to the reference pixels on the left boundary of the current block. The description of this is omitted.
[0107] In one possible embodiment, when the predicted value cannot be obtained at the boundary, usually, one default value is used as padding. This padding value is usually 1<<(bitdepth-1) or (1<<(bitdepth-1)-1). When the image bit width is 8, bitdepth is equal to 8, that is, the padding of the default value is 128 or 127. Due to the padding with a single default value, the predicted values in multiple prediction modes are all the same. Therefore, in the encoding process, some modes are not selected, resulting in encoding redundancy.
[0108] In response to the above discovery, embodiments of the present invention provide an encoding and decoding method. For an encoding unit (i.e., the current block) located at the boundary, by using the encoded reconstructed block, as many different reference pixels as possible are derived in several predictions, and more reference pixel padding methods can be added. Prediction modes that are not selected with the padding of a single default value can be padded with other reference pixels so that the prediction mode may be selected. For example, for different prediction modes, when the upper boundary is unavailable and the left boundary is available, the reference pixel of the upper boundary is derived from the reconstructed value of the left block. When the upper boundary is available and the left boundary is unavailable, the reference pixel of the left boundary is derived from the reconstructed value of the upper block. For different prediction modes, the derivation method may be different.
[0109] Hereinafter, in connection with several specific embodiments, the encoding and decoding methods in embodiments of the present invention will be described in detail.
[0110] Embodiment 4: Embodiments of the present invention provide an encoding and decoding method. This method may be applied to the decoding side (also called a video decoder), and this method may also be applied to the encoding side (also called a video encoder). For the decoding side, the encoding and decoding method may be a decoding method, and for the encoding side, the encoding and decoding method may be an encoding method.
[0111] FIG. 6 is a schematic flowchart of the encoding and decoding method, and the method may include the following.
[0112] In step 601, if the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are available, the reference pixels of the first boundary may be padded based on the reference pixels of the second boundary.
[0113] In step 602, the current block is encoded or decoded based on the padded reference pixels of the first boundary and the reference pixels of the second boundary.
[0114] For example, the decoding side may decode the current block based on the padded reference pixels of the first boundary and the reference pixels of the second boundary, and the decoding process is not limited herein. For example, the encoding side may encode the current block based on the padded reference pixels of the first boundary and the reference pixels of the second boundary, and the encoding process is not limited herein.
[0115] Exemplarily, the first boundary may be the left boundary, and the second boundary may be the upper boundary. Therefore, if the reference pixels of the left boundary of the current block are unavailable and the reference pixels of the upper boundary of the current block are available, the reference pixels of the left boundary are padded based on the reference pixels of the upper boundary, and the current block is encoded and decoded based on the reference pixels of the left boundary and the reference pixels of the upper boundary.
[0116] Exemplarily, the first boundary may be the upper boundary, and the second boundary may be the left boundary. Therefore, if the reference pixels of the upper boundary of the current block are unavailable and the reference pixels of the left boundary of the current block are available, the reference pixels of the upper boundary are padded based on the reference pixels of the left boundary, and the current block is encoded and decoded based on the reference pixels of the left boundary and the reference pixels of the upper boundary.
[0117] In one possible embodiment, when the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are available, the step of padding the reference pixels of the first boundary based on the reference pixels of the second boundary may include, but is not limited to, the case where the prediction mode corresponding to the current block is the point-by-point prediction mode, the reference pixels of the upper boundary of the current block are unavailable, and the reference pixels of the left boundary of the current block are available. In this case, all the reference pixels of the upper boundary are padded with the value of the first one of the reference pixels of the left boundary. When the reference pixels of the left boundary of the current block are unavailable and the reference pixels of the upper boundary of the current block are available, the step of padding all the reference pixels of the left boundary with the value of the first one of the reference pixels of the upper boundary may be included.
[0118] In one possible embodiment, when the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are available, the step of padding the reference pixels of the first boundary based on the reference pixels of the second boundary may include, but is not limited to, the case where the prediction mode corresponding to the current block is the point-by-point prediction mode, the reference pixels of the upper boundary of the current block are unavailable, and the reference pixels of the left boundary of the current block are available. In this case, the reference pixels of the upper boundary are padded with the reconstruction value of the corresponding prediction position in the first row of the coded block of the left boundary. When the reference pixels of the left boundary of the current block are unavailable and the reference pixels of the upper boundary of the current block are available, the step of padding all the reference pixels of the left boundary with the value of the first one of the reference pixels of the upper boundary may be included.
[0119] In one possible embodiment, when the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are available, the step of padding the reference pixels of the first boundary based on the reference pixels of the second boundary may include, but is not limited to, the case where the prediction mode corresponding to the current block is an intra-frame prediction mode other than the DC prediction mode, the reference pixels of the upper boundary of the current block are unavailable, and the reference pixels of the left boundary of the current block are available, padding the reference pixels of the upper boundary with the reconstructed values at the corresponding prediction positions in the first row of the encoded block of the left boundary; and when the reference pixels of the left boundary of the current block are unavailable and the reference pixels of the upper boundary of the current block are available, padding the reference pixels of the left boundary with the reference pixel values at the corresponding positions in the first row of the upper boundary.
[0120] In one possible embodiment, when the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are available, the step of padding the reference pixels of the first boundary based on the reference pixels of the second boundary may include, but is not limited to, the case where the prediction mode corresponding to the current block is an intra-frame prediction mode, the reference pixels of the upper boundary are unavailable, and the reference pixels of the left boundary are available, padding the reference pixels of the upper boundary with the reconstructed values at the corresponding prediction positions in the first row of the encoded block of the left boundary; and when the reference pixels of the left boundary are unavailable and the reference pixels of the upper boundary are available, padding all the reference pixels of the left boundary with default values.
[0121] In one possible embodiment, when the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are unavailable, a removal process may be performed on the target prediction mode in the initial prediction mode list corresponding to the current block to obtain a target prediction mode list, and the current block may be encoded and decoded based on the target prediction mode list.
[0122] Exemplarily, the initial prediction mode list may include a plurality of prediction modes, and the target prediction mode may be a prediction mode that is not used for the current block in the initial prediction mode list when the reference pixel is unavailable.
[0123] Exemplarily, the step of performing a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block may include: determining a plurality of candidate prediction modes in the initial prediction mode list, where the candidate prediction mode is a prediction mode that is not used for the current block in the initial prediction mode list when the reference pixel is unavailable; and selecting at least one prediction mode from all the candidate prediction modes as the first target prediction mode, and performing a removal process on the first target prediction mode in the initial prediction mode list, but is not limited thereto. Exemplarily, the step of selecting at least one prediction mode from all the candidate prediction modes as the first target prediction mode may include: based on the codeword length corresponding to each candidate prediction mode, selecting K candidate prediction modes from all the candidate prediction modes as the retained prediction modes, where K is a positive integer; and determining the candidate prediction modes other than the retained prediction modes as the first target prediction mode.
[0124] When the reference pixel of the first boundary is unavailable and the reference pixel of the second boundary is unavailable, the candidate prediction modes include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode, and the first target prediction modes include the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode.
[0125] Exemplarily, the step of performing a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block may include a step of determining a second target prediction mode in the initial prediction mode list, where the second target prediction mode is a prediction mode not used for the current block in the initial prediction mode list when the reference pixel is unavailable, and a step of performing a removal process on the second target prediction mode in the initial prediction mode list, but is not limited thereto.
[0126] Exemplarily, when the reference pixel of the first boundary of the current block is unavailable and the reference pixel of the second boundary of the current block is unavailable, that is, when the reference pixel of the upper boundary of the current block is unavailable and the reference pixel of the left boundary of the current block is unavailable, the processing process may refer to Embodiments 1 to 3, and the processing process is not limited thereto.
[0127] As can be seen from the above technical solutions, in the embodiments of the present invention, for the current block located at the boundary (that is, the reference pixel of the left boundary is unavailable or the reference pixel of the upper boundary is unavailable), an encoded reconstructed block is used to derive as many different reference pixels as possible, and based on the reconstructed block, reconstructed values that cannot be obtained in different prediction modes are derived, and more reference pixel padding methods can be added. A mode that is not selected by single default value padding can be padded with other reference pixels so that the mode may be selected. By removing coding redundancy, improving coding efficiency, effectively padding reference pixels at the boundary, and improving the prediction ability of the prediction mode at the boundary position, the quality at the boundary of the reconstructed image can be improved, and the coding performance and decoding performance can be improved.
[0128] Example 5: For Example 4, when the pixels outside the slice boundary are unavailable, for the encoding unit located at the boundary (i.e., the current block), more reference pixel padding methods can be added by using the encoded reconstructed block. For different prediction modes, when the upper boundary is unavailable and the left boundary is available, the reference pixels of the upper boundary are derived from the reconstructed values of the left block. When the upper boundary is available and the left boundary is unavailable, the reference pixels of the left boundary are derived from the reconstructed values of the upper block. For example, the following reference pixel padding methods are provided.
[0129] Case 1: When the prediction mode corresponding to the current block is the point - by - point prediction mode, the upper - boundary reference pixels of the current block are unavailable, and the left - boundary reference pixels of the current block are available, all the upper - boundary reference pixels may be padded with the first value of the left - boundary reference pixels. As shown in FIG. 7A, all the upper - boundary reference pixels of the current block are padded with the first value "A" of the left - boundary reference pixels. When the left - boundary reference pixels of the current block are unavailable and the upper - boundary reference pixels of the current block are available, all the left - boundary reference pixels may be padded with the first value of the upper - boundary reference pixels. As shown in FIG. 7A, all the left - boundary reference pixels of the current block are padded with the first value "A" of the upper - boundary reference pixels.
[0130] In FIG. 7A, the lowercase letter "a" represents the reference pixels of the upper boundary of the current block or the reference pixels of the left boundary of the current block, and the capital letter "A" represents the reconstructed pixel value of the left boundary of the current block or the reconstructed pixel value of the upper boundary of the current block. Obviously, when the reference pixels "a" of the upper boundary of the current block are unavailable, the reconstructed pixel value "A" of the left boundary of the current block may be used instead of the reference pixels "a" of the upper boundary of the current block. Or, when the reference pixels "a" of the left boundary of the current block are unavailable, the reconstructed pixel value "A" of the upper boundary of the current block may be used instead of the reference pixels "a" of the left boundary of the current block.
[0131] Case 2: When the prediction mode corresponding to the current block is the point-by-point prediction mode, the reference pixel of the upper boundary of the current block is unavailable, and the reference pixel of the left boundary of the current block is available, the reference pixel of the upper boundary may be padded with the reconstruction value of the corresponding prediction position in the first row of the encoded block of the left boundary. As shown in FIG. 7B, the upper boundary of the current block corresponds to 16 reference pixels, and the reconstruction values of 16 prediction positions are selected from the first row of the encoded block of the left boundary. The first reference pixel a of the upper boundary is padded with the reconstruction value A of the first prediction position of the encoded block of the left boundary,..., the third reference pixel b of the upper boundary is padded with the reconstruction value B of the third prediction position of the encoded block of the left boundary,..., the fifth reference pixel c of the upper boundary is padded with the reconstruction value C of the fifth prediction position of the encoded block of the left boundary,..., the 15th reference pixel h of the upper boundary is padded with the reconstruction value H of the 15th prediction position of the encoded block of the left boundary,....
[0132] When the reference pixel of the left boundary of the current block is unavailable and the reference pixel of the upper boundary of the current block is available, all the reference pixels of the left boundary may be padded with the first value of the reference pixels of the upper boundary. As shown in FIG. 7A, all the reference pixels of the left boundary of the current block are padded with the first value "A" of the reference pixels of the upper boundary. Alternatively, when the reference pixel of the left boundary of the current block is unavailable and the reference pixel of the upper boundary of the current block is available, the reference pixel of the left boundary may be padded with the reference pixel value of the corresponding position in the first row of the upper boundary. As shown in FIG. 7B, the first reference pixel of the left boundary of the current block is padded with the first value "A" of the upper boundary, and the second reference pixel of the left boundary of the current block is padded with the second value "B" of the upper boundary.
[0133] In FIG. 7B, the lowercase letters "a, b" represent the reference pixels of the upper boundary of the current block or the reference pixels of the left boundary of the current block, and the uppercase letters "A, B" represent the reconstructed pixel values of the left boundary of the current block or the reconstructed pixel values of the upper boundary of the current block. Obviously, when the reference pixels a, b of the upper boundary of the current block are unavailable, the reconstructed pixel values A, B of the left boundary of the current block may be used instead of the reference pixels a, b of the upper boundary of the current block. Or, when the reference pixels a, b of the left boundary of the current block are unavailable, the reconstructed pixel values A, B of the upper boundary of the current block may be used instead of the reference pixels a, b of the left boundary of the current block. Of course, there are also lowercase letters such as c, d, e, f, and uppercase letters such as C, D, E, F.
[0134] Case 3: When the prediction mode corresponding to the current block is an intra-frame prediction mode other than the DC prediction mode, that is, an intra-frame prediction mode (excluding the DC prediction mode), and the reference pixels of the upper boundary of the current block are unavailable while the reference pixels of the left boundary of the current block are available, the reference pixels of the upper boundary may be padded with the reconstructed values of the corresponding prediction positions in the first row of the encoded block of the left boundary. As shown in FIG. 7C, the upper boundary of the current block corresponds to 16 reference pixels, and the reconstructed values of 16 prediction positions may be selected from the first row of the encoded block of the left boundary. The first reference pixel of the upper boundary is padded with the reconstructed value of the first prediction position of the encoded block of the left boundary, the second reference pixel of the upper boundary is padded with the reconstructed value of the second prediction position of the encoded block of the left boundary,..., and the 16th reference pixel of the upper boundary is padded with the reconstructed value of the 16th prediction position of the encoded block of the left boundary.
[0135] When the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, the reference pixel at the left boundary may be padded with the reference pixel value at the corresponding position in the first row of the upper boundary. As shown in FIG. 7D, when there are two reference pixels at the left boundary of the current block, the first reference pixel at the left boundary of the current block is padded with the reference pixel value at the first position in the first row of the upper boundary, and the second reference pixel at the left boundary of the current block is padded with the reference pixel value at the second position in the first row of the upper boundary. Alternatively, when the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, all the reference pixels at the left boundary may be padded with the first value of the reference pixels at the upper boundary.
[0136] Exemplarily, in Case 3, (1<<(bitdepth-1)) may be held as the default value padding method. Therefore, when the reference pixel at the upper boundary of the current block is unavailable, the DC prediction mode may be held as it is.
[0137] Case 4: When the prediction mode corresponding to the current block is an intra-frame prediction mode (including the DC prediction mode), the reference pixel at the upper boundary is unavailable, and the reference pixel at the left boundary of the current block is available, the reference pixel at the upper boundary is padded with the reconstruction value at the corresponding prediction position in the first row of the encoded block at the left boundary. For example, the upper boundary of the current block corresponds to 16 reference pixels, and the reconstruction values of 16 prediction positions are selected from the first row of the encoded block at the left boundary. The first reference pixel at the upper boundary is padded with the reconstruction value at the first prediction position of the encoded block at the left boundary, the second reference pixel at the upper boundary is padded with the reconstruction value at the second prediction position of the encoded block at the left boundary,..., and the 16th reference pixel at the upper boundary is padded with the reconstruction value at the 16th prediction position of the encoded block at the left boundary.
[0138] If the reference pixels on the left boundary of the current block are unavailable and the reference pixels on the upper boundary of the current block are available, all the reference pixels on the left boundary may be padded with default values. For example, all the reference pixels on the left boundary may be padded with 1<<(bitdepth-1). Of course, 1<<(bitdepth-1) is just an example of the default value, and this default value is not limited and may be set arbitrarily. Since it is necessary to hold (1<<(bitdepth-1)) as the default value padding method, the prediction value in the horizontal direction may be held as it is.
[0139] In one possible embodiment, when the prediction value cannot be obtained at the boundary, usually, one default value is used as padding. This padding value is usually 1<<(bitdepth-1) or (1<<(bitdepth-1)-1). When the image bit width is 8, bitdepth is equal to 8, that is, the default value padding is 128 or 127. Due to the padding with a single default value, the prediction values in multiple prediction modes are all the same, so in the encoding process, some modes are not selected, resulting in encoding redundancy.
[0140] In response to the above discovery, embodiments of the present invention provide an encoding and decoding method. For an encoding unit (current block) located at the boundary, when an IBC mode, such as an IBM0 prediction mode, an IBM1 prediction mode, or an IBM2 prediction mode, is used for the current block, an encoded reconstructed block is utilized to derive as many different reference pixels as possible, and more reference pixel padding methods can be added.
[0141] Hereinafter, the encoding and decoding methods in the embodiments of the present invention will be described in detail with reference to some specific embodiments.
[0142] Example 6: The embodiments of the present invention provide an encoding and decoding method, which may be applied to the decoding side (also called a video decoder), and which may also be applied to the encoding side (also called a video encoder). For the decoding side, the encoding and decoding method may be a decoding method, and for the encoding side, the encoding and decoding method may be an encoding method. As shown in FIG. 8A, FIG. 8A is a schematic flowchart of the encoding and decoding method. When the intra-block copy prediction mode is valid for the current block, the method may include the following.
[0143] In step 801, when the reference pixel on the left boundary of the current block is unavailable and the reference pixel on the upper boundary of the current block is available, based on the reconstructed pixels on the upper boundary, determine a first search region corresponding to the first sub-block of the current block, and based on the reference pixels in the first search region, determine the reconstructed pixels of the first sub-block of the current block.
[0144] In step 802, after obtaining the reconstructed pixels of the first sub-block, based on the reconstructed pixels on the upper boundary of the current block and / or the reconstructed pixels of the first sub-block of the current block, determine a second search region corresponding to the second sub-block of the current block, and based on the reference pixels in the second search region, determine the reconstructed pixels of the second sub-block of the current block.
[0145] Exemplarily, the current block is divided into a first sub-block and a second sub-block.
[0146] Exemplarily, in the encoding process, the encoding side may divide the current block into a first sub-block and a second sub-block, determine a first search region corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, determine the reconstructed pixels of the first sub-block of the current block based on the reference pixels of the first search region, determine a second search region corresponding to the second sub-block of the current block based on the reconstructed pixels of the upper boundary of the current block and / or the reconstructed pixels of the first sub-block of the current block, and determine the reconstructed pixels of the second sub-block of the current block based on the reference pixels of the second search region.
[0147] Exemplarily, in the decoding process, the decoding side may divide the current block into a first sub-block and a second sub-block, determine a first search region corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, determine the reconstructed pixels of the first sub-block of the current block based on the reference pixels of the first search region, determine a second search region corresponding to the second sub-block of the current block based on the reconstructed pixels of the upper boundary of the current block and / or the reconstructed pixels of the first sub-block of the current block, and determine the reconstructed pixels of the second sub-block of the current block based on the reference pixels of the second search region.
[0148] In one possible embodiment, the step of determining the reconstructed pixels of the first sub-block based on the reference pixels of the first search region may include, but is not limited to, dividing the first sub-block into M first prediction blocks and determining the reconstructed pixels of each first prediction block based on the reference pixels of the first search region, where M is a positive integer. Also, the step of determining the reconstructed pixels of the second sub-block based on the reference pixels of the second search region may include, but is not limited to, dividing the second sub-block into N second prediction blocks and determining the reconstructed pixels of each second prediction block based on the reference pixels of the second search region, where N is a positive integer.
[0149] Exemplarily, the size of the second prediction block may be the same as the size of the first prediction block, or the size of the second prediction block may be different from the size of the first prediction block. For example, if the size of the current block is 16*2 and the sizes of both the first sub-block and the second sub-block are 8*2, the size of the first prediction block is 2*1, the size of the second prediction block is 2*1 or 2*2, or the size of the first prediction block is 4*1, the size of the second prediction block is 4*1 or 4*2, or the size of the first prediction block is 8*1, the size of the second prediction block is 8*1 or 8*2. Of course, the above are just some examples and are not limited thereto.
[0150] In one possible embodiment, the step of determining the first search region corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary may include padding the complete region of the first designated region on the left side of the current block based on the reconstructed pixels of the first row of the upper boundary, and determining the complete region of the first designated region as the first search region corresponding to the first sub-block, or padding a partial region of the first designated region on the left side of the current block based on the reconstructed pixels of the first row of the upper boundary, and determining the partial region of the first designated region as the first search region corresponding to the first sub-block, but is not limited thereto.
[0151] In one possible embodiment, the step of determining the first search region corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary may include determining the reconstructed pixels of the upper boundary as the first search region corresponding to the first sub-block, but is not limited thereto. Here, the reconstructed pixels of the upper boundary may include the reconstructed pixels of the first row of the upper boundary, or the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the second row of the upper boundary. The length of the reconstructed pixels of the upper boundary may be equal to the width of the current block, or the length of the reconstructed pixels of the upper boundary may be greater than the width of the current block.
[0152] In one possible embodiment, the step of determining the second search region corresponding to the second sub-block of the current block based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block may include, but is not limited to, padding the complete region of the second designated region on the left side of the second sub-block based on the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the first sub-block, and determining the complete region of the second designated region as the second search region corresponding to the second sub-block, or padding a partial region of the second designated region on the left side of the second sub-block based on the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the first sub-block, and determining the partial region of the second designated region as the second search region corresponding to the second sub-block.
[0153] In one possible embodiment, the step of determining the second search region corresponding to the second sub-block of the current block based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block may include, but is not limited to, determining the reconstructed pixels of the upper boundary as the second search region corresponding to the second sub-block, or determining the reconstructed pixels of the first sub-block as the second search region corresponding to the second sub-block. Alternatively, the reconstructed pixels of the upper boundary and the reconstructed pixels of the first sub-block may be determined as the second search region corresponding to the second sub-block, that is, the second search region simultaneously includes the reconstructed pixels of the upper boundary and the reconstructed pixels of the first sub-block. Here, the reconstructed pixels of the upper boundary may include the reconstructed pixels of the first row of the upper boundary, or the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the second row of the upper boundary. The length of the reconstructed pixels of the upper boundary may be equal to the width of the current block, or the length of the reconstructed pixels of the upper boundary may be greater than the width of the current block.
[0154] In one possible embodiment, when the reference pixels of the upper boundary of the current block are unavailable and the reference pixels of the left boundary of the current block are unavailable, a removal process may be performed on the target prediction mode in the initial prediction mode list corresponding to the current block to obtain a target prediction mode list, and the current block may be encoded and decoded based on the target prediction mode list.
[0155] Exemplarily, the initial prediction mode list may include a plurality of prediction modes, and the target prediction mode may be a prediction mode not used for the current block in the initial prediction mode list when the reference pixel is unavailable.
[0156] Exemplarily, the step of performing a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block may include: determining a plurality of candidate prediction modes in the initial prediction mode list, where the candidate prediction modes are prediction modes not used for the current block in the initial prediction mode list when the reference pixel is unavailable; and selecting at least one prediction mode from all the candidate prediction modes as the first target prediction mode, and performing a removal process on the first target prediction mode in the initial prediction mode list, but is not limited thereto.
[0157] The step of selecting at least one prediction mode from all the candidate prediction modes as the first target prediction mode may include: selecting K candidate prediction modes from all the candidate prediction modes as the retained prediction modes based on the codeword length corresponding to each candidate prediction mode, where K is a positive integer; and determining the candidate prediction modes other than the retained prediction modes as the first target prediction mode.
[0158] Exemplarily, when the reference pixel of the upper boundary of the current block is unavailable and the reference pixel of the left boundary of the current block is unavailable, the processing process may refer to Embodiments 1 to 3, and the processing process is not limited herein.
[0159] As can be seen from the above technical solutions, in the embodiments of the present invention, for the IBC mode, for the current block located at the boundary (i.e., the reference pixel at the left boundary is unavailable), the reconstructed block at the upper boundary is used to derive as many different reference pixels as possible, add more reference pixel padding methods, improve the coding efficiency, effectively pad the reference pixels at the boundary, and improve the prediction ability of the prediction mode at the boundary position, so as to improve the quality at the boundary of the reconstructed image and improve the coding performance and decoding performance.
[0160] Embodiment 7: For a current block of 16*2 (current blocks of other sizes are similar), as shown in FIG. 5C, FIG. 5C is a schematic diagram of the intra-block copy prediction mode, and the intra-block copy prediction mode may have three types of prediction modes, namely intra-block copy prediction mode 0, intra-block copy prediction mode 1, and intra-block copy prediction mode 2. Exemplarily, for the intra-block copy prediction mode 0, the current block of 16*2 may be divided into two prediction blocks of 8*2 in the vertical direction, and the predicted value of each 8*2 prediction block may be determined based on the reference pixels in the search region of 32*2 on the left. For the intra-block copy prediction mode 1, the current block of 16*2 may be divided into four prediction blocks of 4*2 in the vertical direction, and the predicted value of each 4*2 prediction block may be determined based on the reference pixels in the search region of 32*2 on the left. For the intra-block copy prediction mode 2, the current block of 16*2 may be divided into eight prediction blocks of 2*2 in the vertical direction, and the predicted value of each 2*2 prediction block may be determined based on the reference pixels in the search region of 32*2 on the left.
[0161] In one possible embodiment, if the reference pixels in the 32*2 search region to the left of the current block are unavailable, the 32*2 search region may be padded with 1<<(bitdepth - 1) by default, and the predicted value of each prediction block may be determined based on the padded 32*2 search region. It may not be necessary to execute the intra-block copy prediction mode for the 16*2 pixel block in the first column of the slice. In the intra-block copy prediction mode, three channels share the mode information and BV (Block Vector, representing the position of the copy block in the search region).
[0162] In one possible embodiment, the current block may be divided into a first sub-block and a second sub-block. When the size of the current block is 16*2, the size of the first sub-block is 8*2, and the size of the second sub-block is 8*2. Of course, when the current block has other sizes, the current block may be evenly divided into a first sub-block and a second sub-block in the vertical direction.
[0163] For the first sub-block, if the reference pixels at the left boundary of the current block are unavailable and the reference pixels at the upper boundary of the current block are available (for example, the upper boundary of the current block is not an image boundary or a slice boundary), the first search region corresponding to the first sub-block of the current block may be padded based on the reconstructed pixels at the upper boundary (for example, the reconstructed pixels in the first row of the upper boundary).
[0164] Exemplarily, based on the reconstructed pixels in the first row of the upper boundary, the complete region of the first specified region on the left side of the current block may be padded, and the complete region of the first specified region may be determined as the first search region. Assume that the size of the current block is 16*2, that is, the first row of the upper boundary of the current block is 16*1 reconstructed pixels, and the first specified region is a 32*2 region on the left side of the current block. Then, based on the 16*1 reconstructed pixels in the first row of the upper boundary, the complete region of the 32*2 first specified region on the left side may be padded, and the complete region of the first specified region may be determined as the first search region. For example, the 16*1 reconstructed pixels in the first row of the upper boundary may be copied twice to the first row of the first specified region, and the 16*1 reconstructed pixels in the first row of the upper boundary may be copied twice to the second row of the first specified region. Also, for example, the 16*1 reconstructed pixels in the first row of the upper boundary may be copied twice to the first row of the first specified region, and the second row of the first specified region may be padded with 32 default values. Also, for example, the first row of the first specified region may be padded with 32 default values, and the 16*1 reconstructed pixels in the first row of the upper boundary may be copied twice to the second row of the first specified region. Also, for example, the first row of the first specified region may be padded with 16 default values, then the 16*1 reconstructed pixels in the first row of the upper boundary may be copied, and the 16*1 reconstructed pixels in the first row of the upper boundary may be copied twice to the second row of the first specified region. Also, for example, the first row of the first specified region may be padded with 16 default values, then the 16*1 reconstructed pixels in the first row of the upper boundary may be copied, the second row of the first specified region may be padded with 16 default values, and then the 16*1 reconstructed pixels in the first row of the upper boundary may be copied. Also, for example, the 16*1 reconstructed pixels in the first row of the upper boundary may be copied to the first row of the first specified region, then padded with 16 default values, the 16*1 reconstructed pixels in the first row of the upper boundary may be copied to the second row of the first specified region, and then padded with 16 default values. The above are just several examples, and this embodiment is not limited thereto. As long as the complete region of the first specified region can be padded based on the reconstructed pixels in the first row of the upper boundary and the complete region of the first specified region can be determined as the first search region, it is acceptable.
[0165] Exemplarily, based on the reconstructed pixels in the first row of the upper boundary, a partial region of the first specified region on the left side of the current block may be padded, and the partial region of the first specified region may be determined as the first search region. Assume that the size of the current block is 16*2, that is, the first row of the upper boundary of the current block is 16*1 reconstructed pixels, and the first specified region is a 32*2 region on the left side of the current block. Then, based on the 16*1 reconstructed pixels in the first row of the upper boundary, a partial region of the 32*2 first specified region on the left side may be padded. That is, when the search region cannot meet the predetermined search range, the search region may be reduced.
[0166] For example, the partial region of the first specified region may be a 16*2 region on the left side of the current block. Copy the 16*1 reconstructed pixels in the first row of the upper boundary to the first row of the first specified region, and copy the 16*1 reconstructed pixels in the first row of the upper boundary to the second row of the first specified region. Or, copy the 16*1 reconstructed pixels in the first row of the upper boundary to the first row of the first specified region, and pad the second row of the first specified region with 16 default values. Or, pad the first row of the first specified region with 16 default values, and copy the 16*1 reconstructed pixels in the first row of the upper boundary to the second row of the first specified region. Or, first pad the first row of the first specified region with 8 default values, then copy the first 8 reconstructed pixels in the first row of the upper boundary to the first row of the first specified region, pad the second row of the first specified region with 8 default values, and then copy the last 8 reconstructed pixels in the first row of the upper boundary to the second row of the first specified region. Of course, the above are just some examples, and this embodiment is not limited thereto. As long as the 16*2 region of the first specified region can be padded based on the reconstructed pixels in the first row of the upper boundary.
[0167] For example, the partial region of the first specified region may be an 8*2 region on the left side of the current block. Copy the first 8 reconstructed pixels in the first row of the upper boundary to the first row of the first specified region, and copy the last 8 reconstructed pixels in the first row of the upper boundary to the second row of the first specified region. Of course, the above are just examples, and this embodiment is not limited thereto.
[0168] For example, the partial region of the first specified region may be a 24*2 region on the left side of the current block. After padding the first row of the first specified region with 8 default values, copy the 16*1 reconstructed pixels of the first row of the upper boundary to the first row of the first specified region. After padding the second row of the first specified region with 8 default values, copy the 16*1 reconstructed pixels of the first row of the upper boundary to the second row of the first specified region. Or, copy the first 8 reconstructed pixels of the first row of the upper boundary to the first row of the first specified region, then copy the 16*1 reconstructed pixels of the first row of the upper boundary to the first row of the first specified region. Copy the last 8 reconstructed pixels of the first row of the upper boundary to the second row of the first specified region, and then copy the 16*1 reconstructed pixels of the first row of the upper boundary to the second row of the first specified region. Of course, the above are just some examples, and this embodiment is not limited thereto. As long as the 24*2 region of the first specified region can be padded based on the reconstructed pixels of the first row of the upper boundary.
[0169] Exemplarily, after padding the first search region corresponding to the first sub-block based on the reconstructed pixels of the upper boundary, the reconstructed pixels of the first sub-block may be determined based on the reference pixels of the first search region. For example, the reconstructed pixels of the first sub-block may be determined based on the reference pixels of the first search region (such as a 32*2 search region or a 24*2 search region, etc.).
[0170] Exemplarily, the first sub-block may be divided into M first prediction blocks, where M may be a positive integer. The reconstructed pixels of each first prediction block may be determined based on the reference pixels of the first search region. For example, for each first prediction block, find a reference block that matches the first prediction block from the first search region. The size of the reference block is the same as the size of the first prediction block, and the reconstructed pixels of the first prediction block may be determined based on the reference block.
[0171] Exemplarily, the process of finding a reference block that matches the first prediction block from the first search area may be called a BV (Block Vector, representing the position of a copy block in the search area) search process. In the search process, it is sufficient to search 32 positions in the horizontal direction, and the horizontal BV may be encoded with a 5-bit fixed-length code, and there is no need to encode the vertical BV.
[0172] Exemplarily, the size of the first prediction block may be 2*1, or the size of the first prediction block may be 4*1, or the size of the first prediction block may be 8*1. Of course, the above are only examples and are not limited thereto. For example, for intra-block copy prediction mode 0, an 8*2 first sub-block may be divided into two 8*1 prediction blocks, and the predicted value of each 8*1 prediction block may be determined based on the reference pixels in the first search area. For intra-block copy prediction mode 1, an 8*2 first sub-block may be divided into four 4*1 prediction blocks, and the predicted value of each 4*1 prediction block may be determined based on the reference pixels in the first search area. For intra-block copy prediction mode 2, an 8*2 first sub-block may be divided into eight 2*1 prediction blocks, and the predicted value of each 2*1 prediction block may be determined based on the reference pixels in the first search area.
[0173] For the second sub-block, when the reference pixels at the left boundary of the current block are unavailable and the reference pixels at the upper boundary of the current block are available (for example, the upper boundary of the current block is not an image boundary or a slice boundary), after obtaining the reconstructed pixels of the first sub-block, based on the reconstructed pixels at the upper boundary of the current block (for example, the reconstructed pixels in the first row of the upper boundary) and the reconstructed pixels of the first sub-block of the current block, the second search area corresponding to the second sub-block of the current block may be padded.
[0174] Exemplarily, based on the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the first sub-block of the current block, the complete area of the second specified area on the left side of the second sub-block may be padded, and the complete area of the second specified area may be determined as the second search area corresponding to the second sub-block. Assume that the size of the current block is 16*2, that is, the first row of the upper boundary of the current block is 16*1 reconstructed pixels, and the second specified area is a 32*2 area on the left side of the second sub-block. For example, assume that the second specified area is an 8*2 area of the first sub-block and a 24*2 area on the left side of the current block. Obviously, since the 8*2 area of the first sub-block is padded with the reconstructed pixels of the first sub-block, based on the 16*1 reconstructed pixels of the first row of the upper boundary and the 8*2 reconstructed pixels of the first sub-block, the complete area of the 24*2 area on the left side of the current block (hereinafter referred to as area A) may be padded. For example, after copying the 16*1 reconstructed pixels of the first row of the upper boundary to the first row of area A, copy the 8*1 reconstructed pixels of the first row of the first sub-block, then copy the 16*1 reconstructed pixels of the first row of the upper boundary to the second row of area A, and then copy the 8*1 reconstructed pixels of the second row of the first sub-block. Or, after copying the 8*1 reconstructed pixels of the first row of the first sub-block to the first row of area A, copy the 16*1 reconstructed pixels of the first row of the upper boundary, then copy the 8*1 reconstructed pixels of the second row of the first sub-block to the second row of area A, and then copy the 16*1 reconstructed pixels of the first row of the upper boundary. Or, after copying the 16*1 reconstructed pixels of the first row of the upper boundary to the first row of area A, pad with 8 default values, then copy the 16*1 reconstructed pixels of the first row of the upper boundary to the second row of area A, and then pad with 8 default values. Or, pad the first row of area A with 8 default values, then copy the 16*1 reconstructed pixels of the first row of the upper boundary, pad the second row of area A with 8 default values, and then copy the 16*1 reconstructed pixels of the first row of the upper boundary. Of course, the above are just some examples, and this embodiment is not limited thereto. After obtaining area A, area A and the 8*2 area of the first sub-block constitute the complete area of the second specified area, thereby obtaining the second search area corresponding to the second sub-block.
[0175] Exemplarily, based on the reconstructed pixels in the first row of the upper boundary and the reconstructed pixels in the first sub-block of the current block, a partial region of the second designated region on the left side of the second sub-block may be padded, and the partial region of the second designated region may be determined as the second search region corresponding to the second sub-block. Assume that the size of the current block is 16*2, that is, the first row of the upper boundary of the current block is 16*1 reconstructed pixels, and the second designated region is the 8*2 region of the first sub-block and the 24*2 region on the left side of the current block (denoted as region A). Based on the 16*1 reconstructed pixels in the first row of the upper boundary and the 8*2 reconstructed pixels in the first sub-block, the partial region of region A may be padded, that is, when the search region cannot meet the predetermined search range, the search region is reduced.
[0176] For example, the partial region of region A may be the 16*2 region on the left side of the current block. The 16*1 reconstructed pixels in the first row of the upper boundary are copied to the first row of the region, and the 16*1 reconstructed pixels in the first row of the upper boundary are copied to the second row of the region. Or, the 8*1 reconstructed pixels in the first row of the first sub-block are copied to the first row of the region, and then the first 8 reconstructed pixels in the first row of the upper boundary are copied. The 8*1 reconstructed pixels in the second row of the first sub-block are copied to the second row of the region, and then the last 8 reconstructed pixels in the first row of the upper boundary are copied. Or, the first 8 reconstructed pixels in the first row of the upper boundary are copied to the first row of the region, and then padded with 8 default values. The last 8 reconstructed pixels in the first row of the upper boundary are copied to the second row of the region, and then padded with 8 default values. Or, the first row of the region is padded with 8 default values, and then the first 8 reconstructed pixels in the first row of the upper boundary are copied. The second row of the region is padded with 8 default values, and then the last 8 reconstructed pixels in the first row of the upper boundary are copied. Of course, the above are only some examples, and this embodiment is not limited thereto.
[0177] For example, the sub-region of region A may be an 8*2 region on the left side of the current block. Copy the first 8 reconstructed pixels of the first row of the upper boundary to the first row of the region, and copy the last 8 reconstructed pixels of the first row of the upper boundary to the second row of the region.
[0178] As described above, after padding the sub-region of region A, the reconstructed pixels of the sub-region of region A and the first sub-block constitute the sub-region of the second specified region, and the sub-region of the second specified region is determined as the second search region.
[0179] Exemplarily, after padding the second search region corresponding to the second sub-block based on the reconstructed pixels of the upper boundary and the first sub-block, the reconstructed pixels of the second sub-block may be determined based on the reference pixels of the second search region. For example, the reconstructed pixels of the second sub-block are determined based on the reference pixels of the second search region (for example, a 32*2 search region, a 24*2 search region, a 16*2 search region, etc.).
[0180] Exemplarily, the second sub-block may be divided into N second prediction blocks, where N may be a positive integer, and the reconstructed pixels of each second prediction block may be determined based on the reference pixels of the second search region. For example, for each second prediction block, find a reference block in the second search region that matches the second prediction block. The size of the reference block is the same as the size of the second prediction block, and the reconstructed pixels of the second prediction block may be determined based on the reference block.
[0181] Exemplarily, the size of the second prediction block may be the same as the size of the first prediction block, or the size of the second prediction block may be different from the size of the first prediction block. For example, the size of the first prediction block is 2*1, and the size of the second prediction block is 2*1 or 2*2, or the size of the first prediction block is 4*1, and the size of the second prediction block is 4*1 or 4*2, or the size of the first prediction block is 8*1, and the size of the second prediction block is 8*1 or 8*2. Of course, the above are only examples and are not limited thereto.
[0182] For example, for the intra-block copy prediction mode 0, the 8*2 second sub-block may be divided into two 8*1 prediction blocks, and the predicted value of each 8*1 prediction block may be determined based on the reference pixels in the second search area, or the 8*2 second sub-block may be divided into one 8*2 prediction block, and the predicted value of each 8*2 prediction block may be determined based on the reference pixels in the second search area. For the intra-block copy prediction mode 1, the 8*2 second sub-block may be divided into four 4*1 prediction blocks, and the predicted value of each 4*1 prediction block may be determined based on the reference pixels in the second search area, or the 8*2 second sub-block may be divided into two 4*2 prediction blocks, and the predicted value of each 4*2 prediction block may be determined based on the reference pixels in the second search area. For the intra-block copy prediction mode 2, the 8*2 second sub-block may be divided into eight 2*1 prediction blocks, and the predicted value of each 2*1 prediction block may be determined based on the reference pixels in the second search area, or the 8*2 second sub-block may be divided into four 2*2 prediction blocks, and the predicted value of each 2*2 prediction block may be determined based on the reference pixels in the second search area.
[0183] In one possible embodiment, the size of the first prediction block may be derived based on the position, or may be derived based on the number of reconstructed pixels in the search area (i.e., not including padded pixels), and the size of the second prediction block may be derived based on the position, or may be derived based on the number of reconstructed pixels in the search area. For example, for the intra-block copy prediction mode 2, when the left boundary is unavailable, the size of the prediction block in the first sub-block may be 2*1, and the size of the prediction block in the second sub-block may be 2*1, or the size of the prediction block in the first sub-block may be 2*1, and the size of the prediction block in the second sub-block may be 2*2.
[0184] If the left boundary of the current block is unavailable, or the current block is close to the left boundary and the search area cannot meet the predetermined search range, the search area can be reduced, and it is not necessary to pad with the default value, or it is not necessary to expand the padding range (that is, when padding with the reconstructed pixels in the first row of the upper boundary, the length of the padding is the width of the current block, without padding other positions, and the search range becomes smaller).
[0185] Embodiment 8: For a current block of 16*2 (current blocks of other sizes are similar), the current block may be divided into a first sub-block and a second sub-block. The size of the first sub-block is 8*2, and the size of the second sub-block is 8*2. For the first sub-block, if the reference pixel of the left boundary of the current block is unavailable and the reference pixel of the upper boundary of the current block is available (for example, the upper boundary of the current block is not an image boundary or a slice boundary), a first search area corresponding to the first sub-block of the current block may be determined based on the reconstructed pixels of the upper boundary. For example, the reconstructed pixels of the upper boundary may be directly determined as the first search area corresponding to the first sub-block. After determining the first search area corresponding to the first sub-block based on the reconstructed pixels of the upper boundary, the reconstructed pixels of the first sub-block may be determined based on the reference pixels of the first search area. For example, the first sub-block may be divided into M first prediction blocks, where M may be a positive integer, and the reconstructed pixels of each first prediction block may be determined based on the reference pixels of the first search area. Here, the size of the first prediction block may be 2*1, or the size of the first prediction block may be 4*1, or the size of the first prediction block may be 8*1. Of course, the above is only an example and is not limited thereto.
[0186] For the second sub-block, if the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available (for example, the upper boundary of the current block is not an image boundary or a slice boundary), after obtaining the reconstructed pixels of the first sub-block, a second search region corresponding to the second sub-block of the current block may be determined based on the reconstructed pixels at the upper boundary of the current block and / or the reconstructed pixels of the first sub-block of the current block. For example, the reconstructed pixel at the upper boundary may be directly determined as the second search region corresponding to the second sub-block, or the reconstructed pixel of the first sub-block may be directly determined as the second search region corresponding to the second sub-block. After padding the second search region corresponding to the second sub-block based on the reconstructed pixel at the upper boundary and / or the reconstructed pixel of the first sub-block, the reconstructed pixels of the second sub-block may be determined based on the reference pixels of the second search region. For example, the second sub-block may be divided into N second prediction blocks, N may be a positive integer, and the reconstructed pixels of each second prediction block may be determined based on the reference pixels of the second search region. Here, the size of the second prediction block may be the same as or different from the size of the first prediction block. For example, the size of the first prediction block is 2*1, the size of the second prediction block is 2*1 or 2*2, or the size of the first prediction block is 4*1, the size of the second prediction block is 4*1 or 4*2, or the size of the first prediction block is 8*1, the size of the second prediction block is 8*1 or 8*2. Of course, the above are only examples and are not limited thereto.
[0187] In one possible embodiment, the reconstructed pixels of the upper boundary may include, but are not limited to, the following. The reconstructed pixels in the first row of the upper boundary, that is, the reconstructed pixels in the first row of the upper boundary are used as the first search region corresponding to the first sub-block, and the reconstructed pixels in the first row of the upper boundary are used as the second search region corresponding to the second sub-block. Or, the reconstructed pixels in the first row of the upper boundary and the reconstructed pixels in the second row of the upper boundary, that is, the reconstructed pixels in the first row of the upper boundary and the reconstructed pixels in the second row of the upper boundary are used as the first search region corresponding to the first sub-block, and the reconstructed pixels in the first row of the upper boundary and the reconstructed pixels in the second row of the upper boundary are used as the second search region corresponding to the second sub-block. Of course, the above is only an example and is not limited thereto. For example, it may be the reconstructed pixels in the first P rows of the upper boundary, and P may be 1, 2, 3, 4, etc.
[0188] The length of the reconstructed pixels of the upper boundary may be equal to the width of the current block, or the length of the reconstructed pixels of the upper boundary may be greater than the width of the current block, or the length of the reconstructed pixels of the upper boundary may be smaller than the width of the current block.
[0189] In one possible embodiment, for the current block where the left boundary is unavailable and the upper boundary is available, the search region may be the 16*1 reconstructed pixel region of the upper boundary of the current block (for example, the 16*2 current block), and the size of the predicted block may be 4*1. As shown in FIG. 8B, the search region is the 16*1 reconstructed pixel region of the upper boundary. For the current block where the left boundary is unavailable and the upper boundary is unavailable, the IBC mode may be turned off. For the IBC mode at other positions, the description of its implementation method is omitted.
[0190] In one possible embodiment, for the current block where the left boundary is unavailable and the upper boundary is available, the search region may be the 32*1 reconstructed pixel region of the upper boundary of the current block (for example, the 16*2 current block), and the size of the predicted block may be 4*1. As shown in FIG. 8C, the search region is the 32*1 reconstructed pixel region of the upper boundary.
[0191] In one possible embodiment, lossless compression is a technique that compresses redundant information in the original image and reconstructs the original image without causing distortion. Although there is an error between the reconstructed image and the original image, if the error is suppressed within a certain range, it can be called near-lossless compression. In the compression encoding process, it is necessary to predict the residual value between pixels in the original image, and the residual value is used to indicate the difference between pixels. Semi-fixed length encoding is used to encode the residual value in order to further shorten the code length. However, semi-fixed length encoding still has the problem of a long code length and low encoding efficiency.
[0192] For example, for signed fixed-length encoding, when the fixed-length code is N, the range of values to be encoded may be [-(1<<(N - 1)),(1<<(N - 1)) - 1]. Or, the range of values to be encoded may be [1 - (1<<(N - 1)),(1<<(N - 1))]. Or, the range of values to be encoded is [1 - (1<<(N - 1)),(1<<(N - 1))] or [-(1<<(N - 1)),(1<<(N - 1)) - 1], and when the value to be encoded is not equal to the boundary value, i.e., +(1<<(N - 1)) or -(1<<(N - 1)), the encoding and decoding methods are not changed. When the value to be encoded is equal to the boundary value, the sign of this value is encoded and decoded with 1 bit. This method is suitable for encoding and decoding methods where multiple values are in one group. For example, four residuals are in one group, and the fixed-length codes of the four residuals are the same. When there is a boundary value within the group, it is necessary to encode or decode the sign bit. Otherwise, it is not necessary to encode or decode the sign bit.
[0193] However, for the signed fixed-length coding method, the range of coefficient values that can be represented during coding is a power of 2, and since there is a coefficient value equal to 0, the positive and negative regions are not symmetric. Generally, since the distribution of residuals has the characteristic of a zero mean value, when coding residuals with a signed fixed-length code, it is inevitable to be biased towards positive or negative numbers. For multiple groups, the method of determining the code of the current group by coding one sign bit can solve the problem of the bias in the value range when coding residuals with a signed fixed-length code. However, the analysis of this sign bit needs to depend on the analysis of the residuals, and the analysis of the residuals depends on the analysis of the fixed-length code length. Such a dependence leads to a high cost in hardware implementation, that is, a decrease in coding performance and decoding performance.
[0194] In view of the above findings, embodiments of the present invention design a method for the signed fixed-length coding method that does not depend on the analysis of residuals and can know whether it is necessary to analyze the sign bit for the current group before analyzing the residuals. For example, design a sign bit analysis method that depends on the fixed-length code value. When coding residuals with a signed fixed-length code, if the length of the fixed-length code is less than or equal to the target value K, it is necessary to analyze the sign bit for the current coding group, and in other cases, it is not necessary to analyze the sign bit.
[0195] Hereinafter, with reference to several specific embodiments, the coding and decoding methods in the embodiments of the present invention will be described in detail.
[0196] Embodiment 9: Embodiments of the present invention provide a decoding method, which may be applied to the decoding side (also called a video decoder). FIG. 9A is a schematic flowchart of the decoding method, and the method may include the following.
[0197] In step 911, from the bitstream corresponding to the current block, decode the fixed-length codes corresponding to each sub-block within the current block.
[0198] In step 912, for each sub-block within the current block, based on the fixed-length code corresponding to the sub-block, the residual value corresponding to each position (e.g., pixel position) within the sub-block is decoded from the bit stream corresponding to the current block.
[0199] In step 913, for each sub-block within the current block, it is determined whether it is necessary to decode the coded bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block. If it is necessary to decode the coded bits corresponding to the sub-block, the coded bits corresponding to the sub-block are decoded from the bit stream corresponding to the current block.
[0200] In step 914, for each sub-block within the current block, if the residual value corresponding to the target position within the sub-block is the residual boundary value, the sign of the residual boundary value is determined based on the coded bits, and the target position may be any position within the sub-block.
[0201] In one possible embodiment, the step of determining whether it is necessary to decode the coded bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block may include the step of determining that it is necessary to decode the coded bits corresponding to the sub-block when the value of the fixed-length code corresponding to the sub-block is less than or equal to the target value K, and determining that it is not necessary to decode the coded bits corresponding to the sub-block in other cases, but is not limited thereto.
[0202] Exemplarily, the target value K may be a fixed value agreed upon by the decoding side and the encoding side, or the target value K may be a value parsed by the decoding side from the image header, or the target value K may be a value derived based on the image bit width, or the target value K may be a value derived based on the QP parameter. Of course, the above are only some examples and are not limited thereto.
[0203] In one possible embodiment, the step of decoding a fixed-length code corresponding to each sub-block in the current block from the bitstream corresponding to the current block may include, for the first sub-block, the step of decoding the fixed-length code corresponding to the sub-block from the bitstream, and for sub-blocks other than the first sub-block, the step of decoding first indication information corresponding to the sub-block from the bitstream, where the first indication information may be used to indicate whether the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block preceding the sub-block. Based on this, when the first indication information indicates that the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block preceding the sub-block, determining the fixed-length code corresponding to the sub-block based on the fixed-length code corresponding to the sub-block preceding the sub-block; and when the first indication information indicates that the fixed-length code corresponding to the sub-block is different from the fixed-length code corresponding to the sub-block preceding the sub-block, the step of decoding the fixed-length code corresponding to the sub-block from the bitstream, but is not limited thereto.
[0204] In one possible embodiment, the step of decoding, from a bitstream corresponding to a current block, a fixed-length code corresponding to each sub-block within the current block includes: decoding, from the bitstream, second indication information corresponding to the current block, where the second indication information is used to indicate whether a sub-block belongs to the same merging group as the sub-block preceding the sub-block, and fixed-length codes corresponding to each sub-block within the same merging group are the same, and fixed-length codes corresponding to each sub-block in different merging groups are different; for the first sub-block, decoding, from the bitstream, the fixed-length code corresponding to the sub-block; and for sub-blocks other than the first sub-block, when the second indication information indicates that the sub-block belongs to the same merging group as the sub-block preceding the sub-block, determining, based on the fixed-length code corresponding to the sub-block preceding the sub-block, the fixed-length code corresponding to the sub-block, and when the second indication information indicates that the sub-block belongs to a different merging group from the sub-block preceding the sub-block, decoding, from the bitstream, the fixed-length code to be adjusted corresponding to the sub-block, adjusting the fixed-length code to be adjusted based on the fixed-length code corresponding to the sub-block preceding the sub-block, and obtaining the final fixed-length code corresponding to the sub-block. However, the embodiment is not limited thereto.
[0205] Similarly, embodiments of the present invention provide an encoding method, which may be applied to an encoding side (also referred to as a video encoder). FIG. 9B is a schematic flowchart of the encoding method, and the method may include the following.
[0206] In step 921, a fixed-length code corresponding to each sub-block within a current block is encoded into a bitstream corresponding to the current block.
[0207] In step 922, for each sub-block within the current block, based on the fixed-length code corresponding to the sub-block, residual values corresponding to each position (e.g., pixel position) within the sub-block are encoded into the bitstream corresponding to the current block.
[0208] In step 923, for each sub-block within the current block, it is determined whether it is necessary to encode the coded bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block. If it is necessary to encode the coded bits corresponding to the sub-block, the coded bits corresponding to the sub-block are encoded into the bitstream corresponding to the current block.
[0209] Exemplarily, for each sub-block within the current block, if the residual value corresponding to the target position within the sub-block is a residual boundary value, the coded bits corresponding to the sub-block are determined based on the code of the residual boundary value. That is, the coded bits corresponding to the sub-block are used to indicate the code of the residual boundary value, and the target position may be any position within the sub-block.
[0210] In one possible embodiment, the step of determining whether it is necessary to encode the coded bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block may include, but is not limited to, determining that it is necessary to encode the coded bits corresponding to the sub-block when the value of the fixed-length code corresponding to the sub-block is less than or equal to the target value K, and determining that it is not necessary to encode the coded bits corresponding to the sub-block otherwise.
[0211] Exemplarily, the target value K may be a fixed value agreed upon by the decoding side and the encoding side, or the target value K may be a value encoded by the encoding side in the image header, or the target value K may be a value derived based on the image bit width, or the target value K may be a value derived based on the QP parameter. Of course, the above are only examples and are not limited thereto.
[0212] In one possible embodiment, the step of encoding, into the bitstream corresponding to the current block, the fixed-length code corresponding to each sub-block within the current block may include: for the first sub-block, encoding the fixed-length code corresponding to the sub-block into the bitstream; and for sub-blocks other than the first sub-block, if the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block preceding the sub-block, encoding, into the bitstream, first indication information corresponding to the sub-block, where the first indication information may be used to indicate that the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block preceding the sub-block; and if the fixed-length code corresponding to the sub-block is different from the fixed-length code corresponding to the sub-block preceding the sub-block, encoding, into the bitstream, first indication information corresponding to the sub-block and encoding the fixed-length code corresponding to the sub-block into the bitstream, where the first indication information may be used to indicate that the fixed-length code corresponding to the sub-block is different from the fixed-length code corresponding to the sub-block preceding the sub-block, but is not limited thereto.
[0213] In one possible embodiment, for the bitstream corresponding to the current block, the step of encoding the fixed-length code corresponding to each sub-block in the current block is the step of encoding second indication information corresponding to the current block in the bitstream, where the second indication information is used to indicate whether the sub-block belongs to the same merging group as the sub-block before it, and the fixed-length codes corresponding to each sub-block within the same merging group are the same, and the fixed-length codes corresponding to each sub-block in different merging groups are different; the step of encoding the fixed-length code corresponding to the first sub-block in the bitstream; and for sub-blocks other than the first sub-block, when the second indication information indicates that the sub-block belongs to the same merging group as the sub-block before it, prohibiting encoding the fixed-length code corresponding to the sub-block in the bitstream, and when the second indication information indicates that the sub-block belongs to a different merging group from the sub-block before it, the step of encoding the adjustable fixed-length code corresponding to the sub-block in the bitstream. However, it is not limited thereto. Exemplarily, when encoding the adjustable fixed-length code corresponding to the sub-block in the bitstream, the adjustable fixed-length code corresponding to the sub-block may be determined based on the fixed-length code corresponding to the sub-block before it, and the adjustable fixed-length code corresponding to the sub-block may be encoded in the bitstream.
[0214] As can be seen from the above technical solutions, in the embodiments of the present invention, by improving the boundary code bits of the fixed-length code with symbols, the compression efficiency is improved, the hardware cost is reduced, and the analysis of the code bits does not depend on the residual value itself.
[0215] Example 10: Regarding the fixed-length coding method with symbols for boundary values, the embodiments of the present invention provide a decoding method and an encoding method, which may be applied to the decoding side or the encoding side, and the method may include the following steps.
[0216] In step S11, for the current block, the decoding side analyzes the sub-block grouping information of the current block.
[0217] Corresponding to the processing process on the decoding side, the encoding side encodes the sub-block grouping information of the current block.
[0218] For example, the encoding side encodes the sub-block grouping information of the current block into the bit stream of the current block, and the decoding side decodes the sub-block grouping information of the current block from the bit stream of the current block, and this encoding process and decoding process are not limited.
[0219] Exemplarily, the sub-block grouping information is used to indicate how to divide the current block into sub-blocks. For example, assuming that the current block is a 16*2 block, the sub-block grouping information is used to indicate that the current block is divided into two 8*2 sub-blocks, or the sub-block grouping information is used to indicate that the current block is divided into four 4*2 sub-blocks, or the sub-block grouping information is used to indicate that the current block is divided into eight 2*2 sub-blocks, or the sub-block grouping information is used to indicate that the current block is divided into four 8*1 sub-blocks, or the sub-block grouping information is used to indicate that the current block is divided into eight 4*1 sub-blocks, or the sub-block grouping information is used to indicate that the current block is divided into sixteen 2*1 sub-blocks. For other sizes of the current block, the implementation methods are similar and will not be described here.
[0220] Exemplarily, the sub-block division method of the current block may be fixed, that is, the encoding side and the decoding side agree on the sub-block division method of the current block. In this way, the encoding side does not need to encode the sub-block grouping information of the current block, and the decoding side also does not need to analyze the sub-block grouping information of the current block. For example, assuming that the current block is a 16*2 block, both the encoding side and the decoding side divide the current block into two 8*2 sub-blocks, or divide the current block into four 4*2 sub-blocks, or divide the current block into eight 2*2 sub-blocks, or divide the current block into four 8*1 sub-blocks, or divide the current block into eight 4*1 sub-blocks, or divide the current block into sixteen 2*1 sub-blocks. Of course, the above are just some examples and are not limited thereto.
[0221] In step S12, for each sub-block in the current block, the decoding side analyzes the fixed-length code corresponding to the sub-block.
[0222] Corresponding to the processing process of the decoding side, the encoding side encodes the fixed-length code corresponding to the sub-block.
[0223] For example, for each sub-block in the current block, the encoding side encodes the fixed-length code corresponding to the sub-block into the bit stream corresponding to the current block, and the decoding side decodes the fixed-length code corresponding to the sub-block from the bit stream corresponding to the current block.
[0224] Exemplarily, the fixed-length code corresponding to a sub-block is used to indicate the length of the residual value corresponding to each position (e.g., pixel position) within the sub-block. For example, the fixed-length code corresponding to sub-block A is used to indicate the length of the residual value corresponding to each position within sub-block A, the fixed-length code corresponding to sub-block B is used to indicate the length of the residual value corresponding to each position within sub-block B... Assuming that the fixed-length code corresponding to sub-block A is 4, based on this fixed-length code, the 1st to 4th bits may be regarded as the residual value corresponding to the 1st position of sub-block A, and the 5th to 8th bits may be regarded as the residual value corresponding to the 2nd position of sub-block A, and so on.
[0225] Exemplarily, for the analysis of the fixed-length code corresponding to each sub-block, a variable-length code may be used for the analysis.
[0226] In one possible embodiment, the encoding side encodes the fixed-length code corresponding to each sub-block into the bitstream corresponding to the current block, and the decoding side decodes the fixed-length code corresponding to each sub-block from the bitstream corresponding to the current block. For example, the encoding side sequentially encodes the fixed-length code corresponding to sub-block A, the fixed-length code corresponding to sub-block B,... into the bitstream corresponding to the current block, and the decoding side sequentially decodes the fixed-length code corresponding to sub-block A, the fixed-length code corresponding to sub-block B,... from the bitstream corresponding to the current block.
[0227] In one possible embodiment, for the first sub-block, the encoding side encodes a fixed-length code corresponding to the sub-block in the bitstream, and the decoding side decodes the fixed-length code corresponding to the sub-block from the bitstream. For sub-blocks other than the first sub-block, when the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block before it, the encoding side encodes first indication information corresponding to the sub-block in the bitstream, and the first indication information is used to indicate that the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block before it. The decoding side decodes the first indication information corresponding to the sub-block from the bitstream. When the first indication information is used to indicate that the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block before it, the fixed-length code corresponding to the sub-block is determined based on the fixed-length code corresponding to the sub-block before it. For sub-blocks other than the first sub-block, when the fixed-length code corresponding to the sub-block is different from the fixed-length code corresponding to the sub-block before it, the encoding side encodes first indication information corresponding to the sub-block in the bitstream and encodes the fixed-length code corresponding to the sub-block in the bitstream. The first indication information is used to indicate that the fixed-length code corresponding to the sub-block is different from the fixed-length code corresponding to the sub-block before it. The decoding side decodes the first indication information corresponding to the sub-block from the bitstream. When the first indication information is used to indicate that the fixed-length code corresponding to the sub-block is different from the fixed-length code corresponding to the sub-block before it, the fixed-length code corresponding to the sub-block is decoded from the bitstream.
[0228] Here, the first indication information is used to indicate whether the fixed-length code of the current sub-block is the same as that of the previous sub-block, and may be represented by 1 bit. That is, for the second and subsequent sub-blocks, it is analyzed in 1 bit whether the fixed-length code of the sub-block is the same as that of the previous sub-block. For example, when the first indication information is the first value, it indicates that the fixed-length code of the current sub-block is the same as that of the previous sub-block; when the first indication information is the second value, it indicates that the fixed-length code of the current sub-block is different from that of the previous sub-block.
[0229] For example, the encoding side encodes, into the bit stream corresponding to the current block, the fixed-length code corresponding to sub-block A, the first indication information corresponding to sub-block B, the fixed-length code corresponding to sub-block B (when the first indication information corresponding to sub-block B is used to indicate that the fixed-length codes are the same, there is no fixed-length code corresponding to sub-block B in the bit stream; when the first indication information corresponding to sub-block B is used to indicate that the fixed-length codes are different, there is a fixed-length code corresponding to sub-block B in the bit stream), the first indication information corresponding to sub-block C, the fixed-length code corresponding to sub-block C (when the first indication information corresponding to sub-block C is used to indicate that the fixed-length codes are the same, there is no fixed-length code corresponding to sub-block C in the bit stream; when the first indication information corresponding to sub-block C is used to indicate that the fixed-length codes are different, there is a fixed-length code corresponding to sub-block C in the bit stream),...
[0230] The decoding side decodes the fixed-length code corresponding to sub-block A and the first instruction information corresponding to sub-block B from the bit stream corresponding to the current block. When the first instruction information corresponding to sub-block B is used to indicate that the fixed-length codes are the same, the fixed-length code corresponding to sub-block A is used as the fixed-length code corresponding to sub-block B, and the fixed-length code corresponding to sub-block B is not decoded from the bit stream. When the first instruction information corresponding to sub-block B is used to indicate that the fixed-length codes are different, the fixed-length code corresponding to sub-block B is decoded from the bit stream. Next, the first instruction information corresponding to sub-block C is decoded from the bit stream corresponding to the current block. When the first instruction information corresponding to sub-block C is used to indicate that the fixed-length codes are the same, the fixed-length code corresponding to sub-block B is used as the fixed-length code corresponding to sub-block C, and the fixed-length code corresponding to sub-block C is not decoded from the bit stream. When the first instruction information corresponding to sub-block C is used to indicate that the fixed-length codes are different, the fixed-length code corresponding to sub-block C is decoded from the bit stream. The same applies hereinafter.
[0231] In one possible embodiment, the encoding side may encode second indication information corresponding to the current block in the bitstream, and the decoding side may decode the second indication information corresponding to the current block from the bitstream. The second indication information is used to indicate whether the sub-block belongs to the same merging group as the sub-block before it. The fixed-length codes corresponding to each sub-block within the same merging group may be the same, and the fixed-length codes corresponding to each sub-block in different merging groups may be different. For example, the first bit of the second indication information is used to indicate whether the second sub-block belongs to the same merging group as the first sub-block. For example, when the first bit is the first value, it indicates belonging to the same merging group, and when the first bit is the second value, it indicates not belonging to the same merging group. The second bit of the second indication information is used to indicate whether the third sub-block belongs to the same merging group as the second sub-block. The same applies hereinafter.
[0232] For the first sub-block, the encoding side encodes the fixed-length code corresponding to the sub-block in the bit stream, and the decoding side decodes the fixed-length code corresponding to the sub-block from the bit stream. For sub-blocks other than the first sub-block, when the second indication information indicates that the sub-block belongs to the same merging group as the sub-block before it, the encoding side does not encode the fixed-length code corresponding to the sub-block in the bit stream, and the decoding side determines the fixed-length code corresponding to the sub-block based on the fixed-length code corresponding to the sub-block before it, and does not decode the fixed-length code corresponding to the sub-block from the bit stream. When the second indication information indicates that the sub-block belongs to a different merging group from the sub-block before it, the encoding side encodes the fixed-length code to be adjusted corresponding to the sub-block in the bit stream, that is, determines the fixed-length code to be adjusted corresponding to the sub-block based on the fixed-length code corresponding to the sub-block before it, encodes the fixed-length code to be adjusted corresponding to the sub-block in the bit stream, and the decoding side decodes the fixed-length code to be adjusted corresponding to the sub-block from the bit stream, adjusts the fixed-length code to be adjusted based on the fixed-length code corresponding to the sub-block before it, and obtains the final fixed-length code corresponding to the sub-block.
[0233] As can be seen from the above, the decoding side may analyze the merging status of each sub-block (e.g., 4*1 sub-block) in the entire current block. When the second group (i.e., the second sub-block) is not merged with the first group (i.e., the first sub-block), the fixed-length code of the second group is not equal to the fixed-length code of the first group. When analyzing the fixed-length code of the second group, if the code word of the first group is short, the fixed-length code of the second group may be adjusted based on the fixed-length code of the first group, that is, a different value is given to the fixed-length code of the second group.
[0234] For example, the encoding side encodes the bitstream corresponding to the current block with second instruction information, a fixed-length code corresponding to sub-block A, a fixed-length code to be adjusted corresponding to sub-block B (when the second instruction information indicates that sub-block B belongs to the same merging group as sub-block A, there is no fixed-length code to be adjusted corresponding to sub-block B in the bitstream, and when the second instruction information indicates that sub-block B belongs to a different merging group from sub-block A, there is a fixed-length code to be adjusted corresponding to sub-block B in the bitstream), a fixed-length code to be adjusted corresponding to sub-block C (when the second instruction information indicates that sub-block C belongs to the same merging group as sub-block B, there is no fixed-length code to be adjusted corresponding to sub-block C in the bitstream, and when the second instruction information indicates that sub-block C belongs to a different merging group from sub-block B, there is a fixed-length code to be adjusted corresponding to sub-block C in the bitstream),...
[0235] The decryption side decrypts the second instruction information from the bit stream corresponding to the current block, and decrypts the fixed-length code corresponding to sub-block A from the bit stream corresponding to the current block. When the second instruction information indicates that sub-block B belongs to the same merging group as sub-block A, the fixed-length code corresponding to sub-block A is used as the fixed-length code corresponding to sub-block B, and the decryption side does not decrypt the fixed-length code corresponding to sub-block B from the bit stream. When the second instruction information indicates that sub-block B belongs to a different merging group from sub-block A, the decryption side decrypts the fixed-length code to be adjusted corresponding to sub-block B from the bit stream, adjusts the fixed-length code to be adjusted based on the fixed-length code corresponding to sub-block A, and obtains the final fixed-length code corresponding to sub-block B. When the second instruction information indicates that sub-block C belongs to the same merging group as sub-block B, the fixed-length code corresponding to sub-block B is used as the fixed-length code corresponding to sub-block C, and the decryption side does not decrypt the fixed-length code corresponding to sub-block C from the bit stream. When the second instruction information indicates that sub-block C belongs to a different merging group from sub-block B, the decryption side decrypts the fixed-length code to be adjusted corresponding to sub-block C from the bit stream, adjusts the fixed-length code to be adjusted based on the fixed-length code corresponding to sub-block B, and obtains the final fixed-length code corresponding to sub-block C. The same applies hereinafter.
[0236] Exemplarily, assume that the fixed-length codes are m1, m2, m3, and m4 in sequence, the codeword of m1 is smaller than that of m2, the codeword of m2 is smaller than that of m3, and the codeword of m3 is smaller than that of m4. Based on this, assume that the fixed-length code corresponding to sub-block A is m1, and the second indication information indicates that sub-block B belongs to a merging group different from sub-block A. When the final fixed-length code corresponding to sub-block B is m3, the fixed-length code to be adjusted corresponding to sub-block B encoded in the bit stream may be m2 (i.e., the codeword is smaller), and the decoding side, after decoding the fixed-length code m2 to be adjusted from the bit stream, since the fixed-length code corresponding to sub-block A is m1, that is, it is located before m2, may adjust the fixed-length code m2 to be adjusted to obtain the final fixed-length code m3 corresponding to sub-block B. Or, assume that the fixed-length code corresponding to sub-block A is m4, and the second indication information indicates that sub-block B belongs to a merging group different from sub-block A. When the final fixed-length code corresponding to sub-block B is m3, the fixed-length code to be adjusted corresponding to sub-block B encoded in the bit stream may be m3, and the decoding side, after decoding the fixed-length code m3 to be adjusted from the bit stream, since the fixed-length code corresponding to sub-block A is m4, that is, it is located after m3, may keep the fixed-length code m3 to be adjusted as it is to obtain the final fixed-length code m3 corresponding to sub-block B.
[0237] In step S13, for each sub-block in the current block, the decoding side analyzes the residual value at each position in the sub-block using the fixed-length code corresponding to the sub-block, that is, decodes the residual value corresponding to each position in the sub-block from the bit stream corresponding to the current block.
[0238] Corresponding to the processing process on the decoding side, the encoding side encodes the residual value at each position in the sub-block using the fixed-length code corresponding to the sub-block, that is, encodes the residual value corresponding to each position in the sub-block into the bit stream corresponding to the current block.
[0239] In step S14, for each sub-block within the current block, the decoding side needs to determine whether to decode the code bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block. If it is necessary to decode the code bits corresponding to the sub-block, the decoding side decodes the code bits corresponding to the sub-block from the bit stream corresponding to the current block. If it is not necessary to decode the code bits corresponding to the sub-block, the decoding side does not decode the code bits corresponding to the sub-block from the bit stream corresponding to the current block.
[0240] Corresponding to the processing process of the decoding side, the encoding side determines whether it is necessary to encode the code bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block. If it is necessary to encode the code bits corresponding to the sub-block, the encoding side may encode the code bits corresponding to the sub-block into the bit stream corresponding to the current block. If it is not necessary to encode the code bits corresponding to the sub-block, the encoding side does not have to encode the code bits corresponding to the sub-block into the bit stream corresponding to the current block.
[0241] In one possible embodiment, for the analysis of the code bits, it may depend on the value of the fixed-length code. For example, when the value of the fixed-length code is less than or equal to the target value K, the encoding side needs to encode the code bits into the bit stream corresponding to the current block, and the decoding side may decode the code bits from the bit stream corresponding to the current block. When the value of the fixed-length code is greater than the target value K, the encoding side does not encode the code bits into the bit stream corresponding to the current block, and the decoding side also does not decode the code bits from the bit stream corresponding to the current block.
[0242] Exemplarily, the target value K may be a fixed value agreed upon by the decoding side and the encoding side, that is, the target value K is a value fixed on the decoding side and the encoding side. Or, the target value K may be a value analyzed from the image header. For example, the target value K may be a value encoded by the encoding side in the image header, or the target value K may be a value analyzed by the decoding side from the image header. Or, the target value K may be a value derived based on the image bit width. For example, the target value K may be a value derived by the encoding side based on the image bit width, or the target value K may be a value derived by the decoding side based on the image bit width. Or, the target value K may be a value derived based on the QP parameter. For example, the target value K may be a value derived by the encoding side based on the QP parameter, or the target value K may be a value derived by the decoding side based on the QP parameter. Of course, the above are just some examples of the target value K, and the target value K is not limited, as long as the encoding side and the decoding side can obtain the target value K.
[0243] In step S15, for each sub-block in the current block, when the residual value corresponding to the target position in the sub-block is the residual boundary value, the decoding side determines the sign of the residual boundary value based on the sign bit, and the target position may be any position within the sub-block.
[0244] Corresponding to the processing process on the decoding side, when the residual value corresponding to the target position in the sub-block is the residual boundary value, the encoding side determines the sign bit corresponding to the sub-block based on the sign of the residual boundary value, and the sign bit is used to indicate the sign of the residual boundary value.
[0245] For example, when the sign bit corresponding to a sub-block is the first value, it indicates that the sign of the residual boundary value is negative. In this case, all coefficient values (i.e., residual values) within the sub-block that are equal to the value of 2^(coding length - 1) (i.e., the residual boundary value) are all equal to -2^(coding length - 1). In other cases, when the sign bit corresponding to the sub-block is the second value, it indicates that the sign of the residual boundary value is positive, and all coefficient values (i.e., residual values) within the sub-block that are equal to the value of 2^(coding length - 1) are all equal to 2^(coding length - 1).
[0246] As can be seen from the above, first, the coding length may be analyzed from the bit stream. Since all coefficients (i.e., residual values) within the sub-block are analyzed using the same fixed-length code coding length, the range of coefficient analysis may be [-2^(coding length - 1) - 1, 2^(coding length - 1)]. Exemplarily, when there is one or more coefficient values of 2^(coding length - 1) in a group, one sign bit is analyzed, and all coefficient values within the group that are equal to the value of 2^(coding length - 1) share one sign bit. When the analyzed sign is negative, all coefficient values within the group that are equal to the value of 2^(coding length - 1) are equal to -2^(coding length - 1), and in other cases, all coefficient values within the group that are equal to the value of 2^(coding length - 1) are equal to 2^(coding length - 1).
[0247] Exemplarily, each of the above embodiments may be implemented alone or in combination. For example, each of the embodiments 1 to 10 may be implemented alone, or at least two of the embodiments 1 to 10 may be implemented in combination. For example, embodiments 1 to 3 may be arbitrarily combined and implemented, embodiments 4 to 5 may be arbitrarily combined and implemented, embodiments 6 to 8 may be arbitrarily combined and implemented, and embodiments 9 to 10 may be arbitrarily combined and implemented.
[0248] Exemplarily, in each of the above embodiments, the content on the encoding side may be applied to the decoding side, that is, it may be processed in the same manner by the decoding side, and the content on the decoding side may be applied to the encoding side, that is, it may be processed in the same manner by the encoding side.
[0249] Based on the same concept as the above method, embodiments of the present invention further provide an encoding and decoding apparatus, which is applied to the decoding side. The apparatus includes a memory configured to store video data, and a decoder configured to implement the encoding and decoding methods of the above embodiments 1 to 10, that is, the processing process on the decoding side.
[0250] For example, in one possible embodiment, the decoder when the reference pixels of the current block are unavailable, performing a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block to obtain a target prediction mode list, and encoding or decoding the current block based on the target prediction mode list; or, when the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are available, padding the reference pixels of the first boundary based on the reference pixels of the second boundary, and encoding or decoding the current block based on the padded reference pixels of the first boundary and the reference pixels of the second boundary; Alternatively, when the intra-block copy prediction mode is valid for the current block, if the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, based on the reconstructed pixels of the upper boundary, determine a first search region corresponding to a first sub-block of the current block, and based on the reference pixels of the first search region, determine the reconstructed pixels of the first sub-block; after obtaining the reconstructed pixels of the first sub-block, based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block, determine a second search region corresponding to a second sub-block of the current block, and based on the reference pixels of the second search region, determine the reconstructed pixels of the second sub-block, wherein the current block is divided into the first sub-block and the second sub-block, and perform the steps. Alternatively, decode the fixed-length code corresponding to each sub-block in the current block from the bitstream corresponding to the current block; for each sub-block in the current block, based on the fixed-length code corresponding to the sub-block, decode the residual value corresponding to each position in the sub-block from the bitstream corresponding to the current block; determine whether it is necessary to decode the coded bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block, and if it is necessary to decode the coded bits corresponding to the sub-block, decode the coded bits corresponding to the sub-block from the bitstream corresponding to the current block; when the residual value corresponding to the target position in the sub-block is the residual boundary value, determine the sign of the residual boundary value based on the coded bits, wherein the target position is an arbitrary position in the sub-block, and perform the steps.
[0251] Based on the same concept as the above method, an embodiment of the present invention further provides an encoding and decoding apparatus, which is applied to the encoding side. The apparatus includes a memory configured to store video data, and an encoder configured to implement the encoding and decoding methods of the above Embodiments 1 to 10, that is, the processing process on the encoding side.
[0252] For example, in one possible embodiment, the encoder when the reference pixels of the current block are unavailable, performs a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block to obtain a target prediction mode list, and encodes or decodes the current block based on the target prediction mode list; or, when the reference pixels of the first boundary of the current block are unavailable and the reference pixels of the second boundary of the current block are available, pads the reference pixels of the first boundary based on the reference pixels of the second boundary, and encodes or decodes the current block based on the padded reference pixels of the first boundary and the reference pixels of the second boundary; or, when the intra-block copy prediction mode is valid for the current block, if the reference pixels of the left boundary of the current block are unavailable and the reference pixels of the upper boundary of the current block are available, determines a first search region corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, and determines the reconstructed pixels of the first sub-block based on the reference pixels of the first search region; after obtaining the reconstructed pixels of the first sub-block, determines a second search region corresponding to the second sub-block of the current block based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block, and determines the reconstructed pixels of the second sub-block based on the reference pixels of the second search region, where the current block is divided into the first sub-block and the second sub-block.
[0253] Based on the same concept as the above method, for the decoding device (also called a video decoder) provided by an embodiment of the present invention, from a hardware perspective, its schematic hardware architecture diagram may specifically be as shown in FIG. 9C. It includes a processor 931 and a machine-readable storage medium 932. The machine-readable storage medium 932 stores machine-executable instructions executable by the processor 931, and the processor 931 is used to execute the machine-executable instructions to implement the encoding and decoding methods of the above Embodiments 1 to 10 of the present invention.
[0254] Based on the same concept as the above method, for the encoding device (also called a video encoder) provided by an embodiment of the present invention, from a hardware perspective, its schematic hardware architecture diagram may specifically be as shown in FIG. 9D. It includes a processor 941 and a machine-readable storage medium 942. The machine-readable storage medium 942 stores machine-executable instructions executable by the processor 941, and the processor 941 is used to execute the machine-executable instructions to implement the encoding and decoding methods of the above Embodiments 1 to 10 of the present invention.
[0255] Based on the same concept as the above method, an embodiment of the present invention further provides a machine-readable storage medium storing several computer instructions, and when the computer instructions are executed by a processor, the methods disclosed in the above examples of the present invention, such as the encoding and decoding methods in the above respective embodiments, can be implemented.
[0256] Based on the same concept as the above method, an embodiment of the present invention further provides a computer application, and when the computer application is executed by a processor, the encoding and decoding methods disclosed in the above examples of the present invention can be implemented.
[0257] Based on the same concept as the above method, embodiments of the present invention further provide an encoding and decoding apparatus, which is applied to the decoding side or the encoding side. When the reference pixels of the current block are unavailable, the apparatus includes a processing module for performing a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block to obtain a target prediction mode list, and an encoding and decoding module for encoding or decoding the current block based on the target prediction mode list.
[0258] Exemplarily, the initial prediction mode list includes a plurality of prediction modes, and when the reference pixels are unavailable, the target prediction mode is a prediction mode not used for the current block in the initial prediction mode list.
[0259] Exemplarily, when the processing module performs a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block, specifically, it determines a plurality of candidate prediction modes in the initial prediction mode list. The candidate prediction modes are prediction modes not used for the current block in the initial prediction mode list when the reference pixels are unavailable. At least one prediction mode is selected from all the candidate prediction modes as the first target prediction mode, and it is used to perform a removal process on the first target prediction mode in the initial prediction mode list.
[0260] Exemplarily, when the processing module selects at least one prediction mode from all the candidate prediction modes as the first target prediction mode, specifically, based on the codeword lengths corresponding to each candidate prediction mode, K candidate prediction modes are selected from all the candidate prediction modes as the retained prediction modes, where K is a positive integer. The candidate prediction modes other than the retained prediction modes are used to determine the first target prediction mode.
[0261] Exemplarily, K is 1, and the retained prediction mode is the candidate prediction mode with the shortest codeword length.
[0262] Exemplarily, when the processing module performs a removal process on the target prediction mode in the initial prediction mode list corresponding to the current block, specifically, it determines the second target prediction mode in the initial prediction mode list, and the second target prediction mode is a prediction mode not used for the current block in the initial prediction mode list when the reference pixel is unavailable, and a removal process is performed on the second target prediction mode in the initial prediction mode list.
[0263] Exemplarily, the candidate prediction modes include a plurality of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode, and the first target prediction mode includes at least one of the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, the VER prediction mode, the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode.
[0264] Exemplarily, when the reference pixel of the upper boundary of the current block is unavailable, the candidate prediction modes include the DC prediction mode, the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode, and the first target prediction mode includes the DIAG0 prediction mode, the DIAG1 prediction mode, the DIAG2 prediction mode, the DIAG3 prediction mode, and the VER prediction mode.
[0265] Exemplarily, when the reference pixel of the left boundary of the current block is unavailable, the candidate prediction modes include the HOR prediction mode, the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode, and the first target prediction mode includes the IBM0 prediction mode, the IBM1 prediction mode, and the IBM2 prediction mode.
[0266] Exemplarily, when the reference pixel at the upper boundary of the current block is unavailable and the reference pixel at the left boundary of the current block is unavailable, the candidate prediction modes include a DC prediction mode, a DIAG0 prediction mode, a DIAG1 prediction mode, a DIAG2 prediction mode, a DIAG3 prediction mode, a VER prediction mode, a HOR prediction mode, an IBM0 prediction mode, an IBM1 prediction mode, and an IBM2 prediction mode, and the first target prediction mode includes a DIAG0 prediction mode, a DIAG1 prediction mode, a DIAG2 prediction mode, a DIAG3 prediction mode, a VER prediction mode, a HOR prediction mode, an IBM0 prediction mode, an IBM1 prediction mode, and an IBM2 prediction mode.
[0267] Based on the same concept as the above method, embodiments of the present invention further provide an encoding and decoding apparatus, which is applicable to a decoding side or an encoding side. When the reference pixel at the first boundary of the current block is unavailable and the reference pixel at the second boundary of the current block is available, the apparatus includes a processing module for padding the reference pixel at the first boundary based on the reference pixel at the second boundary, and an encoding and decoding module for encoding or decoding the current block based on the padded reference pixel at the first boundary and the reference pixel at the second boundary. Exemplarily, the first boundary is a left boundary and the second boundary is an upper boundary, or the first boundary is an upper boundary and the second boundary is a left boundary.
[0268] Exemplarily, when the reference pixel of the first boundary of the current block is unavailable and the reference pixel of the second boundary of the current block is available, when padding the reference pixel of the first boundary based on the reference pixel of the second boundary, specifically, when the prediction mode corresponding to the current block is the point-by-point prediction mode, the upper boundary reference pixel is unavailable, and the left boundary reference pixel is available, all the upper boundary reference pixels are padded with the first value of the left boundary reference pixel; when the left boundary reference pixel is unavailable and the upper boundary reference pixel is available, it is used to pad all the left boundary reference pixels with the first value of the upper boundary reference pixel. Or, when the prediction mode corresponding to the current block is the point-by-point prediction mode, the upper boundary reference pixel is unavailable, and the left boundary reference pixel is available, the upper boundary reference pixels are padded with the reconstructed value at the corresponding prediction position in the first row of the left boundary coded block; when the left boundary reference pixel is unavailable and the upper boundary reference pixel is available, it is used to pad all the left boundary reference pixels with the first value of the upper boundary reference pixel. Or, when the prediction mode corresponding to the current block is an intra-frame prediction mode other than the DC prediction mode, the upper boundary reference pixel is unavailable, and the left boundary reference pixel is available, the upper boundary reference pixels are padded with the reconstructed value at the corresponding prediction position in the first row of the left boundary coded block; when the left boundary reference pixel is unavailable and the upper boundary reference pixel is available, it is used to pad the left boundary reference pixels with the reference pixel value at the corresponding position in the first row of the upper boundary. Or, when the prediction mode corresponding to the current block is the intra-frame prediction mode, the upper boundary reference pixel is unavailable, and the left boundary reference pixel is available, the upper boundary reference pixels are padded with the reconstructed value at the corresponding prediction position in the first row of the left boundary coded block; when the left boundary reference pixel is unavailable and the upper boundary reference pixel is available, it is used to pad all the left boundary reference pixels with default values.
[0269] Based on the same concept as the above method, an embodiment of the present invention further provides an encoding and decoding apparatus, which is applied to the decoding side or the encoding side. When the intra-block copy prediction mode is effective for the current block, if the reference pixels on the left boundary of the current block are unavailable and the reference pixels on the upper boundary of the current block are available, the apparatus includes: a first processing module for determining a first search area corresponding to a first sub-block of the current block based on the reconstructed pixels of the upper boundary; a first determination module for determining the reconstructed pixels of the first sub-block based on the reference pixels of the first search area; after obtaining the reconstructed pixels of the first sub-block, a second processing module for determining a second search area corresponding to a second sub-block of the current block based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block; and a second determination module for determining the reconstructed pixels of the second sub-block based on the reference pixels of the second search area, wherein the current block is divided into the first sub-block and the second sub-block.
[0270] Exemplarily, when the first determination module determines the reconstructed pixels of the first sub-block based on the reference pixels of the first search area, specifically, the first sub-block is divided into M first prediction blocks, and is used to determine the reconstructed pixels of each first prediction block based on the reference pixels of the first search area, where M is a positive integer. When the second determination module determines the reconstructed pixels of the second sub-block based on the reference pixels of the second search area, specifically, the second sub-block is divided into N second prediction blocks, and is used to determine the reconstructed pixels of each second prediction block based on the reference pixels of the second search area, where N is a positive integer.
[0271] Exemplarily, the size of the second prediction block is the same as the size of the first prediction block, or the size of the second prediction block is different from the size of the first prediction block. Exemplarily, when the size of the current block is 16*2 and the sizes of the first sub-block and the second sub-block are both 8*2, the size of the first prediction block is 2*1, the size of the second prediction block is 2*1 or 2*2, or the size of the first prediction block is 4*1, the size of the second prediction block is 4*1 or 4*2, or the size of the first prediction block is 8*1, the size of the second prediction block is 8*1 or 8*2.
[0272] Exemplarily, when the first processing module determines a first search region corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, specifically, based on the reconstructed pixels of the first row of the upper boundary, it pads the complete region of the first designated region on the left side of the current block, and the complete region of the first designated region is used to determine the first search region, or based on the reconstructed pixels of the first row of the upper boundary, it pads a partial region of the first designated region on the left side of the current block, and the partial region of the first designated region is used to determine the first search region.
[0273] Exemplarily, when the first processing module determines a first search region corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, specifically, the reconstructed pixels of the upper boundary are used to determine the first search region corresponding to the first sub-block.
[0274] Exemplarily, when the second processing module determines a second search region corresponding to a second sub-block of the current block based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block, specifically, based on the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the first sub-block, a complete region of a second designated region on the left side of the second sub-block is padded, and the complete region of the second designated region is used to determine the second search region, or, based on the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the first sub-block, a partial region of the second designated region on the left side of the second sub-block is padded, and the partial region of the second designated region is used to determine the second search region.
[0275] Exemplarily, when the second processing module determines a second search region corresponding to a second sub-block of the current block based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block, specifically, the reconstructed pixels of the upper boundary are used to determine the second search region corresponding to the second sub-block, or, the reconstructed pixels of the first sub-block are used to determine the second search region corresponding to the second sub-block.
[0276] Exemplarily, the reconstructed pixels of the upper boundary include the reconstructed pixels of the first row of the upper boundary, or the reconstructed pixels of the first row of the upper boundary and the reconstructed pixels of the second row of the upper boundary, the length of the reconstructed pixels of the upper boundary is equal to the width of the current block, or the length of the reconstructed pixels of the upper boundary is greater than the width of the current block.
[0277] Based on the same concept as the above method, embodiments of the present invention further provide a decoding apparatus, which is applied to the decoding side. The apparatus decodes a fixed-length code corresponding to each sub-block in the current block from the bitstream corresponding to the current block. For each sub-block in the current block, based on the fixed-length code corresponding to the sub-block, it decodes a residual value corresponding to each position in the sub-block from the bitstream corresponding to the current block, and determines whether it is necessary to decode the code bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block. When it is necessary to decode the code bits corresponding to the sub-block, it includes a decoding module for decoding the code bits corresponding to the sub-block from the bitstream corresponding to the current block, and a determination module for determining the sign of the residual boundary value based on the code bits when the residual value corresponding to the target position in the sub-block is the residual boundary value. The target position is any position within the sub-block.
[0278] Exemplarily, when the decoding module determines whether it is necessary to decode the code bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block, specifically, when the value of the fixed-length code corresponding to the sub-block is less than or equal to the target value K, it is determined that it is necessary to decode the code bits corresponding to the sub-block, and in other cases, it is used to determine that it is not necessary to decode the code bits corresponding to the sub-block.
[0279] Exemplarily, the target value K is a fixed value agreed upon by the decoding side and the encoding side, or the target value K is a value analyzed by the decoding side from the image header, or the target value K is a value derived based on the image bit width, or the target value K is a value derived based on the QP parameter. Exemplarily, when the decoding module decodes the fixed-length code corresponding to each sub-block in the current block from the bit stream corresponding to the current block, specifically, for the first sub-block, it decodes the fixed-length code corresponding to the sub-block from the bit stream, and for the sub-blocks other than the first sub-block, it decodes the first indication information corresponding to the sub-block from the bit stream. The first indication information is used to indicate whether the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block before the sub-block. When the first indication information indicates that the fixed-length code corresponding to the sub-block is the same as the fixed-length code corresponding to the sub-block before the sub-block, the fixed-length code corresponding to the sub-block is determined based on the fixed-length code corresponding to the sub-block before the sub-block. When the first indication information indicates that the fixed-length code corresponding to the sub-block is different from the fixed-length code corresponding to the sub-block before the sub-block, it is used to decode the fixed-length code corresponding to the sub-block from the bit stream.
[0280] Exemplarily, when the decoding module decodes a fixed-length code corresponding to each sub-block in the current block from the bitstream corresponding to the current block, specifically, it decodes second instruction information corresponding to the current block from the bitstream. The second instruction information is used to indicate whether the sub-block belongs to the same merging group as the sub-block before it. The fixed-length codes corresponding to each sub-block within the same merging group are the same, and the fixed-length codes corresponding to each sub-block in different merging groups are different. For the first sub-block, it decodes the fixed-length code corresponding to the sub-block from the bitstream. For sub-blocks other than the first sub-block, when the second instruction information indicates that the sub-block belongs to the same merging group as the sub-block before it, it determines the fixed-length code corresponding to the sub-block based on the fixed-length code corresponding to the sub-block before it. When the second instruction information indicates that the sub-block belongs to a different merging group from the sub-block before it, it decodes the fixed-length code to be adjusted corresponding to the sub-block from the bitstream, adjusts the fixed-length code to be adjusted based on the fixed-length code corresponding to the sub-block before it, and uses it to obtain the final fixed-length code corresponding to the sub-block.
[0281] The above are only examples of the present invention and do not limit the present invention. For those skilled in the art, various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle scope of the present invention shall all be included within the scope of the claims of the present invention.
Claims
1. A decoding method applied to the decoding side. When the intra-block copy prediction mode is valid for the current block, if the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, determining a first search area corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, and determining the reconstructed pixels of the first sub-block based on the reference pixels in the first search area; after obtaining the reconstructed pixels of the first sub-block, determining a second search area corresponding to the second sub-block of the current block based on the reconstructed pixels of the upper boundary, and determining the reconstructed pixels of the second sub-block based on the reference pixels in the second search area, wherein the current block is divided into the first sub-block and the second sub-block, characterized in that it is a decoding method.
2. The step of determining the first search area corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary includes the step of determining the reconstructed pixels of the upper boundary as the first search area corresponding to the first sub-block, The step of determining the second search area corresponding to the second sub-block of the current block based on the reconstructed pixels of the upper boundary includes the step of determining the reconstructed pixels of the upper boundary as the second search area corresponding to the second sub-block, characterized in that it is the method according to Claim 1.
3. The first sub-block includes at least one first prediction block, if the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, the step of determining the first search area corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, and determining the reconstructed pixels of the first sub-block based on the reference pixels in the first search area is: if the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, the step of determining the first search area corresponding to the first sub-block of the current block based on the reconstructed pixels of the upper boundary, and determining the reconstructed pixels of each first prediction block among at least one first prediction block in the first sub-block based on the reference pixels in the first search area. The method according to claim 1, characterized in that...
4. The second sub-block includes at least one second prediction block. After obtaining the reconstructed pixels of the first sub-block, based on the reconstructed pixels of the upper boundary, a second search region corresponding to the second sub-block of the current block is determined, and based on the reference pixels of the second search region, the step of determining the reconstructed pixels of the second sub-block is as follows: After obtaining the reconstructed pixels of the first sub-block, based on the reconstructed pixels of the upper boundary and / or the reconstructed pixels of the first sub-block, a second search region corresponding to the second sub-block of the current block is determined, and based on the reference pixels of the second search region, the step of determining the reconstructed pixels of each second prediction block among at least one second prediction block in the second sub-block is included. The method according to claim 3, characterized in that...
5. The step of determining the reconstructed pixels of each first prediction block among at least one first prediction block in the first sub-block based on the reference pixels of the first search region is as follows: For each first prediction block among the at least one first prediction block, finding a reference block that matches the first prediction block from the first search region, and determining the reconstructed pixels of the first prediction block based on the reference block, wherein the size of the reference block is the same as the size of the first prediction block. The step includes... The method according to claim 3 or 4, characterized in that...
6. When the size of the current block is 16*2 and the size of the first sub-block is 8*2, the size of the first prediction block is 4*1. The method according to claim 3, characterized in that...
7. The step of determining the reconstructed pixels of each second prediction block among at least one second prediction block in the second sub-block based on the reference pixels of the second search region is as follows: For each second prediction block among the at least one second prediction block, finding a reference block that matches the second prediction block from the second search region, and determining the reconstructed pixels of the second prediction block based on the reference block, wherein the size of the reference block is the same as the size of the second prediction block. The step includes... The method according to claim 4, characterized in that...
8. The size of the at least one second prediction block is the same as the size of the at least one first prediction block, where the size of the current block is 16*2, and when the size of the first sub-block and the size of the second sub-block are both 8*2, the size of each first prediction block among the at least one first prediction block is 4*1, and the size of each second prediction block among the at least one second prediction block is 4*1, The method according to claim 4, 5, or 7, characterized in that.
9. An encoding method applied to the encoding side, when the intra-block copy prediction mode is effective for the current block, if the reference pixel on the left boundary of the current block is unavailable and the reference pixel on the upper boundary of the current block is available, determining a first search area corresponding to the first sub-block of the current block based on the reconstructed pixels on the upper boundary, and determining the reconstructed pixels of the first sub-block based on the reference pixels in the first search area; after obtaining the reconstructed pixels of the first sub-block, determining a second search area corresponding to the second sub-block of the current block based on the reconstructed pixels on the upper boundary, and determining the reconstructed pixels of the second sub-block based on the reference pixels in the second search area, including the current block is divided into the first sub-block and the second sub-block, An encoding method characterized by this.
10. A decoding method applied to the decoding side, decoding a fixed-length code corresponding to each sub-block in the current block from the bitstream corresponding to the current block; for each sub-block in the current block, decoding a residual value corresponding to each position in the sub-block from the bitstream corresponding to the current block based on the fixed-length code corresponding to the sub-block; determining whether it is necessary to decode the coded bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block, and if it is necessary to decode the coded bits corresponding to the sub-block, decoding the coded bits corresponding to the sub-block from the bitstream corresponding to the current block; When the residual value corresponding to the target position within the sub-block is the residual boundary value, a step of determining the sign of the residual boundary value based on the sign bit, where the target position is any position within the sub-block, and, A decoding method characterized by the above.
11. The step of determining whether it is necessary to decode the sign bit corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block is, When the value of the fixed-length code corresponding to the sub-block is less than or equal to the target value K, it is determined that it is necessary to decode the sign bit corresponding to the sub-block, and when the value of the fixed-length code corresponding to the sub-block is greater than the target value K, it includes the step of determining that it is not necessary to decode the sign bit corresponding to the sub-block. The method according to claim 10, characterized by the above.
12. The target value K is a fixed value agreed upon by the decoding side and the encoding side. The method according to claim 11, characterized by the above.
13. The step of determining the sign of the residual boundary value based on the sign bit is, When the sign bit corresponding to the sub-block is the first value, a step of determining that the sign of the residual boundary value is a negative number, where the residual boundary values within the sub-block are all equal to negative values of 2^(fixed-length code value - 1), and, When the sign bit corresponding to the sub-block is the second value, a step of determining that the sign of the residual boundary value is a positive number, where the residual boundary values within the sub-block are all equal to 2^(fixed-length code value - 1), and, including, The fixed-length code value is a length value analyzed from the bit stream. The method according to claim 10, characterized by the above.
14. An encoding method applied to the encoding side, Encoding the fixed-length code corresponding to each sub-block within the current block into the bit stream corresponding to the current block, and, For each sub-block within the current block, encoding the residual value corresponding to each position within the sub-block into the bit stream corresponding to the current block based on the fixed-length code corresponding to the sub-block. Based on the value of the fixed-length code corresponding to the sub-block, determine whether it is necessary to encode the code bits corresponding to the sub-block. If it is necessary to encode the code bits corresponding to the sub-block, then in the bit stream corresponding to the current block, perform the step of encoding the code bits corresponding to the sub-block. An encoding method characterized by the above.
15. A memory configured to store video data, When the intra-block copy prediction mode is effective for the current block, if the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, based on the reconstructed pixels at the upper boundary, determine a first search area corresponding to a first sub-block of the current block, and based on the reference pixels in the first search area, determine the reconstructed pixels of the first sub-block; after obtaining the reconstructed pixels of the first sub-block, based on the reconstructed pixels at the upper boundary and / or the reconstructed pixels of the first sub-block, determine a second search area corresponding to a second sub-block of the current block, and based on the reference pixels in the second search area, determine the reconstructed pixels of the second sub-block, wherein the current block is divided into the first sub-block and the second sub-block. Or, decoding a fixed-length code corresponding to each sub-block in the current block from a bitstream corresponding to the current block; for each sub-block in the current block, based on the fixed-length code corresponding to the sub-block, decoding a residual value corresponding to each position in the sub-block from the bitstream corresponding to the current block; determining whether it is necessary to decode a coded bit corresponding to the sub-block based on a value of the fixed-length code corresponding to the sub-block, and if it is necessary to decode the coded bit corresponding to the sub-block, decoding the coded bit corresponding to the sub-block from the bitstream corresponding to the current block; and when a residual value corresponding to a target position in the sub-block is a residual boundary value, determining a sign of the residual boundary value based on the coded bit, wherein the target position is an arbitrary position within the sub-block, steps, and a decoder configured to perform the steps. An encoding and decoding apparatus characterized by the above.
16. A decoding apparatus applied to the decoding side, when an intra-block copy prediction mode is valid for a current block A first processing module for determining a first search area corresponding to a first sub-block of the current block based on a reconstructed pixel of the upper boundary when a reference pixel of a left boundary of the current block is unavailable and a reference pixel of an upper boundary of the current block is available A first determination module for determining a reconstructed pixel of the first sub-block based on a reference pixel of the first search area After obtaining the reconstructed pixel of the first sub-block, a second processing module for determining a second search area corresponding to a second sub-block of the current block based on the reconstructed pixel of the upper boundary A second determination module for determining a reconstructed pixel of the second sub-block based on a reference pixel of the second search area, and including The current block is divided into the first sub-block and the second sub-block. A decoding apparatus characterized by the above.
17. An encoding apparatus applied to the encoding side, when an intra-block copy prediction mode is valid for a current block When the reference pixel at the left boundary of the current block is unavailable and the reference pixel at the upper boundary of the current block is available, a first processing module for determining a first search region corresponding to a first sub-block of the current block based on the reconstructed pixels of the upper boundary; A first determination module for determining the reconstructed pixels of the first sub-block based on the reference pixels of the first search region; After obtaining the reconstructed pixels of the first sub-block, a second processing module for determining a second search region corresponding to a second sub-block of the current block based on the reconstructed pixels of the upper boundary; A second determination module for determining the reconstructed pixels of the second sub-block based on the reference pixels of the second search region, and including: The current block is divided into the first sub-block and the second sub-block. An encoding device characterized by the above.
18. A decoding device applied to the decoding side, Decoding a fixed-length code corresponding to each sub-block in the current block from a bit stream corresponding to the current block, and for each sub-block in the current block, based on the fixed-length code corresponding to the sub-block, from the bit stream corresponding to the current block, decoding a residual value corresponding to each position in the sub-block, determining whether it is necessary to decode the code bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block, and if it is necessary to decode the code bits corresponding to the sub-block, a decoding module for decoding the code bits corresponding to the sub-block from the bit stream corresponding to the current block; A determination module for determining the sign of the residual boundary value based on the code bits when the residual value corresponding to the target position in the sub-block is the residual boundary value, and including: The target position is an arbitrary position within the sub-block. A decoding device characterized by the above.
19. An encoding device applied to the encoding side, Encode a fixed-length code corresponding to each sub-block within the current block into the bitstream corresponding to the current block. For each sub-block within the current block, based on the fixed-length code corresponding to the sub-block, encode the residual value corresponding to each position within the sub-block into the bitstream corresponding to the current block. Determine whether it is necessary to encode the coded bits corresponding to the sub-block based on the value of the fixed-length code corresponding to the sub-block. If it is necessary to encode the coded bits corresponding to the sub-block, include an encoding module for encoding the coded bits corresponding to the sub-block in the bitstream corresponding to the current block. An encoding device characterized by the above.
20. A decoding device including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions executable by the processor. The processor executes the machine-executable instructions to implement the method according to any one of claims 1 to 8, or the method according to claim 9, or the method according to any one of claims 10 to 13, or the method according to claim 14. A decoding device characterized by the above.
21. An encoding device including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions executable by the processor. The processor executes the machine-executable instructions to implement the method according to any one of claims 1 to 8, or the method according to claim 9, or the method according to any one of claims 10 to 13, or the method according to claim 14. An encoding device characterized by the above.
Citation Information
Patent Citations
Intra block copy prediction restrictions for parallel processing
US20160105682A1
Intra block copy merge mode and padding of unavailable IBC reference region
US20170099495A1
Template-matching-based method and apparatus for encoding and decoding intra picture
US20170134726A1
Method and Apparatus of Error Handling for Video Coding Using Intra Block Copy Mode
US20180152727A1
Method and apparatus for video coding
US20200099953A1